Drive Labels API . labels . permissions

Instance Methods

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

Deletes Label permissions. Permissions affect the Label resource as a whole, are not revisioned, and do not require publishing.

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

Updates Label permissions. If a permission for the indicated principal doesn't exist, a new Label Permission is created, otherwise the existing permission is updated. Permissions affect the Label resource as a whole, are not revisioned, and do not require publishing.

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 new Label Permission is created, otherwise the existing permission is updated. Permissions affect the Label resource as a whole, are not revisioned, and do not require publishing.

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

Deletes a Label's permission. Permissions affect the Label resource as a whole, are not revisioned, and do not require publishing.

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

Lists a Label's permissions.

list_next()

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, are not revisioned, and do not 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 of 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, are not revisioned, and do not 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 new Label Permission is created, otherwise the existing permission is updated. Permissions affect the Label resource as a whole, are not revisioned, and do not 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, are not revisioned, and do not 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 pricinpal. Not populated for audience principals. User and Group permissions may only be inserted using 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 pricinpal. Not populated for audience principals. User and Group permissions may only be inserted using 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 new Label Permission is created, otherwise the existing permission is updated. Permissions affect the Label resource as a whole, are not revisioned, and do not 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 pricinpal. Not populated for audience principals. User and Group permissions may only be inserted using 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 pricinpal. Not populated for audience principals. User and Group permissions may only be inserted using 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, are not revisioned, and do not 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 Permission 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 pricinpal. Not populated for audience principals. User and Group permissions may only be inserted using 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.