google-apis-drivelabels_v2 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,6 +49,195 @@ module Google
49
49
  @batch_path = 'batch'
50
50
  end
51
51
 
52
+ # Creates a new Label.
53
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label] google_apps_drive_labels_v2_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::DrivelabelsV2::GoogleAppsDriveLabelsV2Label] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label]
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_v2_label_object = nil, language_code: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:post, 'v2/labels', options)
80
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
81
+ command.request_object = google_apps_drive_labels_v2_label_object
82
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
83
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
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::DrivelabelsV2::GoogleProtobufEmpty] parsed result object
113
+ # @yieldparam err [StandardError] error object if request failed
114
+ #
115
+ # @return [Google::Apis::DrivelabelsV2::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, 'v2/{+name}', options)
122
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
123
+ command.response_class = Google::Apis::DrivelabelsV2::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::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest] google_apps_drive_labels_v2_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::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse] parsed result object
149
+ # @yieldparam err [StandardError] error object if request failed
150
+ #
151
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse]
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_v2_delta_update_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:post, 'v2/{+name}:delta', options)
158
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest::Representation
159
+ command.request_object = google_apps_drive_labels_v2_delta_update_label_request_object
160
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse::Representation
161
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DeltaUpdateLabelResponse
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::DrivelabelsV2::GoogleAppsDriveLabelsV2DisableLabelRequest] google_apps_drive_labels_v2_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::DrivelabelsV2::GoogleAppsDriveLabelsV2Label] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label]
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_v2_disable_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:post, 'v2/{+name}:disable', options)
195
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2DisableLabelRequest::Representation
196
+ command.request_object = google_apps_drive_labels_v2_disable_label_request_object
197
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
198
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
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::DrivelabelsV2::GoogleAppsDriveLabelsV2EnableLabelRequest] google_apps_drive_labels_v2_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::DrivelabelsV2::GoogleAppsDriveLabelsV2Label] parsed result object
222
+ # @yieldparam err [StandardError] error object if request failed
223
+ #
224
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label]
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_v2_enable_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
230
+ command = make_simple_command(:post, 'v2/{+name}:enable', options)
231
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2EnableLabelRequest::Representation
232
+ command.request_object = google_apps_drive_labels_v2_enable_label_request_object
233
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
234
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
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
+
52
241
  # Get a label by its resource name. Resource name may be any of: * `labels/`id``
53
242
  # - See `labels/`id`@latest` * `labels/`id`@latest` - Gets the latest revision
54
243
  # of the label. * `labels/`id`@published` - Gets the current published revision
@@ -98,6 +287,9 @@ module Google
98
287
  end
99
288
 
100
289
  # List labels.
290
+ # @param [String] customer
291
+ # The customer to scope this list request to. For example: "customers/abcd1234".
292
+ # If unset, will return all labels within the current customer.
101
293
  # @param [String] language_code
102
294
  # The BCP-47 language code to use for evaluating localized field labels. When
103
295
  # not specified, values in the default configured language are used.
@@ -138,10 +330,11 @@ module Google
138
330
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
139
331
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
140
332
  # @raise [Google::Apis::AuthorizationError] Authorization is required
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)
333
+ 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)
142
334
  command = make_simple_command(:get, 'v2/labels', options)
143
335
  command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelsResponse::Representation
144
336
  command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelsResponse
337
+ command.query['customer'] = customer unless customer.nil?
145
338
  command.query['languageCode'] = language_code unless language_code.nil?
146
339
  command.query['minimumRole'] = minimum_role unless minimum_role.nil?
147
340
  command.query['pageSize'] = page_size unless page_size.nil?
@@ -153,6 +346,684 @@ module Google
153
346
  command.query['quotaUser'] = quota_user unless quota_user.nil?
154
347
  execute_or_queue_command(command, &block)
155
348
  end
