# Admin Directory API . roles

## Instance Methods

Deletes a role.

Retrieves a role.

Creates a role.

Retrieves a paginated list of all the roles in a domain.

Retrieves the next page of results.

Updates a role. This method supports patch semantics.

Updates a role.

### Method Details

`delete(customer, roleId)`

    Deletes a role.

    Args:
      customer: string, Immutable ID of the Google Apps account. (required)
      roleId: string, Immutable ID of the role. (required)

`get(customer, roleId)`

    Retrieves a role.

    Args:
      customer: string, Immutable ID of the Google Apps account. (required)
      roleId: string, Immutable ID of the role. (required)

    Returns:
      An object of the form:

        { # JSON template for role resource in Directory API.
          "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
          "roleId": "A String", # ID of the role.
          "roleDescription": "A String", # A short description of the role.
          "etag": "A String", # ETag of the resource.
          "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
          "roleName": "A String", # Name of the role.
          "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
          "rolePrivileges": [ # The set of privileges that are granted to this role.
            {
              "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
              "privilegeName": "A String", # The name of the privilege.
            },
          ],
        }

`insert(customer, body)`

    Creates a role.

    Args:
      customer: string, Immutable ID of the Google Apps account. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for role resource in Directory API.
        "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
        "roleId": "A String", # ID of the role.
        "roleDescription": "A String", # A short description of the role.
        "etag": "A String", # ETag of the resource.
        "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
        "roleName": "A String", # Name of the role.
        "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
        "rolePrivileges": [ # The set of privileges that are granted to this role.
          {
            "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
            "privilegeName": "A String", # The name of the privilege.
          },
        ],
      }

    Returns:
      An object of the form:

        { # JSON template for role resource in Directory API.
          "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
          "roleId": "A String", # ID of the role.
          "roleDescription": "A String", # A short description of the role.
          "etag": "A String", # ETag of the resource.
          "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
          "roleName": "A String", # Name of the role.
          "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
          "rolePrivileges": [ # The set of privileges that are granted to this role.
            {
              "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
              "privilegeName": "A String", # The name of the privilege.
            },
          ],
        }

`list(customer, pageToken=None, maxResults=None)`

    Retrieves a paginated list of all the roles in a domain.

    Args:
      customer: string, Immutable id of the Google Apps account. (required)
      pageToken: string, Token to specify the next page in the list.
      maxResults: integer, Maximum number of results to return.

    Returns:
      An object of the form:

        { # JSON response template for List roles operation in Directory API.
        "nextPageToken": "A String",
        "items": [ # A list of Role resources.
          { # JSON template for role resource in Directory API.
              "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
              "roleId": "A String", # ID of the role.
              "roleDescription": "A String", # A short description of the role.
              "etag": "A String", # ETag of the resource.
              "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
              "roleName": "A String", # Name of the role.
              "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
              "rolePrivileges": [ # The set of privileges that are granted to this role.
                {
                  "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
                  "privilegeName": "A String", # The name of the privilege.
                },
              ],
            },
        ],
        "kind": "admin#directory#roles", # The type of the API resource. This is always admin#directory#roles.
        "etag": "A String", # ETag of the resource.
      }

`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(customer, roleId, body)`

    Updates a role. This method supports patch semantics.

    Args:
      customer: string, Immutable ID of the Google Apps account. (required)
      roleId: string, Immutable ID of the role. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for role resource in Directory API.
        "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
        "roleId": "A String", # ID of the role.
        "roleDescription": "A String", # A short description of the role.
        "etag": "A String", # ETag of the resource.
        "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
        "roleName": "A String", # Name of the role.
        "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
        "rolePrivileges": [ # The set of privileges that are granted to this role.
          {
            "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
            "privilegeName": "A String", # The name of the privilege.
          },
        ],
      }

    Returns:
      An object of the form:

        { # JSON template for role resource in Directory API.
          "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
          "roleId": "A String", # ID of the role.
          "roleDescription": "A String", # A short description of the role.
          "etag": "A String", # ETag of the resource.
          "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
          "roleName": "A String", # Name of the role.
          "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
          "rolePrivileges": [ # The set of privileges that are granted to this role.
            {
              "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
              "privilegeName": "A String", # The name of the privilege.
            },
          ],
        }

`update(customer, roleId, body)`

    Updates a role.

    Args:
      customer: string, Immutable ID of the Google Apps account. (required)
      roleId: string, Immutable ID of the role. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # JSON template for role resource in Directory API.
        "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
        "roleId": "A String", # ID of the role.
        "roleDescription": "A String", # A short description of the role.
        "etag": "A String", # ETag of the resource.
        "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
        "roleName": "A String", # Name of the role.
        "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
        "rolePrivileges": [ # The set of privileges that are granted to this role.
          {
            "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
            "privilegeName": "A String", # The name of the privilege.
          },
        ],
      }

    Returns:
      An object of the form:

        { # JSON template for role resource in Directory API.
          "kind": "admin#directory#role", # The type of the API resource. This is always admin#directory#role.
          "roleId": "A String", # ID of the role.
          "roleDescription": "A String", # A short description of the role.
          "etag": "A String", # ETag of the resource.
          "isSuperAdminRole": True or False, # Returns true if the role is a super admin role.
          "roleName": "A String", # Name of the role.
          "isSystemRole": True or False, # Returns true if this is a pre-defined system role.
          "rolePrivileges": [ # The set of privileges that are granted to this role.
            {
              "serviceId": "A String", # The obfuscated ID of the service this privilege is for.
              "privilegeName": "A String", # The name of the privilege.
            },
          ],
        }