google-apis-admin_directory_v1 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,4035 @@
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 AdminDirectoryV1
23
+ # Admin SDK API
24
+ #
25
+ # Admin SDK lets administrators of enterprise domains to view and manage
26
+ # resources like user, groups etc. It also provides audit and usage reports of
27
+ # domain.
28
+ #
29
+ # @example
30
+ # require 'google/apis/admin_directory_v1'
31
+ #
32
+ # Admin = Google::Apis::AdminDirectoryV1 # Alias the module
33
+ # service = Admin::DirectoryService.new
34
+ #
35
+ # @see http://developers.google.com/admin-sdk/
36
+ class DirectoryService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://admin.googleapis.com/', '',
49
+ client_name: 'google-apis-admin_directory_v1',
50
+ client_version: Google::Apis::AdminDirectoryV1::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Delete an ASP issued by a user.
55
+ # @param [String] user_key
56
+ # Identifies the user in the API request. The value can be the user's primary
57
+ # email address, alias email address, or unique user ID.
58
+ # @param [Fixnum] code_id
59
+ # The unique ID of the ASP to be deleted.
60
+ # @param [String] fields
61
+ # Selector specifying which fields to include in a partial response.
62
+ # @param [String] quota_user
63
+ # Available to use for quota purposes for server-side applications. Can be any
64
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
65
+ # @param [Google::Apis::RequestOptions] options
66
+ # Request-specific options
67
+ #
68
+ # @yield [result, err] Result & error if block supplied
69
+ # @yieldparam result [NilClass] No result returned for this method
70
+ # @yieldparam err [StandardError] error object if request failed
71
+ #
72
+ # @return [void]
73
+ #
74
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
75
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
76
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
77
+ def delete_asp(user_key, code_id, fields: nil, quota_user: nil, options: nil, &block)
78
+ command = make_simple_command(:delete, 'admin/directory/v1/users/{userKey}/asps/{codeId}', options)
79
+ command.params['userKey'] = user_key unless user_key.nil?
80
+ command.params['codeId'] = code_id unless code_id.nil?
81
+ command.query['fields'] = fields unless fields.nil?
82
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
83
+ execute_or_queue_command(command, &block)
84
+ end
85
+
86
+ # Get information about an ASP issued by a user.
87
+ # @param [String] user_key
88
+ # Identifies the user in the API request. The value can be the user's primary
89
+ # email address, alias email address, or unique user ID.
90
+ # @param [Fixnum] code_id
91
+ # The unique ID of the ASP.
92
+ # @param [String] fields
93
+ # Selector specifying which fields to include in a partial response.
94
+ # @param [String] quota_user
95
+ # Available to use for quota purposes for server-side applications. Can be any
96
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
97
+ # @param [Google::Apis::RequestOptions] options
98
+ # Request-specific options
99
+ #
100
+ # @yield [result, err] Result & error if block supplied
101
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Asp] parsed result object
102
+ # @yieldparam err [StandardError] error object if request failed
103
+ #
104
+ # @return [Google::Apis::AdminDirectoryV1::Asp]
105
+ #
106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
109
+ def get_asp(user_key, code_id, fields: nil, quota_user: nil, options: nil, &block)
110
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}/asps/{codeId}', options)
111
+ command.response_representation = Google::Apis::AdminDirectoryV1::Asp::Representation
112
+ command.response_class = Google::Apis::AdminDirectoryV1::Asp
113
+ command.params['userKey'] = user_key unless user_key.nil?
114
+ command.params['codeId'] = code_id unless code_id.nil?
115
+ command.query['fields'] = fields unless fields.nil?
116
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
117
+ execute_or_queue_command(command, &block)
118
+ end
119
+
120
+ # List the ASPs issued by a user.
121
+ # @param [String] user_key
122
+ # Identifies the user in the API request. The value can be the user's primary
123
+ # email address, alias email address, or unique user ID.
124
+ # @param [String] fields
125
+ # Selector specifying which fields to include in a partial response.
126
+ # @param [String] quota_user
127
+ # Available to use for quota purposes for server-side applications. Can be any
128
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
129
+ # @param [Google::Apis::RequestOptions] options
130
+ # Request-specific options
131
+ #
132
+ # @yield [result, err] Result & error if block supplied
133
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Asps] parsed result object
134
+ # @yieldparam err [StandardError] error object if request failed
135
+ #
136
+ # @return [Google::Apis::AdminDirectoryV1::Asps]
137
+ #
138
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
139
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
140
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
141
+ def list_asps(user_key, fields: nil, quota_user: nil, options: nil, &block)
142
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}/asps', options)
143
+ command.response_representation = Google::Apis::AdminDirectoryV1::Asps::Representation
144
+ command.response_class = Google::Apis::AdminDirectoryV1::Asps
145
+ command.params['userKey'] = user_key unless user_key.nil?
146
+ command.query['fields'] = fields unless fields.nil?
147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
148
+ execute_or_queue_command(command, &block)
149
+ end
150
+
151
+ # Stop watching resources through this channel.
152
+ # @param [Google::Apis::AdminDirectoryV1::Channel] channel_object
153
+ # @param [String] fields
154
+ # Selector specifying which fields to include in a partial response.
155
+ # @param [String] quota_user
156
+ # Available to use for quota purposes for server-side applications. Can be any
157
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
158
+ # @param [Google::Apis::RequestOptions] options
159
+ # Request-specific options
160
+ #
161
+ # @yield [result, err] Result & error if block supplied
162
+ # @yieldparam result [NilClass] No result returned for this method
163
+ # @yieldparam err [StandardError] error object if request failed
164
+ #
165
+ # @return [void]
166
+ #
167
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
168
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
169
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
170
+ def stop_channel(channel_object = nil, fields: nil, quota_user: nil, options: nil, &block)
171
+ command = make_simple_command(:post, 'admin/directory_v1/channels/stop', options)
172
+ command.request_representation = Google::Apis::AdminDirectoryV1::Channel::Representation
173
+ command.request_object = channel_object
174
+ command.query['fields'] = fields unless fields.nil?
175
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
176
+ execute_or_queue_command(command, &block)
177
+ end
178
+
179
+ # Takes an action that affects a Chrome OS Device. This includes deprovisioning,
180
+ # disabling, and re-enabling devices. *Warning:* * Deprovisioning a device will
181
+ # stop device policy syncing and remove device-level printers. After a device is
182
+ # deprovisioned, it must be wiped before it can be re-enrolled. * Lost or stolen
183
+ # devices should use the disable action. * Re-enabling a disabled device will
184
+ # consume a device license. If you do not have sufficient licenses available
185
+ # when completing the re-enable action, you will receive an error. For more
186
+ # information about deprovisioning and disabling devices, visit the [help center]
187
+ # (https://support.google.com/chrome/a/answer/3523633).
188
+ # @param [String] customer_id
189
+ # The unique ID for the customer's Google Workspace account. As an account
190
+ # administrator, you can also use the `my_customer` alias to represent your
191
+ # account's `customerId`. The `customerId` is also returned as part of the [
192
+ # Users resource](/admin-sdk/directory/v1/reference/users).
193
+ # @param [String] resource_id
194
+ # The unique ID of the device. The `resourceId`s are returned in the response
195
+ # from the [chromeosdevices.list](/admin-sdk/directory/v1/reference/
196
+ # chromeosdevices/list) method.
197
+ # @param [Google::Apis::AdminDirectoryV1::ChromeOsDeviceAction] chrome_os_device_action_object
198
+ # @param [String] fields
199
+ # Selector specifying which fields to include in a partial response.
200
+ # @param [String] quota_user
201
+ # Available to use for quota purposes for server-side applications. Can be any
202
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
203
+ # @param [Google::Apis::RequestOptions] options
204
+ # Request-specific options
205
+ #
206
+ # @yield [result, err] Result & error if block supplied
207
+ # @yieldparam result [NilClass] No result returned for this method
208
+ # @yieldparam err [StandardError] error object if request failed
209
+ #
210
+ # @return [void]
211
+ #
212
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
213
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
214
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
215
+ def action_chromeosdevice(customer_id, resource_id, chrome_os_device_action_object = nil, fields: nil, quota_user: nil, options: nil, &block)
216
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action', options)
217
+ command.request_representation = Google::Apis::AdminDirectoryV1::ChromeOsDeviceAction::Representation
218
+ command.request_object = chrome_os_device_action_object
219
+ command.params['customerId'] = customer_id unless customer_id.nil?
220
+ command.params['resourceId'] = resource_id unless resource_id.nil?
221
+ command.query['fields'] = fields unless fields.nil?
222
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
223
+ execute_or_queue_command(command, &block)
224
+ end
225
+
226
+ # Retrieves a Chrome OS device's properties.
227
+ # @param [String] customer_id
228
+ # The unique ID for the customer's Google Workspace account. As an account
229
+ # administrator, you can also use the `my_customer` alias to represent your
230
+ # account's `customerId`. The `customerId` is also returned as part of the [
231
+ # Users resource](/admin-sdk/directory/v1/reference/users).
232
+ # @param [String] device_id
233
+ # The unique ID of the device. The `deviceId`s are returned in the response from
234
+ # the [chromeosdevices.list](/admin-sdk/directory/v1/reference/chromeosdevices/
235
+ # list) method.
236
+ # @param [String] projection
237
+ # Determines whether the response contains the full list of properties or only a
238
+ # subset.
239
+ # @param [String] fields
240
+ # Selector specifying which fields to include in a partial response.
241
+ # @param [String] quota_user
242
+ # Available to use for quota purposes for server-side applications. Can be any
243
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
244
+ # @param [Google::Apis::RequestOptions] options
245
+ # Request-specific options
246
+ #
247
+ # @yield [result, err] Result & error if block supplied
248
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::ChromeOsDevice] parsed result object
249
+ # @yieldparam err [StandardError] error object if request failed
250
+ #
251
+ # @return [Google::Apis::AdminDirectoryV1::ChromeOsDevice]
252
+ #
253
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
254
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
255
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
256
+ def get_chrome_os_device(customer_id, device_id, projection: nil, fields: nil, quota_user: nil, options: nil, &block)
257
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}', options)
258
+ command.response_representation = Google::Apis::AdminDirectoryV1::ChromeOsDevice::Representation
259
+ command.response_class = Google::Apis::AdminDirectoryV1::ChromeOsDevice
260
+ command.params['customerId'] = customer_id unless customer_id.nil?
261
+ command.params['deviceId'] = device_id unless device_id.nil?
262
+ command.query['projection'] = projection unless projection.nil?
263
+ command.query['fields'] = fields unless fields.nil?
264
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
265
+ execute_or_queue_command(command, &block)
266
+ end
267
+
268
+ # Retrieves a paginated list of Chrome OS devices within an account.
269
+ # @param [String] customer_id
270
+ # The unique ID for the customer's Google Workspace account. As an account
271
+ # administrator, you can also use the `my_customer` alias to represent your
272
+ # account's `customerId`. The `customerId` is also returned as part of the [
273
+ # Users resource](/admin-sdk/directory/v1/reference/users).
274
+ # @param [Fixnum] max_results
275
+ # Maximum number of results to return.
276
+ # @param [String] order_by
277
+ # Device property to use for sorting results.
278
+ # @param [String] org_unit_path
279
+ # The full path of the organizational unit or its unique ID.
280
+ # @param [String] page_token
281
+ # The `pageToken` query parameter is used to request the next page of query
282
+ # results. The follow-on request's `pageToken` query parameter is the `
283
+ # nextPageToken` from your previous response.
284
+ # @param [String] projection
285
+ # Restrict information returned to a set of selected fields.
286
+ # @param [String] query
287
+ # Search string in the format given at http://support.google.com/chromeos/a/bin/
288
+ # answer.py?answer=1698333
289
+ # @param [String] sort_order
290
+ # Whether to return results in ascending or descending order. Must be used with
291
+ # the `orderBy` parameter.
292
+ # @param [String] fields
293
+ # Selector specifying which fields to include in a partial response.
294
+ # @param [String] quota_user
295
+ # Available to use for quota purposes for server-side applications. Can be any
296
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
297
+ # @param [Google::Apis::RequestOptions] options
298
+ # Request-specific options
299
+ #
300
+ # @yield [result, err] Result & error if block supplied
301
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::ChromeOsDevices] parsed result object
302
+ # @yieldparam err [StandardError] error object if request failed
303
+ #
304
+ # @return [Google::Apis::AdminDirectoryV1::ChromeOsDevices]
305
+ #
306
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
307
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
308
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
309
+ def list_chrome_os_devices(customer_id, max_results: nil, order_by: nil, org_unit_path: nil, page_token: nil, projection: nil, query: nil, sort_order: nil, fields: nil, quota_user: nil, options: nil, &block)
310
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/devices/chromeos', options)
311
+ command.response_representation = Google::Apis::AdminDirectoryV1::ChromeOsDevices::Representation
312
+ command.response_class = Google::Apis::AdminDirectoryV1::ChromeOsDevices
313
+ command.params['customerId'] = customer_id unless customer_id.nil?
314
+ command.query['maxResults'] = max_results unless max_results.nil?
315
+ command.query['orderBy'] = order_by unless order_by.nil?
316
+ command.query['orgUnitPath'] = org_unit_path unless org_unit_path.nil?
317
+ command.query['pageToken'] = page_token unless page_token.nil?
318
+ command.query['projection'] = projection unless projection.nil?
319
+ command.query['query'] = query unless query.nil?
320
+ command.query['sortOrder'] = sort_order unless sort_order.nil?
321
+ command.query['fields'] = fields unless fields.nil?
322
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
323
+ execute_or_queue_command(command, &block)
324
+ end
325
+
326
+ # Move or insert multiple Chrome OS devices to an organizational unit. You can
327
+ # move up to 50 devices at once.
328
+ # @param [String] customer_id
329
+ # Immutable ID of the Google Workspace account
330
+ # @param [String] org_unit_path
331
+ # Full path of the target organizational unit or its ID
332
+ # @param [Google::Apis::AdminDirectoryV1::ChromeOsMoveDevicesToOu] chrome_os_move_devices_to_ou_object
333
+ # @param [String] fields
334
+ # Selector specifying which fields to include in a partial response.
335
+ # @param [String] quota_user
336
+ # Available to use for quota purposes for server-side applications. Can be any
337
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
338
+ # @param [Google::Apis::RequestOptions] options
339
+ # Request-specific options
340
+ #
341
+ # @yield [result, err] Result & error if block supplied
342
+ # @yieldparam result [NilClass] No result returned for this method
343
+ # @yieldparam err [StandardError] error object if request failed
344
+ #
345
+ # @return [void]
346
+ #
347
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
348
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
349
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
350
+ def move_chromeosdevice_devices_to_ou(customer_id, org_unit_path, chrome_os_move_devices_to_ou_object = nil, fields: nil, quota_user: nil, options: nil, &block)
351
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu', options)
352
+ command.request_representation = Google::Apis::AdminDirectoryV1::ChromeOsMoveDevicesToOu::Representation
353
+ command.request_object = chrome_os_move_devices_to_ou_object
354
+ command.params['customerId'] = customer_id unless customer_id.nil?
355
+ command.query['orgUnitPath'] = org_unit_path unless org_unit_path.nil?
356
+ command.query['fields'] = fields unless fields.nil?
357
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
358
+ execute_or_queue_command(command, &block)
359
+ end
360
+
361
+ # Updates a device's updatable properties, such as `annotatedUser`, `
362
+ # annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`. This method
363
+ # supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
364
+ # @param [String] customer_id
365
+ # The unique ID for the customer's Google Workspace account. As an account
366
+ # administrator, you can also use the `my_customer` alias to represent your
367
+ # account's `customerId`. The `customerId` is also returned as part of the [
368
+ # Users resource](/admin-sdk/directory/v1/reference/users).
369
+ # @param [String] device_id
370
+ # The unique ID of the device. The `deviceId`s are returned in the response from
371
+ # the [chromeosdevices.list](/admin-sdk/v1/reference/chromeosdevices/list)
372
+ # method.
373
+ # @param [Google::Apis::AdminDirectoryV1::ChromeOsDevice] chrome_os_device_object
374
+ # @param [String] projection
375
+ # Restrict information returned to a set of selected fields.
376
+ # @param [String] fields
377
+ # Selector specifying which fields to include in a partial response.
378
+ # @param [String] quota_user
379
+ # Available to use for quota purposes for server-side applications. Can be any
380
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
381
+ # @param [Google::Apis::RequestOptions] options
382
+ # Request-specific options
383
+ #
384
+ # @yield [result, err] Result & error if block supplied
385
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::ChromeOsDevice] parsed result object
386
+ # @yieldparam err [StandardError] error object if request failed
387
+ #
388
+ # @return [Google::Apis::AdminDirectoryV1::ChromeOsDevice]
389
+ #
390
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
391
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
392
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
393
+ def patch_chrome_os_device(customer_id, device_id, chrome_os_device_object = nil, projection: nil, fields: nil, quota_user: nil, options: nil, &block)
394
+ command = make_simple_command(:patch, 'admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}', options)
395
+ command.request_representation = Google::Apis::AdminDirectoryV1::ChromeOsDevice::Representation
396
+ command.request_object = chrome_os_device_object
397
+ command.response_representation = Google::Apis::AdminDirectoryV1::ChromeOsDevice::Representation
398
+ command.response_class = Google::Apis::AdminDirectoryV1::ChromeOsDevice
399
+ command.params['customerId'] = customer_id unless customer_id.nil?
400
+ command.params['deviceId'] = device_id unless device_id.nil?
401
+ command.query['projection'] = projection unless projection.nil?
402
+ command.query['fields'] = fields unless fields.nil?
403
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
404
+ execute_or_queue_command(command, &block)
405
+ end
406
+
407
+ # Updates a device's updatable properties, such as `annotatedUser`, `
408
+ # annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.
409
+ # @param [String] customer_id
410
+ # The unique ID for the customer's Google Workspace account. As an account
411
+ # administrator, you can also use the `my_customer` alias to represent your
412
+ # account's `customerId`. The `customerId` is also returned as part of the [
413
+ # Users resource](/admin-sdk/directory/v1/reference/users).
414
+ # @param [String] device_id
415
+ # The unique ID of the device. The `deviceId`s are returned in the response from
416
+ # the [chromeosdevices.list](/admin-sdk/v1/reference/chromeosdevices/list)
417
+ # method.
418
+ # @param [Google::Apis::AdminDirectoryV1::ChromeOsDevice] chrome_os_device_object
419
+ # @param [String] projection
420
+ # Restrict information returned to a set of selected fields.
421
+ # @param [String] fields
422
+ # Selector specifying which fields to include in a partial response.
423
+ # @param [String] quota_user
424
+ # Available to use for quota purposes for server-side applications. Can be any
425
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
426
+ # @param [Google::Apis::RequestOptions] options
427
+ # Request-specific options
428
+ #
429
+ # @yield [result, err] Result & error if block supplied
430
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::ChromeOsDevice] parsed result object
431
+ # @yieldparam err [StandardError] error object if request failed
432
+ #
433
+ # @return [Google::Apis::AdminDirectoryV1::ChromeOsDevice]
434
+ #
435
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
436
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
437
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
438
+ def update_chrome_os_device(customer_id, device_id, chrome_os_device_object = nil, projection: nil, fields: nil, quota_user: nil, options: nil, &block)
439
+ command = make_simple_command(:put, 'admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}', options)
440
+ command.request_representation = Google::Apis::AdminDirectoryV1::ChromeOsDevice::Representation
441
+ command.request_object = chrome_os_device_object
442
+ command.response_representation = Google::Apis::AdminDirectoryV1::ChromeOsDevice::Representation
443
+ command.response_class = Google::Apis::AdminDirectoryV1::ChromeOsDevice
444
+ command.params['customerId'] = customer_id unless customer_id.nil?
445
+ command.params['deviceId'] = device_id unless device_id.nil?
446
+ command.query['projection'] = projection unless projection.nil?
447
+ command.query['fields'] = fields unless fields.nil?
448
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
449
+ execute_or_queue_command(command, &block)
450
+ end
451
+
452
+ # Issues a command for the device to execute.
453
+ # @param [String] customer_id
454
+ # Immutable. Immutable ID of the Google Workspace account.
455
+ # @param [String] device_id
456
+ # Immutable. Immutable ID of Chrome OS Device.
457
+ # @param [Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesIssueCommandRequest] directory_chromeosdevices_issue_command_request_object
458
+ # @param [String] fields
459
+ # Selector specifying which fields to include in a partial response.
460
+ # @param [String] quota_user
461
+ # Available to use for quota purposes for server-side applications. Can be any
462
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
463
+ # @param [Google::Apis::RequestOptions] options
464
+ # Request-specific options
465
+ #
466
+ # @yield [result, err] Result & error if block supplied
467
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesIssueCommandResponse] parsed result object
468
+ # @yieldparam err [StandardError] error object if request failed
469
+ #
470
+ # @return [Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesIssueCommandResponse]
471
+ #
472
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
473
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
474
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
475
+ def issue_customer_device_chromeo_command(customer_id, device_id, directory_chromeosdevices_issue_command_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
476
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}:issueCommand', options)
477
+ command.request_representation = Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesIssueCommandRequest::Representation
478
+ command.request_object = directory_chromeosdevices_issue_command_request_object
479
+ command.response_representation = Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesIssueCommandResponse::Representation
480
+ command.response_class = Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesIssueCommandResponse
481
+ command.params['customerId'] = customer_id unless customer_id.nil?
482
+ command.params['deviceId'] = device_id unless device_id.nil?
483
+ command.query['fields'] = fields unless fields.nil?
484
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
485
+ execute_or_queue_command(command, &block)
486
+ end
487
+
488
+ # Gets command data a specific command issued to the device.
489
+ # @param [String] customer_id
490
+ # Immutable. Immutable ID of the Google Workspace account.
491
+ # @param [String] device_id
492
+ # Immutable. Immutable ID of Chrome OS Device.
493
+ # @param [Fixnum] command_id
494
+ # Immutable. Immutable ID of Chrome OS Device Command.
495
+ # @param [String] fields
496
+ # Selector specifying which fields to include in a partial response.
497
+ # @param [String] quota_user
498
+ # Available to use for quota purposes for server-side applications. Can be any
499
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
500
+ # @param [Google::Apis::RequestOptions] options
501
+ # Request-specific options
502
+ #
503
+ # @yield [result, err] Result & error if block supplied
504
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesCommand] parsed result object
505
+ # @yieldparam err [StandardError] error object if request failed
506
+ #
507
+ # @return [Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesCommand]
508
+ #
509
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
510
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
511
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
512
+ def get_customer_device_chromeo_command(customer_id, device_id, command_id, fields: nil, quota_user: nil, options: nil, &block)
513
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}/commands/{commandId}', options)
514
+ command.response_representation = Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesCommand::Representation
515
+ command.response_class = Google::Apis::AdminDirectoryV1::DirectoryChromeosdevicesCommand
516
+ command.params['customerId'] = customer_id unless customer_id.nil?
517
+ command.params['deviceId'] = device_id unless device_id.nil?
518
+ command.params['commandId'] = command_id unless command_id.nil?
519
+ command.query['fields'] = fields unless fields.nil?
520
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
521
+ execute_or_queue_command(command, &block)
522
+ end
523
+
524
+ # Retrieves a customer.
525
+ # @param [String] customer_key
526
+ # Id of the customer to be retrieved
527
+ # @param [String] fields
528
+ # Selector specifying which fields to include in a partial response.
529
+ # @param [String] quota_user
530
+ # Available to use for quota purposes for server-side applications. Can be any
531
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
532
+ # @param [Google::Apis::RequestOptions] options
533
+ # Request-specific options
534
+ #
535
+ # @yield [result, err] Result & error if block supplied
536
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Customer] parsed result object
537
+ # @yieldparam err [StandardError] error object if request failed
538
+ #
539
+ # @return [Google::Apis::AdminDirectoryV1::Customer]
540
+ #
541
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
542
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
543
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
544
+ def get_customer(customer_key, fields: nil, quota_user: nil, options: nil, &block)
545
+ command = make_simple_command(:get, 'admin/directory/v1/customers/{customerKey}', options)
546
+ command.response_representation = Google::Apis::AdminDirectoryV1::Customer::Representation
547
+ command.response_class = Google::Apis::AdminDirectoryV1::Customer
548
+ command.params['customerKey'] = customer_key unless customer_key.nil?
549
+ command.query['fields'] = fields unless fields.nil?
550
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
551
+ execute_or_queue_command(command, &block)
552
+ end
553
+
554
+ # Patch Customers via Apiary Patch Orchestration
555
+ # @param [String] customer_key
556
+ # Id of the customer to be updated
557
+ # @param [Google::Apis::AdminDirectoryV1::Customer] customer_object
558
+ # @param [String] fields
559
+ # Selector specifying which fields to include in a partial response.
560
+ # @param [String] quota_user
561
+ # Available to use for quota purposes for server-side applications. Can be any
562
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
563
+ # @param [Google::Apis::RequestOptions] options
564
+ # Request-specific options
565
+ #
566
+ # @yield [result, err] Result & error if block supplied
567
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Customer] parsed result object
568
+ # @yieldparam err [StandardError] error object if request failed
569
+ #
570
+ # @return [Google::Apis::AdminDirectoryV1::Customer]
571
+ #
572
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
573
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
574
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
575
+ def patch_customer(customer_key, customer_object = nil, fields: nil, quota_user: nil, options: nil, &block)
576
+ command = make_simple_command(:patch, 'admin/directory/v1/customers/{customerKey}', options)
577
+ command.request_representation = Google::Apis::AdminDirectoryV1::Customer::Representation
578
+ command.request_object = customer_object
579
+ command.response_representation = Google::Apis::AdminDirectoryV1::Customer::Representation
580
+ command.response_class = Google::Apis::AdminDirectoryV1::Customer
581
+ command.params['customerKey'] = customer_key unless customer_key.nil?
582
+ command.query['fields'] = fields unless fields.nil?
583
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
584
+ execute_or_queue_command(command, &block)
585
+ end
586
+
587
+ # Updates a customer.
588
+ # @param [String] customer_key
589
+ # Id of the customer to be updated
590
+ # @param [Google::Apis::AdminDirectoryV1::Customer] customer_object
591
+ # @param [String] fields
592
+ # Selector specifying which fields to include in a partial response.
593
+ # @param [String] quota_user
594
+ # Available to use for quota purposes for server-side applications. Can be any
595
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
596
+ # @param [Google::Apis::RequestOptions] options
597
+ # Request-specific options
598
+ #
599
+ # @yield [result, err] Result & error if block supplied
600
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Customer] parsed result object
601
+ # @yieldparam err [StandardError] error object if request failed
602
+ #
603
+ # @return [Google::Apis::AdminDirectoryV1::Customer]
604
+ #
605
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
606
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
607
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
608
+ def update_customer(customer_key, customer_object = nil, fields: nil, quota_user: nil, options: nil, &block)
609
+ command = make_simple_command(:put, 'admin/directory/v1/customers/{customerKey}', options)
610
+ command.request_representation = Google::Apis::AdminDirectoryV1::Customer::Representation
611
+ command.request_object = customer_object
612
+ command.response_representation = Google::Apis::AdminDirectoryV1::Customer::Representation
613
+ command.response_class = Google::Apis::AdminDirectoryV1::Customer
614
+ command.params['customerKey'] = customer_key unless customer_key.nil?
615
+ command.query['fields'] = fields unless fields.nil?
616
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
617
+ execute_or_queue_command(command, &block)
618
+ end
619
+
620
+ # Deletes a domain Alias of the customer.
621
+ # @param [String] customer
622
+ # Immutable ID of the Google Workspace account.
623
+ # @param [String] domain_alias_name
624
+ # Name of domain alias to be retrieved.
625
+ # @param [String] fields
626
+ # Selector specifying which fields to include in a partial response.
627
+ # @param [String] quota_user
628
+ # Available to use for quota purposes for server-side applications. Can be any
629
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
630
+ # @param [Google::Apis::RequestOptions] options
631
+ # Request-specific options
632
+ #
633
+ # @yield [result, err] Result & error if block supplied
634
+ # @yieldparam result [NilClass] No result returned for this method
635
+ # @yieldparam err [StandardError] error object if request failed
636
+ #
637
+ # @return [void]
638
+ #
639
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
640
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
641
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
642
+ def delete_domain_alias(customer, domain_alias_name, fields: nil, quota_user: nil, options: nil, &block)
643
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}', options)
644
+ command.params['customer'] = customer unless customer.nil?
645
+ command.params['domainAliasName'] = domain_alias_name unless domain_alias_name.nil?
646
+ command.query['fields'] = fields unless fields.nil?
647
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
648
+ execute_or_queue_command(command, &block)
649
+ end
650
+
651
+ # Retrieves a domain alias of the customer.
652
+ # @param [String] customer
653
+ # Immutable ID of the Google Workspace account.
654
+ # @param [String] domain_alias_name
655
+ # Name of domain alias to be retrieved.
656
+ # @param [String] fields
657
+ # Selector specifying which fields to include in a partial response.
658
+ # @param [String] quota_user
659
+ # Available to use for quota purposes for server-side applications. Can be any
660
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
661
+ # @param [Google::Apis::RequestOptions] options
662
+ # Request-specific options
663
+ #
664
+ # @yield [result, err] Result & error if block supplied
665
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::DomainAlias] parsed result object
666
+ # @yieldparam err [StandardError] error object if request failed
667
+ #
668
+ # @return [Google::Apis::AdminDirectoryV1::DomainAlias]
669
+ #
670
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
671
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
672
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
673
+ def get_domain_alias(customer, domain_alias_name, fields: nil, quota_user: nil, options: nil, &block)
674
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}', options)
675
+ command.response_representation = Google::Apis::AdminDirectoryV1::DomainAlias::Representation
676
+ command.response_class = Google::Apis::AdminDirectoryV1::DomainAlias
677
+ command.params['customer'] = customer unless customer.nil?
678
+ command.params['domainAliasName'] = domain_alias_name unless domain_alias_name.nil?
679
+ command.query['fields'] = fields unless fields.nil?
680
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
681
+ execute_or_queue_command(command, &block)
682
+ end
683
+
684
+ # Inserts a domain alias of the customer.
685
+ # @param [String] customer
686
+ # Immutable ID of the Google Workspace account.
687
+ # @param [Google::Apis::AdminDirectoryV1::DomainAlias] domain_alias_object
688
+ # @param [String] fields
689
+ # Selector specifying which fields to include in a partial response.
690
+ # @param [String] quota_user
691
+ # Available to use for quota purposes for server-side applications. Can be any
692
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
693
+ # @param [Google::Apis::RequestOptions] options
694
+ # Request-specific options
695
+ #
696
+ # @yield [result, err] Result & error if block supplied
697
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::DomainAlias] parsed result object
698
+ # @yieldparam err [StandardError] error object if request failed
699
+ #
700
+ # @return [Google::Apis::AdminDirectoryV1::DomainAlias]
701
+ #
702
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
703
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
704
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
705
+ def insert_domain_alias(customer, domain_alias_object = nil, fields: nil, quota_user: nil, options: nil, &block)
706
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/domainaliases', options)
707
+ command.request_representation = Google::Apis::AdminDirectoryV1::DomainAlias::Representation
708
+ command.request_object = domain_alias_object
709
+ command.response_representation = Google::Apis::AdminDirectoryV1::DomainAlias::Representation
710
+ command.response_class = Google::Apis::AdminDirectoryV1::DomainAlias
711
+ command.params['customer'] = customer unless customer.nil?
712
+ command.query['fields'] = fields unless fields.nil?
713
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
714
+ execute_or_queue_command(command, &block)
715
+ end
716
+
717
+ # Lists the domain aliases of the customer.
718
+ # @param [String] customer
719
+ # Immutable ID of the Google Workspace account.
720
+ # @param [String] parent_domain_name
721
+ # Name of the parent domain for which domain aliases are to be fetched.
722
+ # @param [String] fields
723
+ # Selector specifying which fields to include in a partial response.
724
+ # @param [String] quota_user
725
+ # Available to use for quota purposes for server-side applications. Can be any
726
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
727
+ # @param [Google::Apis::RequestOptions] options
728
+ # Request-specific options
729
+ #
730
+ # @yield [result, err] Result & error if block supplied
731
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::DomainAliases] parsed result object
732
+ # @yieldparam err [StandardError] error object if request failed
733
+ #
734
+ # @return [Google::Apis::AdminDirectoryV1::DomainAliases]
735
+ #
736
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
737
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
738
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
739
+ def list_domain_aliases(customer, parent_domain_name: nil, fields: nil, quota_user: nil, options: nil, &block)
740
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/domainaliases', options)
741
+ command.response_representation = Google::Apis::AdminDirectoryV1::DomainAliases::Representation
742
+ command.response_class = Google::Apis::AdminDirectoryV1::DomainAliases
743
+ command.params['customer'] = customer unless customer.nil?
744
+ command.query['parentDomainName'] = parent_domain_name unless parent_domain_name.nil?
745
+ command.query['fields'] = fields unless fields.nil?
746
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
747
+ execute_or_queue_command(command, &block)
748
+ end
749
+
750
+ # Deletes a domain of the customer.
751
+ # @param [String] customer
752
+ # Immutable ID of the Google Workspace account.
753
+ # @param [String] domain_name
754
+ # Name of domain to be deleted
755
+ # @param [String] fields
756
+ # Selector specifying which fields to include in a partial response.
757
+ # @param [String] quota_user
758
+ # Available to use for quota purposes for server-side applications. Can be any
759
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
760
+ # @param [Google::Apis::RequestOptions] options
761
+ # Request-specific options
762
+ #
763
+ # @yield [result, err] Result & error if block supplied
764
+ # @yieldparam result [NilClass] No result returned for this method
765
+ # @yieldparam err [StandardError] error object if request failed
766
+ #
767
+ # @return [void]
768
+ #
769
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
770
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
771
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
772
+ def delete_domain(customer, domain_name, fields: nil, quota_user: nil, options: nil, &block)
773
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customer}/domains/{domainName}', options)
774
+ command.params['customer'] = customer unless customer.nil?
775
+ command.params['domainName'] = domain_name unless domain_name.nil?
776
+ command.query['fields'] = fields unless fields.nil?
777
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
778
+ execute_or_queue_command(command, &block)
779
+ end
780
+
781
+ # Retrieves a domain of the customer.
782
+ # @param [String] customer
783
+ # Immutable ID of the Google Workspace account.
784
+ # @param [String] domain_name
785
+ # Name of domain to be retrieved
786
+ # @param [String] fields
787
+ # Selector specifying which fields to include in a partial response.
788
+ # @param [String] quota_user
789
+ # Available to use for quota purposes for server-side applications. Can be any
790
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
791
+ # @param [Google::Apis::RequestOptions] options
792
+ # Request-specific options
793
+ #
794
+ # @yield [result, err] Result & error if block supplied
795
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Domains] parsed result object
796
+ # @yieldparam err [StandardError] error object if request failed
797
+ #
798
+ # @return [Google::Apis::AdminDirectoryV1::Domains]
799
+ #
800
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
801
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
802
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
803
+ def get_domain(customer, domain_name, fields: nil, quota_user: nil, options: nil, &block)
804
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/domains/{domainName}', options)
805
+ command.response_representation = Google::Apis::AdminDirectoryV1::Domains::Representation
806
+ command.response_class = Google::Apis::AdminDirectoryV1::Domains
807
+ command.params['customer'] = customer unless customer.nil?
808
+ command.params['domainName'] = domain_name unless domain_name.nil?
809
+ command.query['fields'] = fields unless fields.nil?
810
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
811
+ execute_or_queue_command(command, &block)
812
+ end
813
+
814
+ # Inserts a domain of the customer.
815
+ # @param [String] customer
816
+ # Immutable ID of the Google Workspace account.
817
+ # @param [Google::Apis::AdminDirectoryV1::Domains] domains_object
818
+ # @param [String] fields
819
+ # Selector specifying which fields to include in a partial response.
820
+ # @param [String] quota_user
821
+ # Available to use for quota purposes for server-side applications. Can be any
822
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
823
+ # @param [Google::Apis::RequestOptions] options
824
+ # Request-specific options
825
+ #
826
+ # @yield [result, err] Result & error if block supplied
827
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Domains] parsed result object
828
+ # @yieldparam err [StandardError] error object if request failed
829
+ #
830
+ # @return [Google::Apis::AdminDirectoryV1::Domains]
831
+ #
832
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
833
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
834
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
835
+ def insert_domain(customer, domains_object = nil, fields: nil, quota_user: nil, options: nil, &block)
836
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/domains', options)
837
+ command.request_representation = Google::Apis::AdminDirectoryV1::Domains::Representation
838
+ command.request_object = domains_object
839
+ command.response_representation = Google::Apis::AdminDirectoryV1::Domains::Representation
840
+ command.response_class = Google::Apis::AdminDirectoryV1::Domains
841
+ command.params['customer'] = customer unless customer.nil?
842
+ command.query['fields'] = fields unless fields.nil?
843
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
844
+ execute_or_queue_command(command, &block)
845
+ end
846
+
847
+ # Lists the domains of the customer.
848
+ # @param [String] customer
849
+ # Immutable ID of the Google Workspace account.
850
+ # @param [String] fields
851
+ # Selector specifying which fields to include in a partial response.
852
+ # @param [String] quota_user
853
+ # Available to use for quota purposes for server-side applications. Can be any
854
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
855
+ # @param [Google::Apis::RequestOptions] options
856
+ # Request-specific options
857
+ #
858
+ # @yield [result, err] Result & error if block supplied
859
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Domains2] parsed result object
860
+ # @yieldparam err [StandardError] error object if request failed
861
+ #
862
+ # @return [Google::Apis::AdminDirectoryV1::Domains2]
863
+ #
864
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
865
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
866
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
867
+ def list_domains(customer, fields: nil, quota_user: nil, options: nil, &block)
868
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/domains', options)
869
+ command.response_representation = Google::Apis::AdminDirectoryV1::Domains2::Representation
870
+ command.response_class = Google::Apis::AdminDirectoryV1::Domains2
871
+ command.params['customer'] = customer unless customer.nil?
872
+ command.query['fields'] = fields unless fields.nil?
873
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
874
+ execute_or_queue_command(command, &block)
875
+ end
876
+
877
+ # Deletes a group.
878
+ # @param [String] group_key
879
+ # Identifies the group in the API request. The value can be the group's email
880
+ # address, group alias, or the unique group ID.
881
+ # @param [String] fields
882
+ # Selector specifying which fields to include in a partial response.
883
+ # @param [String] quota_user
884
+ # Available to use for quota purposes for server-side applications. Can be any
885
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
886
+ # @param [Google::Apis::RequestOptions] options
887
+ # Request-specific options
888
+ #
889
+ # @yield [result, err] Result & error if block supplied
890
+ # @yieldparam result [NilClass] No result returned for this method
891
+ # @yieldparam err [StandardError] error object if request failed
892
+ #
893
+ # @return [void]
894
+ #
895
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
896
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
897
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
898
+ def delete_group(group_key, fields: nil, quota_user: nil, options: nil, &block)
899
+ command = make_simple_command(:delete, 'admin/directory/v1/groups/{groupKey}', options)
900
+ command.params['groupKey'] = group_key unless group_key.nil?
901
+ command.query['fields'] = fields unless fields.nil?
902
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
903
+ execute_or_queue_command(command, &block)
904
+ end
905
+
906
+ # Retrieves a group's properties.
907
+ # @param [String] group_key
908
+ # Identifies the group in the API request. The value can be the group's email
909
+ # address, group alias, or the unique group ID.
910
+ # @param [String] fields
911
+ # Selector specifying which fields to include in a partial response.
912
+ # @param [String] quota_user
913
+ # Available to use for quota purposes for server-side applications. Can be any
914
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
915
+ # @param [Google::Apis::RequestOptions] options
916
+ # Request-specific options
917
+ #
918
+ # @yield [result, err] Result & error if block supplied
919
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Group] parsed result object
920
+ # @yieldparam err [StandardError] error object if request failed
921
+ #
922
+ # @return [Google::Apis::AdminDirectoryV1::Group]
923
+ #
924
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
925
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
926
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
927
+ def get_group(group_key, fields: nil, quota_user: nil, options: nil, &block)
928
+ command = make_simple_command(:get, 'admin/directory/v1/groups/{groupKey}', options)
929
+ command.response_representation = Google::Apis::AdminDirectoryV1::Group::Representation
930
+ command.response_class = Google::Apis::AdminDirectoryV1::Group
931
+ command.params['groupKey'] = group_key unless group_key.nil?
932
+ command.query['fields'] = fields unless fields.nil?
933
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
934
+ execute_or_queue_command(command, &block)
935
+ end
936
+
937
+ # Creates a group.
938
+ # @param [Google::Apis::AdminDirectoryV1::Group] group_object
939
+ # @param [String] fields
940
+ # Selector specifying which fields to include in a partial response.
941
+ # @param [String] quota_user
942
+ # Available to use for quota purposes for server-side applications. Can be any
943
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
944
+ # @param [Google::Apis::RequestOptions] options
945
+ # Request-specific options
946
+ #
947
+ # @yield [result, err] Result & error if block supplied
948
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Group] parsed result object
949
+ # @yieldparam err [StandardError] error object if request failed
950
+ #
951
+ # @return [Google::Apis::AdminDirectoryV1::Group]
952
+ #
953
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
954
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
955
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
956
+ def insert_group(group_object = nil, fields: nil, quota_user: nil, options: nil, &block)
957
+ command = make_simple_command(:post, 'admin/directory/v1/groups', options)
958
+ command.request_representation = Google::Apis::AdminDirectoryV1::Group::Representation
959
+ command.request_object = group_object
960
+ command.response_representation = Google::Apis::AdminDirectoryV1::Group::Representation
961
+ command.response_class = Google::Apis::AdminDirectoryV1::Group
962
+ command.query['fields'] = fields unless fields.nil?
963
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
964
+ execute_or_queue_command(command, &block)
965
+ end
966
+
967
+ # Retrieve all groups of a domain or of a user given a userKey (paginated)
968
+ # @param [String] customer
969
+ # The unique ID for the customer's Google Workspace account. In case of a multi-
970
+ # domain account, to fetch all groups for a customer, fill this field instead of
971
+ # domain. As an account administrator, you can also use the `my_customer` alias
972
+ # to represent your account's `customerId`. The `customerId` is also returned as
973
+ # part of the [Users](/admin-sdk/directory/v1/reference/users)
974
+ # @param [String] domain
975
+ # The domain name. Use this field to get fields from only one domain. To return
976
+ # all domains for a customer account, use the `customer` query parameter instead.
977
+ # @param [Fixnum] max_results
978
+ # Maximum number of results to return. Max allowed value is 200.
979
+ # @param [String] order_by
980
+ # Column to use for sorting results
981
+ # @param [String] page_token
982
+ # Token to specify next page in the list
983
+ # @param [String] query
984
+ # Query string search. Should be of the form "". Complete documentation is at
985
+ # https: //developers.google.com/admin-sdk/directory/v1/guides/search-groups
986
+ # @param [String] sort_order
987
+ # Whether to return results in ascending or descending order. Only of use when
988
+ # orderBy is also used
989
+ # @param [String] user_key
990
+ # Email or immutable ID of the user if only those groups are to be listed, the
991
+ # given user is a member of. If it's an ID, it should match with the ID of the
992
+ # user object.
993
+ # @param [String] fields
994
+ # Selector specifying which fields to include in a partial response.
995
+ # @param [String] quota_user
996
+ # Available to use for quota purposes for server-side applications. Can be any
997
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
998
+ # @param [Google::Apis::RequestOptions] options
999
+ # Request-specific options
1000
+ #
1001
+ # @yield [result, err] Result & error if block supplied
1002
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Groups] parsed result object
1003
+ # @yieldparam err [StandardError] error object if request failed
1004
+ #
1005
+ # @return [Google::Apis::AdminDirectoryV1::Groups]
1006
+ #
1007
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1008
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1009
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1010
+ def list_groups(customer: nil, domain: nil, max_results: nil, order_by: nil, page_token: nil, query: nil, sort_order: nil, user_key: nil, fields: nil, quota_user: nil, options: nil, &block)
1011
+ command = make_simple_command(:get, 'admin/directory/v1/groups', options)
1012
+ command.response_representation = Google::Apis::AdminDirectoryV1::Groups::Representation
1013
+ command.response_class = Google::Apis::AdminDirectoryV1::Groups
1014
+ command.query['customer'] = customer unless customer.nil?
1015
+ command.query['domain'] = domain unless domain.nil?
1016
+ command.query['maxResults'] = max_results unless max_results.nil?
1017
+ command.query['orderBy'] = order_by unless order_by.nil?
1018
+ command.query['pageToken'] = page_token unless page_token.nil?
1019
+ command.query['query'] = query unless query.nil?
1020
+ command.query['sortOrder'] = sort_order unless sort_order.nil?
1021
+ command.query['userKey'] = user_key unless user_key.nil?
1022
+ command.query['fields'] = fields unless fields.nil?
1023
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1024
+ execute_or_queue_command(command, &block)
1025
+ end
1026
+
1027
+ # Updates a group's properties. This method supports [patch semantics](/admin-
1028
+ # sdk/directory/v1/guides/performance#patch).
1029
+ # @param [String] group_key
1030
+ # Identifies the group in the API request. The value can be the group's email
1031
+ # address, group alias, or the unique group ID.
1032
+ # @param [Google::Apis::AdminDirectoryV1::Group] group_object
1033
+ # @param [String] fields
1034
+ # Selector specifying which fields to include in a partial response.
1035
+ # @param [String] quota_user
1036
+ # Available to use for quota purposes for server-side applications. Can be any
1037
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1038
+ # @param [Google::Apis::RequestOptions] options
1039
+ # Request-specific options
1040
+ #
1041
+ # @yield [result, err] Result & error if block supplied
1042
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Group] parsed result object
1043
+ # @yieldparam err [StandardError] error object if request failed
1044
+ #
1045
+ # @return [Google::Apis::AdminDirectoryV1::Group]
1046
+ #
1047
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1048
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1049
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1050
+ def patch_group(group_key, group_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1051
+ command = make_simple_command(:patch, 'admin/directory/v1/groups/{groupKey}', options)
1052
+ command.request_representation = Google::Apis::AdminDirectoryV1::Group::Representation
1053
+ command.request_object = group_object
1054
+ command.response_representation = Google::Apis::AdminDirectoryV1::Group::Representation
1055
+ command.response_class = Google::Apis::AdminDirectoryV1::Group
1056
+ command.params['groupKey'] = group_key unless group_key.nil?
1057
+ command.query['fields'] = fields unless fields.nil?
1058
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1059
+ execute_or_queue_command(command, &block)
1060
+ end
1061
+
1062
+ # Updates a group's properties.
1063
+ # @param [String] group_key
1064
+ # Identifies the group in the API request. The value can be the group's email
1065
+ # address, group alias, or the unique group ID.
1066
+ # @param [Google::Apis::AdminDirectoryV1::Group] group_object
1067
+ # @param [String] fields
1068
+ # Selector specifying which fields to include in a partial response.
1069
+ # @param [String] quota_user
1070
+ # Available to use for quota purposes for server-side applications. Can be any
1071
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1072
+ # @param [Google::Apis::RequestOptions] options
1073
+ # Request-specific options
1074
+ #
1075
+ # @yield [result, err] Result & error if block supplied
1076
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Group] parsed result object
1077
+ # @yieldparam err [StandardError] error object if request failed
1078
+ #
1079
+ # @return [Google::Apis::AdminDirectoryV1::Group]
1080
+ #
1081
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1082
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1083
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1084
+ def update_group(group_key, group_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1085
+ command = make_simple_command(:put, 'admin/directory/v1/groups/{groupKey}', options)
1086
+ command.request_representation = Google::Apis::AdminDirectoryV1::Group::Representation
1087
+ command.request_object = group_object
1088
+ command.response_representation = Google::Apis::AdminDirectoryV1::Group::Representation
1089
+ command.response_class = Google::Apis::AdminDirectoryV1::Group
1090
+ command.params['groupKey'] = group_key unless group_key.nil?
1091
+ command.query['fields'] = fields unless fields.nil?
1092
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1093
+ execute_or_queue_command(command, &block)
1094
+ end
1095
+
1096
+ # Removes an alias.
1097
+ # @param [String] group_key
1098
+ # Identifies the group in the API request. The value can be the group's email
1099
+ # address, group alias, or the unique group ID.
1100
+ # @param [String] group_alias
1101
+ # The alias to be removed
1102
+ # @param [String] fields
1103
+ # Selector specifying which fields to include in a partial response.
1104
+ # @param [String] quota_user
1105
+ # Available to use for quota purposes for server-side applications. Can be any
1106
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1107
+ # @param [Google::Apis::RequestOptions] options
1108
+ # Request-specific options
1109
+ #
1110
+ # @yield [result, err] Result & error if block supplied
1111
+ # @yieldparam result [NilClass] No result returned for this method
1112
+ # @yieldparam err [StandardError] error object if request failed
1113
+ #
1114
+ # @return [void]
1115
+ #
1116
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1117
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1118
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1119
+ def delete_group_alias(group_key, group_alias, fields: nil, quota_user: nil, options: nil, &block)
1120
+ command = make_simple_command(:delete, 'admin/directory/v1/groups/{groupKey}/aliases/{alias}', options)
1121
+ command.params['groupKey'] = group_key unless group_key.nil?
1122
+ command.params['alias'] = group_alias unless group_alias.nil?
1123
+ command.query['fields'] = fields unless fields.nil?
1124
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1125
+ execute_or_queue_command(command, &block)
1126
+ end
1127
+
1128
+ # Adds an alias for the group.
1129
+ # @param [String] group_key
1130
+ # Identifies the group in the API request. The value can be the group's email
1131
+ # address, group alias, or the unique group ID.
1132
+ # @param [Google::Apis::AdminDirectoryV1::Alias] alias_object
1133
+ # @param [String] fields
1134
+ # Selector specifying which fields to include in a partial response.
1135
+ # @param [String] quota_user
1136
+ # Available to use for quota purposes for server-side applications. Can be any
1137
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1138
+ # @param [Google::Apis::RequestOptions] options
1139
+ # Request-specific options
1140
+ #
1141
+ # @yield [result, err] Result & error if block supplied
1142
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Alias] parsed result object
1143
+ # @yieldparam err [StandardError] error object if request failed
1144
+ #
1145
+ # @return [Google::Apis::AdminDirectoryV1::Alias]
1146
+ #
1147
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1148
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1149
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1150
+ def insert_group_alias(group_key, alias_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1151
+ command = make_simple_command(:post, 'admin/directory/v1/groups/{groupKey}/aliases', options)
1152
+ command.request_representation = Google::Apis::AdminDirectoryV1::Alias::Representation
1153
+ command.request_object = alias_object
1154
+ command.response_representation = Google::Apis::AdminDirectoryV1::Alias::Representation
1155
+ command.response_class = Google::Apis::AdminDirectoryV1::Alias
1156
+ command.params['groupKey'] = group_key unless group_key.nil?
1157
+ command.query['fields'] = fields unless fields.nil?
1158
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1159
+ execute_or_queue_command(command, &block)
1160
+ end
1161
+
1162
+ # Lists all aliases for a group.
1163
+ # @param [String] group_key
1164
+ # Identifies the group in the API request. The value can be the group's email
1165
+ # address, group alias, or the unique group ID.
1166
+ # @param [String] fields
1167
+ # Selector specifying which fields to include in a partial response.
1168
+ # @param [String] quota_user
1169
+ # Available to use for quota purposes for server-side applications. Can be any
1170
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1171
+ # @param [Google::Apis::RequestOptions] options
1172
+ # Request-specific options
1173
+ #
1174
+ # @yield [result, err] Result & error if block supplied
1175
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Aliases] parsed result object
1176
+ # @yieldparam err [StandardError] error object if request failed
1177
+ #
1178
+ # @return [Google::Apis::AdminDirectoryV1::Aliases]
1179
+ #
1180
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1181
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1182
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1183
+ def list_group_aliases(group_key, fields: nil, quota_user: nil, options: nil, &block)
1184
+ command = make_simple_command(:get, 'admin/directory/v1/groups/{groupKey}/aliases', options)
1185
+ command.response_representation = Google::Apis::AdminDirectoryV1::Aliases::Representation
1186
+ command.response_class = Google::Apis::AdminDirectoryV1::Aliases
1187
+ command.params['groupKey'] = group_key unless group_key.nil?
1188
+ command.query['fields'] = fields unless fields.nil?
1189
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1190
+ execute_or_queue_command(command, &block)
1191
+ end
1192
+
1193
+ # Removes a member from a group.
1194
+ # @param [String] group_key
1195
+ # Identifies the group in the API request. The value can be the group's email
1196
+ # address, group alias, or the unique group ID.
1197
+ # @param [String] member_key
1198
+ # Identifies the group member in the API request. A group member can be a user
1199
+ # or another group. The value can be the member's (group or user) primary email
1200
+ # address, alias, or unique ID.
1201
+ # @param [String] fields
1202
+ # Selector specifying which fields to include in a partial response.
1203
+ # @param [String] quota_user
1204
+ # Available to use for quota purposes for server-side applications. Can be any
1205
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1206
+ # @param [Google::Apis::RequestOptions] options
1207
+ # Request-specific options
1208
+ #
1209
+ # @yield [result, err] Result & error if block supplied
1210
+ # @yieldparam result [NilClass] No result returned for this method
1211
+ # @yieldparam err [StandardError] error object if request failed
1212
+ #
1213
+ # @return [void]
1214
+ #
1215
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1216
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1217
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1218
+ def delete_member(group_key, member_key, fields: nil, quota_user: nil, options: nil, &block)
1219
+ command = make_simple_command(:delete, 'admin/directory/v1/groups/{groupKey}/members/{memberKey}', options)
1220
+ command.params['groupKey'] = group_key unless group_key.nil?
1221
+ command.params['memberKey'] = member_key unless member_key.nil?
1222
+ command.query['fields'] = fields unless fields.nil?
1223
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1224
+ execute_or_queue_command(command, &block)
1225
+ end
1226
+
1227
+ # Retrieves a group member's properties.
1228
+ # @param [String] group_key
1229
+ # Identifies the group in the API request. The value can be the group's email
1230
+ # address, group alias, or the unique group ID.
1231
+ # @param [String] member_key
1232
+ # Identifies the group member in the API request. A group member can be a user
1233
+ # or another group. The value can be the member's (group or user) primary email
1234
+ # address, alias, or unique ID.
1235
+ # @param [String] fields
1236
+ # Selector specifying which fields to include in a partial response.
1237
+ # @param [String] quota_user
1238
+ # Available to use for quota purposes for server-side applications. Can be any
1239
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1240
+ # @param [Google::Apis::RequestOptions] options
1241
+ # Request-specific options
1242
+ #
1243
+ # @yield [result, err] Result & error if block supplied
1244
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Member] parsed result object
1245
+ # @yieldparam err [StandardError] error object if request failed
1246
+ #
1247
+ # @return [Google::Apis::AdminDirectoryV1::Member]
1248
+ #
1249
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1250
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1251
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1252
+ def get_member(group_key, member_key, fields: nil, quota_user: nil, options: nil, &block)
1253
+ command = make_simple_command(:get, 'admin/directory/v1/groups/{groupKey}/members/{memberKey}', options)
1254
+ command.response_representation = Google::Apis::AdminDirectoryV1::Member::Representation
1255
+ command.response_class = Google::Apis::AdminDirectoryV1::Member
1256
+ command.params['groupKey'] = group_key unless group_key.nil?
1257
+ command.params['memberKey'] = member_key unless member_key.nil?
1258
+ command.query['fields'] = fields unless fields.nil?
1259
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1260
+ execute_or_queue_command(command, &block)
1261
+ end
1262
+
1263
+ # Checks whether the given user is a member of the group. Membership can be
1264
+ # direct or nested.
1265
+ # @param [String] group_key
1266
+ # Identifies the group in the API request. The value can be the group's email
1267
+ # address, group alias, or the unique group ID.
1268
+ # @param [String] member_key
1269
+ # Identifies the user member in the API request. The value can be the user's
1270
+ # primary email address, alias, or unique ID.
1271
+ # @param [String] fields
1272
+ # Selector specifying which fields to include in a partial response.
1273
+ # @param [String] quota_user
1274
+ # Available to use for quota purposes for server-side applications. Can be any
1275
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1276
+ # @param [Google::Apis::RequestOptions] options
1277
+ # Request-specific options
1278
+ #
1279
+ # @yield [result, err] Result & error if block supplied
1280
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::MembersHasMember] parsed result object
1281
+ # @yieldparam err [StandardError] error object if request failed
1282
+ #
1283
+ # @return [Google::Apis::AdminDirectoryV1::MembersHasMember]
1284
+ #
1285
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1286
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1287
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1288
+ def has_member_member(group_key, member_key, fields: nil, quota_user: nil, options: nil, &block)
1289
+ command = make_simple_command(:get, 'admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}', options)
1290
+ command.response_representation = Google::Apis::AdminDirectoryV1::MembersHasMember::Representation
1291
+ command.response_class = Google::Apis::AdminDirectoryV1::MembersHasMember
1292
+ command.params['groupKey'] = group_key unless group_key.nil?
1293
+ command.params['memberKey'] = member_key unless member_key.nil?
1294
+ command.query['fields'] = fields unless fields.nil?
1295
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1296
+ execute_or_queue_command(command, &block)
1297
+ end
1298
+
1299
+ # Adds a user to the specified group.
1300
+ # @param [String] group_key
1301
+ # Identifies the group in the API request. The value can be the group's email
1302
+ # address, group alias, or the unique group ID.
1303
+ # @param [Google::Apis::AdminDirectoryV1::Member] member_object
1304
+ # @param [String] fields
1305
+ # Selector specifying which fields to include in a partial response.
1306
+ # @param [String] quota_user
1307
+ # Available to use for quota purposes for server-side applications. Can be any
1308
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1309
+ # @param [Google::Apis::RequestOptions] options
1310
+ # Request-specific options
1311
+ #
1312
+ # @yield [result, err] Result & error if block supplied
1313
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Member] parsed result object
1314
+ # @yieldparam err [StandardError] error object if request failed
1315
+ #
1316
+ # @return [Google::Apis::AdminDirectoryV1::Member]
1317
+ #
1318
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1319
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1320
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1321
+ def insert_member(group_key, member_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1322
+ command = make_simple_command(:post, 'admin/directory/v1/groups/{groupKey}/members', options)
1323
+ command.request_representation = Google::Apis::AdminDirectoryV1::Member::Representation
1324
+ command.request_object = member_object
1325
+ command.response_representation = Google::Apis::AdminDirectoryV1::Member::Representation
1326
+ command.response_class = Google::Apis::AdminDirectoryV1::Member
1327
+ command.params['groupKey'] = group_key unless group_key.nil?
1328
+ command.query['fields'] = fields unless fields.nil?
1329
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1330
+ execute_or_queue_command(command, &block)
1331
+ end
1332
+
1333
+ # Retrieves a paginated list of all members in a group.
1334
+ # @param [String] group_key
1335
+ # Identifies the group in the API request. The value can be the group's email
1336
+ # address, group alias, or the unique group ID.
1337
+ # @param [Boolean] include_derived_membership
1338
+ # Whether to list indirect memberships. Default: false.
1339
+ # @param [Fixnum] max_results
1340
+ # Maximum number of results to return. Max allowed value is 200.
1341
+ # @param [String] page_token
1342
+ # Token to specify next page in the list.
1343
+ # @param [String] roles
1344
+ # The `roles` query parameter allows you to retrieve group members by role.
1345
+ # Allowed values are `OWNER`, `MANAGER`, and `MEMBER`.
1346
+ # @param [String] fields
1347
+ # Selector specifying which fields to include in a partial response.
1348
+ # @param [String] quota_user
1349
+ # Available to use for quota purposes for server-side applications. Can be any
1350
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1351
+ # @param [Google::Apis::RequestOptions] options
1352
+ # Request-specific options
1353
+ #
1354
+ # @yield [result, err] Result & error if block supplied
1355
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Members] parsed result object
1356
+ # @yieldparam err [StandardError] error object if request failed
1357
+ #
1358
+ # @return [Google::Apis::AdminDirectoryV1::Members]
1359
+ #
1360
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1361
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1362
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1363
+ def list_members(group_key, include_derived_membership: nil, max_results: nil, page_token: nil, roles: nil, fields: nil, quota_user: nil, options: nil, &block)
1364
+ command = make_simple_command(:get, 'admin/directory/v1/groups/{groupKey}/members', options)
1365
+ command.response_representation = Google::Apis::AdminDirectoryV1::Members::Representation
1366
+ command.response_class = Google::Apis::AdminDirectoryV1::Members
1367
+ command.params['groupKey'] = group_key unless group_key.nil?
1368
+ command.query['includeDerivedMembership'] = include_derived_membership unless include_derived_membership.nil?
1369
+ command.query['maxResults'] = max_results unless max_results.nil?
1370
+ command.query['pageToken'] = page_token unless page_token.nil?
1371
+ command.query['roles'] = roles unless roles.nil?
1372
+ command.query['fields'] = fields unless fields.nil?
1373
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1374
+ execute_or_queue_command(command, &block)
1375
+ end
1376
+
1377
+ # Updates the membership properties of a user in the specified group. This
1378
+ # method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#
1379
+ # patch).
1380
+ # @param [String] group_key
1381
+ # Identifies the group in the API request. The value can be the group's email
1382
+ # address, group alias, or the unique group ID.
1383
+ # @param [String] member_key
1384
+ # Identifies the group member in the API request. A group member can be a user
1385
+ # or another group. The value can be the member's (group or user) primary email
1386
+ # address, alias, or unique ID.
1387
+ # @param [Google::Apis::AdminDirectoryV1::Member] member_object
1388
+ # @param [String] fields
1389
+ # Selector specifying which fields to include in a partial response.
1390
+ # @param [String] quota_user
1391
+ # Available to use for quota purposes for server-side applications. Can be any
1392
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1393
+ # @param [Google::Apis::RequestOptions] options
1394
+ # Request-specific options
1395
+ #
1396
+ # @yield [result, err] Result & error if block supplied
1397
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Member] parsed result object
1398
+ # @yieldparam err [StandardError] error object if request failed
1399
+ #
1400
+ # @return [Google::Apis::AdminDirectoryV1::Member]
1401
+ #
1402
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1403
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1404
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1405
+ def patch_member(group_key, member_key, member_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1406
+ command = make_simple_command(:patch, 'admin/directory/v1/groups/{groupKey}/members/{memberKey}', options)
1407
+ command.request_representation = Google::Apis::AdminDirectoryV1::Member::Representation
1408
+ command.request_object = member_object
1409
+ command.response_representation = Google::Apis::AdminDirectoryV1::Member::Representation
1410
+ command.response_class = Google::Apis::AdminDirectoryV1::Member
1411
+ command.params['groupKey'] = group_key unless group_key.nil?
1412
+ command.params['memberKey'] = member_key unless member_key.nil?
1413
+ command.query['fields'] = fields unless fields.nil?
1414
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1415
+ execute_or_queue_command(command, &block)
1416
+ end
1417
+
1418
+ # Updates the membership of a user in the specified group.
1419
+ # @param [String] group_key
1420
+ # Identifies the group in the API request. The value can be the group's email
1421
+ # address, group alias, or the unique group ID.
1422
+ # @param [String] member_key
1423
+ # Identifies the group member in the API request. A group member can be a user
1424
+ # or another group. The value can be the member's (group or user) primary email
1425
+ # address, alias, or unique ID.
1426
+ # @param [Google::Apis::AdminDirectoryV1::Member] member_object
1427
+ # @param [String] fields
1428
+ # Selector specifying which fields to include in a partial response.
1429
+ # @param [String] quota_user
1430
+ # Available to use for quota purposes for server-side applications. Can be any
1431
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1432
+ # @param [Google::Apis::RequestOptions] options
1433
+ # Request-specific options
1434
+ #
1435
+ # @yield [result, err] Result & error if block supplied
1436
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Member] parsed result object
1437
+ # @yieldparam err [StandardError] error object if request failed
1438
+ #
1439
+ # @return [Google::Apis::AdminDirectoryV1::Member]
1440
+ #
1441
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1442
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1443
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1444
+ def update_member(group_key, member_key, member_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1445
+ command = make_simple_command(:put, 'admin/directory/v1/groups/{groupKey}/members/{memberKey}', options)
1446
+ command.request_representation = Google::Apis::AdminDirectoryV1::Member::Representation
1447
+ command.request_object = member_object
1448
+ command.response_representation = Google::Apis::AdminDirectoryV1::Member::Representation
1449
+ command.response_class = Google::Apis::AdminDirectoryV1::Member
1450
+ command.params['groupKey'] = group_key unless group_key.nil?
1451
+ command.params['memberKey'] = member_key unless member_key.nil?
1452
+ command.query['fields'] = fields unless fields.nil?
1453
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1454
+ execute_or_queue_command(command, &block)
1455
+ end
1456
+
1457
+ # Takes an action that affects a mobile device. For example, remotely wiping a
1458
+ # device.
1459
+ # @param [String] customer_id
1460
+ # The unique ID for the customer's Google Workspace account. As an account
1461
+ # administrator, you can also use the `my_customer` alias to represent your
1462
+ # account's `customerId`. The `customerId` is also returned as part of the [
1463
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1464
+ # @param [String] resource_id
1465
+ # The unique ID the API service uses to identify the mobile device.
1466
+ # @param [Google::Apis::AdminDirectoryV1::MobileDeviceAction] mobile_device_action_object
1467
+ # @param [String] fields
1468
+ # Selector specifying which fields to include in a partial response.
1469
+ # @param [String] quota_user
1470
+ # Available to use for quota purposes for server-side applications. Can be any
1471
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1472
+ # @param [Google::Apis::RequestOptions] options
1473
+ # Request-specific options
1474
+ #
1475
+ # @yield [result, err] Result & error if block supplied
1476
+ # @yieldparam result [NilClass] No result returned for this method
1477
+ # @yieldparam err [StandardError] error object if request failed
1478
+ #
1479
+ # @return [void]
1480
+ #
1481
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1482
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1483
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1484
+ def action_mobile_device(customer_id, resource_id, mobile_device_action_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1485
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action', options)
1486
+ command.request_representation = Google::Apis::AdminDirectoryV1::MobileDeviceAction::Representation
1487
+ command.request_object = mobile_device_action_object
1488
+ command.params['customerId'] = customer_id unless customer_id.nil?
1489
+ command.params['resourceId'] = resource_id unless resource_id.nil?
1490
+ command.query['fields'] = fields unless fields.nil?
1491
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1492
+ execute_or_queue_command(command, &block)
1493
+ end
1494
+
1495
+ # Removes a mobile device.
1496
+ # @param [String] customer_id
1497
+ # The unique ID for the customer's Google Workspace account. As an account
1498
+ # administrator, you can also use the `my_customer` alias to represent your
1499
+ # account's `customerId`. The `customerId` is also returned as part of the [
1500
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1501
+ # @param [String] resource_id
1502
+ # The unique ID the API service uses to identify the mobile device.
1503
+ # @param [String] fields
1504
+ # Selector specifying which fields to include in a partial response.
1505
+ # @param [String] quota_user
1506
+ # Available to use for quota purposes for server-side applications. Can be any
1507
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1508
+ # @param [Google::Apis::RequestOptions] options
1509
+ # Request-specific options
1510
+ #
1511
+ # @yield [result, err] Result & error if block supplied
1512
+ # @yieldparam result [NilClass] No result returned for this method
1513
+ # @yieldparam err [StandardError] error object if request failed
1514
+ #
1515
+ # @return [void]
1516
+ #
1517
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1518
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1519
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1520
+ def delete_mobile_device(customer_id, resource_id, fields: nil, quota_user: nil, options: nil, &block)
1521
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}', options)
1522
+ command.params['customerId'] = customer_id unless customer_id.nil?
1523
+ command.params['resourceId'] = resource_id unless resource_id.nil?
1524
+ command.query['fields'] = fields unless fields.nil?
1525
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1526
+ execute_or_queue_command(command, &block)
1527
+ end
1528
+
1529
+ # Retrieves a mobile device's properties.
1530
+ # @param [String] customer_id
1531
+ # The unique ID for the customer's Google Workspace account. As an account
1532
+ # administrator, you can also use the `my_customer` alias to represent your
1533
+ # account's `customerId`. The `customerId` is also returned as part of the [
1534
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1535
+ # @param [String] resource_id
1536
+ # The unique ID the API service uses to identify the mobile device.
1537
+ # @param [String] projection
1538
+ # Restrict information returned to a set of selected fields.
1539
+ # @param [String] fields
1540
+ # Selector specifying which fields to include in a partial response.
1541
+ # @param [String] quota_user
1542
+ # Available to use for quota purposes for server-side applications. Can be any
1543
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1544
+ # @param [Google::Apis::RequestOptions] options
1545
+ # Request-specific options
1546
+ #
1547
+ # @yield [result, err] Result & error if block supplied
1548
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::MobileDevice] parsed result object
1549
+ # @yieldparam err [StandardError] error object if request failed
1550
+ #
1551
+ # @return [Google::Apis::AdminDirectoryV1::MobileDevice]
1552
+ #
1553
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1554
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1555
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1556
+ def get_mobile_device(customer_id, resource_id, projection: nil, fields: nil, quota_user: nil, options: nil, &block)
1557
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}', options)
1558
+ command.response_representation = Google::Apis::AdminDirectoryV1::MobileDevice::Representation
1559
+ command.response_class = Google::Apis::AdminDirectoryV1::MobileDevice
1560
+ command.params['customerId'] = customer_id unless customer_id.nil?
1561
+ command.params['resourceId'] = resource_id unless resource_id.nil?
1562
+ command.query['projection'] = projection unless projection.nil?
1563
+ command.query['fields'] = fields unless fields.nil?
1564
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1565
+ execute_or_queue_command(command, &block)
1566
+ end
1567
+
1568
+ # Retrieves a paginated list of all mobile devices for an account.
1569
+ # @param [String] customer_id
1570
+ # The unique ID for the customer's Google Workspace account. As an account
1571
+ # administrator, you can also use the `my_customer` alias to represent your
1572
+ # account's `customerId`. The `customerId` is also returned as part of the [
1573
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1574
+ # @param [Fixnum] max_results
1575
+ # Maximum number of results to return. Max allowed value is 100.
1576
+ # @param [String] order_by
1577
+ # Device property to use for sorting results.
1578
+ # @param [String] page_token
1579
+ # Token to specify next page in the list
1580
+ # @param [String] projection
1581
+ # Restrict information returned to a set of selected fields.
1582
+ # @param [String] query
1583
+ # Search string in the format given at https://developers.google.com/admin-sdk/
1584
+ # directory/v1/search-operators
1585
+ # @param [String] sort_order
1586
+ # Whether to return results in ascending or descending order. Must be used with
1587
+ # the `orderBy` parameter.
1588
+ # @param [String] fields
1589
+ # Selector specifying which fields to include in a partial response.
1590
+ # @param [String] quota_user
1591
+ # Available to use for quota purposes for server-side applications. Can be any
1592
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1593
+ # @param [Google::Apis::RequestOptions] options
1594
+ # Request-specific options
1595
+ #
1596
+ # @yield [result, err] Result & error if block supplied
1597
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::MobileDevices] parsed result object
1598
+ # @yieldparam err [StandardError] error object if request failed
1599
+ #
1600
+ # @return [Google::Apis::AdminDirectoryV1::MobileDevices]
1601
+ #
1602
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1603
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1604
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1605
+ def list_mobile_devices(customer_id, max_results: nil, order_by: nil, page_token: nil, projection: nil, query: nil, sort_order: nil, fields: nil, quota_user: nil, options: nil, &block)
1606
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/devices/mobile', options)
1607
+ command.response_representation = Google::Apis::AdminDirectoryV1::MobileDevices::Representation
1608
+ command.response_class = Google::Apis::AdminDirectoryV1::MobileDevices
1609
+ command.params['customerId'] = customer_id unless customer_id.nil?
1610
+ command.query['maxResults'] = max_results unless max_results.nil?
1611
+ command.query['orderBy'] = order_by unless order_by.nil?
1612
+ command.query['pageToken'] = page_token unless page_token.nil?
1613
+ command.query['projection'] = projection unless projection.nil?
1614
+ command.query['query'] = query unless query.nil?
1615
+ command.query['sortOrder'] = sort_order unless sort_order.nil?
1616
+ command.query['fields'] = fields unless fields.nil?
1617
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1618
+ execute_or_queue_command(command, &block)
1619
+ end
1620
+
1621
+ # Removes an organizational unit.
1622
+ # @param [String] customer_id
1623
+ # The unique ID for the customer's Google Workspace account. As an account
1624
+ # administrator, you can also use the `my_customer` alias to represent your
1625
+ # account's `customerId`. The `customerId` is also returned as part of the [
1626
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1627
+ # @param [String] org_unit_path
1628
+ # The full path of the organizational unit or its unique ID.
1629
+ # @param [String] fields
1630
+ # Selector specifying which fields to include in a partial response.
1631
+ # @param [String] quota_user
1632
+ # Available to use for quota purposes for server-side applications. Can be any
1633
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1634
+ # @param [Google::Apis::RequestOptions] options
1635
+ # Request-specific options
1636
+ #
1637
+ # @yield [result, err] Result & error if block supplied
1638
+ # @yieldparam result [NilClass] No result returned for this method
1639
+ # @yieldparam err [StandardError] error object if request failed
1640
+ #
1641
+ # @return [void]
1642
+ #
1643
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1644
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1645
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1646
+ def delete_org_unit(customer_id, org_unit_path, fields: nil, quota_user: nil, options: nil, &block)
1647
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}', options)
1648
+ command.params['customerId'] = customer_id unless customer_id.nil?
1649
+ command.params['orgUnitPath'] = org_unit_path unless org_unit_path.nil?
1650
+ command.query['fields'] = fields unless fields.nil?
1651
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1652
+ execute_or_queue_command(command, &block)
1653
+ end
1654
+
1655
+ # Retrieves an organizational unit.
1656
+ # @param [String] customer_id
1657
+ # The unique ID for the customer's Google Workspace account. As an account
1658
+ # administrator, you can also use the `my_customer` alias to represent your
1659
+ # account's `customerId`. The `customerId` is also returned as part of the [
1660
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1661
+ # @param [String] org_unit_path
1662
+ # The full path of the organizational unit or its unique ID.
1663
+ # @param [String] fields
1664
+ # Selector specifying which fields to include in a partial response.
1665
+ # @param [String] quota_user
1666
+ # Available to use for quota purposes for server-side applications. Can be any
1667
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1668
+ # @param [Google::Apis::RequestOptions] options
1669
+ # Request-specific options
1670
+ #
1671
+ # @yield [result, err] Result & error if block supplied
1672
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::OrgUnit] parsed result object
1673
+ # @yieldparam err [StandardError] error object if request failed
1674
+ #
1675
+ # @return [Google::Apis::AdminDirectoryV1::OrgUnit]
1676
+ #
1677
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1678
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1679
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1680
+ def get_org_unit(customer_id, org_unit_path, fields: nil, quota_user: nil, options: nil, &block)
1681
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}', options)
1682
+ command.response_representation = Google::Apis::AdminDirectoryV1::OrgUnit::Representation
1683
+ command.response_class = Google::Apis::AdminDirectoryV1::OrgUnit
1684
+ command.params['customerId'] = customer_id unless customer_id.nil?
1685
+ command.params['orgUnitPath'] = org_unit_path unless org_unit_path.nil?
1686
+ command.query['fields'] = fields unless fields.nil?
1687
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1688
+ execute_or_queue_command(command, &block)
1689
+ end
1690
+
1691
+ # Adds an organizational unit.
1692
+ # @param [String] customer_id
1693
+ # The unique ID for the customer's Google Workspace account. As an account
1694
+ # administrator, you can also use the `my_customer` alias to represent your
1695
+ # account's `customerId`. The `customerId` is also returned as part of the [
1696
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1697
+ # @param [Google::Apis::AdminDirectoryV1::OrgUnit] org_unit_object
1698
+ # @param [String] fields
1699
+ # Selector specifying which fields to include in a partial response.
1700
+ # @param [String] quota_user
1701
+ # Available to use for quota purposes for server-side applications. Can be any
1702
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1703
+ # @param [Google::Apis::RequestOptions] options
1704
+ # Request-specific options
1705
+ #
1706
+ # @yield [result, err] Result & error if block supplied
1707
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::OrgUnit] parsed result object
1708
+ # @yieldparam err [StandardError] error object if request failed
1709
+ #
1710
+ # @return [Google::Apis::AdminDirectoryV1::OrgUnit]
1711
+ #
1712
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1713
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1714
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1715
+ def insert_org_unit(customer_id, org_unit_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1716
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customerId}/orgunits', options)
1717
+ command.request_representation = Google::Apis::AdminDirectoryV1::OrgUnit::Representation
1718
+ command.request_object = org_unit_object
1719
+ command.response_representation = Google::Apis::AdminDirectoryV1::OrgUnit::Representation
1720
+ command.response_class = Google::Apis::AdminDirectoryV1::OrgUnit
1721
+ command.params['customerId'] = customer_id unless customer_id.nil?
1722
+ command.query['fields'] = fields unless fields.nil?
1723
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1724
+ execute_or_queue_command(command, &block)
1725
+ end
1726
+
1727
+ # Retrieves a list of all organizational units for an account.
1728
+ # @param [String] customer_id
1729
+ # The unique ID for the customer's Google Workspace account. As an account
1730
+ # administrator, you can also use the `my_customer` alias to represent your
1731
+ # account's `customerId`. The `customerId` is also returned as part of the [
1732
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1733
+ # @param [String] org_unit_path
1734
+ # The full path to the organizational unit or its unique ID. Returns the
1735
+ # children of the specified organizational unit.
1736
+ # @param [String] type
1737
+ # Whether to return all sub-organizations or just immediate children.
1738
+ # @param [String] fields
1739
+ # Selector specifying which fields to include in a partial response.
1740
+ # @param [String] quota_user
1741
+ # Available to use for quota purposes for server-side applications. Can be any
1742
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1743
+ # @param [Google::Apis::RequestOptions] options
1744
+ # Request-specific options
1745
+ #
1746
+ # @yield [result, err] Result & error if block supplied
1747
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::OrgUnits] parsed result object
1748
+ # @yieldparam err [StandardError] error object if request failed
1749
+ #
1750
+ # @return [Google::Apis::AdminDirectoryV1::OrgUnits]
1751
+ #
1752
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1753
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1754
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1755
+ def list_org_units(customer_id, org_unit_path: nil, type: nil, fields: nil, quota_user: nil, options: nil, &block)
1756
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/orgunits', options)
1757
+ command.response_representation = Google::Apis::AdminDirectoryV1::OrgUnits::Representation
1758
+ command.response_class = Google::Apis::AdminDirectoryV1::OrgUnits
1759
+ command.params['customerId'] = customer_id unless customer_id.nil?
1760
+ command.query['orgUnitPath'] = org_unit_path unless org_unit_path.nil?
1761
+ command.query['type'] = type unless type.nil?
1762
+ command.query['fields'] = fields unless fields.nil?
1763
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1764
+ execute_or_queue_command(command, &block)
1765
+ end
1766
+
1767
+ # Updates an organizational unit. This method supports [patch semantics](/admin-
1768
+ # sdk/directory/v1/guides/performance#patch)
1769
+ # @param [String] customer_id
1770
+ # The unique ID for the customer's Google Workspace account. As an account
1771
+ # administrator, you can also use the `my_customer` alias to represent your
1772
+ # account's `customerId`. The `customerId` is also returned as part of the [
1773
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1774
+ # @param [String] org_unit_path
1775
+ # The full path of the organizational unit or its unique ID.
1776
+ # @param [Google::Apis::AdminDirectoryV1::OrgUnit] org_unit_object
1777
+ # @param [String] fields
1778
+ # Selector specifying which fields to include in a partial response.
1779
+ # @param [String] quota_user
1780
+ # Available to use for quota purposes for server-side applications. Can be any
1781
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1782
+ # @param [Google::Apis::RequestOptions] options
1783
+ # Request-specific options
1784
+ #
1785
+ # @yield [result, err] Result & error if block supplied
1786
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::OrgUnit] parsed result object
1787
+ # @yieldparam err [StandardError] error object if request failed
1788
+ #
1789
+ # @return [Google::Apis::AdminDirectoryV1::OrgUnit]
1790
+ #
1791
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1792
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1793
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1794
+ def patch_org_unit(customer_id, org_unit_path, org_unit_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1795
+ command = make_simple_command(:patch, 'admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}', options)
1796
+ command.request_representation = Google::Apis::AdminDirectoryV1::OrgUnit::Representation
1797
+ command.request_object = org_unit_object
1798
+ command.response_representation = Google::Apis::AdminDirectoryV1::OrgUnit::Representation
1799
+ command.response_class = Google::Apis::AdminDirectoryV1::OrgUnit
1800
+ command.params['customerId'] = customer_id unless customer_id.nil?
1801
+ command.params['orgUnitPath'] = org_unit_path unless org_unit_path.nil?
1802
+ command.query['fields'] = fields unless fields.nil?
1803
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1804
+ execute_or_queue_command(command, &block)
1805
+ end
1806
+
1807
+ # Updates an organizational unit.
1808
+ # @param [String] customer_id
1809
+ # The unique ID for the customer's Google Workspace account. As an account
1810
+ # administrator, you can also use the `my_customer` alias to represent your
1811
+ # account's `customerId`. The `customerId` is also returned as part of the [
1812
+ # Users resource](/admin-sdk/directory/v1/reference/users).
1813
+ # @param [String] org_unit_path
1814
+ # The full path of the organizational unit or its unique ID.
1815
+ # @param [Google::Apis::AdminDirectoryV1::OrgUnit] org_unit_object
1816
+ # @param [String] fields
1817
+ # Selector specifying which fields to include in a partial response.
1818
+ # @param [String] quota_user
1819
+ # Available to use for quota purposes for server-side applications. Can be any
1820
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1821
+ # @param [Google::Apis::RequestOptions] options
1822
+ # Request-specific options
1823
+ #
1824
+ # @yield [result, err] Result & error if block supplied
1825
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::OrgUnit] parsed result object
1826
+ # @yieldparam err [StandardError] error object if request failed
1827
+ #
1828
+ # @return [Google::Apis::AdminDirectoryV1::OrgUnit]
1829
+ #
1830
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1831
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1832
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1833
+ def update_org_unit(customer_id, org_unit_path, org_unit_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1834
+ command = make_simple_command(:put, 'admin/directory/v1/customer/{customerId}/orgunits/{+orgUnitPath}', options)
1835
+ command.request_representation = Google::Apis::AdminDirectoryV1::OrgUnit::Representation
1836
+ command.request_object = org_unit_object
1837
+ command.response_representation = Google::Apis::AdminDirectoryV1::OrgUnit::Representation
1838
+ command.response_class = Google::Apis::AdminDirectoryV1::OrgUnit
1839
+ command.params['customerId'] = customer_id unless customer_id.nil?
1840
+ command.params['orgUnitPath'] = org_unit_path unless org_unit_path.nil?
1841
+ command.query['fields'] = fields unless fields.nil?
1842
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1843
+ execute_or_queue_command(command, &block)
1844
+ end
1845
+
1846
+ # Retrieves a paginated list of all privileges for a customer.
1847
+ # @param [String] customer
1848
+ # Immutable ID of the Google Workspace account.
1849
+ # @param [String] fields
1850
+ # Selector specifying which fields to include in a partial response.
1851
+ # @param [String] quota_user
1852
+ # Available to use for quota purposes for server-side applications. Can be any
1853
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1854
+ # @param [Google::Apis::RequestOptions] options
1855
+ # Request-specific options
1856
+ #
1857
+ # @yield [result, err] Result & error if block supplied
1858
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Privileges] parsed result object
1859
+ # @yieldparam err [StandardError] error object if request failed
1860
+ #
1861
+ # @return [Google::Apis::AdminDirectoryV1::Privileges]
1862
+ #
1863
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1864
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1865
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1866
+ def list_privileges(customer, fields: nil, quota_user: nil, options: nil, &block)
1867
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/roles/ALL/privileges', options)
1868
+ command.response_representation = Google::Apis::AdminDirectoryV1::Privileges::Representation
1869
+ command.response_class = Google::Apis::AdminDirectoryV1::Privileges
1870
+ command.params['customer'] = customer unless customer.nil?
1871
+ command.query['fields'] = fields unless fields.nil?
1872
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1873
+ execute_or_queue_command(command, &block)
1874
+ end
1875
+
1876
+ # Deletes a building.
1877
+ # @param [String] customer
1878
+ # The unique ID for the customer's Google Workspace account. As an account
1879
+ # administrator, you can also use the `my_customer` alias to represent your
1880
+ # account's customer ID.
1881
+ # @param [String] building_id
1882
+ # The id of the building to delete.
1883
+ # @param [String] fields
1884
+ # Selector specifying which fields to include in a partial response.
1885
+ # @param [String] quota_user
1886
+ # Available to use for quota purposes for server-side applications. Can be any
1887
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1888
+ # @param [Google::Apis::RequestOptions] options
1889
+ # Request-specific options
1890
+ #
1891
+ # @yield [result, err] Result & error if block supplied
1892
+ # @yieldparam result [NilClass] No result returned for this method
1893
+ # @yieldparam err [StandardError] error object if request failed
1894
+ #
1895
+ # @return [void]
1896
+ #
1897
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1898
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1899
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1900
+ def delete_resource_building(customer, building_id, fields: nil, quota_user: nil, options: nil, &block)
1901
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}', options)
1902
+ command.params['customer'] = customer unless customer.nil?
1903
+ command.params['buildingId'] = building_id unless building_id.nil?
1904
+ command.query['fields'] = fields unless fields.nil?
1905
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1906
+ execute_or_queue_command(command, &block)
1907
+ end
1908
+
1909
+ # Retrieves a building.
1910
+ # @param [String] customer
1911
+ # The unique ID for the customer's Google Workspace account. As an account
1912
+ # administrator, you can also use the `my_customer` alias to represent your
1913
+ # account's customer ID.
1914
+ # @param [String] building_id
1915
+ # The unique ID of the building to retrieve.
1916
+ # @param [String] fields
1917
+ # Selector specifying which fields to include in a partial response.
1918
+ # @param [String] quota_user
1919
+ # Available to use for quota purposes for server-side applications. Can be any
1920
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1921
+ # @param [Google::Apis::RequestOptions] options
1922
+ # Request-specific options
1923
+ #
1924
+ # @yield [result, err] Result & error if block supplied
1925
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Building] parsed result object
1926
+ # @yieldparam err [StandardError] error object if request failed
1927
+ #
1928
+ # @return [Google::Apis::AdminDirectoryV1::Building]
1929
+ #
1930
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1931
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1932
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1933
+ def get_resource_building(customer, building_id, fields: nil, quota_user: nil, options: nil, &block)
1934
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}', options)
1935
+ command.response_representation = Google::Apis::AdminDirectoryV1::Building::Representation
1936
+ command.response_class = Google::Apis::AdminDirectoryV1::Building
1937
+ command.params['customer'] = customer unless customer.nil?
1938
+ command.params['buildingId'] = building_id unless building_id.nil?
1939
+ command.query['fields'] = fields unless fields.nil?
1940
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1941
+ execute_or_queue_command(command, &block)
1942
+ end
1943
+
1944
+ # Inserts a building.
1945
+ # @param [String] customer
1946
+ # The unique ID for the customer's Google Workspace account. As an account
1947
+ # administrator, you can also use the `my_customer` alias to represent your
1948
+ # account's customer ID.
1949
+ # @param [Google::Apis::AdminDirectoryV1::Building] building_object
1950
+ # @param [String] coordinates_source
1951
+ # Source from which Building.coordinates are derived.
1952
+ # @param [String] fields
1953
+ # Selector specifying which fields to include in a partial response.
1954
+ # @param [String] quota_user
1955
+ # Available to use for quota purposes for server-side applications. Can be any
1956
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1957
+ # @param [Google::Apis::RequestOptions] options
1958
+ # Request-specific options
1959
+ #
1960
+ # @yield [result, err] Result & error if block supplied
1961
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Building] parsed result object
1962
+ # @yieldparam err [StandardError] error object if request failed
1963
+ #
1964
+ # @return [Google::Apis::AdminDirectoryV1::Building]
1965
+ #
1966
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1967
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1968
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1969
+ def insert_resource_building(customer, building_object = nil, coordinates_source: nil, fields: nil, quota_user: nil, options: nil, &block)
1970
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/resources/buildings', options)
1971
+ command.request_representation = Google::Apis::AdminDirectoryV1::Building::Representation
1972
+ command.request_object = building_object
1973
+ command.response_representation = Google::Apis::AdminDirectoryV1::Building::Representation
1974
+ command.response_class = Google::Apis::AdminDirectoryV1::Building
1975
+ command.params['customer'] = customer unless customer.nil?
1976
+ command.query['coordinatesSource'] = coordinates_source unless coordinates_source.nil?
1977
+ command.query['fields'] = fields unless fields.nil?
1978
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1979
+ execute_or_queue_command(command, &block)
1980
+ end
1981
+
1982
+ # Retrieves a list of buildings for an account.
1983
+ # @param [String] customer
1984
+ # The unique ID for the customer's Google Workspace account. As an account
1985
+ # administrator, you can also use the `my_customer` alias to represent your
1986
+ # account's customer ID.
1987
+ # @param [Fixnum] max_results
1988
+ # Maximum number of results to return.
1989
+ # @param [String] page_token
1990
+ # Token to specify the next page in the list.
1991
+ # @param [String] fields
1992
+ # Selector specifying which fields to include in a partial response.
1993
+ # @param [String] quota_user
1994
+ # Available to use for quota purposes for server-side applications. Can be any
1995
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1996
+ # @param [Google::Apis::RequestOptions] options
1997
+ # Request-specific options
1998
+ #
1999
+ # @yield [result, err] Result & error if block supplied
2000
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Buildings] parsed result object
2001
+ # @yieldparam err [StandardError] error object if request failed
2002
+ #
2003
+ # @return [Google::Apis::AdminDirectoryV1::Buildings]
2004
+ #
2005
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2006
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2007
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2008
+ def list_resource_buildings(customer, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2009
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/resources/buildings', options)
2010
+ command.response_representation = Google::Apis::AdminDirectoryV1::Buildings::Representation
2011
+ command.response_class = Google::Apis::AdminDirectoryV1::Buildings
2012
+ command.params['customer'] = customer unless customer.nil?
2013
+ command.query['maxResults'] = max_results unless max_results.nil?
2014
+ command.query['pageToken'] = page_token unless page_token.nil?
2015
+ command.query['fields'] = fields unless fields.nil?
2016
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2017
+ execute_or_queue_command(command, &block)
2018
+ end
2019
+
2020
+ # Patches a building via Apiary Patch Orchestration.
2021
+ # @param [String] customer
2022
+ # The unique ID for the customer's Google Workspace account. As an account
2023
+ # administrator, you can also use the `my_customer` alias to represent your
2024
+ # account's customer ID.
2025
+ # @param [String] building_id
2026
+ # The id of the building to update.
2027
+ # @param [Google::Apis::AdminDirectoryV1::Building] building_object
2028
+ # @param [String] coordinates_source
2029
+ # Source from which Building.coordinates are derived.
2030
+ # @param [String] fields
2031
+ # Selector specifying which fields to include in a partial response.
2032
+ # @param [String] quota_user
2033
+ # Available to use for quota purposes for server-side applications. Can be any
2034
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2035
+ # @param [Google::Apis::RequestOptions] options
2036
+ # Request-specific options
2037
+ #
2038
+ # @yield [result, err] Result & error if block supplied
2039
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Building] parsed result object
2040
+ # @yieldparam err [StandardError] error object if request failed
2041
+ #
2042
+ # @return [Google::Apis::AdminDirectoryV1::Building]
2043
+ #
2044
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2045
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2046
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2047
+ def patch_resource_building(customer, building_id, building_object = nil, coordinates_source: nil, fields: nil, quota_user: nil, options: nil, &block)
2048
+ command = make_simple_command(:patch, 'admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}', options)
2049
+ command.request_representation = Google::Apis::AdminDirectoryV1::Building::Representation
2050
+ command.request_object = building_object
2051
+ command.response_representation = Google::Apis::AdminDirectoryV1::Building::Representation
2052
+ command.response_class = Google::Apis::AdminDirectoryV1::Building
2053
+ command.params['customer'] = customer unless customer.nil?
2054
+ command.params['buildingId'] = building_id unless building_id.nil?
2055
+ command.query['coordinatesSource'] = coordinates_source unless coordinates_source.nil?
2056
+ command.query['fields'] = fields unless fields.nil?
2057
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2058
+ execute_or_queue_command(command, &block)
2059
+ end
2060
+
2061
+ # Updates a building.
2062
+ # @param [String] customer
2063
+ # The unique ID for the customer's Google Workspace account. As an account
2064
+ # administrator, you can also use the `my_customer` alias to represent your
2065
+ # account's customer ID.
2066
+ # @param [String] building_id
2067
+ # The id of the building to update.
2068
+ # @param [Google::Apis::AdminDirectoryV1::Building] building_object
2069
+ # @param [String] coordinates_source
2070
+ # Source from which Building.coordinates are derived.
2071
+ # @param [String] fields
2072
+ # Selector specifying which fields to include in a partial response.
2073
+ # @param [String] quota_user
2074
+ # Available to use for quota purposes for server-side applications. Can be any
2075
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2076
+ # @param [Google::Apis::RequestOptions] options
2077
+ # Request-specific options
2078
+ #
2079
+ # @yield [result, err] Result & error if block supplied
2080
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Building] parsed result object
2081
+ # @yieldparam err [StandardError] error object if request failed
2082
+ #
2083
+ # @return [Google::Apis::AdminDirectoryV1::Building]
2084
+ #
2085
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2086
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2087
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2088
+ def update_resource_building(customer, building_id, building_object = nil, coordinates_source: nil, fields: nil, quota_user: nil, options: nil, &block)
2089
+ command = make_simple_command(:put, 'admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}', options)
2090
+ command.request_representation = Google::Apis::AdminDirectoryV1::Building::Representation
2091
+ command.request_object = building_object
2092
+ command.response_representation = Google::Apis::AdminDirectoryV1::Building::Representation
2093
+ command.response_class = Google::Apis::AdminDirectoryV1::Building
2094
+ command.params['customer'] = customer unless customer.nil?
2095
+ command.params['buildingId'] = building_id unless building_id.nil?
2096
+ command.query['coordinatesSource'] = coordinates_source unless coordinates_source.nil?
2097
+ command.query['fields'] = fields unless fields.nil?
2098
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2099
+ execute_or_queue_command(command, &block)
2100
+ end
2101
+
2102
+ # Deletes a calendar resource.
2103
+ # @param [String] customer
2104
+ # The unique ID for the customer's Google Workspace account. As an account
2105
+ # administrator, you can also use the `my_customer` alias to represent your
2106
+ # account's customer ID.
2107
+ # @param [String] calendar_resource_id
2108
+ # The unique ID of the calendar resource to delete.
2109
+ # @param [String] fields
2110
+ # Selector specifying which fields to include in a partial response.
2111
+ # @param [String] quota_user
2112
+ # Available to use for quota purposes for server-side applications. Can be any
2113
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2114
+ # @param [Google::Apis::RequestOptions] options
2115
+ # Request-specific options
2116
+ #
2117
+ # @yield [result, err] Result & error if block supplied
2118
+ # @yieldparam result [NilClass] No result returned for this method
2119
+ # @yieldparam err [StandardError] error object if request failed
2120
+ #
2121
+ # @return [void]
2122
+ #
2123
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2124
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2125
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2126
+ def delete_calendar_resource(customer, calendar_resource_id, fields: nil, quota_user: nil, options: nil, &block)
2127
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}', options)
2128
+ command.params['customer'] = customer unless customer.nil?
2129
+ command.params['calendarResourceId'] = calendar_resource_id unless calendar_resource_id.nil?
2130
+ command.query['fields'] = fields unless fields.nil?
2131
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2132
+ execute_or_queue_command(command, &block)
2133
+ end
2134
+
2135
+ # Retrieves a calendar resource.
2136
+ # @param [String] customer
2137
+ # The unique ID for the customer's Google Workspace account. As an account
2138
+ # administrator, you can also use the `my_customer` alias to represent your
2139
+ # account's customer ID.
2140
+ # @param [String] calendar_resource_id
2141
+ # The unique ID of the calendar resource to retrieve.
2142
+ # @param [String] fields
2143
+ # Selector specifying which fields to include in a partial response.
2144
+ # @param [String] quota_user
2145
+ # Available to use for quota purposes for server-side applications. Can be any
2146
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2147
+ # @param [Google::Apis::RequestOptions] options
2148
+ # Request-specific options
2149
+ #
2150
+ # @yield [result, err] Result & error if block supplied
2151
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::CalendarResource] parsed result object
2152
+ # @yieldparam err [StandardError] error object if request failed
2153
+ #
2154
+ # @return [Google::Apis::AdminDirectoryV1::CalendarResource]
2155
+ #
2156
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2157
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2158
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2159
+ def get_calendar_resource(customer, calendar_resource_id, fields: nil, quota_user: nil, options: nil, &block)
2160
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}', options)
2161
+ command.response_representation = Google::Apis::AdminDirectoryV1::CalendarResource::Representation
2162
+ command.response_class = Google::Apis::AdminDirectoryV1::CalendarResource
2163
+ command.params['customer'] = customer unless customer.nil?
2164
+ command.params['calendarResourceId'] = calendar_resource_id unless calendar_resource_id.nil?
2165
+ command.query['fields'] = fields unless fields.nil?
2166
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2167
+ execute_or_queue_command(command, &block)
2168
+ end
2169
+
2170
+ # Inserts a calendar resource.
2171
+ # @param [String] customer
2172
+ # The unique ID for the customer's Google Workspace account. As an account
2173
+ # administrator, you can also use the `my_customer` alias to represent your
2174
+ # account's customer ID.
2175
+ # @param [Google::Apis::AdminDirectoryV1::CalendarResource] calendar_resource_object
2176
+ # @param [String] fields
2177
+ # Selector specifying which fields to include in a partial response.
2178
+ # @param [String] quota_user
2179
+ # Available to use for quota purposes for server-side applications. Can be any
2180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2181
+ # @param [Google::Apis::RequestOptions] options
2182
+ # Request-specific options
2183
+ #
2184
+ # @yield [result, err] Result & error if block supplied
2185
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::CalendarResource] parsed result object
2186
+ # @yieldparam err [StandardError] error object if request failed
2187
+ #
2188
+ # @return [Google::Apis::AdminDirectoryV1::CalendarResource]
2189
+ #
2190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2193
+ def calendar_resource(customer, calendar_resource_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2194
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/resources/calendars', options)
2195
+ command.request_representation = Google::Apis::AdminDirectoryV1::CalendarResource::Representation
2196
+ command.request_object = calendar_resource_object
2197
+ command.response_representation = Google::Apis::AdminDirectoryV1::CalendarResource::Representation
2198
+ command.response_class = Google::Apis::AdminDirectoryV1::CalendarResource
2199
+ command.params['customer'] = customer unless customer.nil?
2200
+ command.query['fields'] = fields unless fields.nil?
2201
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2202
+ execute_or_queue_command(command, &block)
2203
+ end
2204
+
2205
+ # Retrieves a list of calendar resources for an account.
2206
+ # @param [String] customer
2207
+ # The unique ID for the customer's Google Workspace account. As an account
2208
+ # administrator, you can also use the `my_customer` alias to represent your
2209
+ # account's customer ID.
2210
+ # @param [Fixnum] max_results
2211
+ # Maximum number of results to return.
2212
+ # @param [String] order_by
2213
+ # Field(s) to sort results by in either ascending or descending order. Supported
2214
+ # fields include `resourceId`, `resourceName`, `capacity`, `buildingId`, and `
2215
+ # floorName`. If no order is specified, defaults to ascending. Should be of the
2216
+ # form "field [asc|desc], field [asc|desc], ...". For example `buildingId,
2217
+ # capacity desc` would return results sorted first by `buildingId` in ascending
2218
+ # order then by `capacity` in descending order.
2219
+ # @param [String] page_token
2220
+ # Token to specify the next page in the list.
2221
+ # @param [String] query
2222
+ # String query used to filter results. Should be of the form "field operator
2223
+ # value" where field can be any of supported fields and operators can be any of
2224
+ # supported operations. Operators include '=' for exact match, '!=' for mismatch
2225
+ # and ':' for prefix match or HAS match where applicable. For prefix match, the
2226
+ # value should always be followed by a *. Logical operators NOT and AND are
2227
+ # supported (in this order of precedence). Supported fields include `
2228
+ # generatedResourceName`, `name`, `buildingId`, `floor_name`, `capacity`, `
2229
+ # featureInstances.feature.name`, `resourceEmail`, `resourceCategory`. For
2230
+ # example `buildingId=US-NYC-9TH AND featureInstances.feature.name:Phone`.
2231
+ # @param [String] fields
2232
+ # Selector specifying which fields to include in a partial response.
2233
+ # @param [String] quota_user
2234
+ # Available to use for quota purposes for server-side applications. Can be any
2235
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2236
+ # @param [Google::Apis::RequestOptions] options
2237
+ # Request-specific options
2238
+ #
2239
+ # @yield [result, err] Result & error if block supplied
2240
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::CalendarResources] parsed result object
2241
+ # @yieldparam err [StandardError] error object if request failed
2242
+ #
2243
+ # @return [Google::Apis::AdminDirectoryV1::CalendarResources]
2244
+ #
2245
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2246
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2247
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2248
+ def list_calendar_resources(customer, max_results: nil, order_by: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
2249
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/resources/calendars', options)
2250
+ command.response_representation = Google::Apis::AdminDirectoryV1::CalendarResources::Representation
2251
+ command.response_class = Google::Apis::AdminDirectoryV1::CalendarResources
2252
+ command.params['customer'] = customer unless customer.nil?
2253
+ command.query['maxResults'] = max_results unless max_results.nil?
2254
+ command.query['orderBy'] = order_by unless order_by.nil?
2255
+ command.query['pageToken'] = page_token unless page_token.nil?
2256
+ command.query['query'] = query unless query.nil?
2257
+ command.query['fields'] = fields unless fields.nil?
2258
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2259
+ execute_or_queue_command(command, &block)
2260
+ end
2261
+
2262
+ # Patches a calendar resource via Apiary Patch Orchestration.
2263
+ # @param [String] customer
2264
+ # The unique ID for the customer's Google Workspace account. As an account
2265
+ # administrator, you can also use the `my_customer` alias to represent your
2266
+ # account's customer ID.
2267
+ # @param [String] calendar_resource_id
2268
+ # The unique ID of the calendar resource to update.
2269
+ # @param [Google::Apis::AdminDirectoryV1::CalendarResource] calendar_resource_object
2270
+ # @param [String] fields
2271
+ # Selector specifying which fields to include in a partial response.
2272
+ # @param [String] quota_user
2273
+ # Available to use for quota purposes for server-side applications. Can be any
2274
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2275
+ # @param [Google::Apis::RequestOptions] options
2276
+ # Request-specific options
2277
+ #
2278
+ # @yield [result, err] Result & error if block supplied
2279
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::CalendarResource] parsed result object
2280
+ # @yieldparam err [StandardError] error object if request failed
2281
+ #
2282
+ # @return [Google::Apis::AdminDirectoryV1::CalendarResource]
2283
+ #
2284
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2285
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2286
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2287
+ def patch_calendar_resource(customer, calendar_resource_id, calendar_resource_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2288
+ command = make_simple_command(:patch, 'admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}', options)
2289
+ command.request_representation = Google::Apis::AdminDirectoryV1::CalendarResource::Representation
2290
+ command.request_object = calendar_resource_object
2291
+ command.response_representation = Google::Apis::AdminDirectoryV1::CalendarResource::Representation
2292
+ command.response_class = Google::Apis::AdminDirectoryV1::CalendarResource
2293
+ command.params['customer'] = customer unless customer.nil?
2294
+ command.params['calendarResourceId'] = calendar_resource_id unless calendar_resource_id.nil?
2295
+ command.query['fields'] = fields unless fields.nil?
2296
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2297
+ execute_or_queue_command(command, &block)
2298
+ end
2299
+
2300
+ # Updates a calendar resource. This method supports patch semantics, meaning you
2301
+ # only need to include the fields you wish to update. Fields that are not
2302
+ # present in the request will be preserved.
2303
+ # @param [String] customer
2304
+ # The unique ID for the customer's Google Workspace account. As an account
2305
+ # administrator, you can also use the `my_customer` alias to represent your
2306
+ # account's customer ID.
2307
+ # @param [String] calendar_resource_id
2308
+ # The unique ID of the calendar resource to update.
2309
+ # @param [Google::Apis::AdminDirectoryV1::CalendarResource] calendar_resource_object
2310
+ # @param [String] fields
2311
+ # Selector specifying which fields to include in a partial response.
2312
+ # @param [String] quota_user
2313
+ # Available to use for quota purposes for server-side applications. Can be any
2314
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2315
+ # @param [Google::Apis::RequestOptions] options
2316
+ # Request-specific options
2317
+ #
2318
+ # @yield [result, err] Result & error if block supplied
2319
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::CalendarResource] parsed result object
2320
+ # @yieldparam err [StandardError] error object if request failed
2321
+ #
2322
+ # @return [Google::Apis::AdminDirectoryV1::CalendarResource]
2323
+ #
2324
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2325
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2326
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2327
+ def update_calendar_resource(customer, calendar_resource_id, calendar_resource_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2328
+ command = make_simple_command(:put, 'admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}', options)
2329
+ command.request_representation = Google::Apis::AdminDirectoryV1::CalendarResource::Representation
2330
+ command.request_object = calendar_resource_object
2331
+ command.response_representation = Google::Apis::AdminDirectoryV1::CalendarResource::Representation
2332
+ command.response_class = Google::Apis::AdminDirectoryV1::CalendarResource
2333
+ command.params['customer'] = customer unless customer.nil?
2334
+ command.params['calendarResourceId'] = calendar_resource_id unless calendar_resource_id.nil?
2335
+ command.query['fields'] = fields unless fields.nil?
2336
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2337
+ execute_or_queue_command(command, &block)
2338
+ end
2339
+
2340
+ # Deletes a feature.
2341
+ # @param [String] customer
2342
+ # The unique ID for the customer's Google Workspace account. As an account
2343
+ # administrator, you can also use the `my_customer` alias to represent your
2344
+ # account's customer ID.
2345
+ # @param [String] feature_key
2346
+ # The unique ID of the feature to delete.
2347
+ # @param [String] fields
2348
+ # Selector specifying which fields to include in a partial response.
2349
+ # @param [String] quota_user
2350
+ # Available to use for quota purposes for server-side applications. Can be any
2351
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2352
+ # @param [Google::Apis::RequestOptions] options
2353
+ # Request-specific options
2354
+ #
2355
+ # @yield [result, err] Result & error if block supplied
2356
+ # @yieldparam result [NilClass] No result returned for this method
2357
+ # @yieldparam err [StandardError] error object if request failed
2358
+ #
2359
+ # @return [void]
2360
+ #
2361
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2362
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2363
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2364
+ def delete_resource_feature(customer, feature_key, fields: nil, quota_user: nil, options: nil, &block)
2365
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customer}/resources/features/{featureKey}', options)
2366
+ command.params['customer'] = customer unless customer.nil?
2367
+ command.params['featureKey'] = feature_key unless feature_key.nil?
2368
+ command.query['fields'] = fields unless fields.nil?
2369
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2370
+ execute_or_queue_command(command, &block)
2371
+ end
2372
+
2373
+ # Retrieves a feature.
2374
+ # @param [String] customer
2375
+ # The unique ID for the customer's Google Workspace account. As an account
2376
+ # administrator, you can also use the `my_customer` alias to represent your
2377
+ # account's customer ID.
2378
+ # @param [String] feature_key
2379
+ # The unique ID of the feature to retrieve.
2380
+ # @param [String] fields
2381
+ # Selector specifying which fields to include in a partial response.
2382
+ # @param [String] quota_user
2383
+ # Available to use for quota purposes for server-side applications. Can be any
2384
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2385
+ # @param [Google::Apis::RequestOptions] options
2386
+ # Request-specific options
2387
+ #
2388
+ # @yield [result, err] Result & error if block supplied
2389
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Feature] parsed result object
2390
+ # @yieldparam err [StandardError] error object if request failed
2391
+ #
2392
+ # @return [Google::Apis::AdminDirectoryV1::Feature]
2393
+ #
2394
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2395
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2396
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2397
+ def get_resource_feature(customer, feature_key, fields: nil, quota_user: nil, options: nil, &block)
2398
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/resources/features/{featureKey}', options)
2399
+ command.response_representation = Google::Apis::AdminDirectoryV1::Feature::Representation
2400
+ command.response_class = Google::Apis::AdminDirectoryV1::Feature
2401
+ command.params['customer'] = customer unless customer.nil?
2402
+ command.params['featureKey'] = feature_key unless feature_key.nil?
2403
+ command.query['fields'] = fields unless fields.nil?
2404
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2405
+ execute_or_queue_command(command, &block)
2406
+ end
2407
+
2408
+ # Inserts a feature.
2409
+ # @param [String] customer
2410
+ # The unique ID for the customer's Google Workspace account. As an account
2411
+ # administrator, you can also use the `my_customer` alias to represent your
2412
+ # account's customer ID.
2413
+ # @param [Google::Apis::AdminDirectoryV1::Feature] feature_object
2414
+ # @param [String] fields
2415
+ # Selector specifying which fields to include in a partial response.
2416
+ # @param [String] quota_user
2417
+ # Available to use for quota purposes for server-side applications. Can be any
2418
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2419
+ # @param [Google::Apis::RequestOptions] options
2420
+ # Request-specific options
2421
+ #
2422
+ # @yield [result, err] Result & error if block supplied
2423
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Feature] parsed result object
2424
+ # @yieldparam err [StandardError] error object if request failed
2425
+ #
2426
+ # @return [Google::Apis::AdminDirectoryV1::Feature]
2427
+ #
2428
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2429
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2430
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2431
+ def insert_resource_feature(customer, feature_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2432
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/resources/features', options)
2433
+ command.request_representation = Google::Apis::AdminDirectoryV1::Feature::Representation
2434
+ command.request_object = feature_object
2435
+ command.response_representation = Google::Apis::AdminDirectoryV1::Feature::Representation
2436
+ command.response_class = Google::Apis::AdminDirectoryV1::Feature
2437
+ command.params['customer'] = customer unless customer.nil?
2438
+ command.query['fields'] = fields unless fields.nil?
2439
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2440
+ execute_or_queue_command(command, &block)
2441
+ end
2442
+
2443
+ # Retrieves a list of features for an account.
2444
+ # @param [String] customer
2445
+ # The unique ID for the customer's Google Workspace account. As an account
2446
+ # administrator, you can also use the `my_customer` alias to represent your
2447
+ # account's customer ID.
2448
+ # @param [Fixnum] max_results
2449
+ # Maximum number of results to return.
2450
+ # @param [String] page_token
2451
+ # Token to specify the next page in the list.
2452
+ # @param [String] fields
2453
+ # Selector specifying which fields to include in a partial response.
2454
+ # @param [String] quota_user
2455
+ # Available to use for quota purposes for server-side applications. Can be any
2456
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2457
+ # @param [Google::Apis::RequestOptions] options
2458
+ # Request-specific options
2459
+ #
2460
+ # @yield [result, err] Result & error if block supplied
2461
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Features] parsed result object
2462
+ # @yieldparam err [StandardError] error object if request failed
2463
+ #
2464
+ # @return [Google::Apis::AdminDirectoryV1::Features]
2465
+ #
2466
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2467
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2468
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2469
+ def list_resource_features(customer, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2470
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/resources/features', options)
2471
+ command.response_representation = Google::Apis::AdminDirectoryV1::Features::Representation
2472
+ command.response_class = Google::Apis::AdminDirectoryV1::Features
2473
+ command.params['customer'] = customer unless customer.nil?
2474
+ command.query['maxResults'] = max_results unless max_results.nil?
2475
+ command.query['pageToken'] = page_token unless page_token.nil?
2476
+ command.query['fields'] = fields unless fields.nil?
2477
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2478
+ execute_or_queue_command(command, &block)
2479
+ end
2480
+
2481
+ # Patches a feature via Apiary Patch Orchestration.
2482
+ # @param [String] customer
2483
+ # The unique ID for the customer's Google Workspace account. As an account
2484
+ # administrator, you can also use the `my_customer` alias to represent your
2485
+ # account's customer ID.
2486
+ # @param [String] feature_key
2487
+ # The unique ID of the feature to update.
2488
+ # @param [Google::Apis::AdminDirectoryV1::Feature] feature_object
2489
+ # @param [String] fields
2490
+ # Selector specifying which fields to include in a partial response.
2491
+ # @param [String] quota_user
2492
+ # Available to use for quota purposes for server-side applications. Can be any
2493
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2494
+ # @param [Google::Apis::RequestOptions] options
2495
+ # Request-specific options
2496
+ #
2497
+ # @yield [result, err] Result & error if block supplied
2498
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Feature] parsed result object
2499
+ # @yieldparam err [StandardError] error object if request failed
2500
+ #
2501
+ # @return [Google::Apis::AdminDirectoryV1::Feature]
2502
+ #
2503
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2504
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2505
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2506
+ def patch_resource_feature(customer, feature_key, feature_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2507
+ command = make_simple_command(:patch, 'admin/directory/v1/customer/{customer}/resources/features/{featureKey}', options)
2508
+ command.request_representation = Google::Apis::AdminDirectoryV1::Feature::Representation
2509
+ command.request_object = feature_object
2510
+ command.response_representation = Google::Apis::AdminDirectoryV1::Feature::Representation
2511
+ command.response_class = Google::Apis::AdminDirectoryV1::Feature
2512
+ command.params['customer'] = customer unless customer.nil?
2513
+ command.params['featureKey'] = feature_key unless feature_key.nil?
2514
+ command.query['fields'] = fields unless fields.nil?
2515
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2516
+ execute_or_queue_command(command, &block)
2517
+ end
2518
+
2519
+ # Renames a feature.
2520
+ # @param [String] customer
2521
+ # The unique ID for the customer's Google Workspace account. As an account
2522
+ # administrator, you can also use the `my_customer` alias to represent your
2523
+ # account's customer ID.
2524
+ # @param [String] old_name
2525
+ # The unique ID of the feature to rename.
2526
+ # @param [Google::Apis::AdminDirectoryV1::FeatureRename] feature_rename_object
2527
+ # @param [String] fields
2528
+ # Selector specifying which fields to include in a partial response.
2529
+ # @param [String] quota_user
2530
+ # Available to use for quota purposes for server-side applications. Can be any
2531
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2532
+ # @param [Google::Apis::RequestOptions] options
2533
+ # Request-specific options
2534
+ #
2535
+ # @yield [result, err] Result & error if block supplied
2536
+ # @yieldparam result [NilClass] No result returned for this method
2537
+ # @yieldparam err [StandardError] error object if request failed
2538
+ #
2539
+ # @return [void]
2540
+ #
2541
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2542
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2543
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2544
+ def rename_resource_feature(customer, old_name, feature_rename_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2545
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename', options)
2546
+ command.request_representation = Google::Apis::AdminDirectoryV1::FeatureRename::Representation
2547
+ command.request_object = feature_rename_object
2548
+ command.params['customer'] = customer unless customer.nil?
2549
+ command.params['oldName'] = old_name unless old_name.nil?
2550
+ command.query['fields'] = fields unless fields.nil?
2551
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2552
+ execute_or_queue_command(command, &block)
2553
+ end
2554
+
2555
+ # Updates a feature.
2556
+ # @param [String] customer
2557
+ # The unique ID for the customer's Google Workspace account. As an account
2558
+ # administrator, you can also use the `my_customer` alias to represent your
2559
+ # account's customer ID.
2560
+ # @param [String] feature_key
2561
+ # The unique ID of the feature to update.
2562
+ # @param [Google::Apis::AdminDirectoryV1::Feature] feature_object
2563
+ # @param [String] fields
2564
+ # Selector specifying which fields to include in a partial response.
2565
+ # @param [String] quota_user
2566
+ # Available to use for quota purposes for server-side applications. Can be any
2567
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2568
+ # @param [Google::Apis::RequestOptions] options
2569
+ # Request-specific options
2570
+ #
2571
+ # @yield [result, err] Result & error if block supplied
2572
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Feature] parsed result object
2573
+ # @yieldparam err [StandardError] error object if request failed
2574
+ #
2575
+ # @return [Google::Apis::AdminDirectoryV1::Feature]
2576
+ #
2577
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2578
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2579
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2580
+ def update_resource_feature(customer, feature_key, feature_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2581
+ command = make_simple_command(:put, 'admin/directory/v1/customer/{customer}/resources/features/{featureKey}', options)
2582
+ command.request_representation = Google::Apis::AdminDirectoryV1::Feature::Representation
2583
+ command.request_object = feature_object
2584
+ command.response_representation = Google::Apis::AdminDirectoryV1::Feature::Representation
2585
+ command.response_class = Google::Apis::AdminDirectoryV1::Feature
2586
+ command.params['customer'] = customer unless customer.nil?
2587
+ command.params['featureKey'] = feature_key unless feature_key.nil?
2588
+ command.query['fields'] = fields unless fields.nil?
2589
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2590
+ execute_or_queue_command(command, &block)
2591
+ end
2592
+
2593
+ # Deletes a role assignment.
2594
+ # @param [String] customer
2595
+ # Immutable ID of the Google Workspace account.
2596
+ # @param [String] role_assignment_id
2597
+ # Immutable ID of the role assignment.
2598
+ # @param [String] fields
2599
+ # Selector specifying which fields to include in a partial response.
2600
+ # @param [String] quota_user
2601
+ # Available to use for quota purposes for server-side applications. Can be any
2602
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2603
+ # @param [Google::Apis::RequestOptions] options
2604
+ # Request-specific options
2605
+ #
2606
+ # @yield [result, err] Result & error if block supplied
2607
+ # @yieldparam result [NilClass] No result returned for this method
2608
+ # @yieldparam err [StandardError] error object if request failed
2609
+ #
2610
+ # @return [void]
2611
+ #
2612
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2613
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2614
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2615
+ def delete_role_assignment(customer, role_assignment_id, fields: nil, quota_user: nil, options: nil, &block)
2616
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}', options)
2617
+ command.params['customer'] = customer unless customer.nil?
2618
+ command.params['roleAssignmentId'] = role_assignment_id unless role_assignment_id.nil?
2619
+ command.query['fields'] = fields unless fields.nil?
2620
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2621
+ execute_or_queue_command(command, &block)
2622
+ end
2623
+
2624
+ # Retrieve a role assignment.
2625
+ # @param [String] customer
2626
+ # Immutable ID of the Google Workspace account.
2627
+ # @param [String] role_assignment_id
2628
+ # Immutable ID of the role assignment.
2629
+ # @param [String] fields
2630
+ # Selector specifying which fields to include in a partial response.
2631
+ # @param [String] quota_user
2632
+ # Available to use for quota purposes for server-side applications. Can be any
2633
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2634
+ # @param [Google::Apis::RequestOptions] options
2635
+ # Request-specific options
2636
+ #
2637
+ # @yield [result, err] Result & error if block supplied
2638
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::RoleAssignment] parsed result object
2639
+ # @yieldparam err [StandardError] error object if request failed
2640
+ #
2641
+ # @return [Google::Apis::AdminDirectoryV1::RoleAssignment]
2642
+ #
2643
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2644
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2645
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2646
+ def get_role_assignment(customer, role_assignment_id, fields: nil, quota_user: nil, options: nil, &block)
2647
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}', options)
2648
+ command.response_representation = Google::Apis::AdminDirectoryV1::RoleAssignment::Representation
2649
+ command.response_class = Google::Apis::AdminDirectoryV1::RoleAssignment
2650
+ command.params['customer'] = customer unless customer.nil?
2651
+ command.params['roleAssignmentId'] = role_assignment_id unless role_assignment_id.nil?
2652
+ command.query['fields'] = fields unless fields.nil?
2653
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2654
+ execute_or_queue_command(command, &block)
2655
+ end
2656
+
2657
+ # Creates a role assignment.
2658
+ # @param [String] customer
2659
+ # Immutable ID of the Google Workspace account.
2660
+ # @param [Google::Apis::AdminDirectoryV1::RoleAssignment] role_assignment_object
2661
+ # @param [String] fields
2662
+ # Selector specifying which fields to include in a partial response.
2663
+ # @param [String] quota_user
2664
+ # Available to use for quota purposes for server-side applications. Can be any
2665
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2666
+ # @param [Google::Apis::RequestOptions] options
2667
+ # Request-specific options
2668
+ #
2669
+ # @yield [result, err] Result & error if block supplied
2670
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::RoleAssignment] parsed result object
2671
+ # @yieldparam err [StandardError] error object if request failed
2672
+ #
2673
+ # @return [Google::Apis::AdminDirectoryV1::RoleAssignment]
2674
+ #
2675
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2676
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2677
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2678
+ def insert_role_assignment(customer, role_assignment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2679
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/roleassignments', options)
2680
+ command.request_representation = Google::Apis::AdminDirectoryV1::RoleAssignment::Representation
2681
+ command.request_object = role_assignment_object
2682
+ command.response_representation = Google::Apis::AdminDirectoryV1::RoleAssignment::Representation
2683
+ command.response_class = Google::Apis::AdminDirectoryV1::RoleAssignment
2684
+ command.params['customer'] = customer unless customer.nil?
2685
+ command.query['fields'] = fields unless fields.nil?
2686
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2687
+ execute_or_queue_command(command, &block)
2688
+ end
2689
+
2690
+ # Retrieves a paginated list of all roleAssignments.
2691
+ # @param [String] customer
2692
+ # Immutable ID of the Google Workspace account.
2693
+ # @param [Fixnum] max_results
2694
+ # Maximum number of results to return.
2695
+ # @param [String] page_token
2696
+ # Token to specify the next page in the list.
2697
+ # @param [String] role_id
2698
+ # Immutable ID of a role. If included in the request, returns only role
2699
+ # assignments containing this role ID.
2700
+ # @param [String] user_key
2701
+ # The user's primary email address, alias email address, or unique user ID. If
2702
+ # included in the request, returns role assignments only for this user.
2703
+ # @param [String] fields
2704
+ # Selector specifying which fields to include in a partial response.
2705
+ # @param [String] quota_user
2706
+ # Available to use for quota purposes for server-side applications. Can be any
2707
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2708
+ # @param [Google::Apis::RequestOptions] options
2709
+ # Request-specific options
2710
+ #
2711
+ # @yield [result, err] Result & error if block supplied
2712
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::RoleAssignments] parsed result object
2713
+ # @yieldparam err [StandardError] error object if request failed
2714
+ #
2715
+ # @return [Google::Apis::AdminDirectoryV1::RoleAssignments]
2716
+ #
2717
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2718
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2719
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2720
+ def list_role_assignments(customer, max_results: nil, page_token: nil, role_id: nil, user_key: nil, fields: nil, quota_user: nil, options: nil, &block)
2721
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/roleassignments', options)
2722
+ command.response_representation = Google::Apis::AdminDirectoryV1::RoleAssignments::Representation
2723
+ command.response_class = Google::Apis::AdminDirectoryV1::RoleAssignments
2724
+ command.params['customer'] = customer unless customer.nil?
2725
+ command.query['maxResults'] = max_results unless max_results.nil?
2726
+ command.query['pageToken'] = page_token unless page_token.nil?
2727
+ command.query['roleId'] = role_id unless role_id.nil?
2728
+ command.query['userKey'] = user_key unless user_key.nil?
2729
+ command.query['fields'] = fields unless fields.nil?
2730
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2731
+ execute_or_queue_command(command, &block)
2732
+ end
2733
+
2734
+ # Deletes a role.
2735
+ # @param [String] customer
2736
+ # Immutable ID of the Google Workspace account.
2737
+ # @param [String] role_id
2738
+ # Immutable ID of the role.
2739
+ # @param [String] fields
2740
+ # Selector specifying which fields to include in a partial response.
2741
+ # @param [String] quota_user
2742
+ # Available to use for quota purposes for server-side applications. Can be any
2743
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2744
+ # @param [Google::Apis::RequestOptions] options
2745
+ # Request-specific options
2746
+ #
2747
+ # @yield [result, err] Result & error if block supplied
2748
+ # @yieldparam result [NilClass] No result returned for this method
2749
+ # @yieldparam err [StandardError] error object if request failed
2750
+ #
2751
+ # @return [void]
2752
+ #
2753
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2754
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2755
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2756
+ def delete_role(customer, role_id, fields: nil, quota_user: nil, options: nil, &block)
2757
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customer}/roles/{roleId}', options)
2758
+ command.params['customer'] = customer unless customer.nil?
2759
+ command.params['roleId'] = role_id unless role_id.nil?
2760
+ command.query['fields'] = fields unless fields.nil?
2761
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2762
+ execute_or_queue_command(command, &block)
2763
+ end
2764
+
2765
+ # Retrieves a role.
2766
+ # @param [String] customer
2767
+ # Immutable ID of the Google Workspace account.
2768
+ # @param [String] role_id
2769
+ # Immutable ID of the role.
2770
+ # @param [String] fields
2771
+ # Selector specifying which fields to include in a partial response.
2772
+ # @param [String] quota_user
2773
+ # Available to use for quota purposes for server-side applications. Can be any
2774
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2775
+ # @param [Google::Apis::RequestOptions] options
2776
+ # Request-specific options
2777
+ #
2778
+ # @yield [result, err] Result & error if block supplied
2779
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Role] parsed result object
2780
+ # @yieldparam err [StandardError] error object if request failed
2781
+ #
2782
+ # @return [Google::Apis::AdminDirectoryV1::Role]
2783
+ #
2784
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2785
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2786
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2787
+ def get_role(customer, role_id, fields: nil, quota_user: nil, options: nil, &block)
2788
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/roles/{roleId}', options)
2789
+ command.response_representation = Google::Apis::AdminDirectoryV1::Role::Representation
2790
+ command.response_class = Google::Apis::AdminDirectoryV1::Role
2791
+ command.params['customer'] = customer unless customer.nil?
2792
+ command.params['roleId'] = role_id unless role_id.nil?
2793
+ command.query['fields'] = fields unless fields.nil?
2794
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2795
+ execute_or_queue_command(command, &block)
2796
+ end
2797
+
2798
+ # Creates a role.
2799
+ # @param [String] customer
2800
+ # Immutable ID of the Google Workspace account.
2801
+ # @param [Google::Apis::AdminDirectoryV1::Role] role_object
2802
+ # @param [String] fields
2803
+ # Selector specifying which fields to include in a partial response.
2804
+ # @param [String] quota_user
2805
+ # Available to use for quota purposes for server-side applications. Can be any
2806
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2807
+ # @param [Google::Apis::RequestOptions] options
2808
+ # Request-specific options
2809
+ #
2810
+ # @yield [result, err] Result & error if block supplied
2811
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Role] parsed result object
2812
+ # @yieldparam err [StandardError] error object if request failed
2813
+ #
2814
+ # @return [Google::Apis::AdminDirectoryV1::Role]
2815
+ #
2816
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2817
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2818
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2819
+ def insert_role(customer, role_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2820
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customer}/roles', options)
2821
+ command.request_representation = Google::Apis::AdminDirectoryV1::Role::Representation
2822
+ command.request_object = role_object
2823
+ command.response_representation = Google::Apis::AdminDirectoryV1::Role::Representation
2824
+ command.response_class = Google::Apis::AdminDirectoryV1::Role
2825
+ command.params['customer'] = customer unless customer.nil?
2826
+ command.query['fields'] = fields unless fields.nil?
2827
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2828
+ execute_or_queue_command(command, &block)
2829
+ end
2830
+
2831
+ # Retrieves a paginated list of all the roles in a domain.
2832
+ # @param [String] customer
2833
+ # Immutable ID of the Google Workspace account.
2834
+ # @param [Fixnum] max_results
2835
+ # Maximum number of results to return.
2836
+ # @param [String] page_token
2837
+ # Token to specify the next page in the list.
2838
+ # @param [String] fields
2839
+ # Selector specifying which fields to include in a partial response.
2840
+ # @param [String] quota_user
2841
+ # Available to use for quota purposes for server-side applications. Can be any
2842
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2843
+ # @param [Google::Apis::RequestOptions] options
2844
+ # Request-specific options
2845
+ #
2846
+ # @yield [result, err] Result & error if block supplied
2847
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Roles] parsed result object
2848
+ # @yieldparam err [StandardError] error object if request failed
2849
+ #
2850
+ # @return [Google::Apis::AdminDirectoryV1::Roles]
2851
+ #
2852
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2853
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2854
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2855
+ def list_roles(customer, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2856
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customer}/roles', options)
2857
+ command.response_representation = Google::Apis::AdminDirectoryV1::Roles::Representation
2858
+ command.response_class = Google::Apis::AdminDirectoryV1::Roles
2859
+ command.params['customer'] = customer unless customer.nil?
2860
+ command.query['maxResults'] = max_results unless max_results.nil?
2861
+ command.query['pageToken'] = page_token unless page_token.nil?
2862
+ command.query['fields'] = fields unless fields.nil?
2863
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2864
+ execute_or_queue_command(command, &block)
2865
+ end
2866
+
2867
+ # Patch role via Apiary Patch Orchestration
2868
+ # @param [String] customer
2869
+ # Immutable ID of the Google Workspace account.
2870
+ # @param [String] role_id
2871
+ # Immutable ID of the role.
2872
+ # @param [Google::Apis::AdminDirectoryV1::Role] role_object
2873
+ # @param [String] fields
2874
+ # Selector specifying which fields to include in a partial response.
2875
+ # @param [String] quota_user
2876
+ # Available to use for quota purposes for server-side applications. Can be any
2877
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2878
+ # @param [Google::Apis::RequestOptions] options
2879
+ # Request-specific options
2880
+ #
2881
+ # @yield [result, err] Result & error if block supplied
2882
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Role] parsed result object
2883
+ # @yieldparam err [StandardError] error object if request failed
2884
+ #
2885
+ # @return [Google::Apis::AdminDirectoryV1::Role]
2886
+ #
2887
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2888
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2889
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2890
+ def patch_role(customer, role_id, role_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2891
+ command = make_simple_command(:patch, 'admin/directory/v1/customer/{customer}/roles/{roleId}', options)
2892
+ command.request_representation = Google::Apis::AdminDirectoryV1::Role::Representation
2893
+ command.request_object = role_object
2894
+ command.response_representation = Google::Apis::AdminDirectoryV1::Role::Representation
2895
+ command.response_class = Google::Apis::AdminDirectoryV1::Role
2896
+ command.params['customer'] = customer unless customer.nil?
2897
+ command.params['roleId'] = role_id unless role_id.nil?
2898
+ command.query['fields'] = fields unless fields.nil?
2899
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2900
+ execute_or_queue_command(command, &block)
2901
+ end
2902
+
2903
+ # Updates a role.
2904
+ # @param [String] customer
2905
+ # Immutable ID of the Google Workspace account.
2906
+ # @param [String] role_id
2907
+ # Immutable ID of the role.
2908
+ # @param [Google::Apis::AdminDirectoryV1::Role] role_object
2909
+ # @param [String] fields
2910
+ # Selector specifying which fields to include in a partial response.
2911
+ # @param [String] quota_user
2912
+ # Available to use for quota purposes for server-side applications. Can be any
2913
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2914
+ # @param [Google::Apis::RequestOptions] options
2915
+ # Request-specific options
2916
+ #
2917
+ # @yield [result, err] Result & error if block supplied
2918
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Role] parsed result object
2919
+ # @yieldparam err [StandardError] error object if request failed
2920
+ #
2921
+ # @return [Google::Apis::AdminDirectoryV1::Role]
2922
+ #
2923
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2924
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2925
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2926
+ def update_role(customer, role_id, role_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2927
+ command = make_simple_command(:put, 'admin/directory/v1/customer/{customer}/roles/{roleId}', options)
2928
+ command.request_representation = Google::Apis::AdminDirectoryV1::Role::Representation
2929
+ command.request_object = role_object
2930
+ command.response_representation = Google::Apis::AdminDirectoryV1::Role::Representation
2931
+ command.response_class = Google::Apis::AdminDirectoryV1::Role
2932
+ command.params['customer'] = customer unless customer.nil?
2933
+ command.params['roleId'] = role_id unless role_id.nil?
2934
+ command.query['fields'] = fields unless fields.nil?
2935
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2936
+ execute_or_queue_command(command, &block)
2937
+ end
2938
+
2939
+ # Delete schema
2940
+ # @param [String] customer_id
2941
+ # Immutable ID of the Google Workspace account.
2942
+ # @param [String] schema_key
2943
+ # Name or immutable ID of the schema.
2944
+ # @param [String] fields
2945
+ # Selector specifying which fields to include in a partial response.
2946
+ # @param [String] quota_user
2947
+ # Available to use for quota purposes for server-side applications. Can be any
2948
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2949
+ # @param [Google::Apis::RequestOptions] options
2950
+ # Request-specific options
2951
+ #
2952
+ # @yield [result, err] Result & error if block supplied
2953
+ # @yieldparam result [NilClass] No result returned for this method
2954
+ # @yieldparam err [StandardError] error object if request failed
2955
+ #
2956
+ # @return [void]
2957
+ #
2958
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2959
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2960
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2961
+ def delete_schema(customer_id, schema_key, fields: nil, quota_user: nil, options: nil, &block)
2962
+ command = make_simple_command(:delete, 'admin/directory/v1/customer/{customerId}/schemas/{schemaKey}', options)
2963
+ command.params['customerId'] = customer_id unless customer_id.nil?
2964
+ command.params['schemaKey'] = schema_key unless schema_key.nil?
2965
+ command.query['fields'] = fields unless fields.nil?
2966
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2967
+ execute_or_queue_command(command, &block)
2968
+ end
2969
+
2970
+ # Retrieve schema
2971
+ # @param [String] customer_id
2972
+ # Immutable ID of the Google Workspace account.
2973
+ # @param [String] schema_key
2974
+ # Name or immutable ID of the schema.
2975
+ # @param [String] fields
2976
+ # Selector specifying which fields to include in a partial response.
2977
+ # @param [String] quota_user
2978
+ # Available to use for quota purposes for server-side applications. Can be any
2979
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2980
+ # @param [Google::Apis::RequestOptions] options
2981
+ # Request-specific options
2982
+ #
2983
+ # @yield [result, err] Result & error if block supplied
2984
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Schema] parsed result object
2985
+ # @yieldparam err [StandardError] error object if request failed
2986
+ #
2987
+ # @return [Google::Apis::AdminDirectoryV1::Schema]
2988
+ #
2989
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2990
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2991
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2992
+ def get_schema(customer_id, schema_key, fields: nil, quota_user: nil, options: nil, &block)
2993
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/schemas/{schemaKey}', options)
2994
+ command.response_representation = Google::Apis::AdminDirectoryV1::Schema::Representation
2995
+ command.response_class = Google::Apis::AdminDirectoryV1::Schema
2996
+ command.params['customerId'] = customer_id unless customer_id.nil?
2997
+ command.params['schemaKey'] = schema_key unless schema_key.nil?
2998
+ command.query['fields'] = fields unless fields.nil?
2999
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3000
+ execute_or_queue_command(command, &block)
3001
+ end
3002
+
3003
+ # Create schema.
3004
+ # @param [String] customer_id
3005
+ # Immutable ID of the Google Workspace account.
3006
+ # @param [Google::Apis::AdminDirectoryV1::Schema] schema_object
3007
+ # @param [String] fields
3008
+ # Selector specifying which fields to include in a partial response.
3009
+ # @param [String] quota_user
3010
+ # Available to use for quota purposes for server-side applications. Can be any
3011
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3012
+ # @param [Google::Apis::RequestOptions] options
3013
+ # Request-specific options
3014
+ #
3015
+ # @yield [result, err] Result & error if block supplied
3016
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Schema] parsed result object
3017
+ # @yieldparam err [StandardError] error object if request failed
3018
+ #
3019
+ # @return [Google::Apis::AdminDirectoryV1::Schema]
3020
+ #
3021
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3022
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3023
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3024
+ def insert_schema(customer_id, schema_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3025
+ command = make_simple_command(:post, 'admin/directory/v1/customer/{customerId}/schemas', options)
3026
+ command.request_representation = Google::Apis::AdminDirectoryV1::Schema::Representation
3027
+ command.request_object = schema_object
3028
+ command.response_representation = Google::Apis::AdminDirectoryV1::Schema::Representation
3029
+ command.response_class = Google::Apis::AdminDirectoryV1::Schema
3030
+ command.params['customerId'] = customer_id unless customer_id.nil?
3031
+ command.query['fields'] = fields unless fields.nil?
3032
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3033
+ execute_or_queue_command(command, &block)
3034
+ end
3035
+
3036
+ # Retrieve all schemas for a customer
3037
+ # @param [String] customer_id
3038
+ # Immutable ID of the Google Workspace account.
3039
+ # @param [String] fields
3040
+ # Selector specifying which fields to include in a partial response.
3041
+ # @param [String] quota_user
3042
+ # Available to use for quota purposes for server-side applications. Can be any
3043
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3044
+ # @param [Google::Apis::RequestOptions] options
3045
+ # Request-specific options
3046
+ #
3047
+ # @yield [result, err] Result & error if block supplied
3048
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Schemas] parsed result object
3049
+ # @yieldparam err [StandardError] error object if request failed
3050
+ #
3051
+ # @return [Google::Apis::AdminDirectoryV1::Schemas]
3052
+ #
3053
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3054
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3055
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3056
+ def list_schemas(customer_id, fields: nil, quota_user: nil, options: nil, &block)
3057
+ command = make_simple_command(:get, 'admin/directory/v1/customer/{customerId}/schemas', options)
3058
+ command.response_representation = Google::Apis::AdminDirectoryV1::Schemas::Representation
3059
+ command.response_class = Google::Apis::AdminDirectoryV1::Schemas
3060
+ command.params['customerId'] = customer_id unless customer_id.nil?
3061
+ command.query['fields'] = fields unless fields.nil?
3062
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3063
+ execute_or_queue_command(command, &block)
3064
+ end
3065
+
3066
+ # Patch Schema via Apiary Patch Orchestration
3067
+ # @param [String] customer_id
3068
+ # Immutable ID of the Google Workspace account.
3069
+ # @param [String] schema_key
3070
+ # Name or immutable ID of the schema.
3071
+ # @param [Google::Apis::AdminDirectoryV1::Schema] schema_object
3072
+ # @param [String] fields
3073
+ # Selector specifying which fields to include in a partial response.
3074
+ # @param [String] quota_user
3075
+ # Available to use for quota purposes for server-side applications. Can be any
3076
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3077
+ # @param [Google::Apis::RequestOptions] options
3078
+ # Request-specific options
3079
+ #
3080
+ # @yield [result, err] Result & error if block supplied
3081
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Schema] parsed result object
3082
+ # @yieldparam err [StandardError] error object if request failed
3083
+ #
3084
+ # @return [Google::Apis::AdminDirectoryV1::Schema]
3085
+ #
3086
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3087
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3088
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3089
+ def patch_schema(customer_id, schema_key, schema_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3090
+ command = make_simple_command(:patch, 'admin/directory/v1/customer/{customerId}/schemas/{schemaKey}', options)
3091
+ command.request_representation = Google::Apis::AdminDirectoryV1::Schema::Representation
3092
+ command.request_object = schema_object
3093
+ command.response_representation = Google::Apis::AdminDirectoryV1::Schema::Representation
3094
+ command.response_class = Google::Apis::AdminDirectoryV1::Schema
3095
+ command.params['customerId'] = customer_id unless customer_id.nil?
3096
+ command.params['schemaKey'] = schema_key unless schema_key.nil?
3097
+ command.query['fields'] = fields unless fields.nil?
3098
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3099
+ execute_or_queue_command(command, &block)
3100
+ end
3101
+
3102
+ # Update schema
3103
+ # @param [String] customer_id
3104
+ # Immutable ID of the Google Workspace account.
3105
+ # @param [String] schema_key
3106
+ # Name or immutable ID of the schema.
3107
+ # @param [Google::Apis::AdminDirectoryV1::Schema] schema_object
3108
+ # @param [String] fields
3109
+ # Selector specifying which fields to include in a partial response.
3110
+ # @param [String] quota_user
3111
+ # Available to use for quota purposes for server-side applications. Can be any
3112
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3113
+ # @param [Google::Apis::RequestOptions] options
3114
+ # Request-specific options
3115
+ #
3116
+ # @yield [result, err] Result & error if block supplied
3117
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Schema] parsed result object
3118
+ # @yieldparam err [StandardError] error object if request failed
3119
+ #
3120
+ # @return [Google::Apis::AdminDirectoryV1::Schema]
3121
+ #
3122
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3123
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3124
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3125
+ def update_schema(customer_id, schema_key, schema_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3126
+ command = make_simple_command(:put, 'admin/directory/v1/customer/{customerId}/schemas/{schemaKey}', options)
3127
+ command.request_representation = Google::Apis::AdminDirectoryV1::Schema::Representation
3128
+ command.request_object = schema_object
3129
+ command.response_representation = Google::Apis::AdminDirectoryV1::Schema::Representation
3130
+ command.response_class = Google::Apis::AdminDirectoryV1::Schema
3131
+ command.params['customerId'] = customer_id unless customer_id.nil?
3132
+ command.params['schemaKey'] = schema_key unless schema_key.nil?
3133
+ command.query['fields'] = fields unless fields.nil?
3134
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3135
+ execute_or_queue_command(command, &block)
3136
+ end
3137
+
3138
+ # Delete all access tokens issued by a user for an application.
3139
+ # @param [String] user_key
3140
+ # Identifies the user in the API request. The value can be the user's primary
3141
+ # email address, alias email address, or unique user ID.
3142
+ # @param [String] client_id
3143
+ # The Client ID of the application the token is issued to.
3144
+ # @param [String] fields
3145
+ # Selector specifying which fields to include in a partial response.
3146
+ # @param [String] quota_user
3147
+ # Available to use for quota purposes for server-side applications. Can be any
3148
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3149
+ # @param [Google::Apis::RequestOptions] options
3150
+ # Request-specific options
3151
+ #
3152
+ # @yield [result, err] Result & error if block supplied
3153
+ # @yieldparam result [NilClass] No result returned for this method
3154
+ # @yieldparam err [StandardError] error object if request failed
3155
+ #
3156
+ # @return [void]
3157
+ #
3158
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3159
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3160
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3161
+ def delete_token(user_key, client_id, fields: nil, quota_user: nil, options: nil, &block)
3162
+ command = make_simple_command(:delete, 'admin/directory/v1/users/{userKey}/tokens/{clientId}', options)
3163
+ command.params['userKey'] = user_key unless user_key.nil?
3164
+ command.params['clientId'] = client_id unless client_id.nil?
3165
+ command.query['fields'] = fields unless fields.nil?
3166
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3167
+ execute_or_queue_command(command, &block)
3168
+ end
3169
+
3170
+ # Get information about an access token issued by a user.
3171
+ # @param [String] user_key
3172
+ # Identifies the user in the API request. The value can be the user's primary
3173
+ # email address, alias email address, or unique user ID.
3174
+ # @param [String] client_id
3175
+ # The Client ID of the application the token is issued to.
3176
+ # @param [String] fields
3177
+ # Selector specifying which fields to include in a partial response.
3178
+ # @param [String] quota_user
3179
+ # Available to use for quota purposes for server-side applications. Can be any
3180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3181
+ # @param [Google::Apis::RequestOptions] options
3182
+ # Request-specific options
3183
+ #
3184
+ # @yield [result, err] Result & error if block supplied
3185
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Token] parsed result object
3186
+ # @yieldparam err [StandardError] error object if request failed
3187
+ #
3188
+ # @return [Google::Apis::AdminDirectoryV1::Token]
3189
+ #
3190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3193
+ def get_token(user_key, client_id, fields: nil, quota_user: nil, options: nil, &block)
3194
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}/tokens/{clientId}', options)
3195
+ command.response_representation = Google::Apis::AdminDirectoryV1::Token::Representation
3196
+ command.response_class = Google::Apis::AdminDirectoryV1::Token
3197
+ command.params['userKey'] = user_key unless user_key.nil?
3198
+ command.params['clientId'] = client_id unless client_id.nil?
3199
+ command.query['fields'] = fields unless fields.nil?
3200
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3201
+ execute_or_queue_command(command, &block)
3202
+ end
3203
+
3204
+ # Returns the set of tokens specified user has issued to 3rd party applications.
3205
+ # @param [String] user_key
3206
+ # Identifies the user in the API request. The value can be the user's primary
3207
+ # email address, alias email address, or unique user ID.
3208
+ # @param [String] fields
3209
+ # Selector specifying which fields to include in a partial response.
3210
+ # @param [String] quota_user
3211
+ # Available to use for quota purposes for server-side applications. Can be any
3212
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3213
+ # @param [Google::Apis::RequestOptions] options
3214
+ # Request-specific options
3215
+ #
3216
+ # @yield [result, err] Result & error if block supplied
3217
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Tokens] parsed result object
3218
+ # @yieldparam err [StandardError] error object if request failed
3219
+ #
3220
+ # @return [Google::Apis::AdminDirectoryV1::Tokens]
3221
+ #
3222
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3223
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3224
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3225
+ def list_tokens(user_key, fields: nil, quota_user: nil, options: nil, &block)
3226
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}/tokens', options)
3227
+ command.response_representation = Google::Apis::AdminDirectoryV1::Tokens::Representation
3228
+ command.response_class = Google::Apis::AdminDirectoryV1::Tokens
3229
+ command.params['userKey'] = user_key unless user_key.nil?
3230
+ command.query['fields'] = fields unless fields.nil?
3231
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3232
+ execute_or_queue_command(command, &block)
3233
+ end
3234
+
3235
+ # Turn off 2-Step Verification for user.
3236
+ # @param [String] user_key
3237
+ # Identifies the user in the API request. The value can be the user's primary
3238
+ # email address, alias email address, or unique user ID.
3239
+ # @param [String] fields
3240
+ # Selector specifying which fields to include in a partial response.
3241
+ # @param [String] quota_user
3242
+ # Available to use for quota purposes for server-side applications. Can be any
3243
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3244
+ # @param [Google::Apis::RequestOptions] options
3245
+ # Request-specific options
3246
+ #
3247
+ # @yield [result, err] Result & error if block supplied
3248
+ # @yieldparam result [NilClass] No result returned for this method
3249
+ # @yieldparam err [StandardError] error object if request failed
3250
+ #
3251
+ # @return [void]
3252
+ #
3253
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3254
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3255
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3256
+ def turn_two_step_verification_off(user_key, fields: nil, quota_user: nil, options: nil, &block)
3257
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/twoStepVerification/turnOff', options)
3258
+ command.params['userKey'] = user_key unless user_key.nil?
3259
+ command.query['fields'] = fields unless fields.nil?
3260
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3261
+ execute_or_queue_command(command, &block)
3262
+ end
3263
+
3264
+ # Deletes a user.
3265
+ # @param [String] user_key
3266
+ # Identifies the user in the API request. The value can be the user's primary
3267
+ # email address, alias email address, or unique user ID.
3268
+ # @param [String] fields
3269
+ # Selector specifying which fields to include in a partial response.
3270
+ # @param [String] quota_user
3271
+ # Available to use for quota purposes for server-side applications. Can be any
3272
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3273
+ # @param [Google::Apis::RequestOptions] options
3274
+ # Request-specific options
3275
+ #
3276
+ # @yield [result, err] Result & error if block supplied
3277
+ # @yieldparam result [NilClass] No result returned for this method
3278
+ # @yieldparam err [StandardError] error object if request failed
3279
+ #
3280
+ # @return [void]
3281
+ #
3282
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3283
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3284
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3285
+ def delete_user(user_key, fields: nil, quota_user: nil, options: nil, &block)
3286
+ command = make_simple_command(:delete, 'admin/directory/v1/users/{userKey}', options)
3287
+ command.params['userKey'] = user_key unless user_key.nil?
3288
+ command.query['fields'] = fields unless fields.nil?
3289
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3290
+ execute_or_queue_command(command, &block)
3291
+ end
3292
+
3293
+ # Retrieves a user.
3294
+ # @param [String] user_key
3295
+ # Identifies the user in the API request. The value can be the user's primary
3296
+ # email address, alias email address, or unique user ID.
3297
+ # @param [String] custom_field_mask
3298
+ # A comma-separated list of schema names. All fields from these schemas are
3299
+ # fetched. This should only be set when `projection=custom`.
3300
+ # @param [String] projection
3301
+ # What subset of fields to fetch for this user.
3302
+ # @param [String] view_type
3303
+ # Whether to fetch the administrator-only or domain-wide public view of the user.
3304
+ # For more information, see [Retrieve a user as a non-administrator](/admin-sdk/
3305
+ # directory/v1/guides/manage-users#retrieve_users_non_admin).
3306
+ # @param [String] fields
3307
+ # Selector specifying which fields to include in a partial response.
3308
+ # @param [String] quota_user
3309
+ # Available to use for quota purposes for server-side applications. Can be any
3310
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3311
+ # @param [Google::Apis::RequestOptions] options
3312
+ # Request-specific options
3313
+ #
3314
+ # @yield [result, err] Result & error if block supplied
3315
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::User] parsed result object
3316
+ # @yieldparam err [StandardError] error object if request failed
3317
+ #
3318
+ # @return [Google::Apis::AdminDirectoryV1::User]
3319
+ #
3320
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3321
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3322
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3323
+ def get_user(user_key, custom_field_mask: nil, projection: nil, view_type: nil, fields: nil, quota_user: nil, options: nil, &block)
3324
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}', options)
3325
+ command.response_representation = Google::Apis::AdminDirectoryV1::User::Representation
3326
+ command.response_class = Google::Apis::AdminDirectoryV1::User
3327
+ command.params['userKey'] = user_key unless user_key.nil?
3328
+ command.query['customFieldMask'] = custom_field_mask unless custom_field_mask.nil?
3329
+ command.query['projection'] = projection unless projection.nil?
3330
+ command.query['viewType'] = view_type unless view_type.nil?
3331
+ command.query['fields'] = fields unless fields.nil?
3332
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3333
+ execute_or_queue_command(command, &block)
3334
+ end
3335
+
3336
+ # Creates a user.
3337
+ # @param [Google::Apis::AdminDirectoryV1::User] user_object
3338
+ # @param [String] fields
3339
+ # Selector specifying which fields to include in a partial response.
3340
+ # @param [String] quota_user
3341
+ # Available to use for quota purposes for server-side applications. Can be any
3342
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3343
+ # @param [Google::Apis::RequestOptions] options
3344
+ # Request-specific options
3345
+ #
3346
+ # @yield [result, err] Result & error if block supplied
3347
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::User] parsed result object
3348
+ # @yieldparam err [StandardError] error object if request failed
3349
+ #
3350
+ # @return [Google::Apis::AdminDirectoryV1::User]
3351
+ #
3352
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3353
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3354
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3355
+ def insert_user(user_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3356
+ command = make_simple_command(:post, 'admin/directory/v1/users', options)
3357
+ command.request_representation = Google::Apis::AdminDirectoryV1::User::Representation
3358
+ command.request_object = user_object
3359
+ command.response_representation = Google::Apis::AdminDirectoryV1::User::Representation
3360
+ command.response_class = Google::Apis::AdminDirectoryV1::User
3361
+ command.query['fields'] = fields unless fields.nil?
3362
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3363
+ execute_or_queue_command(command, &block)
3364
+ end
3365
+
3366
+ # Retrieves a paginated list of either deleted users or all users in a domain.
3367
+ # @param [String] custom_field_mask
3368
+ # A comma-separated list of schema names. All fields from these schemas are
3369
+ # fetched. This should only be set when `projection=custom`.
3370
+ # @param [String] customer
3371
+ # The unique ID for the customer's Google Workspace account. In case of a multi-
3372
+ # domain account, to fetch all groups for a customer, fill this field instead of
3373
+ # domain. You can also use the `my_customer` alias to represent your account's `
3374
+ # customerId`. The `customerId` is also returned as part of the [Users resource](
3375
+ # /admin-sdk/directory/v1/reference/users). Either the `customer` or the `domain`
3376
+ # parameter must be provided.
3377
+ # @param [String] domain
3378
+ # The domain name. Use this field to get fields from only one domain. To return
3379
+ # all domains for a customer account, use the `customer` query parameter instead.
3380
+ # Either the `customer` or the `domain` parameter must be provided.
3381
+ # @param [Fixnum] max_results
3382
+ # Maximum number of results to return.
3383
+ # @param [String] order_by
3384
+ # Property to use for sorting results.
3385
+ # @param [String] page_token
3386
+ # Token to specify next page in the list
3387
+ # @param [String] projection
3388
+ # What subset of fields to fetch for this user.
3389
+ # @param [String] query
3390
+ # Query string for searching user fields. For more information on constructing
3391
+ # user queries, see [Search for Users](/admin-sdk/directory/v1/guides/search-
3392
+ # users).
3393
+ # @param [String] show_deleted
3394
+ # If set to `true`, retrieves the list of deleted users. (Default: `false`)
3395
+ # @param [String] sort_order
3396
+ # Whether to return results in ascending or descending order.
3397
+ # @param [String] view_type
3398
+ # Whether to fetch the administrator-only or domain-wide public view of the user.
3399
+ # For more information, see [Retrieve a user as a non-administrator](/admin-sdk/
3400
+ # directory/v1/guides/manage-users#retrieve_users_non_admin).
3401
+ # @param [String] fields
3402
+ # Selector specifying which fields to include in a partial response.
3403
+ # @param [String] quota_user
3404
+ # Available to use for quota purposes for server-side applications. Can be any
3405
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3406
+ # @param [Google::Apis::RequestOptions] options
3407
+ # Request-specific options
3408
+ #
3409
+ # @yield [result, err] Result & error if block supplied
3410
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Users] parsed result object
3411
+ # @yieldparam err [StandardError] error object if request failed
3412
+ #
3413
+ # @return [Google::Apis::AdminDirectoryV1::Users]
3414
+ #
3415
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3416
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3417
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3418
+ def list_users(custom_field_mask: nil, customer: nil, domain: nil, max_results: nil, order_by: nil, page_token: nil, projection: nil, query: nil, show_deleted: nil, sort_order: nil, view_type: nil, fields: nil, quota_user: nil, options: nil, &block)
3419
+ command = make_simple_command(:get, 'admin/directory/v1/users', options)
3420
+ command.response_representation = Google::Apis::AdminDirectoryV1::Users::Representation
3421
+ command.response_class = Google::Apis::AdminDirectoryV1::Users
3422
+ command.query['customFieldMask'] = custom_field_mask unless custom_field_mask.nil?
3423
+ command.query['customer'] = customer unless customer.nil?
3424
+ command.query['domain'] = domain unless domain.nil?
3425
+ command.query['maxResults'] = max_results unless max_results.nil?
3426
+ command.query['orderBy'] = order_by unless order_by.nil?
3427
+ command.query['pageToken'] = page_token unless page_token.nil?
3428
+ command.query['projection'] = projection unless projection.nil?
3429
+ command.query['query'] = query unless query.nil?
3430
+ command.query['showDeleted'] = show_deleted unless show_deleted.nil?
3431
+ command.query['sortOrder'] = sort_order unless sort_order.nil?
3432
+ command.query['viewType'] = view_type unless view_type.nil?
3433
+ command.query['fields'] = fields unless fields.nil?
3434
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3435
+ execute_or_queue_command(command, &block)
3436
+ end
3437
+
3438
+ # Makes a user a super administrator.
3439
+ # @param [String] user_key
3440
+ # Identifies the user in the API request. The value can be the user's primary
3441
+ # email address, alias email address, or unique user ID.
3442
+ # @param [Google::Apis::AdminDirectoryV1::UserMakeAdmin] user_make_admin_object
3443
+ # @param [String] fields
3444
+ # Selector specifying which fields to include in a partial response.
3445
+ # @param [String] quota_user
3446
+ # Available to use for quota purposes for server-side applications. Can be any
3447
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3448
+ # @param [Google::Apis::RequestOptions] options
3449
+ # Request-specific options
3450
+ #
3451
+ # @yield [result, err] Result & error if block supplied
3452
+ # @yieldparam result [NilClass] No result returned for this method
3453
+ # @yieldparam err [StandardError] error object if request failed
3454
+ #
3455
+ # @return [void]
3456
+ #
3457
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3458
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3459
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3460
+ def make_user_admin(user_key, user_make_admin_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3461
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/makeAdmin', options)
3462
+ command.request_representation = Google::Apis::AdminDirectoryV1::UserMakeAdmin::Representation
3463
+ command.request_object = user_make_admin_object
3464
+ command.params['userKey'] = user_key unless user_key.nil?
3465
+ command.query['fields'] = fields unless fields.nil?
3466
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3467
+ execute_or_queue_command(command, &block)
3468
+ end
3469
+
3470
+ # Updates a user using patch semantics. The update method should be used instead,
3471
+ # since it also supports patch semantics and has better performance. This
3472
+ # method is unable to clear fields that contain repeated objects (`addresses`, `
3473
+ # phones`, etc). Use the update method instead.
3474
+ # @param [String] user_key
3475
+ # Identifies the user in the API request. The value can be the user's primary
3476
+ # email address, alias email address, or unique user ID.
3477
+ # @param [Google::Apis::AdminDirectoryV1::User] user_object
3478
+ # @param [String] fields
3479
+ # Selector specifying which fields to include in a partial response.
3480
+ # @param [String] quota_user
3481
+ # Available to use for quota purposes for server-side applications. Can be any
3482
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3483
+ # @param [Google::Apis::RequestOptions] options
3484
+ # Request-specific options
3485
+ #
3486
+ # @yield [result, err] Result & error if block supplied
3487
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::User] parsed result object
3488
+ # @yieldparam err [StandardError] error object if request failed
3489
+ #
3490
+ # @return [Google::Apis::AdminDirectoryV1::User]
3491
+ #
3492
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3493
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3494
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3495
+ def patch_user(user_key, user_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3496
+ command = make_simple_command(:patch, 'admin/directory/v1/users/{userKey}', options)
3497
+ command.request_representation = Google::Apis::AdminDirectoryV1::User::Representation
3498
+ command.request_object = user_object
3499
+ command.response_representation = Google::Apis::AdminDirectoryV1::User::Representation
3500
+ command.response_class = Google::Apis::AdminDirectoryV1::User
3501
+ command.params['userKey'] = user_key unless user_key.nil?
3502
+ command.query['fields'] = fields unless fields.nil?
3503
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3504
+ execute_or_queue_command(command, &block)
3505
+ end
3506
+
3507
+ # Sign a user out of all web and device sessions and reset their sign-in cookies.
3508
+ # User will have to sign in by authenticating again.
3509
+ # @param [String] user_key
3510
+ # Identifies the target user in the API request. The value can be the user's
3511
+ # primary email address, alias email address, or unique user ID.
3512
+ # @param [String] fields
3513
+ # Selector specifying which fields to include in a partial response.
3514
+ # @param [String] quota_user
3515
+ # Available to use for quota purposes for server-side applications. Can be any
3516
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3517
+ # @param [Google::Apis::RequestOptions] options
3518
+ # Request-specific options
3519
+ #
3520
+ # @yield [result, err] Result & error if block supplied
3521
+ # @yieldparam result [NilClass] No result returned for this method
3522
+ # @yieldparam err [StandardError] error object if request failed
3523
+ #
3524
+ # @return [void]
3525
+ #
3526
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3527
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3528
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3529
+ def sign_user_out(user_key, fields: nil, quota_user: nil, options: nil, &block)
3530
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/signOut', options)
3531
+ command.params['userKey'] = user_key unless user_key.nil?
3532
+ command.query['fields'] = fields unless fields.nil?
3533
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3534
+ execute_or_queue_command(command, &block)
3535
+ end
3536
+
3537
+ # Undeletes a deleted user.
3538
+ # @param [String] user_key
3539
+ # The immutable id of the user
3540
+ # @param [Google::Apis::AdminDirectoryV1::UserUndelete] user_undelete_object
3541
+ # @param [String] fields
3542
+ # Selector specifying which fields to include in a partial response.
3543
+ # @param [String] quota_user
3544
+ # Available to use for quota purposes for server-side applications. Can be any
3545
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3546
+ # @param [Google::Apis::RequestOptions] options
3547
+ # Request-specific options
3548
+ #
3549
+ # @yield [result, err] Result & error if block supplied
3550
+ # @yieldparam result [NilClass] No result returned for this method
3551
+ # @yieldparam err [StandardError] error object if request failed
3552
+ #
3553
+ # @return [void]
3554
+ #
3555
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3556
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3557
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3558
+ def undelete_user(user_key, user_undelete_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3559
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/undelete', options)
3560
+ command.request_representation = Google::Apis::AdminDirectoryV1::UserUndelete::Representation
3561
+ command.request_object = user_undelete_object
3562
+ command.params['userKey'] = user_key unless user_key.nil?
3563
+ command.query['fields'] = fields unless fields.nil?
3564
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3565
+ execute_or_queue_command(command, &block)
3566
+ end
3567
+
3568
+ # Updates a user. This method supports patch semantics, meaning you only need to
3569
+ # include the fields you wish to update. Fields that are not present in the
3570
+ # request will be preserved, and fields set to `null` will be cleared.
3571
+ # @param [String] user_key
3572
+ # Identifies the user in the API request. The value can be the user's primary
3573
+ # email address, alias email address, or unique user ID.
3574
+ # @param [Google::Apis::AdminDirectoryV1::User] user_object
3575
+ # @param [String] fields
3576
+ # Selector specifying which fields to include in a partial response.
3577
+ # @param [String] quota_user
3578
+ # Available to use for quota purposes for server-side applications. Can be any
3579
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3580
+ # @param [Google::Apis::RequestOptions] options
3581
+ # Request-specific options
3582
+ #
3583
+ # @yield [result, err] Result & error if block supplied
3584
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::User] parsed result object
3585
+ # @yieldparam err [StandardError] error object if request failed
3586
+ #
3587
+ # @return [Google::Apis::AdminDirectoryV1::User]
3588
+ #
3589
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3590
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3591
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3592
+ def update_user(user_key, user_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3593
+ command = make_simple_command(:put, 'admin/directory/v1/users/{userKey}', options)
3594
+ command.request_representation = Google::Apis::AdminDirectoryV1::User::Representation
3595
+ command.request_object = user_object
3596
+ command.response_representation = Google::Apis::AdminDirectoryV1::User::Representation
3597
+ command.response_class = Google::Apis::AdminDirectoryV1::User
3598
+ command.params['userKey'] = user_key unless user_key.nil?
3599
+ command.query['fields'] = fields unless fields.nil?
3600
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3601
+ execute_or_queue_command(command, &block)
3602
+ end
3603
+
3604
+ # Watch for changes in users list
3605
+ # @param [Google::Apis::AdminDirectoryV1::Channel] channel_object
3606
+ # @param [String] custom_field_mask
3607
+ # Comma-separated list of schema names. All fields from these schemas are
3608
+ # fetched. This should only be set when projection=custom.
3609
+ # @param [String] customer
3610
+ # Immutable ID of the Google Workspace account. In case of multi-domain, to
3611
+ # fetch all users for a customer, fill this field instead of domain.
3612
+ # @param [String] domain
3613
+ # Name of the domain. Fill this field to get users from only this domain. To
3614
+ # return all users in a multi-domain fill customer field instead."
3615
+ # @param [String] event
3616
+ # Events to watch for.
3617
+ # @param [Fixnum] max_results
3618
+ # Maximum number of results to return.
3619
+ # @param [String] order_by
3620
+ # Column to use for sorting results
3621
+ # @param [String] page_token
3622
+ # Token to specify next page in the list
3623
+ # @param [String] projection
3624
+ # What subset of fields to fetch for this user.
3625
+ # @param [String] query
3626
+ # Query string search. Should be of the form "". Complete documentation is at
3627
+ # https: //developers.google.com/admin-sdk/directory/v1/guides/search-users
3628
+ # @param [String] show_deleted
3629
+ # If set to true, retrieves the list of deleted users. (Default: false)
3630
+ # @param [String] sort_order
3631
+ # Whether to return results in ascending or descending order.
3632
+ # @param [String] view_type
3633
+ # Whether to fetch the administrator-only or domain-wide public view of the user.
3634
+ # For more information, see [Retrieve a user as a non-administrator](/admin-sdk/
3635
+ # directory/v1/guides/manage-users#retrieve_users_non_admin).
3636
+ # @param [String] fields
3637
+ # Selector specifying which fields to include in a partial response.
3638
+ # @param [String] quota_user
3639
+ # Available to use for quota purposes for server-side applications. Can be any
3640
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3641
+ # @param [Google::Apis::RequestOptions] options
3642
+ # Request-specific options
3643
+ #
3644
+ # @yield [result, err] Result & error if block supplied
3645
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Channel] parsed result object
3646
+ # @yieldparam err [StandardError] error object if request failed
3647
+ #
3648
+ # @return [Google::Apis::AdminDirectoryV1::Channel]
3649
+ #
3650
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3651
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3652
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3653
+ def watch_user(channel_object = nil, custom_field_mask: nil, customer: nil, domain: nil, event: nil, max_results: nil, order_by: nil, page_token: nil, projection: nil, query: nil, show_deleted: nil, sort_order: nil, view_type: nil, fields: nil, quota_user: nil, options: nil, &block)
3654
+ command = make_simple_command(:post, 'admin/directory/v1/users/watch', options)
3655
+ command.request_representation = Google::Apis::AdminDirectoryV1::Channel::Representation
3656
+ command.request_object = channel_object
3657
+ command.response_representation = Google::Apis::AdminDirectoryV1::Channel::Representation
3658
+ command.response_class = Google::Apis::AdminDirectoryV1::Channel
3659
+ command.query['customFieldMask'] = custom_field_mask unless custom_field_mask.nil?
3660
+ command.query['customer'] = customer unless customer.nil?
3661
+ command.query['domain'] = domain unless domain.nil?
3662
+ command.query['event'] = event unless event.nil?
3663
+ command.query['maxResults'] = max_results unless max_results.nil?
3664
+ command.query['orderBy'] = order_by unless order_by.nil?
3665
+ command.query['pageToken'] = page_token unless page_token.nil?
3666
+ command.query['projection'] = projection unless projection.nil?
3667
+ command.query['query'] = query unless query.nil?
3668
+ command.query['showDeleted'] = show_deleted unless show_deleted.nil?
3669
+ command.query['sortOrder'] = sort_order unless sort_order.nil?
3670
+ command.query['viewType'] = view_type unless view_type.nil?
3671
+ command.query['fields'] = fields unless fields.nil?
3672
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3673
+ execute_or_queue_command(command, &block)
3674
+ end
3675
+
3676
+ # Removes an alias.
3677
+ # @param [String] user_key
3678
+ # Identifies the user in the API request. The value can be the user's primary
3679
+ # email address, alias email address, or unique user ID.
3680
+ # @param [String] user_alias
3681
+ # The alias to be removed.
3682
+ # @param [String] fields
3683
+ # Selector specifying which fields to include in a partial response.
3684
+ # @param [String] quota_user
3685
+ # Available to use for quota purposes for server-side applications. Can be any
3686
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3687
+ # @param [Google::Apis::RequestOptions] options
3688
+ # Request-specific options
3689
+ #
3690
+ # @yield [result, err] Result & error if block supplied
3691
+ # @yieldparam result [NilClass] No result returned for this method
3692
+ # @yieldparam err [StandardError] error object if request failed
3693
+ #
3694
+ # @return [void]
3695
+ #
3696
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3697
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3698
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3699
+ def delete_user_alias(user_key, user_alias, fields: nil, quota_user: nil, options: nil, &block)
3700
+ command = make_simple_command(:delete, 'admin/directory/v1/users/{userKey}/aliases/{alias}', options)
3701
+ command.params['userKey'] = user_key unless user_key.nil?
3702
+ command.params['alias'] = user_alias unless user_alias.nil?
3703
+ command.query['fields'] = fields unless fields.nil?
3704
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3705
+ execute_or_queue_command(command, &block)
3706
+ end
3707
+
3708
+ # Adds an alias.
3709
+ # @param [String] user_key
3710
+ # Identifies the user in the API request. The value can be the user's primary
3711
+ # email address, alias email address, or unique user ID.
3712
+ # @param [Google::Apis::AdminDirectoryV1::Alias] alias_object
3713
+ # @param [String] fields
3714
+ # Selector specifying which fields to include in a partial response.
3715
+ # @param [String] quota_user
3716
+ # Available to use for quota purposes for server-side applications. Can be any
3717
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3718
+ # @param [Google::Apis::RequestOptions] options
3719
+ # Request-specific options
3720
+ #
3721
+ # @yield [result, err] Result & error if block supplied
3722
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Alias] parsed result object
3723
+ # @yieldparam err [StandardError] error object if request failed
3724
+ #
3725
+ # @return [Google::Apis::AdminDirectoryV1::Alias]
3726
+ #
3727
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3728
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3729
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3730
+ def insert_user_alias(user_key, alias_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3731
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/aliases', options)
3732
+ command.request_representation = Google::Apis::AdminDirectoryV1::Alias::Representation
3733
+ command.request_object = alias_object
3734
+ command.response_representation = Google::Apis::AdminDirectoryV1::Alias::Representation
3735
+ command.response_class = Google::Apis::AdminDirectoryV1::Alias
3736
+ command.params['userKey'] = user_key unless user_key.nil?
3737
+ command.query['fields'] = fields unless fields.nil?
3738
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3739
+ execute_or_queue_command(command, &block)
3740
+ end
3741
+
3742
+ # Lists all aliases for a user.
3743
+ # @param [String] user_key
3744
+ # Identifies the user in the API request. The value can be the user's primary
3745
+ # email address, alias email address, or unique user ID.
3746
+ # @param [String] fields
3747
+ # Selector specifying which fields to include in a partial response.
3748
+ # @param [String] quota_user
3749
+ # Available to use for quota purposes for server-side applications. Can be any
3750
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3751
+ # @param [Google::Apis::RequestOptions] options
3752
+ # Request-specific options
3753
+ #
3754
+ # @yield [result, err] Result & error if block supplied
3755
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Aliases] parsed result object
3756
+ # @yieldparam err [StandardError] error object if request failed
3757
+ #
3758
+ # @return [Google::Apis::AdminDirectoryV1::Aliases]
3759
+ #
3760
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3761
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3762
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3763
+ def list_user_aliases(user_key, fields: nil, quota_user: nil, options: nil, &block)
3764
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}/aliases', options)
3765
+ command.response_representation = Google::Apis::AdminDirectoryV1::Aliases::Representation
3766
+ command.response_class = Google::Apis::AdminDirectoryV1::Aliases
3767
+ command.params['userKey'] = user_key unless user_key.nil?
3768
+ command.query['fields'] = fields unless fields.nil?
3769
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3770
+ execute_or_queue_command(command, &block)
3771
+ end
3772
+
3773
+ # Watch for changes in users list.
3774
+ # @param [String] user_key
3775
+ # Email or immutable ID of the user
3776
+ # @param [Google::Apis::AdminDirectoryV1::Channel] channel_object
3777
+ # @param [String] event
3778
+ # Events to watch for.
3779
+ # @param [String] fields
3780
+ # Selector specifying which fields to include in a partial response.
3781
+ # @param [String] quota_user
3782
+ # Available to use for quota purposes for server-side applications. Can be any
3783
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3784
+ # @param [Google::Apis::RequestOptions] options
3785
+ # Request-specific options
3786
+ #
3787
+ # @yield [result, err] Result & error if block supplied
3788
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::Channel] parsed result object
3789
+ # @yieldparam err [StandardError] error object if request failed
3790
+ #
3791
+ # @return [Google::Apis::AdminDirectoryV1::Channel]
3792
+ #
3793
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3794
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3795
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3796
+ def watch_user_alias(user_key, channel_object = nil, event: nil, fields: nil, quota_user: nil, options: nil, &block)
3797
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/aliases/watch', options)
3798
+ command.request_representation = Google::Apis::AdminDirectoryV1::Channel::Representation
3799
+ command.request_object = channel_object
3800
+ command.response_representation = Google::Apis::AdminDirectoryV1::Channel::Representation
3801
+ command.response_class = Google::Apis::AdminDirectoryV1::Channel
3802
+ command.params['userKey'] = user_key unless user_key.nil?
3803
+ command.query['event'] = event unless event.nil?
3804
+ command.query['fields'] = fields unless fields.nil?
3805
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3806
+ execute_or_queue_command(command, &block)
3807
+ end
3808
+
3809
+ # Removes the user's photo.
3810
+ # @param [String] user_key
3811
+ # Identifies the user in the API request. The value can be the user's primary
3812
+ # email address, alias email address, or unique user ID.
3813
+ # @param [String] fields
3814
+ # Selector specifying which fields to include in a partial response.
3815
+ # @param [String] quota_user
3816
+ # Available to use for quota purposes for server-side applications. Can be any
3817
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3818
+ # @param [Google::Apis::RequestOptions] options
3819
+ # Request-specific options
3820
+ #
3821
+ # @yield [result, err] Result & error if block supplied
3822
+ # @yieldparam result [NilClass] No result returned for this method
3823
+ # @yieldparam err [StandardError] error object if request failed
3824
+ #
3825
+ # @return [void]
3826
+ #
3827
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3828
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3829
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3830
+ def delete_user_photo(user_key, fields: nil, quota_user: nil, options: nil, &block)
3831
+ command = make_simple_command(:delete, 'admin/directory/v1/users/{userKey}/photos/thumbnail', options)
3832
+ command.params['userKey'] = user_key unless user_key.nil?
3833
+ command.query['fields'] = fields unless fields.nil?
3834
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3835
+ execute_or_queue_command(command, &block)
3836
+ end
3837
+
3838
+ # Retrieves the user's photo.
3839
+ # @param [String] user_key
3840
+ # Identifies the user in the API request. The value can be the user's primary
3841
+ # email address, alias email address, or unique user ID.
3842
+ # @param [String] fields
3843
+ # Selector specifying which fields to include in a partial response.
3844
+ # @param [String] quota_user
3845
+ # Available to use for quota purposes for server-side applications. Can be any
3846
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3847
+ # @param [Google::Apis::RequestOptions] options
3848
+ # Request-specific options
3849
+ #
3850
+ # @yield [result, err] Result & error if block supplied
3851
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::UserPhoto] parsed result object
3852
+ # @yieldparam err [StandardError] error object if request failed
3853
+ #
3854
+ # @return [Google::Apis::AdminDirectoryV1::UserPhoto]
3855
+ #
3856
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3857
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3858
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3859
+ def get_user_photo(user_key, fields: nil, quota_user: nil, options: nil, &block)
3860
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}/photos/thumbnail', options)
3861
+ command.response_representation = Google::Apis::AdminDirectoryV1::UserPhoto::Representation
3862
+ command.response_class = Google::Apis::AdminDirectoryV1::UserPhoto
3863
+ command.params['userKey'] = user_key unless user_key.nil?
3864
+ command.query['fields'] = fields unless fields.nil?
3865
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3866
+ execute_or_queue_command(command, &block)
3867
+ end
3868
+
3869
+ # Adds a photo for the user. This method supports [patch semantics](/admin-sdk/
3870
+ # directory/v1/guides/performance#patch).
3871
+ # @param [String] user_key
3872
+ # Identifies the user in the API request. The value can be the user's primary
3873
+ # email address, alias email address, or unique user ID.
3874
+ # @param [Google::Apis::AdminDirectoryV1::UserPhoto] user_photo_object
3875
+ # @param [String] fields
3876
+ # Selector specifying which fields to include in a partial response.
3877
+ # @param [String] quota_user
3878
+ # Available to use for quota purposes for server-side applications. Can be any
3879
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3880
+ # @param [Google::Apis::RequestOptions] options
3881
+ # Request-specific options
3882
+ #
3883
+ # @yield [result, err] Result & error if block supplied
3884
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::UserPhoto] parsed result object
3885
+ # @yieldparam err [StandardError] error object if request failed
3886
+ #
3887
+ # @return [Google::Apis::AdminDirectoryV1::UserPhoto]
3888
+ #
3889
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3890
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3891
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3892
+ def patch_user_photo(user_key, user_photo_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3893
+ command = make_simple_command(:patch, 'admin/directory/v1/users/{userKey}/photos/thumbnail', options)
3894
+ command.request_representation = Google::Apis::AdminDirectoryV1::UserPhoto::Representation
3895
+ command.request_object = user_photo_object
3896
+ command.response_representation = Google::Apis::AdminDirectoryV1::UserPhoto::Representation
3897
+ command.response_class = Google::Apis::AdminDirectoryV1::UserPhoto
3898
+ command.params['userKey'] = user_key unless user_key.nil?
3899
+ command.query['fields'] = fields unless fields.nil?
3900
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3901
+ execute_or_queue_command(command, &block)
3902
+ end
3903
+
3904
+ # Adds a photo for the user.
3905
+ # @param [String] user_key
3906
+ # Identifies the user in the API request. The value can be the user's primary
3907
+ # email address, alias email address, or unique user ID.
3908
+ # @param [Google::Apis::AdminDirectoryV1::UserPhoto] user_photo_object
3909
+ # @param [String] fields
3910
+ # Selector specifying which fields to include in a partial response.
3911
+ # @param [String] quota_user
3912
+ # Available to use for quota purposes for server-side applications. Can be any
3913
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3914
+ # @param [Google::Apis::RequestOptions] options
3915
+ # Request-specific options
3916
+ #
3917
+ # @yield [result, err] Result & error if block supplied
3918
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::UserPhoto] parsed result object
3919
+ # @yieldparam err [StandardError] error object if request failed
3920
+ #
3921
+ # @return [Google::Apis::AdminDirectoryV1::UserPhoto]
3922
+ #
3923
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3924
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3925
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3926
+ def update_user_photo(user_key, user_photo_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3927
+ command = make_simple_command(:put, 'admin/directory/v1/users/{userKey}/photos/thumbnail', options)
3928
+ command.request_representation = Google::Apis::AdminDirectoryV1::UserPhoto::Representation
3929
+ command.request_object = user_photo_object
3930
+ command.response_representation = Google::Apis::AdminDirectoryV1::UserPhoto::Representation
3931
+ command.response_class = Google::Apis::AdminDirectoryV1::UserPhoto
3932
+ command.params['userKey'] = user_key unless user_key.nil?
3933
+ command.query['fields'] = fields unless fields.nil?
3934
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3935
+ execute_or_queue_command(command, &block)
3936
+ end
3937
+
3938
+ # Generate new backup verification codes for the user.
3939
+ # @param [String] user_key
3940
+ # Email or immutable ID of the user
3941
+ # @param [String] fields
3942
+ # Selector specifying which fields to include in a partial response.
3943
+ # @param [String] quota_user
3944
+ # Available to use for quota purposes for server-side applications. Can be any
3945
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3946
+ # @param [Google::Apis::RequestOptions] options
3947
+ # Request-specific options
3948
+ #
3949
+ # @yield [result, err] Result & error if block supplied
3950
+ # @yieldparam result [NilClass] No result returned for this method
3951
+ # @yieldparam err [StandardError] error object if request failed
3952
+ #
3953
+ # @return [void]
3954
+ #
3955
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3956
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3957
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3958
+ def generate_verification_code(user_key, fields: nil, quota_user: nil, options: nil, &block)
3959
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/verificationCodes/generate', options)
3960
+ command.params['userKey'] = user_key unless user_key.nil?
3961
+ command.query['fields'] = fields unless fields.nil?
3962
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3963
+ execute_or_queue_command(command, &block)
3964
+ end
3965
+
3966
+ # Invalidate the current backup verification codes for the user.
3967
+ # @param [String] user_key
3968
+ # Email or immutable ID of the user
3969
+ # @param [String] fields
3970
+ # Selector specifying which fields to include in a partial response.
3971
+ # @param [String] quota_user
3972
+ # Available to use for quota purposes for server-side applications. Can be any
3973
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3974
+ # @param [Google::Apis::RequestOptions] options
3975
+ # Request-specific options
3976
+ #
3977
+ # @yield [result, err] Result & error if block supplied
3978
+ # @yieldparam result [NilClass] No result returned for this method
3979
+ # @yieldparam err [StandardError] error object if request failed
3980
+ #
3981
+ # @return [void]
3982
+ #
3983
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3984
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3985
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3986
+ def invalidate_verification_code(user_key, fields: nil, quota_user: nil, options: nil, &block)
3987
+ command = make_simple_command(:post, 'admin/directory/v1/users/{userKey}/verificationCodes/invalidate', options)
3988
+ command.params['userKey'] = user_key unless user_key.nil?
3989
+ command.query['fields'] = fields unless fields.nil?
3990
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3991
+ execute_or_queue_command(command, &block)
3992
+ end
3993
+
3994
+ # Returns the current set of valid backup verification codes for the specified
3995
+ # user.
3996
+ # @param [String] user_key
3997
+ # Identifies the user in the API request. The value can be the user's primary
3998
+ # email address, alias email address, or unique user ID.
3999
+ # @param [String] fields
4000
+ # Selector specifying which fields to include in a partial response.
4001
+ # @param [String] quota_user
4002
+ # Available to use for quota purposes for server-side applications. Can be any
4003
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
4004
+ # @param [Google::Apis::RequestOptions] options
4005
+ # Request-specific options
4006
+ #
4007
+ # @yield [result, err] Result & error if block supplied
4008
+ # @yieldparam result [Google::Apis::AdminDirectoryV1::VerificationCodes] parsed result object
4009
+ # @yieldparam err [StandardError] error object if request failed
4010
+ #
4011
+ # @return [Google::Apis::AdminDirectoryV1::VerificationCodes]
4012
+ #
4013
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
4014
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
4015
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
4016
+ def list_verification_codes(user_key, fields: nil, quota_user: nil, options: nil, &block)
4017
+ command = make_simple_command(:get, 'admin/directory/v1/users/{userKey}/verificationCodes', options)
4018
+ command.response_representation = Google::Apis::AdminDirectoryV1::VerificationCodes::Representation
4019
+ command.response_class = Google::Apis::AdminDirectoryV1::VerificationCodes
4020
+ command.params['userKey'] = user_key unless user_key.nil?
4021
+ command.query['fields'] = fields unless fields.nil?
4022
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
4023
+ execute_or_queue_command(command, &block)
4024
+ end
4025
+
4026
+ protected
4027
+
4028
+ def apply_command_defaults(command)
4029
+ command.query['key'] = key unless key.nil?
4030
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
4031
+ end
4032
+ end
4033
+ end
4034
+ end
4035
+ end