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:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDriveLabelsService

Returns a new instance of DriveLabelsService.



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

def initialize
  super('https://drivelabels.googleapis.com/', '',
        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.



38
39
40
# File 'lib/google/apis/drivelabels_v2/service.rb', line 38

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.



43
44
45
# File 'lib/google/apis/drivelabels_v2/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

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



87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/google/apis/drivelabels_v2/service.rb', line 87

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

#list_labels(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.

Parameters:

  • 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



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/google/apis/drivelabels_v2/service.rb', line 141

def list_labels(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['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