Admin Directory API . groups

Instance Methods

aliases()

Returns the aliases Resource.

delete(groupKey)

Delete Group

get(groupKey)

Retrieve Group

insert(body=None)

Create Group

list(customer=None, domain=None, maxResults=None, orderBy=None, pageToken=None, query=None, sortOrder=None, userKey=None)

Retrieve all groups of a domain or of a user given a userKey (paginated)

list_next(previous_request, previous_response)

Retrieves the next page of results.

patch(groupKey, body=None)

Update Group. This method supports patch semantics.

update(groupKey, body=None)

Update Group

Method Details

delete(groupKey)
Delete Group

Args:
  groupKey: string, Email or immutable ID of the group (required)
get(groupKey)
Retrieve Group

Args:
  groupKey: string, Email or immutable ID of the group (required)

Returns:
  An object of the form:

    { # JSON template for Group resource in Directory API.
    "adminCreated": True or False, # Is the group created by admin (Read-only) *
    "aliases": [ # List of aliases (Read-only)
      "A String",
    ],
    "description": "A String", # Description of the group
    "directMembersCount": "A String", # Group direct members count
    "email": "A String", # Email of Group
    "etag": "A String", # ETag of the resource.
    "id": "A String", # Unique identifier of Group (Read-only)
    "kind": "admin#directory#group", # Kind of resource this is.
    "name": "A String", # Group name
    "nonEditableAliases": [ # List of non editable aliases (Read-only)
      "A String",
    ],
  }
insert(body=None)
Create Group

Args:
  body: object, The request body.
    The object takes the form of:

{ # JSON template for Group resource in Directory API.
  "adminCreated": True or False, # Is the group created by admin (Read-only) *
  "aliases": [ # List of aliases (Read-only)
    "A String",
  ],
  "description": "A String", # Description of the group
  "directMembersCount": "A String", # Group direct members count
  "email": "A String", # Email of Group
  "etag": "A String", # ETag of the resource.
  "id": "A String", # Unique identifier of Group (Read-only)
  "kind": "admin#directory#group", # Kind of resource this is.
  "name": "A String", # Group name
  "nonEditableAliases": [ # List of non editable aliases (Read-only)
    "A String",
  ],
}


Returns:
  An object of the form:

    { # JSON template for Group resource in Directory API.
    "adminCreated": True or False, # Is the group created by admin (Read-only) *
    "aliases": [ # List of aliases (Read-only)
      "A String",
    ],
    "description": "A String", # Description of the group
    "directMembersCount": "A String", # Group direct members count
    "email": "A String", # Email of Group
    "etag": "A String", # ETag of the resource.
    "id": "A String", # Unique identifier of Group (Read-only)
    "kind": "admin#directory#group", # Kind of resource this is.
    "name": "A String", # Group name
    "nonEditableAliases": [ # List of non editable aliases (Read-only)
      "A String",
    ],
  }
list(customer=None, domain=None, maxResults=None, orderBy=None, pageToken=None, query=None, sortOrder=None, userKey=None)
Retrieve all groups of a domain or of a user given a userKey (paginated)

Args:
  customer: string, Immutable ID of the G Suite account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain.
  domain: string, Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead.
  maxResults: integer, Maximum number of results to return. Max allowed value is 200.
  orderBy: string, Column to use for sorting results
    Allowed values
      email - Email of the group.
  pageToken: string, Token to specify next page in the list
  query: string, Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-groups
  sortOrder: string, Whether to return results in ascending or descending order. Only of use when orderBy is also used
    Allowed values
      ASCENDING - Ascending order.
      DESCENDING - Descending order.
  userKey: string, Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object.

