Remove membership.
Retrieve Group Member
hasMember(groupKey, memberKey)
Checks whether the given user is a member of the group. Membership can be direct or nested.
Add user to the specified group.
list(groupKey, pageToken=None, maxResults=None, roles=None, includeDerivedMembership=None)
Retrieve all members in a group (paginated)
list_next(previous_request, previous_response)
Retrieves the next page of results.
patch(groupKey, memberKey, body)
Update membership of a user in the specified group. This method supports patch semantics.
update(groupKey, memberKey, body)
Update membership of a user in the specified group.
delete(groupKey, memberKey)
Remove membership. Args: groupKey: string, Email or immutable ID of the group (required) memberKey: string, Email or immutable ID of the member (required)
get(groupKey, memberKey)
Retrieve Group Member Args: groupKey: string, Email or immutable ID of the group (required) memberKey: string, Email or immutable ID of the member (required) Returns: An object of the form: { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) }
hasMember(groupKey, memberKey)
Checks whether the given user is a member of the group. Membership can be direct or nested. Args: groupKey: string, Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. (required) memberKey: string, Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID. (required) Returns: An object of the form: { # JSON template for Has Member response in Directory API. "isMember": True or False, # Identifies whether the given user is a member of the group. Membership can be direct or nested. }
insert(groupKey, body)
Add user to the specified group. Args: groupKey: string, Email or immutable ID of the group (required) body: object, The request body. (required) The object takes the form of: { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) } Returns: An object of the form: { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) }
list(groupKey, pageToken=None, maxResults=None, roles=None, includeDerivedMembership=None)
Retrieve all members in a group (paginated) Args: groupKey: string, Email or immutable ID of the group (required) pageToken: string, Token to specify next page in the list maxResults: integer, Maximum number of results to return. Default is 200 roles: string, Comma separated role values to filter list results on. includeDerivedMembership: boolean, Whether to list indirect memberships. Default: false. Returns: An object of the form: { # JSON response template for List Members operation in Directory API. "nextPageToken": "A String", # Token used to access next page of this result. "kind": "admin#directory#members", # Kind of resource this is. "etag": "A String", # ETag of the resource. "members": [ # List of member objects. { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) }, ], }
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, memberKey, body)
Update membership of a user in the specified 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) memberKey: string, Email or immutable ID of the user. If ID, it should match with id of member object (required) body: object, The request body. (required) The object takes the form of: { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) } Returns: An object of the form: { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) }
update(groupKey, memberKey, body)
Update membership of a user in the specified group. Args: groupKey: string, Email or immutable ID of the group. If ID, it should match with id of group object (required) memberKey: string, Email or immutable ID of the user. If ID, it should match with id of member object (required) body: object, The request body. (required) The object takes the form of: { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) } Returns: An object of the form: { # JSON template for Member resource in Directory API. "status": "A String", # Status of member (Immutable) "kind": "admin#directory#member", # Kind of resource this is. "delivery_settings": "A String", # Delivery settings of member "id": "A String", # Unique identifier of customer member (Read-only) Unique identifier of group (Read-only) Unique identifier of member (Read-only) "etag": "A String", # ETag of the resource. "role": "A String", # Role of member "type": "A String", # Type of member (Immutable) "email": "A String", # Email of member (Read-only) }