Admin Directory API . orgunits

Instance Methods

delete(customerId, orgUnitPath)

Remove organizational unit

get(customerId, orgUnitPath)

Retrieve organizational unit

insert(customerId, body)

Add organizational unit

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

Retrieve all organizational units

patch(customerId, orgUnitPath, body)

Update organizational unit. This method supports patch semantics.

update(customerId, orgUnitPath, body)

Update organizational unit

Method Details

delete(customerId, orgUnitPath)
Remove organizational unit

Args:
  customerId: string, Immutable ID of the G Suite account (required)
  orgUnitPath: string, Full path of the organizational unit or its ID (required) (repeated)
get(customerId, orgUnitPath)
Retrieve organizational unit

Args:
  customerId: string, Immutable ID of the G Suite account (required)
  orgUnitPath: string, Full path of the organizational 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 organizational unit

Args:
  customerId: string, Immutable ID of the G Suite 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 organizational units

Args:
  customerId: string, Immutable ID of the G Suite account (required)
  type: string, Whether to return all sub-organizations or just immediate children
    Allowed values
      all - All sub-organizational units.
      children - Immediate children only (default).
  orgUnitPath: string, the URL-encoded organizational 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 organizational unit. This method supports patch semantics.

Args:
  customerId: string, Immutable ID of the G Suite account (required)
  orgUnitPath: string, Full path of the organizational 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 organizational unit

Args:
  customerId: string, Immutable ID of the G Suite account (required)
  orgUnitPath: string, Full path of the organizational 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
    }