Admin Directory API . orgunits

Instance Methods

delete(customerId, orgUnitPath)

Remove organizational unit

get(customerId, orgUnitPath)

Retrieve organizational unit

insert(customerId, body=None)

Add organizational unit

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

Retrieve all organizational units

patch(customerId, orgUnitPath, body=None)

Update organizational unit. This method supports patch semantics.

update(customerId, orgUnitPath, body=None)

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.
    "blockInheritance": True or False, # Should block inheritance
    "description": "A String", # Description of OrgUnit
    "etag": "A String", # ETag of the resource.
    "kind": "admin#directory#orgUnit", # Kind of resource this is.
    "name": "A String", # Name of OrgUnit
    "orgUnitId": "A String", # Id of OrgUnit
    "orgUnitPath": "A String", # Path of OrgUnit
    "parentOrgUnitId": "A String", # Id of parent OrgUnit
    "parentOrgUnitPath": "A String", # Path of parent OrgUnit
  }
insert(customerId, body=None)
Add organizational unit

Args:
  customerId: string, Immutable ID of the G Suite account (required)
  body: object, The request body.
    The object takes the form of:

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


Returns:
  An object of the form:

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

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

Returns:
  An object of the form:

    { # JSON response template for List Organization Units operation in Directory API.
    "etag": "A String", # ETag of the resource.
    "kind": "admin#directory#orgUnits", # Kind of resource this is.
    "organizationUnits": [ # List of user objects.
      { # JSON template for Org Unit resource in Directory API.
        "blockInheritance": True or False, # Should block inheritance
        "description": "A String", # Description of OrgUnit
        "etag": "A String", # ETag of the resource.
        "kind": "admin#directory#orgUnit", # Kind of resource this is.
        "name": "A String", # Name of OrgUnit
        "orgUnitId": "A String", # Id of OrgUnit
        "orgUnitPath": "A String", # Path of OrgUnit
        "parentOrgUnitId": "A String", # Id of parent OrgUnit
        "parentOrgUnitPath": "A String", # Path of parent OrgUnit
      },
    ],
  }
patch(customerId, orgUnitPath, body=None)
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.
    The object takes the form of:

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


Returns:
  An object of the form:

    { # JSON template for Org Unit resource in Directory API.
    "blockInheritance": True or False, # Should block inheritance
    "description": "A String", # Description of OrgUnit
    "etag": "A String", # ETag of the resource.
    "kind": "admin#directory#orgUnit", # Kind of resource this is.
    "name": "A String", # Name of OrgUnit
    "orgUnitId": "A String", # Id of OrgUnit
    "orgUnitPath": "A String", # Path of OrgUnit
    "parentOrgUnitId": "A String", # Id of parent OrgUnit
    "parentOrgUnitPath": "A String", # Path of parent OrgUnit
  }
update(customerId, orgUnitPath, body=None)
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.
    The object takes the form of:

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


Returns:
  An object of the form:

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