# Admin Directory API . members

## Instance Methods

Remove membership.

Retrieve Group Member

Add user to the specified group.

Retrieve all members in a group (paginated)

Retrieves the next page of results.

Update membership of a user in the specified group. This method supports patch semantics.

Update membership of a user in the specified group.

### Method Details

`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.
          "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)
        }

`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.
        "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.
          "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)`

    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.

    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.
              "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.
        "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.
          "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.
        "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.
          "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)
        }