# 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 G Suite account. (required)
      roleId: string, Immutable ID of the role. (required)

`get(customer, roleId)`

    Retrieves a role.

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

    Returns:
      An object of the form:

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

`insert(customer, body=None)`

    Creates a role.

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

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

    Returns:
      An object of the form:

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

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

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

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

    Returns:
      An object of the form:

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

`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=None)`

    Updates a role. This method supports patch semantics.

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

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

    Returns:
      An object of the form:

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

`update(customer, roleId, body=None)`

    Updates a role.

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

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

    Returns:
      An object of the form:

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