google-apis-drivelabels_v2beta 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1025 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module DrivelabelsV2beta
23
+ # Drive Labels API
24
+ #
25
+ # An API for managing Drive Labels
26
+ #
27
+ # @example
28
+ # require 'google/apis/drivelabels_v2beta'
29
+ #
30
+ # Drivelabels = Google::Apis::DrivelabelsV2beta # Alias the module
31
+ # service = Drivelabels::DriveLabelsService.new
32
+ #
33
+ # @see https://developers.google.com/drive/labels
34
+ class DriveLabelsService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://drivelabels.googleapis.com/', '',
47
+ client_name: 'google-apis-drivelabels_v2beta',
48
+ client_version: Google::Apis::DrivelabelsV2beta::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Creates a new Label.
53
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel] google_apps_drive_labels_v2beta_label_object
54
+ # @param [String] language_code
55
+ # The BCP-47 language code to use for evaluating localized Field labels in
56
+ # response. When not specified, values in the default configured language will
57
+ # be used.
58
+ # @param [Boolean] use_admin_access
59
+ # Set to `true` in order to use the user's admin privileges. The server will
60
+ # verify the user is an admin before allowing access.
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [Google::Apis::RequestOptions] options
67
+ # Request-specific options
68
+ #
69
+ # @yield [result, err] Result & error if block supplied
70
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel]
74
+ #
75
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
78
+ def create_label(google_apps_drive_labels_v2beta_label_object = nil, language_code: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:post, 'v2beta/labels', options)
80
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel::Representation
81
+ command.request_object = google_apps_drive_labels_v2beta_label_object
82
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel::Representation
83
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel
84
+ command.query['languageCode'] = language_code unless language_code.nil?
85
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Permanently deletes a Label and related metadata on Drive Items. Once deleted,
92
+ # the Label and related Drive item metadata will be deleted. Only draft Labels,
93
+ # and disabled Labels may be deleted.
94
+ # @param [String] name
95
+ # Required. Label resource name.
96
+ # @param [Boolean] use_admin_access
97
+ # Set to `true` in order to use the user's admin credentials. The server will
98
+ # verify the user is an admin for the Label before allowing access.
99
+ # @param [String] write_control_required_revision_id
100
+ # The revision_id of the label that the write request will be applied to. If
101
+ # this is not the latest revision of the label, the request will not be
102
+ # processed and will return a 400 Bad Request error.
103
+ # @param [String] fields
104
+ # Selector specifying which fields to include in a partial response.
105
+ # @param [String] quota_user
106
+ # Available to use for quota purposes for server-side applications. Can be any
107
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
108
+ # @param [Google::Apis::RequestOptions] options
109
+ # Request-specific options
110
+ #
111
+ # @yield [result, err] Result & error if block supplied
112
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty] parsed result object
113
+ # @yieldparam err [StandardError] error object if request failed
114
+ #
115
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty]
116
+ #
117
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
118
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
119
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
120
+ def delete_label(name, use_admin_access: nil, write_control_required_revision_id: nil, fields: nil, quota_user: nil, options: nil, &block)
121
+ command = make_simple_command(:delete, 'v2beta/{+name}', options)
122
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty::Representation
123
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty
124
+ command.params['name'] = name unless name.nil?
125
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
126
+ command.query['writeControl.requiredRevisionId'] = write_control_required_revision_id unless write_control_required_revision_id.nil?
127
+ command.query['fields'] = fields unless fields.nil?
128
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
129
+ execute_or_queue_command(command, &block)
130
+ end
131
+
132
+ # Updates a single Label by applying a set of update requests resulting in a new
133
+ # draft revision. The batch update is all-or-nothing: If any of the update
134
+ # requests are invalid, no changes are applied. The resulting draft revision
135
+ # must be published before the changes may be used with Drive Items.
136
+ # @param [String] name
137
+ # Required. The resource name of the Label to update.
138
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDeltaUpdateLabelRequest] google_apps_drive_labels_v2beta_delta_update_label_request_object
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
141
+ # @param [String] quota_user
142
+ # Available to use for quota purposes for server-side applications. Can be any
143
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
144
+ # @param [Google::Apis::RequestOptions] options
145
+ # Request-specific options
146
+ #
147
+ # @yield [result, err] Result & error if block supplied
148
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDeltaUpdateLabelResponse] parsed result object
149
+ # @yieldparam err [StandardError] error object if request failed
150
+ #
151
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDeltaUpdateLabelResponse]
152
+ #
153
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
154
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
155
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
156
+ def delta_label(name, google_apps_drive_labels_v2beta_delta_update_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:post, 'v2beta/{+name}:delta', options)
158
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDeltaUpdateLabelRequest::Representation
159
+ command.request_object = google_apps_drive_labels_v2beta_delta_update_label_request_object
160
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDeltaUpdateLabelResponse::Representation
161
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDeltaUpdateLabelResponse
162
+ command.params['name'] = name unless name.nil?
163
+ command.query['fields'] = fields unless fields.nil?
164
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
165
+ execute_or_queue_command(command, &block)
166
+ end
167
+
168
+ # Disable a published Label. Disabling a Label will result in a new disabled
169
+ # published revision based on the current published revision. If there is a
170
+ # draft revision, a new disabled draft revision will be created based on the
171
+ # latest draft revision. Older draft revisions will be deleted. Once disabled, a
172
+ # label may be deleted with `DeleteLabel`.
173
+ # @param [String] name
174
+ # Required. Label resource name.
175
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDisableLabelRequest] google_apps_drive_labels_v2beta_disable_label_request_object
176
+ # @param [String] fields
177
+ # Selector specifying which fields to include in a partial response.
178
+ # @param [String] quota_user
179
+ # Available to use for quota purposes for server-side applications. Can be any
180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
181
+ # @param [Google::Apis::RequestOptions] options
182
+ # Request-specific options
183
+ #
184
+ # @yield [result, err] Result & error if block supplied
185
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel]
189
+ #
190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
193
+ def disable_label(name, google_apps_drive_labels_v2beta_disable_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:post, 'v2beta/{+name}:disable', options)
195
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaDisableLabelRequest::Representation
196
+ command.request_object = google_apps_drive_labels_v2beta_disable_label_request_object
197
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel::Representation
198
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel
199
+ command.params['name'] = name unless name.nil?
200
+ command.query['fields'] = fields unless fields.nil?
201
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
202
+ execute_or_queue_command(command, &block)
203
+ end
204
+
205
+ # Enable a disabled Label and restore it to its published state. This will
206
+ # result in a new published revision based on the current disabled published
207
+ # revision. If there is an existing disabled draft revision, a new revision will
208
+ # be created based on that draft and will be enabled.
209
+ # @param [String] name
210
+ # Required. Label resource name.
211
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaEnableLabelRequest] google_apps_drive_labels_v2beta_enable_label_request_object
212
+ # @param [String] fields
213
+ # Selector specifying which fields to include in a partial response.
214
+ # @param [String] quota_user
215
+ # Available to use for quota purposes for server-side applications. Can be any
216
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
217
+ # @param [Google::Apis::RequestOptions] options
218
+ # Request-specific options
219
+ #
220
+ # @yield [result, err] Result & error if block supplied
221
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel] parsed result object
222
+ # @yieldparam err [StandardError] error object if request failed
223
+ #
224
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel]
225
+ #
226
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
227
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
228
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
229
+ def enable_label(name, google_apps_drive_labels_v2beta_enable_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
230
+ command = make_simple_command(:post, 'v2beta/{+name}:enable', options)
231
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaEnableLabelRequest::Representation
232
+ command.request_object = google_apps_drive_labels_v2beta_enable_label_request_object
233
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel::Representation
234
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel
235
+ command.params['name'] = name unless name.nil?
236
+ command.query['fields'] = fields unless fields.nil?
237
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
238
+ execute_or_queue_command(command, &block)
239
+ end
240
+
241
+ # Get a label by its resource name. Resource name may be any of: * `labels/`id``
242
+ # - See `labels/`id`@latest` * `labels/`id`@latest` - Gets the latest revision
243
+ # of the label. * `labels/`id`@published` - Gets the current published revision
244
+ # of the label. * `labels/`id`@`revision_id`` - Gets the label at the specified
245
+ # revision ID.
246
+ # @param [String] name
247
+ # Required. Label resource name. May be any of: * `labels/`id`` (equivalent to
248
+ # labels/`id`@latest) * `labels/`id`@latest` * `labels/`id`@published` * `labels/
249
+ # `id`@`revision_id``
250
+ # @param [String] language_code
251
+ # The BCP-47 language code to use for evaluating localized field labels. When
252
+ # not specified, values in the default configured language are used.
253
+ # @param [Boolean] use_admin_access
254
+ # Set to `true` in order to use the user's admin credentials. The server
255
+ # verifies that the user is an admin for the label before allowing access.
256
+ # @param [String] view
257
+ # When specified, only certain fields belonging to the indicated view are
258
+ # returned.
259
+ # @param [String] fields
260
+ # Selector specifying which fields to include in a partial response.
261
+ # @param [String] quota_user
262
+ # Available to use for quota purposes for server-side applications. Can be any
263
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
264
+ # @param [Google::Apis::RequestOptions] options
265
+ # Request-specific options
266
+ #
267
+ # @yield [result, err] Result & error if block supplied
268
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel] parsed result object
269
+ # @yieldparam err [StandardError] error object if request failed
270
+ #
271
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel]
272
+ #
273
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
274
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
275
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
276
+ def get_label(name, language_code: nil, use_admin_access: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
277
+ command = make_simple_command(:get, 'v2beta/{+name}', options)
278
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel::Representation
279
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel
280
+ command.params['name'] = name unless name.nil?
281
+ command.query['languageCode'] = language_code unless language_code.nil?
282
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
283
+ command.query['view'] = view unless view.nil?
284
+ command.query['fields'] = fields unless fields.nil?
285
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
286
+ execute_or_queue_command(command, &block)
287
+ end
288
+
289
+ # List labels.
290
+ # @param [String] language_code
291
+ # The BCP-47 language code to use for evaluating localized field labels. When
292
+ # not specified, values in the default configured language are used.
293
+ # @param [String] minimum_role
294
+ # Specifies the level of access the user must have on the returned Labels. The
295
+ # minimum role a user must have on a label. Defaults to `READER`.
296
+ # @param [Fixnum] page_size
297
+ # Maximum number of labels to return per page. Default: 50. Max: 200.
298
+ # @param [String] page_token
299
+ # The token of the page to return.
300
+ # @param [Boolean] published_only
301
+ # Whether to include only published labels in the results. * When `true`, only
302
+ # the current published label revisions are returned. Disabled labels are
303
+ # included. Returned label resource names reference the published revision (`
304
+ # labels/`id`/`revision_id``). * When `false`, the current label revisions are
305
+ # returned, which might not be published. Returned label resource names don't
306
+ # reference a specific revision (`labels/`id``).
307
+ # @param [Boolean] use_admin_access
308
+ # Set to `true` in order to use the user's admin credentials. This will return
309
+ # all Labels within the customer.
310
+ # @param [String] view
311
+ # When specified, only certain fields belonging to the indicated view are
312
+ # returned.
313
+ # @param [String] fields
314
+ # Selector specifying which fields to include in a partial response.
315
+ # @param [String] quota_user
316
+ # Available to use for quota purposes for server-side applications. Can be any
317
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
318
+ # @param [Google::Apis::RequestOptions] options
319
+ # Request-specific options
320
+ #
321
+ # @yield [result, err] Result & error if block supplied
322
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelsResponse] parsed result object
323
+ # @yieldparam err [StandardError] error object if request failed
324
+ #
325
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelsResponse]
326
+ #
327
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
328
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
329
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
330
+ 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)
331
+ command = make_simple_command(:get, 'v2beta/labels', options)
332
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelsResponse::Representation
333
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelsResponse
334
+ command.query['languageCode'] = language_code unless language_code.nil?
335
+ command.query['minimumRole'] = minimum_role unless minimum_role.nil?
336
+ command.query['pageSize'] = page_size unless page_size.nil?
337
+ command.query['pageToken'] = page_token unless page_token.nil?
338
+ command.query['publishedOnly'] = published_only unless published_only.nil?
339
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
340
+ command.query['view'] = view unless view.nil?
341
+ command.query['fields'] = fields unless fields.nil?
342
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
343
+ execute_or_queue_command(command, &block)
344
+ end
345
+
346
+ # Publish all draft changes to the Label. Once published, the Label may not
347
+ # return to its draft state. See `google.apps.drive.labels.v2.Lifecycle` for
348
+ # more information. Publishing a Label will result in a new published revision.
349
+ # All previous draft revisions will be deleted. Previous published revisions
350
+ # will be kept but are subject to automated deletion as needed. Once published,
351
+ # some changes are no longer permitted. Generally, any change that would
352
+ # invalidate or cause new restrictions on existing metadata related to the Label
353
+ # will be rejected. For example, the following changes to a Label will be
354
+ # rejected after the Label is published: * The label cannot be directly deleted.
355
+ # It must be disabled first, then deleted. * Field.FieldType cannot be changed. *
356
+ # Changes to Field validation options cannot reject something that was
357
+ # previously accepted. * Reducing the max entries.
358
+ # @param [String] name
359
+ # Required. Label resource name.
360
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaPublishLabelRequest] google_apps_drive_labels_v2beta_publish_label_request_object
361
+ # @param [String] fields
362
+ # Selector specifying which fields to include in a partial response.
363
+ # @param [String] quota_user
364
+ # Available to use for quota purposes for server-side applications. Can be any
365
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
366
+ # @param [Google::Apis::RequestOptions] options
367
+ # Request-specific options
368
+ #
369
+ # @yield [result, err] Result & error if block supplied
370
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel] parsed result object
371
+ # @yieldparam err [StandardError] error object if request failed
372
+ #
373
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel]
374
+ #
375
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
376
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
377
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
378
+ def publish_label(name, google_apps_drive_labels_v2beta_publish_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
379
+ command = make_simple_command(:post, 'v2beta/{+name}:publish', options)
380
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaPublishLabelRequest::Representation
381
+ command.request_object = google_apps_drive_labels_v2beta_publish_label_request_object
382
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel::Representation
383
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel
384
+ command.params['name'] = name unless name.nil?
385
+ command.query['fields'] = fields unless fields.nil?
386
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
387
+ execute_or_queue_command(command, &block)
388
+ end
389
+
390
+ # Updates a Label's `CopyMode`. Changes to this policy are not revisioned, do
391
+ # not require publishing, and take effect immediately.
392
+ # @param [String] name
393
+ # Required. The resource name of the Label to update.
394
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaUpdateLabelCopyModeRequest] google_apps_drive_labels_v2beta_update_label_copy_mode_request_object
395
+ # @param [String] fields
396
+ # Selector specifying which fields to include in a partial response.
397
+ # @param [String] quota_user
398
+ # Available to use for quota purposes for server-side applications. Can be any
399
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
400
+ # @param [Google::Apis::RequestOptions] options
401
+ # Request-specific options
402
+ #
403
+ # @yield [result, err] Result & error if block supplied
404
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel] parsed result object
405
+ # @yieldparam err [StandardError] error object if request failed
406
+ #
407
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel]
408
+ #
409
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
410
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
411
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
412
+ def update_label_label_copy_mode(name, google_apps_drive_labels_v2beta_update_label_copy_mode_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
413
+ command = make_simple_command(:post, 'v2beta/{+name}:updateLabelCopyMode', options)
414
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaUpdateLabelCopyModeRequest::Representation
415
+ command.request_object = google_apps_drive_labels_v2beta_update_label_copy_mode_request_object
416
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel::Representation
417
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabel
418
+ command.params['name'] = name unless name.nil?
419
+ command.query['fields'] = fields unless fields.nil?
420
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
421
+ execute_or_queue_command(command, &block)
422
+ end
423
+
424
+ # Lists the Locks on a Label.
425
+ # @param [String] parent
426
+ # Required. Label on which Locks are applied. Format: labels/`label`
427
+ # @param [Fixnum] page_size
428
+ # Maximum number of Locks to return per page. Default: 100. Max: 200.
429
+ # @param [String] page_token
430
+ # The token of the page to return.
431
+ # @param [String] fields
432
+ # Selector specifying which fields to include in a partial response.
433
+ # @param [String] quota_user
434
+ # Available to use for quota purposes for server-side applications. Can be any
435
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
436
+ # @param [Google::Apis::RequestOptions] options
437
+ # Request-specific options
438
+ #
439
+ # @yield [result, err] Result & error if block supplied
440
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse] parsed result object
441
+ # @yieldparam err [StandardError] error object if request failed
442
+ #
443
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse]
444
+ #
445
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
446
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
447
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
448
+ def list_label_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
449
+ command = make_simple_command(:get, 'v2beta/{+parent}/locks', options)
450
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse::Representation
451
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse
452
+ command.params['parent'] = parent unless parent.nil?
453
+ command.query['pageSize'] = page_size unless page_size.nil?
454
+ command.query['pageToken'] = page_token unless page_token.nil?
455
+ command.query['fields'] = fields unless fields.nil?
456
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
457
+ execute_or_queue_command(command, &block)
458
+ end
459
+
460
+ # Deletes Label permissions. Permissions affect the Label resource as a whole,
461
+ # are not revisioned, and do not require publishing.
462
+ # @param [String] labels_id
463
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchDeleteLabelPermissionsRequest] google_apps_drive_labels_v2beta_batch_delete_label_permissions_request_object
464
+ # @param [String] fields
465
+ # Selector specifying which fields to include in a partial response.
466
+ # @param [String] quota_user
467
+ # Available to use for quota purposes for server-side applications. Can be any
468
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
469
+ # @param [Google::Apis::RequestOptions] options
470
+ # Request-specific options
471
+ #
472
+ # @yield [result, err] Result & error if block supplied
473
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty] parsed result object
474
+ # @yieldparam err [StandardError] error object if request failed
475
+ #
476
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty]
477
+ #
478
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
479
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
480
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
481
+ def batch_label_permission_delete(labels_id, google_apps_drive_labels_v2beta_batch_delete_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
482
+ command = make_simple_command(:post, 'v2beta/labels/{labelsId}/permissions:batchDelete', options)
483
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchDeleteLabelPermissionsRequest::Representation
484
+ command.request_object = google_apps_drive_labels_v2beta_batch_delete_label_permissions_request_object
485
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty::Representation
486
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty
487
+ command.params['labelsId'] = labels_id unless labels_id.nil?
488
+ command.query['fields'] = fields unless fields.nil?
489
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
490
+ execute_or_queue_command(command, &block)
491
+ end
492
+
493
+ # Updates Label permissions. If a permission for the indicated principal doesn't
494
+ # exist, a new Label Permission is created, otherwise the existing permission is
495
+ # updated. Permissions affect the Label resource as a whole, are not revisioned,
496
+ # and do not require publishing.
497
+ # @param [String] parent
498
+ # Required. The parent Label resource name shared by all permissions being
499
+ # updated. Format: labels/`label` If this is set, the parent field in the
500
+ # UpdateLabelPermissionRequest messages must either be empty or match this field.
501
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsRequest] google_apps_drive_labels_v2beta_batch_update_label_permissions_request_object
502
+ # @param [String] fields
503
+ # Selector specifying which fields to include in a partial response.
504
+ # @param [String] quota_user
505
+ # Available to use for quota purposes for server-side applications. Can be any
506
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
507
+ # @param [Google::Apis::RequestOptions] options
508
+ # Request-specific options
509
+ #
510
+ # @yield [result, err] Result & error if block supplied
511
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse] parsed result object
512
+ # @yieldparam err [StandardError] error object if request failed
513
+ #
514
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse]
515
+ #
516
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
517
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
518
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
519
+ def batch_label_permission_update(parent, google_apps_drive_labels_v2beta_batch_update_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
520
+ command = make_simple_command(:post, 'v2beta/{+parent}/permissions:batchUpdate', options)
521
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsRequest::Representation
522
+ command.request_object = google_apps_drive_labels_v2beta_batch_update_label_permissions_request_object
523
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse::Representation
524
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse
525
+ command.params['parent'] = parent unless parent.nil?
526
+ command.query['fields'] = fields unless fields.nil?
527
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
528
+ execute_or_queue_command(command, &block)
529
+ end
530
+
531
+ # Updates a Label's permissions. If a permission for the indicated principal
532
+ # doesn't exist, a new Label Permission is created, otherwise the existing
533
+ # permission is updated. Permissions affect the Label resource as a whole, are
534
+ # not revisioned, and do not require publishing.
535
+ # @param [String] parent
536
+ # Required. The parent Label resource name on the Label Permission is created.
537
+ # Format: labels/`label`
538
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] google_apps_drive_labels_v2beta_label_permission_object
539
+ # @param [Boolean] use_admin_access
540
+ # Set to `true` in order to use the user's admin credentials. The server will
541
+ # verify the user is an admin for the Label before allowing access.
542
+ # @param [String] fields
543
+ # Selector specifying which fields to include in a partial response.
544
+ # @param [String] quota_user
545
+ # Available to use for quota purposes for server-side applications. Can be any
546
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
547
+ # @param [Google::Apis::RequestOptions] options
548
+ # Request-specific options
549
+ #
550
+ # @yield [result, err] Result & error if block supplied
551
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] parsed result object
552
+ # @yieldparam err [StandardError] error object if request failed
553
+ #
554
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission]
555
+ #
556
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
557
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
558
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
559
+ def create_label_permission(parent, google_apps_drive_labels_v2beta_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
560
+ command = make_simple_command(:post, 'v2beta/{+parent}/permissions', options)
561
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
562
+ command.request_object = google_apps_drive_labels_v2beta_label_permission_object
563
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
564
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission
565
+ command.params['parent'] = parent unless parent.nil?
566
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
567
+ command.query['fields'] = fields unless fields.nil?
568
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
569
+ execute_or_queue_command(command, &block)
570
+ end
571
+
572
+ # Deletes a Label's permission. Permissions affect the Label resource as a whole,
573
+ # are not revisioned, and do not require publishing.
574
+ # @param [String] name
575
+ # Required. Label Permission resource name.
576
+ # @param [Boolean] use_admin_access
577
+ # Set to `true` in order to use the user's admin credentials. The server will
578
+ # verify the user is an admin for the Label before allowing access.
579
+ # @param [String] fields
580
+ # Selector specifying which fields to include in a partial response.
581
+ # @param [String] quota_user
582
+ # Available to use for quota purposes for server-side applications. Can be any
583
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
584
+ # @param [Google::Apis::RequestOptions] options
585
+ # Request-specific options
586
+ #
587
+ # @yield [result, err] Result & error if block supplied
588
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty] parsed result object
589
+ # @yieldparam err [StandardError] error object if request failed
590
+ #
591
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty]
592
+ #
593
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
594
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
595
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
596
+ def delete_label_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
597
+ command = make_simple_command(:delete, 'v2beta/{+name}', options)
598
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty::Representation
599
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty
600
+ command.params['name'] = name unless name.nil?
601
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
602
+ command.query['fields'] = fields unless fields.nil?
603
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
604
+ execute_or_queue_command(command, &block)
605
+ end
606
+
607
+ # Lists a Label's permissions.
608
+ # @param [String] parent
609
+ # Required. The parent Label resource name on which Label Permission are listed.
610
+ # Format: labels/`label`
611
+ # @param [Fixnum] page_size
612
+ # Maximum number of permissions to return per page. Default: 50. Max: 200.
613
+ # @param [String] page_token
614
+ # The token of the page to return.
615
+ # @param [Boolean] use_admin_access
616
+ # Set to `true` in order to use the user's admin credentials. The server will
617
+ # verify the user is an admin for the Label before allowing access.
618
+ # @param [String] fields
619
+ # Selector specifying which fields to include in a partial response.
620
+ # @param [String] quota_user
621
+ # Available to use for quota purposes for server-side applications. Can be any
622
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
623
+ # @param [Google::Apis::RequestOptions] options
624
+ # Request-specific options
625
+ #
626
+ # @yield [result, err] Result & error if block supplied
627
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse] parsed result object
628
+ # @yieldparam err [StandardError] error object if request failed
629
+ #
630
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse]
631
+ #
632
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
633
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
634
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
635
+ def list_label_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
636
+ command = make_simple_command(:get, 'v2beta/{+parent}/permissions', options)
637
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse::Representation
638
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse
639
+ command.params['parent'] = parent unless parent.nil?
640
+ command.query['pageSize'] = page_size unless page_size.nil?
641
+ command.query['pageToken'] = page_token unless page_token.nil?
642
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
643
+ command.query['fields'] = fields unless fields.nil?
644
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
645
+ execute_or_queue_command(command, &block)
646
+ end
647
+
648
+ # Updates a Label's permissions. If a permission for the indicated principal
649
+ # doesn't exist, a new Label Permission is created, otherwise the existing
650
+ # permission is updated. Permissions affect the Label resource as a whole, are
651
+ # not revisioned, and do not require publishing.
652
+ # @param [String] parent
653
+ # Required. The parent Label resource name.
654
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] google_apps_drive_labels_v2beta_label_permission_object
655
+ # @param [Boolean] use_admin_access
656
+ # Set to `true` in order to use the user's admin credentials. The server will
657
+ # verify the user is an admin for the Label before allowing access.
658
+ # @param [String] fields
659
+ # Selector specifying which fields to include in a partial response.
660
+ # @param [String] quota_user
661
+ # Available to use for quota purposes for server-side applications. Can be any
662
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
663
+ # @param [Google::Apis::RequestOptions] options
664
+ # Request-specific options
665
+ #
666
+ # @yield [result, err] Result & error if block supplied
667
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] parsed result object
668
+ # @yieldparam err [StandardError] error object if request failed
669
+ #
670
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission]
671
+ #
672
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
673
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
674
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
675
+ def patch_label_permission(parent, google_apps_drive_labels_v2beta_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
676
+ command = make_simple_command(:patch, 'v2beta/{+parent}', options)
677
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
678
+ command.request_object = google_apps_drive_labels_v2beta_label_permission_object
679
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
680
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission
681
+ command.params['parent'] = parent unless parent.nil?
682
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
683
+ command.query['fields'] = fields unless fields.nil?
684
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
685
+ execute_or_queue_command(command, &block)
686
+ end
687
+
688
+ # Lists the Locks on a Label.
689
+ # @param [String] parent
690
+ # Required. Label on which Locks are applied. Format: labels/`label`
691
+ # @param [Fixnum] page_size
692
+ # Maximum number of Locks to return per page. Default: 100. Max: 200.
693
+ # @param [String] page_token
694
+ # The token of the page to return.
695
+ # @param [String] fields
696
+ # Selector specifying which fields to include in a partial response.
697
+ # @param [String] quota_user
698
+ # Available to use for quota purposes for server-side applications. Can be any
699
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
700
+ # @param [Google::Apis::RequestOptions] options
701
+ # Request-specific options
702
+ #
703
+ # @yield [result, err] Result & error if block supplied
704
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse] parsed result object
705
+ # @yieldparam err [StandardError] error object if request failed
706
+ #
707
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse]
708
+ #
709
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
710
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
711
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
712
+ def list_label_revision_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
713
+ command = make_simple_command(:get, 'v2beta/{+parent}/locks', options)
714
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse::Representation
715
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelLocksResponse
716
+ command.params['parent'] = parent unless parent.nil?
717
+ command.query['pageSize'] = page_size unless page_size.nil?
718
+ command.query['pageToken'] = page_token unless page_token.nil?
719
+ command.query['fields'] = fields unless fields.nil?
720
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
721
+ execute_or_queue_command(command, &block)
722
+ end
723
+
724
+ # Deletes Label permissions. Permissions affect the Label resource as a whole,
725
+ # are not revisioned, and do not require publishing.
726
+ # @param [String] labels_id
727
+ # @param [String] revisions_id
728
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchDeleteLabelPermissionsRequest] google_apps_drive_labels_v2beta_batch_delete_label_permissions_request_object
729
+ # @param [String] fields
730
+ # Selector specifying which fields to include in a partial response.
731
+ # @param [String] quota_user
732
+ # Available to use for quota purposes for server-side applications. Can be any
733
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
734
+ # @param [Google::Apis::RequestOptions] options
735
+ # Request-specific options
736
+ #
737
+ # @yield [result, err] Result & error if block supplied
738
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty] parsed result object
739
+ # @yieldparam err [StandardError] error object if request failed
740
+ #
741
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty]
742
+ #
743
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
744
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
745
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
746
+ def batch_label_revision_permission_delete(labels_id, revisions_id, google_apps_drive_labels_v2beta_batch_delete_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
747
+ command = make_simple_command(:post, 'v2beta/labels/{labelsId}/revisions/{revisionsId}/permissions:batchDelete', options)
748
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchDeleteLabelPermissionsRequest::Representation
749
+ command.request_object = google_apps_drive_labels_v2beta_batch_delete_label_permissions_request_object
750
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty::Representation
751
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty
752
+ command.params['labelsId'] = labels_id unless labels_id.nil?
753
+ command.params['revisionsId'] = revisions_id unless revisions_id.nil?
754
+ command.query['fields'] = fields unless fields.nil?
755
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
756
+ execute_or_queue_command(command, &block)
757
+ end
758
+
759
+ # Updates Label permissions. If a permission for the indicated principal doesn't
760
+ # exist, a new Label Permission is created, otherwise the existing permission is
761
+ # updated. Permissions affect the Label resource as a whole, are not revisioned,
762
+ # and do not require publishing.
763
+ # @param [String] parent
764
+ # Required. The parent Label resource name shared by all permissions being
765
+ # updated. Format: labels/`label` If this is set, the parent field in the
766
+ # UpdateLabelPermissionRequest messages must either be empty or match this field.
767
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsRequest] google_apps_drive_labels_v2beta_batch_update_label_permissions_request_object
768
+ # @param [String] fields
769
+ # Selector specifying which fields to include in a partial response.
770
+ # @param [String] quota_user
771
+ # Available to use for quota purposes for server-side applications. Can be any
772
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
773
+ # @param [Google::Apis::RequestOptions] options
774
+ # Request-specific options
775
+ #
776
+ # @yield [result, err] Result & error if block supplied
777
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse] parsed result object
778
+ # @yieldparam err [StandardError] error object if request failed
779
+ #
780
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse]
781
+ #
782
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
783
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
784
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
785
+ def batch_label_revision_permission_update(parent, google_apps_drive_labels_v2beta_batch_update_label_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
786
+ command = make_simple_command(:post, 'v2beta/{+parent}/permissions:batchUpdate', options)
787
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsRequest::Representation
788
+ command.request_object = google_apps_drive_labels_v2beta_batch_update_label_permissions_request_object
789
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse::Representation
790
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaBatchUpdateLabelPermissionsResponse
791
+ command.params['parent'] = parent unless parent.nil?
792
+ command.query['fields'] = fields unless fields.nil?
793
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
794
+ execute_or_queue_command(command, &block)
795
+ end
796
+
797
+ # Updates a Label's permissions. If a permission for the indicated principal
798
+ # doesn't exist, a new Label Permission is created, otherwise the existing
799
+ # permission is updated. Permissions affect the Label resource as a whole, are
800
+ # not revisioned, and do not require publishing.
801
+ # @param [String] parent
802
+ # Required. The parent Label resource name on the Label Permission is created.
803
+ # Format: labels/`label`
804
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] google_apps_drive_labels_v2beta_label_permission_object
805
+ # @param [Boolean] use_admin_access
806
+ # Set to `true` in order to use the user's admin credentials. The server will
807
+ # verify the user is an admin for the Label before allowing access.
808
+ # @param [String] fields
809
+ # Selector specifying which fields to include in a partial response.
810
+ # @param [String] quota_user
811
+ # Available to use for quota purposes for server-side applications. Can be any
812
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
813
+ # @param [Google::Apis::RequestOptions] options
814
+ # Request-specific options
815
+ #
816
+ # @yield [result, err] Result & error if block supplied
817
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] parsed result object
818
+ # @yieldparam err [StandardError] error object if request failed
819
+ #
820
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission]
821
+ #
822
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
823
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
824
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
825
+ def create_label_revision_permission(parent, google_apps_drive_labels_v2beta_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
826
+ command = make_simple_command(:post, 'v2beta/{+parent}/permissions', options)
827
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
828
+ command.request_object = google_apps_drive_labels_v2beta_label_permission_object
829
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
830
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission
831
+ command.params['parent'] = parent unless parent.nil?
832
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
833
+ command.query['fields'] = fields unless fields.nil?
834
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
835
+ execute_or_queue_command(command, &block)
836
+ end
837
+
838
+ # Deletes a Label's permission. Permissions affect the Label resource as a whole,
839
+ # are not revisioned, and do not require publishing.
840
+ # @param [String] name
841
+ # Required. Label Permission resource name.
842
+ # @param [Boolean] use_admin_access
843
+ # Set to `true` in order to use the user's admin credentials. The server will
844
+ # verify the user is an admin for the Label before allowing access.
845
+ # @param [String] fields
846
+ # Selector specifying which fields to include in a partial response.
847
+ # @param [String] quota_user
848
+ # Available to use for quota purposes for server-side applications. Can be any
849
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
850
+ # @param [Google::Apis::RequestOptions] options
851
+ # Request-specific options
852
+ #
853
+ # @yield [result, err] Result & error if block supplied
854
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty] parsed result object
855
+ # @yieldparam err [StandardError] error object if request failed
856
+ #
857
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty]
858
+ #
859
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
860
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
861
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
862
+ def delete_label_revision_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
863
+ command = make_simple_command(:delete, 'v2beta/{+name}', options)
864
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty::Representation
865
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleProtobufEmpty
866
+ command.params['name'] = name unless name.nil?
867
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
868
+ command.query['fields'] = fields unless fields.nil?
869
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
870
+ execute_or_queue_command(command, &block)
871
+ end
872
+
873
+ # Lists a Label's permissions.
874
+ # @param [String] parent
875
+ # Required. The parent Label resource name on which Label Permission are listed.
876
+ # Format: labels/`label`
877
+ # @param [Fixnum] page_size
878
+ # Maximum number of permissions to return per page. Default: 50. Max: 200.
879
+ # @param [String] page_token
880
+ # The token of the page to return.
881
+ # @param [Boolean] use_admin_access
882
+ # Set to `true` in order to use the user's admin credentials. The server will
883
+ # verify the user is an admin for the Label before allowing access.
884
+ # @param [String] fields
885
+ # Selector specifying which fields to include in a partial response.
886
+ # @param [String] quota_user
887
+ # Available to use for quota purposes for server-side applications. Can be any
888
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
889
+ # @param [Google::Apis::RequestOptions] options
890
+ # Request-specific options
891
+ #
892
+ # @yield [result, err] Result & error if block supplied
893
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse] parsed result object
894
+ # @yieldparam err [StandardError] error object if request failed
895
+ #
896
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse]
897
+ #
898
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
899
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
900
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
901
+ def list_label_revision_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
902
+ command = make_simple_command(:get, 'v2beta/{+parent}/permissions', options)
903
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse::Representation
904
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaListLabelPermissionsResponse
905
+ command.params['parent'] = parent unless parent.nil?
906
+ command.query['pageSize'] = page_size unless page_size.nil?
907
+ command.query['pageToken'] = page_token unless page_token.nil?
908
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
909
+ command.query['fields'] = fields unless fields.nil?
910
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
911
+ execute_or_queue_command(command, &block)
912
+ end
913
+
914
+ # Updates a Label's permissions. If a permission for the indicated principal
915
+ # doesn't exist, a new Label Permission is created, otherwise the existing
916
+ # permission is updated. Permissions affect the Label resource as a whole, are
917
+ # not revisioned, and do not require publishing.
918
+ # @param [String] parent
919
+ # Required. The parent Label resource name.
920
+ # @param [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] google_apps_drive_labels_v2beta_label_permission_object
921
+ # @param [Boolean] use_admin_access
922
+ # Set to `true` in order to use the user's admin credentials. The server will
923
+ # verify the user is an admin for the Label before allowing access.
924
+ # @param [String] fields
925
+ # Selector specifying which fields to include in a partial response.
926
+ # @param [String] quota_user
927
+ # Available to use for quota purposes for server-side applications. Can be any
928
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
929
+ # @param [Google::Apis::RequestOptions] options
930
+ # Request-specific options
931
+ #
932
+ # @yield [result, err] Result & error if block supplied
933
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission] parsed result object
934
+ # @yieldparam err [StandardError] error object if request failed
935
+ #
936
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission]
937
+ #
938
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
939
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
940
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
941
+ def patch_label_revision_permission(parent, google_apps_drive_labels_v2beta_label_permission_object = nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
942
+ command = make_simple_command(:patch, 'v2beta/{+parent}', options)
943
+ command.request_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
944
+ command.request_object = google_apps_drive_labels_v2beta_label_permission_object
945
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission::Representation
946
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelPermission
947
+ command.params['parent'] = parent unless parent.nil?
948
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
949
+ command.query['fields'] = fields unless fields.nil?
950
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
951
+ execute_or_queue_command(command, &block)
952
+ end
953
+
954
+ # Get the constraints on the structure of a Label; such as, the maximum number
955
+ # of Fields allowed and maximum length of the label title.
956
+ # @param [String] name
957
+ # Required. Label revision resource name Must be: "limits/label"
958
+ # @param [String] fields
959
+ # Selector specifying which fields to include in a partial response.
960
+ # @param [String] quota_user
961
+ # Available to use for quota purposes for server-side applications. Can be any
962
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
963
+ # @param [Google::Apis::RequestOptions] options
964
+ # Request-specific options
965
+ #
966
+ # @yield [result, err] Result & error if block supplied
967
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelLimits] parsed result object
968
+ # @yieldparam err [StandardError] error object if request failed
969
+ #
970
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelLimits]
971
+ #
972
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
973
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
974
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
975
+ def get_limit_label(name: nil, fields: nil, quota_user: nil, options: nil, &block)
976
+ command = make_simple_command(:get, 'v2beta/limits/label', options)
977
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelLimits::Representation
978
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaLabelLimits
979
+ command.query['name'] = name unless name.nil?
980
+ command.query['fields'] = fields unless fields.nil?
981
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
982
+ execute_or_queue_command(command, &block)
983
+ end
984
+
985
+ # Gets the user capabilities.
986
+ # @param [String] name
987
+ # Required. The resource name of the user. Only "users/me/capabilities" is
988
+ # supported.
989
+ # @param [String] fields
990
+ # Selector specifying which fields to include in a partial response.
991
+ # @param [String] quota_user
992
+ # Available to use for quota purposes for server-side applications. Can be any
993
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
994
+ # @param [Google::Apis::RequestOptions] options
995
+ # Request-specific options
996
+ #
997
+ # @yield [result, err] Result & error if block supplied
998
+ # @yieldparam result [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaUserCapabilities] parsed result object
999
+ # @yieldparam err [StandardError] error object if request failed
1000
+ #
1001
+ # @return [Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaUserCapabilities]
1002
+ #
1003
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1004
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1005
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1006
+ def get_user_capabilities(name, fields: nil, quota_user: nil, options: nil, &block)
1007
+ command = make_simple_command(:get, 'v2beta/{+name}', options)
1008
+ command.response_representation = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaUserCapabilities::Representation
1009
+ command.response_class = Google::Apis::DrivelabelsV2beta::GoogleAppsDriveLabelsV2betaUserCapabilities
1010
+ command.params['name'] = name unless name.nil?
1011
+ command.query['fields'] = fields unless fields.nil?
1012
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1013
+ execute_or_queue_command(command, &block)
1014
+ end
1015
+
1016
+ protected
1017
+
1018
+ def apply_command_defaults(command)
1019
+ command.query['key'] = key unless key.nil?
1020
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1021
+ end
1022
+ end
1023
+ end
1024
+ end
1025
+ end