Class: Google::Apis::DrivelabelsV2::DriveLabelsService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/drivelabels_v2/service.rb

Overview

Drive Labels API

An API for managing Drive Labels

Examples:

require 'google/apis/drivelabels_v2'

Drivelabels = Google::Apis::DrivelabelsV2 # Alias the module
service = Drivelabels::DriveLabelsService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://drivelabels.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDriveLabelsService

Returns a new instance of DriveLabelsService.



47
48
49
50
51
52
# File 'lib/google/apis/drivelabels_v2/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-drivelabels_v2',
        client_version: Google::Apis::DrivelabelsV2::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



40
41
42
# File 'lib/google/apis/drivelabels_v2/service.rb', line 40

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



45
46
47
# File 'lib/google/apis/drivelabels_v2/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#batch_label_permission_delete(parent, google_apps_drive_labels_v2_batch_delete_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleProtobufEmpty

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

Parameters:

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

  • google_apps_drive_labels_v2_batch_delete_label_permissions_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



581
582
583
584
585
586
587
588
589
590
591
# File 'lib/google/apis/drivelabels_v2/service.rb', line 581

def batch_label_permission_delete(parent, google_apps_drive_labels_v2_batch_delete_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/permissions:batchDelete', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest::Representation
  command.request_object = google_apps_drive_labels_v2_batch_delete_label_permissions_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_label_permission_update(parent, google_apps_drive_labels_v2_batch_update_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse

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.

Parameters:

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

  • google_apps_drive_labels_v2_batch_update_label_permissions_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



620
621
622
623
624
625
626
627
628
629
630
# File 'lib/google/apis/drivelabels_v2/service.rb', line 620

def batch_label_permission_update(parent, google_apps_drive_labels_v2_batch_update_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/permissions:batchUpdate', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest::Representation
  command.request_object = google_apps_drive_labels_v2_batch_update_label_permissions_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_label_revision_permission_delete(parent, google_apps_drive_labels_v2_batch_delete_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleProtobufEmpty

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

Parameters:

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

  • google_apps_drive_labels_v2_batch_delete_label_permissions_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



850
851
852
853
854
855
856
857
858
859
860
# File 'lib/google/apis/drivelabels_v2/service.rb', line 850

def batch_label_revision_permission_delete(parent, google_apps_drive_labels_v2_batch_delete_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/permissions:batchDelete', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest::Representation
  command.request_object = google_apps_drive_labels_v2_batch_delete_label_permissions_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_label_revision_permission_update(parent, google_apps_drive_labels_v2_batch_update_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse

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.

Parameters:

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

  • google_apps_drive_labels_v2_batch_update_label_permissions_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



889
890
891
892
893
894
895
896
897
898
899
# File 'lib/google/apis/drivelabels_v2/service.rb', line 889

def batch_label_revision_permission_update(parent, google_apps_drive_labels_v2_batch_update_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/permissions:batchUpdate', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest::Representation
  command.request_object = google_apps_drive_labels_v2_batch_update_label_permissions_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_label(google_apps_drive_labels_v2_label_object = nil, language_code: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label

Creates a label. For more information, see Create and publish a label.

Parameters:

  • google_apps_drive_labels_v2_label_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label) (defaults to: nil)
  • language_code (String) (defaults to: nil)

    The BCP-47 language code to use for evaluating localized field labels in response. When not specified, values in the default configured language will be used.

  • use_admin_access (Boolean) (defaults to: nil)

    Set to true in order to use the user's admin privileges. The server will verify the user is an admin before allowing access.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/google/apis/drivelabels_v2/service.rb', line 81

def create_label(google_apps_drive_labels_v2_label_object = nil, language_code: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/labels', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.request_object = google_apps_drive_labels_v2_label_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_label_permission(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission

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.

Parameters:

  • parent (String)

    Required. The parent label resource name on the label permission is created. Format: labels/label``.

  • google_apps_drive_labels_v2_label_permission_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission) (defaults to: nil)
  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



660
661
662
663
664
665
666
667
668
669
670
671
# File 'lib/google/apis/drivelabels_v2/service.rb', line 660

def create_label_permission(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/permissions', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.request_object = google_apps_drive_labels_v2_label_permission_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
  command.params['parent'] = parent unless parent.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_label_revision_permission(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission

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.

Parameters:

  • parent (String)

    Required. The parent label resource name on the label permission is created. Format: labels/label``.

  • google_apps_drive_labels_v2_label_permission_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission) (defaults to: nil)
  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



929
930
931
932
933
934
935
936
937
938
939
940
# File 'lib/google/apis/drivelabels_v2/service.rb', line 929

def create_label_revision_permission(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+parent}/permissions', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.request_object = google_apps_drive_labels_v2_label_permission_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
  command.params['parent'] = parent unless parent.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_label(name, use_admin_access: nil, write_control_required_revision_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleProtobufEmpty

Permanently deletes a label and related metadata on Drive items. For more information, see Disable, enable, and delete a label. Once deleted, the label and related Drive item metadata will be deleted. Only draft labels and disabled labels may be deleted.

Parameters:

  • name (String)

    Required. Label resource name.

  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • write_control_required_revision_id (String) (defaults to: nil)

    The revision ID of the label that the write request will be applied to. If this isn't the latest revision of the label, the request will not be processed and will return a 400 Bad Request error.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



125
126
127
128
129
130
131
132
133
134
135
# File 'lib/google/apis/drivelabels_v2/service.rb', line 125

def delete_label(name, use_admin_access: nil, write_control_required_revision_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['writeControl.requiredRevisionId'] = write_control_required_revision_id unless write_control_required_revision_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_label_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleProtobufEmpty

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

Parameters:

  • name (String)

    Required. Label permission resource name.

  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



697
698
699
700
701
702
703
704
705
706
# File 'lib/google/apis/drivelabels_v2/service.rb', line 697

def delete_label_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_label_revision_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleProtobufEmpty

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

Parameters:

  • name (String)

    Required. Label permission resource name.

  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



966
967
968
969
970
971
972
973
974
975
# File 'lib/google/apis/drivelabels_v2/service.rb', line 966

def delete_label_revision_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v2/{+name}', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
  command.params['name'] = name unless name.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delta_label(name, google_apps_drive_labels_v2_delta_update_label_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse

Updates a single label by applying a set of update requests resulting in a new draft revision. For more information, see Update a label. The batch update is all-or-nothing: If any of the update requests are invalid, no changes are applied. The resulting draft revision must be published before the changes may be used with Drive items.

Parameters:

  • name (String)

    Required. The resource name of the label to update.

  • google_apps_drive_labels_v2_delta_update_label_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



163
164
165
166
167
168
169
170
171
172
173
# File 'lib/google/apis/drivelabels_v2/service.rb', line 163

def delta_label(name, google_apps_drive_labels_v2_delta_update_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+name}:delta', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest::Representation
  command.request_object = google_apps_drive_labels_v2_delta_update_label_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#disable_label(name, google_apps_drive_labels_v2_disable_label_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label

Disable a published label. For more information, see Disable, enable, and delete a label. Disabling a label will result in a new disabled published revision based on the current published revision. If there's a draft revision, a new disabled draft revision will be created based on the latest draft revision. Older draft revisions will be deleted. Once disabled, a label may be deleted with DeleteLabel.

Parameters:

  • name (String)

    Required. Label resource name.

  • google_apps_drive_labels_v2_disable_label_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DisableLabelRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



202
203
204
205
206
207
208
209
210
211
212
# File 'lib/google/apis/drivelabels_v2/service.rb', line 202

def disable_label(name, google_apps_drive_labels_v2_disable_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+name}:disable', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DisableLabelRequest::Representation
  command.request_object = google_apps_drive_labels_v2_disable_label_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#enable_label(name, google_apps_drive_labels_v2_enable_label_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label

Enable a disabled label and restore it to its published state. For more information, see Disable, enable, and delete a label. This will result in a new published revision based on the current disabled published revision. If there's an existing disabled draft revision, a new revision will be created based on that draft and will be enabled.

Parameters:

  • name (String)

    Required. Label resource name.

  • google_apps_drive_labels_v2_enable_label_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2EnableLabelRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



240
241
242
243
244
245
246
247
248
249
250
# File 'lib/google/apis/drivelabels_v2/service.rb', line 240

def enable_label(name, google_apps_drive_labels_v2_enable_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+name}:enable', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2EnableLabelRequest::Representation
  command.request_object = google_apps_drive_labels_v2_enable_label_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_label(name, language_code: nil, use_admin_access: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label

Get a label by its resource name. For more information, see Search for labels. Resource name may be any of: * labels/id- See `labels/`id`@latest` * ` labels/`id`@latest` - Gets the latest revision of the label. * `labels/`id`@ published` - Gets the current published revision of the label. * `labels/`id`@` revision_id - Gets the label at the specified revision ID.

Parameters:

  • name (String)

    Required. Label resource name. May be any of: * labels/id(equivalent to labels/`id`@latest) * `labels/`id`@latest` * `labels/`id`@published` * `labels/ `id`@`revision_id

  • language_code (String) (defaults to: nil)

    The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used.

  • use_admin_access (Boolean) (defaults to: nil)

    Set to true in order to use the user's admin credentials. The server verifies that the user is an admin for the label before allowing access.

  • view (String) (defaults to: nil)

    When specified, only certain fields belonging to the indicated view are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/google/apis/drivelabels_v2/service.rb', line 288

def get_label(name, language_code: nil, use_admin_access: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
  command.params['name'] = name unless name.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_limit_label(name: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelLimits

Get the constraints on the structure of a label; such as, the maximum number of fields allowed and maximum length of the label title.

Parameters:

  • name (String) (defaults to: nil)

    Required. Label revision resource name must be: "limits/label".

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1039
1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/google/apis/drivelabels_v2/service.rb', line 1039

def get_limit_label(name: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/limits/label', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelLimits::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelLimits
  command.query['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_capabilities(name, customer: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UserCapabilities

Gets the user capabilities.

Parameters:

  • name (String)

    Required. The resource name of the user. Only "users/me/capabilities" is supported.

  • customer (String) (defaults to: nil)

    The customer to scope this request to. For example: customers/abcd1234. If unset, it will return settings within the current customer.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/google/apis/drivelabels_v2/service.rb', line 1073

def get_user_capabilities(name, customer: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+name}', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UserCapabilities::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UserCapabilities
  command.params['name'] = name unless name.nil?
  command.query['customer'] = customer unless customer.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_label_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse

Lists the label locks on a label.

Parameters:

  • parent (String)

    Required. Label on which locks are applied. Format: labels/label``.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of locks to return per page. Default: 100. Max: 200.

  • page_token (String) (defaults to: nil)

    The token of the page to return.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



544
545
546
547
548
549
550
551
552
553
554
# File 'lib/google/apis/drivelabels_v2/service.rb', line 544

def list_label_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/locks', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_label_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse

Lists a label's permissions.

Parameters:

  • parent (String)

    Required. The parent label resource name on which label permissions are listed. Format: labels/label``.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of permissions to return per page. Default: 50. Max: 200.

  • page_token (String) (defaults to: nil)

    The token of the page to return.

  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



736
737
738
739
740
741
742
743
744
745
746
747
# File 'lib/google/apis/drivelabels_v2/service.rb', line 736

def list_label_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/permissions', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_label_revision_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse

Lists the label locks on a label.

Parameters:

  • parent (String)

    Required. Label on which locks are applied. Format: labels/label``.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of locks to return per page. Default: 100. Max: 200.

  • page_token (String) (defaults to: nil)

    The token of the page to return.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



813
814
815
816
817
818
819
820
821
822
823
# File 'lib/google/apis/drivelabels_v2/service.rb', line 813

def list_label_revision_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/locks', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_label_revision_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse

Lists a label's permissions.

Parameters:

  • parent (String)

    Required. The parent label resource name on which label permissions are listed. Format: labels/label``.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of permissions to return per page. Default: 50. Max: 200.

  • page_token (String) (defaults to: nil)

    The token of the page to return.

  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
# File 'lib/google/apis/drivelabels_v2/service.rb', line 1005

def list_label_revision_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/{+parent}/permissions', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_labels(customer: nil, language_code: nil, minimum_role: nil, page_size: nil, page_token: nil, published_only: nil, use_admin_access: nil, view: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelsResponse

List labels. For more information, see Search for labels.

Parameters:

  • customer (String) (defaults to: nil)

    The customer to scope this list request to. For example: customers/abcd1234. If unset, will return all labels within the current customer.

  • language_code (String) (defaults to: nil)

    The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used.

  • minimum_role (String) (defaults to: nil)

    Specifies the level of access the user must have on the returned labels. The minimum role a user must have on a label. Defaults to READER.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of labels to return per page. Default: 50. Max: 200.

  • page_token (String) (defaults to: nil)

    The token of the page to return.

  • published_only (Boolean) (defaults to: nil)

    Whether to include only published labels in the results. * When true, only the current published label revisions are returned. Disabled labels are included. Returned label resource names reference the published revision ( labels/id/revision_id). * When `false`, the current label revisions are returned, which might not be published. Returned label resource names don't reference a specific revision (`labels/`id).

  • use_admin_access (Boolean) (defaults to: nil)

    Set to true in order to use the user's admin credentials. This will return all labels within the customer.

  • view (String) (defaults to: nil)

    When specified, only certain fields belonging to the indicated view are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/apis/drivelabels_v2/service.rb', line 346

def list_labels(customer: nil, language_code: nil, minimum_role: nil, page_size: nil, page_token: nil, published_only: nil, use_admin_access: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v2/labels', options)
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelsResponse::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelsResponse
  command.query['customer'] = customer unless customer.nil?
  command.query['languageCode'] = language_code unless language_code.nil?
  command.query['minimumRole'] = minimum_role unless minimum_role.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['publishedOnly'] = published_only unless published_only.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['view'] = view unless view.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#publish_label(name, google_apps_drive_labels_v2_publish_label_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label

Publish all draft changes to the label. Once published, the label may not return to its draft state. For more information, see Create and publish a label. Publishing a label will result in a new published revision. All previous draft revisions will be deleted. Previous published revisions will be kept but are subject to automated deletion as needed. For more information, see Label lifecycle. Once published, some changes are no longer permitted. Generally, any change that would invalidate or cause new restrictions on existing metadata related to the label will be rejected. For example, the following changes to a label will be rejected after the label is published: * The label cannot be directly deleted. It must be disabled first, then deleted.

  • Field.FieldType cannot be changed. * Changes to field validation options cannot reject something that was previously accepted. * Reducing the maximum entries.

Parameters:

  • name (String)

    Required. Label resource name.

  • google_apps_drive_labels_v2_publish_label_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2PublishLabelRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



398
399
400
401
402
403
404
405
406
407
408
# File 'lib/google/apis/drivelabels_v2/service.rb', line 398

def publish_label(name, google_apps_drive_labels_v2_publish_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+name}:publish', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2PublishLabelRequest::Representation
  command.request_object = google_apps_drive_labels_v2_publish_label_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_label_label_copy_mode(name, google_apps_drive_labels_v2_update_label_copy_mode_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label

Updates a label's CopyMode. Changes to this policy aren't revisioned, don't require publishing, and take effect immediately.

Parameters:

  • name (String)

    Required. The resource name of the label to update.

  • google_apps_drive_labels_v2_update_label_copy_mode_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



432
433
434
435
436
437
438
439
440
441
442
# File 'lib/google/apis/drivelabels_v2/service.rb', line 432

def update_label_label_copy_mode(name, google_apps_drive_labels_v2_update_label_copy_mode_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+name}:updateLabelCopyMode', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest::Representation
  command.request_object = google_apps_drive_labels_v2_update_label_copy_mode_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_label_label_enabled_app_settings(name, google_apps_drive_labels_v2_update_label_enabled_app_settings_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label

Updates a label's EnabledAppSettings. Enabling a label in a Google Workspace app allows it to be used in that app. This change isn't revisioned, doesn't require publishing, and takes effect immediately.

Parameters:

  • name (String)

    Required. The resource name of the label to update. The resource name of the label to update.

  • google_apps_drive_labels_v2_update_label_enabled_app_settings_request_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



468
469
470
471
472
473
474
475
476
477
478
# File 'lib/google/apis/drivelabels_v2/service.rb', line 468

def update_label_label_enabled_app_settings(name, google_apps_drive_labels_v2_update_label_enabled_app_settings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v2/{+name}:updateLabelEnabledAppSettings', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UpdateLabelEnabledAppSettingsRequest::Representation
  command.request_object = google_apps_drive_labels_v2_update_label_enabled_app_settings_request_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_label_permissions(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission

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.

Parameters:

  • parent (String)

    Required. The parent label resource name.

  • google_apps_drive_labels_v2_label_permission_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission) (defaults to: nil)
  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/google/apis/drivelabels_v2/service.rb', line 507

def update_label_permissions(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+parent}/permissions', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.request_object = google_apps_drive_labels_v2_label_permission_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
  command.params['parent'] = parent unless parent.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_label_revision_permissions(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission

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.

Parameters:

  • parent (String)

    Required. The parent label resource name.

  • google_apps_drive_labels_v2_label_permission_object (Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission) (defaults to: nil)
  • use_admin_access (Boolean) (defaults to: nil)

    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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/google/apis/drivelabels_v2/service.rb', line 776

def update_label_revision_permissions(parent, google_apps_drive_labels_v2_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v2/{+parent}/permissions', options)
  command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.request_object = google_apps_drive_labels_v2_label_permission_object
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
  command.params['parent'] = parent unless parent.nil?
  command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end