# Cloud Spanner API . projects . instances . databases . databaseRoles

## Instance Methods

Close httplib2 connections.

Lists Cloud Spanner database roles.

Retrieves the next page of results.

Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance.

### Method Details

`close()`

    Close httplib2 connections.

`list(parent, pageSize=None, pageToken=None, x__xgafv=None)`

    Lists Cloud Spanner database roles.

    Args:
      parent: string, Required. The database whose roles should be listed. Values are of the form `projects//instances//databases/`. (required)
      pageSize: integer, Number of database roles to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size.
      pageToken: string, If non-empty, `page_token` should contain a next_page_token from a previous ListDatabaseRolesResponse.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # The response for ListDatabaseRoles.
      "databaseRoles": [ # Database roles that matched the request.
        { # A Cloud Spanner database role.
          "name": "A String", # Required. The name of the database role. Values are of the form `projects//instances//databases//databaseRoles/ {role}`, where `` is as specified in the `CREATE ROLE` DDL statement. This name can be passed to Get/Set IAMPolicy methods to identify the database role.
        },
      ],
      "nextPageToken": "A String", # `next_page_token` can be sent in a subsequent ListDatabaseRoles call to fetch more of the matching roles.
    }

`list_next()`

    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.

`testIamPermissions(resource, body=None, x__xgafv=None)`

    Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance.

    Args:
      resource: string, REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. (required)
      body: object, The request body.
        The object takes the form of:

    { # Request message for `TestIamPermissions` method.
      "permissions": [ # REQUIRED: The set of permissions to check for 'resource'. Permissions with wildcards (such as '*', 'spanner.*', 'spanner.instances.*') are not allowed.
        "A String",
      ],
    }

      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response message for `TestIamPermissions` method.
      "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
        "A String",
      ],
    }