# Admin Directory API . orgunits

## Instance Methods

Remove Organization Unit

Retrieve Organization Unit

Add Organization Unit

Retrieve all Organization Units

Update Organization Unit. This method supports patch semantics.

Update Organization Unit

### Method Details

`delete(customerId, orgUnitPath)`

    Remove Organization Unit

    Args:
      customerId: string, Immutable id of the Google Apps account (required)
      orgUnitPath: string, Full path of the organization unit or its Id (required) (repeated)

`get(customerId, orgUnitPath)`

    Retrieve Organization Unit

    Args:
      customerId: string, Immutable id of the Google Apps account (required)
      orgUnitPath: string, Full path of the organization unit or its Id (required) (repeated)

    Returns:
      An object of the form:

        { # JSON template for Org Unit resource in Directory API.
          "kind": "admin#directory#orgUnit", # Kind of resource this is.
          "parentOrgUnitPath": "A String", # Path of parent OrgUnit
          "name": "A String", # Name of OrgUnit
          "etag": "A String", # ETag of the resource.
          "orgUnitPath": "A String", # Path of OrgUnit
          "parentOrgUnitId": "A String", # Id of parent OrgUnit
          "blockInheritance": True or False, # Should block inheritance
          "orgUnitId": "A String", # Id of OrgUnit
          "description": "A String", # Description of OrgUnit
        }

`insert(customerId, body)`

    Add Organization Unit

    Args:
      customerId: string, Immutable id of the Google Apps account (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for Org Unit resource in Directory API.
        "kind": "admin#directory#orgUnit", # Kind of resource this is.
        "parentOrgUnitPath": "A String", # Path of parent OrgUnit
        "name": "A String", # Name of OrgUnit
        "etag": "A String", # ETag of the resource.
        "orgUnitPath": "A String", # Path of OrgUnit
        "parentOrgUnitId": "A String", # Id of parent OrgUnit
        "blockInheritance": True or False, # Should block inheritance
        "orgUnitId": "A String", # Id of OrgUnit
        "description": "A String", # Description of OrgUnit
      }

    Returns:
      An object of the form:

        { # JSON template for Org Unit resource in Directory API.
          "kind": "admin#directory#orgUnit", # Kind of resource this is.
          "parentOrgUnitPath": "A String", # Path of parent OrgUnit
          "name": "A String", # Name of OrgUnit
          "etag": "A String", # ETag of the resource.
          "orgUnitPath": "A String", # Path of OrgUnit
          "parentOrgUnitId": "A String", # Id of parent OrgUnit
          "blockInheritance": True or False, # Should block inheritance
          "orgUnitId": "A String", # Id of OrgUnit
          "description": "A String", # Description of OrgUnit
        }

`list(customerId, type=None, orgUnitPath=None)`

    Retrieve all Organization Units

    Args:
      customerId: string, Immutable id of the Google Apps account (required)
      type: string, Whether to return all sub-organizations or just immediate children
        Allowed values
          all - All sub-organization units.
          children - Immediate children only (default).
      orgUnitPath: string, the URL-encoded organization unit's path or its Id

    Returns:
      An object of the form:

        { # JSON response template for List Organization Units operation in Directory API.
        "kind": "admin#directory#orgUnits", # Kind of resource this is.
        "etag": "A String", # ETag of the resource.
        "organizationUnits": [ # List of user objects.
          { # JSON template for Org Unit resource in Directory API.
              "kind": "admin#directory#orgUnit", # Kind of resource this is.
              "parentOrgUnitPath": "A String", # Path of parent OrgUnit
              "name": "A String", # Name of OrgUnit
              "etag": "A String", # ETag of the resource.
              "orgUnitPath": "A String", # Path of OrgUnit
              "parentOrgUnitId": "A String", # Id of parent OrgUnit
              "blockInheritance": True or False, # Should block inheritance
              "orgUnitId": "A String", # Id of OrgUnit
              "description": "A String", # Description of OrgUnit
            },
        ],
      }

`patch(customerId, orgUnitPath, body)`

    Update Organization Unit. This method supports patch semantics.

    Args:
      customerId: string, Immutable id of the Google Apps account (required)
      orgUnitPath: string, Full path of the organization unit or its Id (required) (repeated)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for Org Unit resource in Directory API.
        "kind": "admin#directory#orgUnit", # Kind of resource this is.
        "parentOrgUnitPath": "A String", # Path of parent OrgUnit
        "name": "A String", # Name of OrgUnit
        "etag": "A String", # ETag of the resource.
        "orgUnitPath": "A String", # Path of OrgUnit
        "parentOrgUnitId": "A String", # Id of parent OrgUnit
        "blockInheritance": True or False, # Should block inheritance
        "orgUnitId": "A String", # Id of OrgUnit
        "description": "A String", # Description of OrgUnit
      }

    Returns:
      An object of the form:

        { # JSON template for Org Unit resource in Directory API.
          "kind": "admin#directory#orgUnit", # Kind of resource this is.
          "parentOrgUnitPath": "A String", # Path of parent OrgUnit
          "name": "A String", # Name of OrgUnit
          "etag": "A String", # ETag of the resource.
          "orgUnitPath": "A String", # Path of OrgUnit
          "parentOrgUnitId": "A String", # Id of parent OrgUnit
          "blockInheritance": True or False, # Should block inheritance
          "orgUnitId": "A String", # Id of OrgUnit
          "description": "A String", # Description of OrgUnit
        }

`update(customerId, orgUnitPath, body)`

    Update Organization Unit

    Args:
      customerId: string, Immutable id of the Google Apps account (required)
      orgUnitPath: string, Full path of the organization unit or its Id (required) (repeated)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for Org Unit resource in Directory API.
        "kind": "admin#directory#orgUnit", # Kind of resource this is.
        "parentOrgUnitPath": "A String", # Path of parent OrgUnit
        "name": "A String", # Name of OrgUnit
        "etag": "A String", # ETag of the resource.
        "orgUnitPath": "A String", # Path of OrgUnit
        "parentOrgUnitId": "A String", # Id of parent OrgUnit
        "blockInheritance": True or False, # Should block inheritance
        "orgUnitId": "A String", # Id of OrgUnit
        "description": "A String", # Description of OrgUnit
      }

    Returns:
      An object of the form:

        { # JSON template for Org Unit resource in Directory API.
          "kind": "admin#directory#orgUnit", # Kind of resource this is.
          "parentOrgUnitPath": "A String", # Path of parent OrgUnit
          "name": "A String", # Name of OrgUnit
          "etag": "A String", # ETag of the resource.
          "orgUnitPath": "A String", # Path of OrgUnit
          "parentOrgUnitId": "A String", # Id of parent OrgUnit
          "blockInheritance": True or False, # Should block inheritance
          "orgUnitId": "A String", # Id of OrgUnit
          "description": "A String", # Description of OrgUnit
        }