# Drive Labels API . labels . permissions

## Instance Methods

Deletes label permissions. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

Updates label permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

Close httplib2 connections.

Updates a label's permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

Deletes a label's permission. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

Lists a label's permissions.

Retrieves the next page of results.

### Method Details

`batchDelete(parent, body=None, x__xgafv=None)`

    Deletes label permissions. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

    Args:
      parent: string, Required. The parent label resource name shared by all permissions being deleted. Format: `labels/{label}`. If this is set, the parent field in the `UpdateLabelPermissionRequest` messages must either be empty or match this field. (required)
      body: object, The request body.
        The object takes the form of:

    { # Deletes one or more label permissions.
      "requests": [ # Required. The request message specifying the resources to update.
        { # Deletes a label permission. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.
          "name": "A String", # Required. Label permission resource name.
          "useAdminAccess": True or False, # Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access.
        },
      ],
      "useAdminAccess": True or False, # Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access. If this is set, the `use_admin_access` field in the `DeleteLabelPermissionRequest` messages must either be empty or match this field.
    }

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

    Returns:
      An object of the form:

        { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    }

`batchUpdate(parent, body=None, x__xgafv=None)`

    Updates label permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

    Args:
      parent: string, Required. The parent label resource name shared by all permissions being updated. Format: `labels/{label}`. If this is set, the parent field in the `UpdateLabelPermissionRequest` messages must either be empty or match this field. (required)
      body: object, The request body.
        The object takes the form of:

    { # Updates one or more label permissions.
      "requests": [ # Required. The request message specifying the resources to update.
        { # Updates a label permission. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.
          "labelPermission": { # The permission that applies to a principal (user, group, audience) on a label. # Required. The permission to create or update on the label.
            "audience": "A String", # Audience to grant a role to. The magic value of `audiences/default` may be used to apply the role to the default audience in the context of the organization that owns the label.
            "email": "A String", # Specifies the email address for a user or group principal. Not populated for audience principals. User and group permissions may only be inserted using an email address. On update requests, if email address is specified, no principal should be specified.
            "group": "A String", # Group resource name.
            "name": "A String", # Resource name of this permission.
            "person": "A String", # Person resource name.
            "role": "A String", # The role the principal should have.
          },
          "parent": "A String", # Required. The parent label resource name.
          "useAdminAccess": True or False, # Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access.
        },
      ],
      "useAdminAccess": True or False, # Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access. If this is set, the `use_admin_access` field in the `UpdateLabelPermissionRequest` messages must either be empty or match this field.
    }

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

    Returns:
      An object of the form:

        { # Response for updating one or more label permissions.
      "permissions": [ # Required. Permissions updated.
        { # The permission that applies to a principal (user, group, audience) on a label.
          "audience": "A String", # Audience to grant a role to. The magic value of `audiences/default` may be used to apply the role to the default audience in the context of the organization that owns the label.
          "email": "A String", # Specifies the email address for a user or group principal. Not populated for audience principals. User and group permissions may only be inserted using an email address. On update requests, if email address is specified, no principal should be specified.
          "group": "A String", # Group resource name.
          "name": "A String", # Resource name of this permission.
          "person": "A String", # Person resource name.
          "role": "A String", # The role the principal should have.
        },
      ],
    }

`close()`

    Close httplib2 connections.

`create(parent, body=None, useAdminAccess=None, x__xgafv=None)`

    Updates a label's permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

    Args:
      parent: string, Required. The parent label resource name on the label permission is created. Format: `labels/{label}`. (required)
      body: object, The request body.
        The object takes the form of:

    { # The permission that applies to a principal (user, group, audience) on a label.
      "audience": "A String", # Audience to grant a role to. The magic value of `audiences/default` may be used to apply the role to the default audience in the context of the organization that owns the label.
      "email": "A String", # Specifies the email address for a user or group principal. Not populated for audience principals. User and group permissions may only be inserted using an email address. On update requests, if email address is specified, no principal should be specified.
      "group": "A String", # Group resource name.
      "name": "A String", # Resource name of this permission.
      "person": "A String", # Person resource name.
      "role": "A String", # The role the principal should have.
    }

      useAdminAccess: boolean, Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # The permission that applies to a principal (user, group, audience) on a label.
      "audience": "A String", # Audience to grant a role to. The magic value of `audiences/default` may be used to apply the role to the default audience in the context of the organization that owns the label.
      "email": "A String", # Specifies the email address for a user or group principal. Not populated for audience principals. User and group permissions may only be inserted using an email address. On update requests, if email address is specified, no principal should be specified.
      "group": "A String", # Group resource name.
      "name": "A String", # Resource name of this permission.
      "person": "A String", # Person resource name.
      "role": "A String", # The role the principal should have.
    }

`delete(name, useAdminAccess=None, x__xgafv=None)`

    Deletes a label's permission. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

    Args:
      name: string, Required. Label permission resource name. (required)
      useAdminAccess: boolean, Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    }

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

    Lists a label's permissions.

    Args:
      parent: string, Required. The parent label resource name on which label permissions are listed. Format: `labels/{label}`. (required)
      pageSize: integer, Maximum number of permissions to return per page. Default: 50. Max: 200.
      pageToken: string, The token of the page to return.
      useAdminAccess: boolean, Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response for listing the permissions on a label.
      "labelPermissions": [ # Label permissions.
        { # The permission that applies to a principal (user, group, audience) on a label.
          "audience": "A String", # Audience to grant a role to. The magic value of `audiences/default` may be used to apply the role to the default audience in the context of the organization that owns the label.
          "email": "A String", # Specifies the email address for a user or group principal. Not populated for audience principals. User and group permissions may only be inserted using an email address. On update requests, if email address is specified, no principal should be specified.
          "group": "A String", # Group resource name.
          "name": "A String", # Resource name of this permission.
          "person": "A String", # Person resource name.
          "role": "A String", # The role the principal should have.
        },
      ],
      "nextPageToken": "A String", # The token of the next page in the response.
    }

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