349
+
350
+ # Publish all draft changes to the Label. Once published, the Label may not
351
+ # return to its draft state. See `google.apps.drive.labels.v2.Lifecycle` for
352
+ # more information. Publishing a Label will result in a new published revision.
353
+ # All previous draft revisions will be deleted. Previous published revisions
354
+ # will be kept but are subject to automated deletion as needed. Once published,
355
+ # some changes are no longer permitted. Generally, any change that would
356
+ # invalidate or cause new restrictions on existing metadata related to the Label
357
+ # will be rejected. For example, the following changes to a Label will be
358
+ # rejected after the Label is published: * The label cannot be directly deleted.
359
+ # It must be disabled first, then deleted. * Field.FieldType cannot be changed. *
360
+ # Changes to Field validation options cannot reject something that was
361
+ # previously accepted. * Reducing the max entries.
362
+ # @param [String] name
363
+ # Required. Label resource name.
364
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2PublishLabelRequest] google_apps_drive_labels_v2_publish_label_request_object
365
+ # @param [String] fields
366
+ # Selector specifying which fields to include in a partial response.
367
+ # @param [String] quota_user
368
+ # Available to use for quota purposes for server-side applications. Can be any
369
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
370
+ # @param [Google::Apis::RequestOptions] options
371
+ # Request-specific options
372
+ #
373
+ # @yield [result, err] Result & error if block supplied
374
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label] parsed result object
375
+ # @yieldparam err [StandardError] error object if request failed
376
+ #
377
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label]
378
+ #
379
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
380
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
381
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
382
+ def publish_label(name, google_apps_drive_labels_v2_publish_label_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
383
+ command = make_simple_command(:post, 'v2/{+name}:publish', options)
384
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2PublishLabelRequest::Representation
385
+ command.request_object = google_apps_drive_labels_v2_publish_label_request_object
386
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
387
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
388
+ command.params['name'] = name unless name.nil?
389
+ command.query['fields'] = fields unless fields.nil?
390
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
391
+ execute_or_queue_command(command, &block)
392
+ end
393
+
394
+ # Updates a Label's `CopyMode`. Changes to this policy are not revisioned, do
395
+ # not require publishing, and take effect immediately.
396
+ # @param [String] name
397
+ # Required. The resource name of the Label to update.
398
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest] google_apps_drive_labels_v2_update_label_copy_mode_request_object
399
+ # @param [String] fields
400
+ # Selector specifying which fields to include in a partial response.
401
+ # @param [String] quota_user
402
+ # Available to use for quota purposes for server-side applications. Can be any
403
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
404
+ # @param [Google::Apis::RequestOptions] options
405
+ # Request-specific options
406
+ #
407
+ # @yield [result, err] Result & error if block supplied
408
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label] parsed result object
409
+ # @yieldparam err [StandardError] error object if request failed
410
+ #
411
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label]
412
+ #
413
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
414
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
415
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
416
+ 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)
417
+ command = make_simple_command(:post, 'v2/{+name}:updateLabelCopyMode', options)
418
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UpdateLabelCopyModeRequest::Representation
419
+ command.request_object = google_apps_drive_labels_v2_update_label_copy_mode_request_object
420
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label::Representation
421
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2Label
422
+ command.params['name'] = name unless name.nil?
423
+ command.query['fields'] = fields unless fields.nil?
424
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
425
+ execute_or_queue_command(command, &block)
426
+ end
427
+
428
+ # Updates a Label's permissions. If a permission for the indicated principal
429
+ # doesn't exist, a new Label Permission is created, otherwise the existing
430
+ # permission is updated. Permissions affect the Label resource as a whole, are
431
+ # not revisioned, and do not require publishing.
432
+ # @param [String] parent
433
+ # Required. The parent Label resource name.
434
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] google_apps_drive_labels_v2_label_permission_object
435
+ # @param [Boolean] use_admin_access
436
+ # Set to `true` in order to use the user's admin credentials. The server will
437
+ # verify the user is an admin for the Label before allowing access.
438
+ # @param [String] fields
439
+ # Selector specifying which fields to include in a partial response.
440
+ # @param [String] quota_user
441
+ # Available to use for quota purposes for server-side applications. Can be any
442
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
443
+ # @param [Google::Apis::RequestOptions] options
444
+ # Request-specific options
445
+ #
446
+ # @yield [result, err] Result & error if block supplied
447
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] parsed result object
448
+ # @yieldparam err [StandardError] error object if request failed
449
+ #
450
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission]
451
+ #
452
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
453
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
454
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
455
+ 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)
456
+ command = make_simple_command(:patch, 'v2/{+parent}/permissions', options)
457
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
458
+ command.request_object = google_apps_drive_labels_v2_label_permission_object
459
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
460
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
461
+ command.params['parent'] = parent unless parent.nil?
462
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
463
+ command.query['fields'] = fields unless fields.nil?
464
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
465
+ execute_or_queue_command(command, &block)
466
+ end
467
+
468
+ # Lists the LabelLocks on a Label.
469
+ # @param [String] parent
470
+ # Required. Label on which Locks are applied. Format: labels/`label`
471
+ # @param [Fixnum] page_size
472
+ # Maximum number of Locks to return per page. Default: 100. Max: 200.
473
+ # @param [String] page_token
474
+ # The token of the page to return.
475
+ # @param [String] fields
476
+ # Selector specifying which fields to include in a partial response.
477
+ # @param [String] quota_user
478
+ # Available to use for quota purposes for server-side applications. Can be any
479
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
480
+ # @param [Google::Apis::RequestOptions] options
481
+ # Request-specific options
482
+ #
483
+ # @yield [result, err] Result & error if block supplied
484
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse] parsed result object
485
+ # @yieldparam err [StandardError] error object if request failed
486
+ #
487
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse]
488
+ #
489
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
490
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
491
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
492
+ def list_label_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
493
+ command = make_simple_command(:get, 'v2/{+parent}/locks', options)
494
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse::Representation
495
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse
496
+ command.params['parent'] = parent unless parent.nil?
497
+ command.query['pageSize'] = page_size unless page_size.nil?
498
+ command.query['pageToken'] = page_token unless page_token.nil?
499
+ command.query['fields'] = fields unless fields.nil?
500
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
501
+ execute_or_queue_command(command, &block)
502
+ end
503
+
504
+ # Deletes Label permissions. Permissions affect the Label resource as a whole,
505
+ # are not revisioned, and do not require publishing.
506
+ # @param [String] parent
507
+ # Required. The parent Label resource name shared by all permissions being
508
+ # deleted. Format: labels/`label` If this is set, the parent field in the
509
+ # UpdateLabelPermissionRequest messages must either be empty or match this field.
510
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest] google_apps_drive_labels_v2_batch_delete_label_permissions_request_object
511
+ # @param [String] fields
512
+ # Selector specifying which fields to include in a partial response.
513
+ # @param [String] quota_user
514
+ # Available to use for quota purposes for server-side applications. Can be any
515
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
516
+ # @param [Google::Apis::RequestOptions] options
517
+ # Request-specific options
518
+ #
519
+ # @yield [result, err] Result & error if block supplied
520
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty] parsed result object
521
+ # @yieldparam err [StandardError] error object if request failed
522
+ #
523
+ # @return [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty]
524
+ #
525
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
526
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
527
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
528
+ 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)
529
+ command = make_simple_command(:post, 'v2/{+parent}/permissions:batchDelete', options)
530
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest::Representation
531
+ command.request_object = google_apps_drive_labels_v2_batch_delete_label_permissions_request_object
532
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
533
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
534
+ command.params['parent'] = parent unless parent.nil?
535
+ command.query['fields'] = fields unless fields.nil?
536
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
537
+ execute_or_queue_command(command, &block)
538
+ end
539
+
540
+ # Updates Label permissions. If a permission for the indicated principal doesn't
541
+ # exist, a new Label Permission is created, otherwise the existing permission is
542
+ # updated. Permissions affect the Label resource as a whole, are not revisioned,
543
+ # and do not require publishing.
544
+ # @param [String] parent
545
+ # Required. The parent Label resource name shared by all permissions being
546
+ # updated. Format: labels/`label` If this is set, the parent field in the
547
+ # UpdateLabelPermissionRequest messages must either be empty or match this field.
548
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest] google_apps_drive_labels_v2_batch_update_label_permissions_request_object
549
+ # @param [String] fields
550
+ # Selector specifying which fields to include in a partial response.
551
+ # @param [String] quota_user
552
+ # Available to use for quota purposes for server-side applications. Can be any
553
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
554
+ # @param [Google::Apis::RequestOptions] options
555
+ # Request-specific options
556
+ #
557
+ # @yield [result, err] Result & error if block supplied
558
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse] parsed result object
559
+ # @yieldparam err [StandardError] error object if request failed
560
+ #
561
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse]
562
+ #
563
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
564
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
565
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
566
+ 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)
567
+ command = make_simple_command(:post, 'v2/{+parent}/permissions:batchUpdate', options)
568
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest::Representation
569
+ command.request_object = google_apps_drive_labels_v2_batch_update_label_permissions_request_object
570
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse::Representation
571
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse
572
+ command.params['parent'] = parent unless parent.nil?
573
+ command.query['fields'] = fields unless fields.nil?
574
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
575
+ execute_or_queue_command(command, &block)
576
+ end
577
+
578
+ # Updates a Label's permissions. If a permission for the indicated principal
579
+ # doesn't exist, a new Label Permission is created, otherwise the existing
580
+ # permission is updated. Permissions affect the Label resource as a whole, are
581
+ # not revisioned, and do not require publishing.
582
+ # @param [String] parent
583
+ # Required. The parent Label resource name on the Label Permission is created.
584
+ # Format: labels/`label`
585
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] google_apps_drive_labels_v2_label_permission_object
586
+ # @param [Boolean] use_admin_access
587
+ # Set to `true` in order to use the user's admin credentials. The server will
588
+ # verify the user is an admin for the Label before allowing access.
589
+ # @param [String] fields
590
+ # Selector specifying which fields to include in a partial response.
591
+ # @param [String] quota_user
592
+ # Available to use for quota purposes for server-side applications. Can be any
593
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
594
+ # @param [Google::Apis::RequestOptions] options
595
+ # Request-specific options
596
+ #
597
+ # @yield [result, err] Result & error if block supplied
598
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] parsed result object
599
+ # @yieldparam err [StandardError] error object if request failed
600
+ #
601
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission]
602
+ #
603
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
604
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
605
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
606
+ 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)
607
+ command = make_simple_command(:post, 'v2/{+parent}/permissions', options)
608
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
609
+ command.request_object = google_apps_drive_labels_v2_label_permission_object
610
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
611
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
612
+ command.params['parent'] = parent unless parent.nil?
613
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
614
+ command.query['fields'] = fields unless fields.nil?
615
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
616
+ execute_or_queue_command(command, &block)
617
+ end
618
+
619
+ # Deletes a Label's permission. Permissions affect the Label resource as a whole,
620
+ # are not revisioned, and do not require publishing.
621
+ # @param [String] name
622
+ # Required. Label Permission resource name.
623
+ # @param [Boolean] use_admin_access
624
+ # Set to `true` in order to use the user's admin credentials. The server will
625
+ # verify the user is an admin for the Label before allowing access.
626
+ # @param [String] fields
627
+ # Selector specifying which fields to include in a partial response.
628
+ # @param [String] quota_user
629
+ # Available to use for quota purposes for server-side applications. Can be any
630
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
631
+ # @param [Google::Apis::RequestOptions] options
632
+ # Request-specific options
633
+ #
634
+ # @yield [result, err] Result & error if block supplied
635
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty] parsed result object
636
+ # @yieldparam err [StandardError] error object if request failed
637
+ #
638
+ # @return [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty]
639
+ #
640
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
641
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
642
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
643
+ def delete_label_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
644
+ command = make_simple_command(:delete, 'v2/{+name}', options)
645
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
646
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
647
+ command.params['name'] = name unless name.nil?
648
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
649
+ command.query['fields'] = fields unless fields.nil?
650
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
651
+ execute_or_queue_command(command, &block)
652
+ end
653
+
654
+ # Lists a Label's permissions.
655
+ # @param [String] parent
656
+ # Required. The parent Label resource name on which Label Permission are listed.
657
+ # Format: labels/`label`
658
+ # @param [Fixnum] page_size
659
+ # Maximum number of permissions to return per page. Default: 50. Max: 200.
660
+ # @param [String] page_token
661
+ # The token of the page to return.
662
+ # @param [Boolean] use_admin_access
663
+ # Set to `true` in order to use the user's admin credentials. The server will
664
+ # verify the user is an admin for the Label before allowing access.
665
+ # @param [String] fields
666
+ # Selector specifying which fields to include in a partial response.
667
+ # @param [String] quota_user
668
+ # Available to use for quota purposes for server-side applications. Can be any
669
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
670
+ # @param [Google::Apis::RequestOptions] options
671
+ # Request-specific options
672
+ #
673
+ # @yield [result, err] Result & error if block supplied
674
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse] parsed result object
675
+ # @yieldparam err [StandardError] error object if request failed
676
+ #
677
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse]
678
+ #
679
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
680
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
681
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
682
+ def list_label_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
683
+ command = make_simple_command(:get, 'v2/{+parent}/permissions', options)
684
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse::Representation
685
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse
686
+ command.params['parent'] = parent unless parent.nil?
687
+ command.query['pageSize'] = page_size unless page_size.nil?
688
+ command.query['pageToken'] = page_token unless page_token.nil?
689
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
690
+ command.query['fields'] = fields unless fields.nil?
691
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
692
+ execute_or_queue_command(command, &block)
693
+ end
694
+
695
+ # Updates a Label's permissions. If a permission for the indicated principal
696
+ # doesn't exist, a new Label Permission is created, otherwise the existing
697
+ # permission is updated. Permissions affect the Label resource as a whole, are
698
+ # not revisioned, and do not require publishing.
699
+ # @param [String] parent
700
+ # Required. The parent Label resource name.
701
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] google_apps_drive_labels_v2_label_permission_object
702
+ # @param [Boolean] use_admin_access
703
+ # Set to `true` in order to use the user's admin credentials. The server will
704
+ # verify the user is an admin for the Label before allowing access.
705
+ # @param [String] fields
706
+ # Selector specifying which fields to include in a partial response.
707
+ # @param [String] quota_user
708
+ # Available to use for quota purposes for server-side applications. Can be any
709
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
710
+ # @param [Google::Apis::RequestOptions] options
711
+ # Request-specific options
712
+ #
713
+ # @yield [result, err] Result & error if block supplied
714
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] parsed result object
715
+ # @yieldparam err [StandardError] error object if request failed
716
+ #
717
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission]
718
+ #
719
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
720
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
721
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
722
+ 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)
723
+ command = make_simple_command(:patch, 'v2/{+parent}/permissions', options)
724
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
725
+ command.request_object = google_apps_drive_labels_v2_label_permission_object
726
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
727
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
728
+ command.params['parent'] = parent unless parent.nil?
729
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
730
+ command.query['fields'] = fields unless fields.nil?
731
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
732
+ execute_or_queue_command(command, &block)
733
+ end
734
+
735
+ # Lists the LabelLocks on a Label.
736
+ # @param [String] parent
737
+ # Required. Label on which Locks are applied. Format: labels/`label`
738
+ # @param [Fixnum] page_size
739
+ # Maximum number of Locks to return per page. Default: 100. Max: 200.
740
+ # @param [String] page_token
741
+ # The token of the page to return.
742
+ # @param [String] fields
743
+ # Selector specifying which fields to include in a partial response.
744
+ # @param [String] quota_user
745
+ # Available to use for quota purposes for server-side applications. Can be any
746
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
747
+ # @param [Google::Apis::RequestOptions] options
748
+ # Request-specific options
749
+ #
750
+ # @yield [result, err] Result & error if block supplied
751
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse] parsed result object
752
+ # @yieldparam err [StandardError] error object if request failed
753
+ #
754
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse]
755
+ #
756
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
757
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
758
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
759
+ def list_label_revision_locks(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
760
+ command = make_simple_command(:get, 'v2/{+parent}/locks', options)
761
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse::Representation
762
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelLocksResponse
763
+ command.params['parent'] = parent unless parent.nil?
764
+ command.query['pageSize'] = page_size unless page_size.nil?
765
+ command.query['pageToken'] = page_token unless page_token.nil?
766
+ command.query['fields'] = fields unless fields.nil?
767
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
768
+ execute_or_queue_command(command, &block)
769
+ end
770
+
771
+ # Deletes Label permissions. Permissions affect the Label resource as a whole,
772
+ # are not revisioned, and do not require publishing.
773
+ # @param [String] parent
774
+ # Required. The parent Label resource name shared by all permissions being
775
+ # deleted. Format: labels/`label` If this is set, the parent field in the
776
+ # UpdateLabelPermissionRequest messages must either be empty or match this field.
777
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest] google_apps_drive_labels_v2_batch_delete_label_permissions_request_object
778
+ # @param [String] fields
779
+ # Selector specifying which fields to include in a partial response.
780
+ # @param [String] quota_user
781
+ # Available to use for quota purposes for server-side applications. Can be any
782
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
783
+ # @param [Google::Apis::RequestOptions] options
784
+ # Request-specific options
785
+ #
786
+ # @yield [result, err] Result & error if block supplied
787
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty] parsed result object
788
+ # @yieldparam err [StandardError] error object if request failed
789
+ #
790
+ # @return [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty]
791
+ #
792
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
793
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
794
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
795
+ 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)
796
+ command = make_simple_command(:post, 'v2/{+parent}/permissions:batchDelete', options)
797
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest::Representation
798
+ command.request_object = google_apps_drive_labels_v2_batch_delete_label_permissions_request_object
799
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
800
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
801
+ command.params['parent'] = parent unless parent.nil?
802
+ command.query['fields'] = fields unless fields.nil?
803
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
804
+ execute_or_queue_command(command, &block)
805
+ end
806
+
807
+ # Updates Label permissions. If a permission for the indicated principal doesn't
808
+ # exist, a new Label Permission is created, otherwise the existing permission is
809
+ # updated. Permissions affect the Label resource as a whole, are not revisioned,
810
+ # and do not require publishing.
811
+ # @param [String] parent
812
+ # Required. The parent Label resource name shared by all permissions being
813
+ # updated. Format: labels/`label` If this is set, the parent field in the
814
+ # UpdateLabelPermissionRequest messages must either be empty or match this field.
815
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest] google_apps_drive_labels_v2_batch_update_label_permissions_request_object
816
+ # @param [String] fields
817
+ # Selector specifying which fields to include in a partial response.
818
+ # @param [String] quota_user
819
+ # Available to use for quota purposes for server-side applications. Can be any
820
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
821
+ # @param [Google::Apis::RequestOptions] options
822
+ # Request-specific options
823
+ #
824
+ # @yield [result, err] Result & error if block supplied
825
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse] parsed result object
826
+ # @yieldparam err [StandardError] error object if request failed
827
+ #
828
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse]
829
+ #
830
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
831
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
832
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
833
+ 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)
834
+ command = make_simple_command(:post, 'v2/{+parent}/permissions:batchUpdate', options)
835
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest::Representation
836
+ command.request_object = google_apps_drive_labels_v2_batch_update_label_permissions_request_object
837
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse::Representation
838
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse
839
+ command.params['parent'] = parent unless parent.nil?
840
+ command.query['fields'] = fields unless fields.nil?
841
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
842
+ execute_or_queue_command(command, &block)
843
+ end
844
+
845
+ # Updates a Label's permissions. If a permission for the indicated principal
846
+ # doesn't exist, a new Label Permission is created, otherwise the existing
847
+ # permission is updated. Permissions affect the Label resource as a whole, are
848
+ # not revisioned, and do not require publishing.
849
+ # @param [String] parent
850
+ # Required. The parent Label resource name on the Label Permission is created.
851
+ # Format: labels/`label`
852
+ # @param [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] google_apps_drive_labels_v2_label_permission_object
853
+ # @param [Boolean] use_admin_access
854
+ # Set to `true` in order to use the user's admin credentials. The server will
855
+ # verify the user is an admin for the Label before allowing access.
856
+ # @param [String] fields
857
+ # Selector specifying which fields to include in a partial response.
858
+ # @param [String] quota_user
859
+ # Available to use for quota purposes for server-side applications. Can be any
860
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
861
+ # @param [Google::Apis::RequestOptions] options
862
+ # Request-specific options
863
+ #
864
+ # @yield [result, err] Result & error if block supplied
865
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission] parsed result object
866
+ # @yieldparam err [StandardError] error object if request failed
867
+ #
868
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission]
869
+ #
870
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
871
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
872
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
873
+ 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)
874
+ command = make_simple_command(:post, 'v2/{+parent}/permissions', options)
875
+ command.request_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
876
+ command.request_object = google_apps_drive_labels_v2_label_permission_object
877
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission::Representation
878
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelPermission
879
+ command.params['parent'] = parent unless parent.nil?
880
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
881
+ command.query['fields'] = fields unless fields.nil?
882
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
883
+ execute_or_queue_command(command, &block)
884
+ end
885
+
886
+ # Deletes a Label's permission. Permissions affect the Label resource as a whole,
887
+ # are not revisioned, and do not require publishing.
888
+ # @param [String] name
889
+ # Required. Label Permission resource name.
890
+ # @param [Boolean] use_admin_access
891
+ # Set to `true` in order to use the user's admin credentials. The server will
892
+ # verify the user is an admin for the Label before allowing access.
893
+ # @param [String] fields
894
+ # Selector specifying which fields to include in a partial response.
895
+ # @param [String] quota_user
896
+ # Available to use for quota purposes for server-side applications. Can be any
897
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
898
+ # @param [Google::Apis::RequestOptions] options
899
+ # Request-specific options
900
+ #
901
+ # @yield [result, err] Result & error if block supplied
902
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty] parsed result object
903
+ # @yieldparam err [StandardError] error object if request failed
904
+ #
905
+ # @return [Google::Apis::DrivelabelsV2::GoogleProtobufEmpty]
906
+ #
907
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
908
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
909
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
910
+ def delete_label_revision_permission(name, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
911
+ command = make_simple_command(:delete, 'v2/{+name}', options)
912
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty::Representation
913
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleProtobufEmpty
914
+ command.params['name'] = name unless name.nil?
915
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
916
+ command.query['fields'] = fields unless fields.nil?
917
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
918
+ execute_or_queue_command(command, &block)
919
+ end
920
+
921
+ # Lists a Label's permissions.
922
+ # @param [String] parent
923
+ # Required. The parent Label resource name on which Label Permission are listed.
924
+ # Format: labels/`label`
925
+ # @param [Fixnum] page_size
926
+ # Maximum number of permissions to return per page. Default: 50. Max: 200.
927
+ # @param [String] page_token
928
+ # The token of the page to return.
929
+ # @param [Boolean] use_admin_access
930
+ # Set to `true` in order to use the user's admin credentials. The server will
931
+ # verify the user is an admin for the Label before allowing access.
932
+ # @param [String] fields
933
+ # Selector specifying which fields to include in a partial response.
934
+ # @param [String] quota_user
935
+ # Available to use for quota purposes for server-side applications. Can be any
936
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
937
+ # @param [Google::Apis::RequestOptions] options
938
+ # Request-specific options
939
+ #
940
+ # @yield [result, err] Result & error if block supplied
941
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse] parsed result object
942
+ # @yieldparam err [StandardError] error object if request failed
943
+ #
944
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse]
945
+ #
946
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
947
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
948
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
949
+ def list_label_revision_permissions(parent, page_size: nil, page_token: nil, use_admin_access: nil, fields: nil, quota_user: nil, options: nil, &block)
950
+ command = make_simple_command(:get, 'v2/{+parent}/permissions', options)
951
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse::Representation
952
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2ListLabelPermissionsResponse
953
+ command.params['parent'] = parent unless parent.nil?
954
+ command.query['pageSize'] = page_size unless page_size.nil?
955
+ command.query['pageToken'] = page_token unless page_token.nil?
956
+ command.query['useAdminAccess'] = use_admin_access unless use_admin_access.nil?
957
+ command.query['fields'] = fields unless fields.nil?
958
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
959
+ execute_or_queue_command(command, &block)
960
+ end
961
+
962
+ # Get the constraints on the structure of a Label; such as, the maximum number
963
+ # of Fields allowed and maximum length of the label title.
964
+ # @param [String] name
965
+ # Required. Label revision resource name Must be: "limits/label"
966
+ # @param [String] fields
967
+ # Selector specifying which fields to include in a partial response.
968
+ # @param [String] quota_user
969
+ # Available to use for quota purposes for server-side applications. Can be any
970
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
971
+ # @param [Google::Apis::RequestOptions] options
972
+ # Request-specific options
973
+ #
974
+ # @yield [result, err] Result & error if block supplied
975
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelLimits] parsed result object
976
+ # @yieldparam err [StandardError] error object if request failed
977
+ #
978
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelLimits]
979
+ #
980
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
981
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
982
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
983
+ def get_limit_label(name: nil, fields: nil, quota_user: nil, options: nil, &block)
984
+ command = make_simple_command(:get, 'v2/limits/label', options)
985
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelLimits::Representation
986
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2LabelLimits
987
+ command.query['name'] = name unless name.nil?
988
+ command.query['fields'] = fields unless fields.nil?
989
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
990
+ execute_or_queue_command(command, &block)
991
+ end
992
+
993
+ # Gets the user capabilities.
994
+ # @param [String] name
995
+ # Required. The resource name of the user. Only "users/me/capabilities" is
996
+ # supported.
997
+ # @param [String] customer
998
+ # The customer to scope this request to. For example: "customers/abcd1234". If
999
+ # unset, will return settings within the current customer.
1000
+ # @param [String] fields
1001
+ # Selector specifying which fields to include in a partial response.
1002
+ # @param [String] quota_user
1003
+ # Available to use for quota purposes for server-side applications. Can be any
1004
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1005
+ # @param [Google::Apis::RequestOptions] options
1006
+ # Request-specific options
1007
+ #
1008
+ # @yield [result, err] Result & error if block supplied
1009
+ # @yieldparam result [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UserCapabilities] parsed result object
1010
+ # @yieldparam err [StandardError] error object if request failed
1011
+ #
1012
+ # @return [Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UserCapabilities]
1013
+ #
1014
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1015
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1016
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1017
+ def get_user_capabilities(name, customer: nil, fields: nil, quota_user: nil, options: nil, &block)
1018
+ command = make_simple_command(:get, 'v2/{+name}', options)
1019
+ command.response_representation = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UserCapabilities::Representation
1020
+ command.response_class = Google::Apis::DrivelabelsV2::GoogleAppsDriveLabelsV2UserCapabilities
1021
+ command.params['name'] = name unless name.nil?
1022
+ command.query['customer'] = customer unless customer.nil?
1023
+ command.query['fields'] = fields unless fields.nil?
1024
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1025
+ execute_or_queue_command(command, &block)
1026
+ end
156
1027
 
157
1028
  protected
158
1029