Returns:
  An object of the form:

    { # JSON response template for List Groups operation in Directory API.
    "etag": "A String", # ETag of the resource.
    "groups": [ # List of group objects.
      { # JSON template for Group resource in Directory API.
        "adminCreated": True or False, # Is the group created by admin (Read-only) *
        "aliases": [ # List of aliases (Read-only)
          "A String",
        ],
        "description": "A String", # Description of the group
        "directMembersCount": "A String", # Group direct members count
        "email": "A String", # Email of Group
        "etag": "A String", # ETag of the resource.
        "id": "A String", # Unique identifier of Group (Read-only)
        "kind": "admin#directory#group", # Kind of resource this is.
        "name": "A String", # Group name
        "nonEditableAliases": [ # List of non editable aliases (Read-only)
          "A String",
        ],
      },
    ],
    "kind": "admin#directory#groups", # Kind of resource this is.
    "nextPageToken": "A String", # Token used to access next page of this result.
  }
list_next(previous_request, previous_response)
Retrieves the next page of results.

Args:
  previous_request: The request for the previous page. (required)
  previous_response: The response from the request for the previous page. (required)

Returns:
  A request object that you can call 'execute()' on to request the next
  page. Returns None if there are no more items in the collection.
    
patch(groupKey, body=None)
Update Group. This method supports patch semantics.

Args:
  groupKey: string, Email or immutable ID of the group. If ID, it should match with id of group object (required)
  body: object, The request body.
    The object takes the form of:

{ # JSON template for Group resource in Directory API.
  "adminCreated": True or False, # Is the group created by admin (Read-only) *
  "aliases": [ # List of aliases (Read-only)
    "A String",
  ],
  "description": "A String", # Description of the group
  "directMembersCount": "A String", # Group direct members count
  "email": "A String", # Email of Group
  "etag": "A String", # ETag of the resource.
  "id": "A String", # Unique identifier of Group (Read-only)
  "kind": "admin#directory#group", # Kind of resource this is.
  "name": "A String", # Group name
  "nonEditableAliases": [ # List of non editable aliases (Read-only)
    "A String",
  ],
}


Returns:
  An object of the form:

    { # JSON template for Group resource in Directory API.
    "adminCreated": True or False, # Is the group created by admin (Read-only) *
    "aliases": [ # List of aliases (Read-only)
      "A String",
    ],
    "description": "A String", # Description of the group
    "directMembersCount": "A String", # Group direct members count
    "email": "A String", # Email of Group
    "etag": "A String", # ETag of the resource.
    "id": "A String", # Unique identifier of Group (Read-only)
    "kind": "admin#directory#group", # Kind of resource this is.
    "name": "A String", # Group name
    "nonEditableAliases": [ # List of non editable aliases (Read-only)
      "A String",
    ],
  }
update(groupKey, body=None)
Update Group

Args:
  groupKey: string, Email or immutable ID of the group. If ID, it should match with id of group object (required)
  body: object, The request body.
    The object takes the form of:

{ # JSON template for Group resource in Directory API.
  "adminCreated": True or False, # Is the group created by admin (Read-only) *
  "aliases": [ # List of aliases (Read-only)
    "A String",
  ],
  "description": "A String", # Description of the group
  "directMembersCount": "A String", # Group direct members count
  "email": "A String", # Email of Group
  "etag": "A String", # ETag of the resource.
  "id": "A String", # Unique identifier of Group (Read-only)
  "kind": "admin#directory#group", # Kind of resource this is.
  "name": "A String", # Group name
  "nonEditableAliases": [ # List of non editable aliases (Read-only)
    "A String",
  ],
}


Returns:
  An object of the form:

    { # JSON template for Group resource in Directory API.
    "adminCreated": True or False, # Is the group created by admin (Read-only) *
    "aliases": [ # List of aliases (Read-only)
      "A String",
    ],
    "description": "A String", # Description of the group
    "directMembersCount": "A String", # Group direct members count
    "email": "A String", # Email of Group
    "etag": "A String", # ETag of the resource.
    "id": "A String", # Unique identifier of Group (Read-only)
    "kind": "admin#directory#group", # Kind of resource this is.
    "name": "A String", # Group name
    "nonEditableAliases": [ # List of non editable aliases (Read-only)
      "A String",
    ],
  }