google-apis-cloudresourcemanager_v3 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,6 +50,469 @@ module Google
50
50
  @batch_path = 'batch'
51
51
  end
52
52
 
53
+ # Creates a Folder in the resource hierarchy. Returns an Operation which can be
54
+ # used to track the progress of the folder creation workflow. Upon success the
55
+ # Operation.response field will be populated with the created Folder. In order
56
+ # to succeed, the addition of this new Folder must not violate the Folder naming,
57
+ # height or fanout constraints. + The Folder's display_name must be distinct
58
+ # from all other Folders that share its parent. + The addition of the Folder
59
+ # must not cause the active Folder hierarchy to exceed a height of 10. Note, the
60
+ # full active + deleted Folder hierarchy is allowed to reach a height of 20;
61
+ # this provides additional headroom when moving folders that contain deleted
62
+ # folders. + The addition of the Folder must not cause the total number of
63
+ # Folders under its parent to exceed 300. If the operation fails due to a folder
64
+ # constraint violation, some errors may be returned by the CreateFolder request,
65
+ # with status code FAILED_PRECONDITION and an error description. Other folder
66
+ # constraint violations will be communicated in the Operation, with the specific
67
+ # PreconditionFailure returned via the details list in the Operation.error field.
68
+ # The caller must have `resourcemanager.folders.create` permission on the
69
+ # identified parent.
70
+ # @param [Google::Apis::CloudresourcemanagerV3::Folder] folder_object
71
+ # @param [String] fields
72
+ # Selector specifying which fields to include in a partial response.
73
+ # @param [String] quota_user
74
+ # Available to use for quota purposes for server-side applications. Can be any
75
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
76
+ # @param [Google::Apis::RequestOptions] options
77
+ # Request-specific options
78
+ #
79
+ # @yield [result, err] Result & error if block supplied
80
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
81
+ # @yieldparam err [StandardError] error object if request failed
82
+ #
83
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
84
+ #
85
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
86
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
87
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
88
+ def create_folder(folder_object = nil, fields: nil, quota_user: nil, options: nil, &block)
89
+ command = make_simple_command(:post, 'v3/folders', options)
90
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::Folder::Representation
91
+ command.request_object = folder_object
92
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
93
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
94
+ command.query['fields'] = fields unless fields.nil?
95
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
96
+ execute_or_queue_command(command, &block)
97
+ end
98
+
99
+ # Requests deletion of a Folder. The Folder is moved into the DELETE_REQUESTED
100
+ # state immediately, and is deleted approximately 30 days later. This method may
101
+ # only be called on an empty Folder, where a Folder is empty if it doesn't
102
+ # contain any Folders or Projects in the ACTIVE state. If called on a folder in
103
+ # DELETE_REQUESTED state the result will be a no-op success. The caller must
104
+ # have `resourcemanager.folders.delete` permission on the identified folder.
105
+ # @param [String] name
106
+ # Required. The resource name of the Folder to be deleted. Must be of the form `
107
+ # folders/`folder_id``.
108
+ # @param [String] fields
109
+ # Selector specifying which fields to include in a partial response.
110
+ # @param [String] quota_user
111
+ # Available to use for quota purposes for server-side applications. Can be any
112
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
113
+ # @param [Google::Apis::RequestOptions] options
114
+ # Request-specific options
115
+ #
116
+ # @yield [result, err] Result & error if block supplied
117
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
118
+ # @yieldparam err [StandardError] error object if request failed
119
+ #
120
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
121
+ #
122
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
123
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
124
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
125
+ def delete_folder(name, fields: nil, quota_user: nil, options: nil, &block)
126
+ command = make_simple_command(:delete, 'v3/{+name}', options)
127
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
128
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
129
+ command.params['name'] = name unless name.nil?
130
+ command.query['fields'] = fields unless fields.nil?
131
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
132
+ execute_or_queue_command(command, &block)
133
+ end
134
+
135
+ # Retrieves a Folder identified by the supplied resource name. Valid Folder
136
+ # resource names have the format `folders/`folder_id`` (for example, `folders/
137
+ # 1234`). The caller must have `resourcemanager.folders.get` permission on the
138
+ # identified folder.
139
+ # @param [String] name
140
+ # Required. The resource name of the Folder to retrieve. Must be of the form `
141
+ # folders/`folder_id``.
142
+ # @param [String] fields
143
+ # Selector specifying which fields to include in a partial response.
144
+ # @param [String] quota_user
145
+ # Available to use for quota purposes for server-side applications. Can be any
146
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
147
+ # @param [Google::Apis::RequestOptions] options
148
+ # Request-specific options
149
+ #
150
+ # @yield [result, err] Result & error if block supplied
151
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Folder] parsed result object
152
+ # @yieldparam err [StandardError] error object if request failed
153
+ #
154
+ # @return [Google::Apis::CloudresourcemanagerV3::Folder]
155
+ #
156
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
157
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
158
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
159
+ def get_folder(name, fields: nil, quota_user: nil, options: nil, &block)
160
+ command = make_simple_command(:get, 'v3/{+name}', options)
161
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Folder::Representation
162
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Folder
163
+ command.params['name'] = name unless name.nil?
164
+ command.query['fields'] = fields unless fields.nil?
165
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
166
+ execute_or_queue_command(command, &block)
167
+ end
168
+
169
+ # Gets the access control policy for a Folder. The returned policy may be empty
170
+ # if no such policy or resource exists. The `resource` field should be the
171
+ # Folder's resource name, e.g. "folders/1234". The caller must have `
172
+ # resourcemanager.folders.getIamPolicy` permission on the identified folder.
173
+ # @param [String] resource
174
+ # REQUIRED: The resource for which the policy is being requested. See the
175
+ # operation documentation for the appropriate value for this field.
176
+ # @param [Google::Apis::CloudresourcemanagerV3::GetIamPolicyRequest] get_iam_policy_request_object
177
+ # @param [String] fields
178
+ # Selector specifying which fields to include in a partial response.
179
+ # @param [String] quota_user
180
+ # Available to use for quota purposes for server-side applications. Can be any
181
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
182
+ # @param [Google::Apis::RequestOptions] options
183
+ # Request-specific options
184
+ #
185
+ # @yield [result, err] Result & error if block supplied
186
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Policy] parsed result object
187
+ # @yieldparam err [StandardError] error object if request failed
188
+ #
189
+ # @return [Google::Apis::CloudresourcemanagerV3::Policy]
190
+ #
191
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
192
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
193
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
194
+ def get_folder_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
195
+ command = make_simple_command(:post, 'v3/{+resource}:getIamPolicy', options)
196
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::GetIamPolicyRequest::Representation
197
+ command.request_object = get_iam_policy_request_object
198
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Policy::Representation
199
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Policy
200
+ command.params['resource'] = resource unless resource.nil?
201
+ command.query['fields'] = fields unless fields.nil?
202
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
203
+ execute_or_queue_command(command, &block)
204
+ end
205
+
206
+ # Lists the Folders that are direct descendants of supplied parent resource.
207
+ # List provides a strongly consistent view of the Folders underneath the
208
+ # specified parent resource. List returns Folders sorted based upon the (
209
+ # ascending) lexical ordering of their display_name. The caller must have `
210
+ # resourcemanager.folders.list` permission on the identified parent.
211
+ # @param [Fixnum] page_size
212
+ # Optional. The maximum number of Folders to return in the response. If
213
+ # unspecified, server picks an appropriate default.
214
+ # @param [String] page_token
215
+ # Optional. A pagination token returned from a previous call to `ListFolders`
216
+ # that indicates where this listing should continue from.
217
+ # @param [String] parent
218
+ # Required. The resource name of the Organization or Folder whose Folders are
219
+ # being listed. Must be of the form `folders/`folder_id`` or `organizations/`
220
+ # org_id``. Access to this method is controlled by checking the `resourcemanager.
221
+ # folders.list` permission on the `parent`.
222
+ # @param [Boolean] show_deleted
223
+ # Optional. Controls whether Folders in the DELETE_REQUESTED state should be
224
+ # returned. Defaults to false.
225
+ # @param [String] fields
226
+ # Selector specifying which fields to include in a partial response.
227
+ # @param [String] quota_user
228
+ # Available to use for quota purposes for server-side applications. Can be any
229
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
230
+ # @param [Google::Apis::RequestOptions] options
231
+ # Request-specific options
232
+ #
233
+ # @yield [result, err] Result & error if block supplied
234
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::ListFoldersResponse] parsed result object
235
+ # @yieldparam err [StandardError] error object if request failed
236
+ #
237
+ # @return [Google::Apis::CloudresourcemanagerV3::ListFoldersResponse]
238
+ #
239
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
240
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
241
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
242
+ def list_folders(page_size: nil, page_token: nil, parent: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil, &block)
243
+ command = make_simple_command(:get, 'v3/folders', options)
244
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::ListFoldersResponse::Representation
245
+ command.response_class = Google::Apis::CloudresourcemanagerV3::ListFoldersResponse
246
+ command.query['pageSize'] = page_size unless page_size.nil?
247
+ command.query['pageToken'] = page_token unless page_token.nil?
248
+ command.query['parent'] = parent unless parent.nil?
249
+ command.query['showDeleted'] = show_deleted unless show_deleted.nil?
250
+ command.query['fields'] = fields unless fields.nil?
251
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
252
+ execute_or_queue_command(command, &block)
253
+ end
254
+
255
+ # Moves a Folder under a new resource parent. Returns an Operation which can be
256
+ # used to track the progress of the folder move workflow. Upon success the
257
+ # Operation.response field will be populated with the moved Folder. Upon failure,
258
+ # a FolderOperationError categorizing the failure cause will be returned - if
259
+ # the failure occurs synchronously then the FolderOperationError will be
260
+ # returned via the Status.details field and if it occurs asynchronously then the
261
+ # FolderOperation will be returned via the Operation.error field. In addition,
262
+ # the Operation.metadata field will be populated with a FolderOperation message
263
+ # as an aid to stateless clients. Folder moves will be rejected if they violate
264
+ # either the naming, height or fanout constraints described in the CreateFolder
265
+ # documentation. The caller must have `resourcemanager.folders.move` permission
266
+ # on the folder's current and proposed new parent.
267
+ # @param [String] name
268
+ # Required. The resource name of the Folder to move. Must be of the form folders/
269
+ # `folder_id`
270
+ # @param [Google::Apis::CloudresourcemanagerV3::MoveFolderRequest] move_folder_request_object
271
+ # @param [String] fields
272
+ # Selector specifying which fields to include in a partial response.
273
+ # @param [String] quota_user
274
+ # Available to use for quota purposes for server-side applications. Can be any
275
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
276
+ # @param [Google::Apis::RequestOptions] options
277
+ # Request-specific options
278
+ #
279
+ # @yield [result, err] Result & error if block supplied
280
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
281
+ # @yieldparam err [StandardError] error object if request failed
282
+ #
283
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
284
+ #
285
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
286
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
287
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
288
+ def move_folder(name, move_folder_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
289
+ command = make_simple_command(:post, 'v3/{+name}:move', options)
290
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::MoveFolderRequest::Representation
291
+ command.request_object = move_folder_request_object
292
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
293
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
294
+ command.params['name'] = name unless name.nil?
295
+ command.query['fields'] = fields unless fields.nil?
296
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
297
+ execute_or_queue_command(command, &block)
298
+ end
299
+
300
+ # Updates a Folder, changing its display_name. Changes to the folder
301
+ # display_name will be rejected if they violate either the display_name
302
+ # formatting rules or naming constraints described in the CreateFolder
303
+ # documentation. The Folder's display_name must start and end with a letter or
304
+ # digit, may contain letters, digits, spaces, hyphens and underscores and can be
305
+ # between 3 and 30 characters. This is captured by the regular expression: `\p`L`
306
+ # \p`N``1,28`[\p`L`\p`N`]`. The caller must have `resourcemanager.folders.update`
307
+ # permission on the identified folder. If the update fails due to the unique
308
+ # name constraint then a PreconditionFailure explaining this violation will be
309
+ # returned in the Status.details field.
310
+ # @param [String] name
311
+ # Output only. The resource name of the Folder. Its format is `folders/`
312
+ # folder_id``, for example: "folders/1234".
313
+ # @param [Google::Apis::CloudresourcemanagerV3::Folder] folder_object
314
+ # @param [String] update_mask
315
+ # Required. Fields to be updated. Only the `display_name` can be updated.
316
+ # @param [String] fields
317
+ # Selector specifying which fields to include in a partial response.
318
+ # @param [String] quota_user
319
+ # Available to use for quota purposes for server-side applications. Can be any
320
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
321
+ # @param [Google::Apis::RequestOptions] options
322
+ # Request-specific options
323
+ #
324
+ # @yield [result, err] Result & error if block supplied
325
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
326
+ # @yieldparam err [StandardError] error object if request failed
327
+ #
328
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
329
+ #
330
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
331
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
332
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
333
+ def patch_folder(name, folder_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
334
+ command = make_simple_command(:patch, 'v3/{+name}', options)
335
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::Folder::Representation
336
+ command.request_object = folder_object
337
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
338
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
339
+ command.params['name'] = name unless name.nil?
340
+ command.query['updateMask'] = update_mask unless update_mask.nil?
341
+ command.query['fields'] = fields unless fields.nil?
342
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
343
+ execute_or_queue_command(command, &block)
344
+ end
345
+
346
+ # Search for folders that match specific filter criteria. Search provides an
347
+ # eventually consistent view of the folders a user has access to which meet the
348
+ # specified filter criteria. This will only return folders on which the caller
349
+ # has the permission `resourcemanager.folders.get`.
350
+ # @param [Fixnum] page_size
351
+ # Optional. The maximum number of folders to return in the response. If
352
+ # unspecified, server picks an appropriate default.
353
+ # @param [String] page_token
354
+ # Optional. A pagination token returned from a previous call to `SearchFolders`
355
+ # that indicates from where search should continue.
356
+ # @param [String] query
357
+ # Optional. Search criteria used to select the Folders to return. If no search
358
+ # criteria is specified then all accessible folders will be returned. Query
359
+ # expressions can be used to restrict results based upon displayName, state and
360
+ # parent, where the operators `=` (`:`) `NOT`, `AND` and `OR` can be used along
361
+ # with the suffix wildcard symbol `*`. The displayName field in a query
362
+ # expression should use escaped quotes for values that include whitespace to
363
+ # prevent unexpected behavior. | Field | Description | |-------------------------
364
+ # |----------------------------------------| | displayName | Filters by
365
+ # displayName. | | parent | Filters by parent (e.g. folders/123). | | state,
366
+ # lifecycleState | Filters by state. | Some example queries are: * Query `
367
+ # displayName=Test*` returns Folder resources whose display name starts with "
368
+ # Test". * Query `state=ACTIVE` returns Folder resources with `state` set to `
369
+ # ACTIVE`. * Query `parent=folders/123` returns Folder resources that have `
370
+ # folders/123` as a parent resource. * Query `parent=folders/123 AND state=
371
+ # ACTIVE` returns active Folder resources that have `folders/123` as a parent
372
+ # resource. * Query `displayName=\\"Test String\\"` returns Folder resources
373
+ # with display names that include both "Test" and "String".
374
+ # @param [String] fields
375
+ # Selector specifying which fields to include in a partial response.
376
+ # @param [String] quota_user
377
+ # Available to use for quota purposes for server-side applications. Can be any
378
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
379
+ # @param [Google::Apis::RequestOptions] options
380
+ # Request-specific options
381
+ #
382
+ # @yield [result, err] Result & error if block supplied
383
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::SearchFoldersResponse] parsed result object
384
+ # @yieldparam err [StandardError] error object if request failed
385
+ #
386
+ # @return [Google::Apis::CloudresourcemanagerV3::SearchFoldersResponse]
387
+ #
388
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
389
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
390
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
391
+ def search_folders(page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
392
+ command = make_simple_command(:get, 'v3/folders:search', options)
393
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::SearchFoldersResponse::Representation
394
+ command.response_class = Google::Apis::CloudresourcemanagerV3::SearchFoldersResponse
395
+ command.query['pageSize'] = page_size unless page_size.nil?
396
+ command.query['pageToken'] = page_token unless page_token.nil?
397
+ command.query['query'] = query unless query.nil?
398
+ command.query['fields'] = fields unless fields.nil?
399
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
400
+ execute_or_queue_command(command, &block)
401
+ end
402
+
403
+ # Sets the access control policy on a Folder, replacing any existing policy. The
404
+ # `resource` field should be the Folder's resource name, e.g. "folders/1234".
405
+ # The caller must have `resourcemanager.folders.setIamPolicy` permission on the
406
+ # identified folder.
407
+ # @param [String] resource
408
+ # REQUIRED: The resource for which the policy is being specified. See the
409
+ # operation documentation for the appropriate value for this field.
410
+ # @param [Google::Apis::CloudresourcemanagerV3::SetIamPolicyRequest] set_iam_policy_request_object
411
+ # @param [String] fields
412
+ # Selector specifying which fields to include in a partial response.
413
+ # @param [String] quota_user
414
+ # Available to use for quota purposes for server-side applications. Can be any
415
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
416
+ # @param [Google::Apis::RequestOptions] options
417
+ # Request-specific options
418
+ #
419
+ # @yield [result, err] Result & error if block supplied
420
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Policy] parsed result object
421
+ # @yieldparam err [StandardError] error object if request failed
422
+ #
423
+ # @return [Google::Apis::CloudresourcemanagerV3::Policy]
424
+ #
425
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
426
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
427
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
428
+ def set_folder_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
429
+ command = make_simple_command(:post, 'v3/{+resource}:setIamPolicy', options)
430
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::SetIamPolicyRequest::Representation
431
+ command.request_object = set_iam_policy_request_object
432
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Policy::Representation
433
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Policy
434
+ command.params['resource'] = resource unless resource.nil?
435
+ command.query['fields'] = fields unless fields.nil?
436
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
437
+ execute_or_queue_command(command, &block)
438
+ end
439
+
440
+ # Returns permissions that a caller has on the specified Folder. The `resource`
441
+ # field should be the Folder's resource name, e.g. "folders/1234". There are no
442
+ # permissions required for making this API call.
443
+ # @param [String] resource
444
+ # REQUIRED: The resource for which the policy detail is being requested. See the
445
+ # operation documentation for the appropriate value for this field.
446
+ # @param [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsRequest] test_iam_permissions_request_object
447
+ # @param [String] fields
448
+ # Selector specifying which fields to include in a partial response.
449
+ # @param [String] quota_user
450
+ # Available to use for quota purposes for server-side applications. Can be any
451
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
452
+ # @param [Google::Apis::RequestOptions] options
453
+ # Request-specific options
454
+ #
455
+ # @yield [result, err] Result & error if block supplied
456
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse] parsed result object
457
+ # @yieldparam err [StandardError] error object if request failed
458
+ #
459
+ # @return [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse]
460
+ #
461
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
462
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
463
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
464
+ def test_folder_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
465
+ command = make_simple_command(:post, 'v3/{+resource}:testIamPermissions', options)
466
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsRequest::Representation
467
+ command.request_object = test_iam_permissions_request_object
468
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse::Representation
469
+ command.response_class = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse
470
+ command.params['resource'] = resource unless resource.nil?
471
+ command.query['fields'] = fields unless fields.nil?
472
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
473
+ execute_or_queue_command(command, &block)
474
+ end
475
+
476
+ # Cancels the deletion request for a Folder. This method may be called on a
477
+ # Folder in any state. If Folder is in ACTIVE state the result will be a no-op
478
+ # success. In order to succeed, the Folder's parent must be in the ACTIVE state.
479
+ # In addition, reintroducing the folder into the tree must not violate folder
480
+ # naming, height and fanout constraints described in the CreateFolder
481
+ # documentation. The caller must have `resourcemanager.folders.undelete`
482
+ # permission on the identified folder.
483
+ # @param [String] name
484
+ # Required. The resource name of the Folder to undelete. Must be of the form `
485
+ # folders/`folder_id``.
486
+ # @param [Google::Apis::CloudresourcemanagerV3::UndeleteFolderRequest] undelete_folder_request_object
487
+ # @param [String] fields
488
+ # Selector specifying which fields to include in a partial response.
489
+ # @param [String] quota_user
490
+ # Available to use for quota purposes for server-side applications. Can be any
491
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
492
+ # @param [Google::Apis::RequestOptions] options
493
+ # Request-specific options
494
+ #
495
+ # @yield [result, err] Result & error if block supplied
496
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
497
+ # @yieldparam err [StandardError] error object if request failed
498
+ #
499
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
500
+ #
501
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
502
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
503
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
504
+ def undelete_folder(name, undelete_folder_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
505
+ command = make_simple_command(:post, 'v3/{+name}:undelete', options)
506
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::UndeleteFolderRequest::Representation
507
+ command.request_object = undelete_folder_request_object
508
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
509
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
510
+ command.params['name'] = name unless name.nil?
511
+ command.query['fields'] = fields unless fields.nil?
512
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
513
+ execute_or_queue_command(command, &block)
514
+ end
515
+
53
516
  # Create a Lien which applies to the resource denoted by the `parent` field.
54
517
  # Callers of this method will require permission on the `parent` resource. For
55
518
  # example, applying to `projects/1234` requires permission `resourcemanager.
@@ -65,30 +528,403 @@ module Google
65
528
  # Request-specific options
66
529
  #
67
530
  # @yield [result, err] Result & error if block supplied
68
- # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Lien] parsed result object
531
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Lien] parsed result object
532
+ # @yieldparam err [StandardError] error object if request failed
533
+ #
534
+ # @return [Google::Apis::CloudresourcemanagerV3::Lien]
535
+ #
536
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
537
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
538
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
539
+ def create_lien(lien_object = nil, fields: nil, quota_user: nil, options: nil, &block)
540
+ command = make_simple_command(:post, 'v3/liens', options)
541
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::Lien::Representation
542
+ command.request_object = lien_object
543
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Lien::Representation
544
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Lien
545
+ command.query['fields'] = fields unless fields.nil?
546
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
547
+ execute_or_queue_command(command, &block)
548
+ end
549
+
550
+ # Delete a Lien by `name`. Callers of this method will require permission on the
551
+ # `parent` resource. For example, a Lien with a `parent` of `projects/1234`
552
+ # requires permission `resourcemanager.projects.updateLiens`.
553
+ # @param [String] name
554
+ # Required. The name/identifier of the Lien to delete.
555
+ # @param [String] fields
556
+ # Selector specifying which fields to include in a partial response.
557
+ # @param [String] quota_user
558
+ # Available to use for quota purposes for server-side applications. Can be any
559
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
560
+ # @param [Google::Apis::RequestOptions] options
561
+ # Request-specific options
562
+ #
563
+ # @yield [result, err] Result & error if block supplied
564
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Empty] parsed result object
565
+ # @yieldparam err [StandardError] error object if request failed
566
+ #
567
+ # @return [Google::Apis::CloudresourcemanagerV3::Empty]
568
+ #
569
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
570
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
571
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
572
+ def delete_lien(name, fields: nil, quota_user: nil, options: nil, &block)
573
+ command = make_simple_command(:delete, 'v3/{+name}', options)
574
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Empty::Representation
575
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Empty
576
+ command.params['name'] = name unless name.nil?
577
+ command.query['fields'] = fields unless fields.nil?
578
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
579
+ execute_or_queue_command(command, &block)
580
+ end
581
+
582
+ # Retrieve a Lien by `name`. Callers of this method will require permission on
583
+ # the `parent` resource. For example, a Lien with a `parent` of `projects/1234`
584
+ # requires permission `resourcemanager.projects.get`
585
+ # @param [String] name
586
+ # Required. The name/identifier of the Lien.
587
+ # @param [String] fields
588
+ # Selector specifying which fields to include in a partial response.
589
+ # @param [String] quota_user
590
+ # Available to use for quota purposes for server-side applications. Can be any
591
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
592
+ # @param [Google::Apis::RequestOptions] options
593
+ # Request-specific options
594
+ #
595
+ # @yield [result, err] Result & error if block supplied
596
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Lien] parsed result object
597
+ # @yieldparam err [StandardError] error object if request failed
598
+ #
599
+ # @return [Google::Apis::CloudresourcemanagerV3::Lien]
600
+ #
601
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
602
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
603
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
604
+ def get_lien(name, fields: nil, quota_user: nil, options: nil, &block)
605
+ command = make_simple_command(:get, 'v3/{+name}', options)
606
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Lien::Representation
607
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Lien
608
+ command.params['name'] = name unless name.nil?
609
+ command.query['fields'] = fields unless fields.nil?
610
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
611
+ execute_or_queue_command(command, &block)
612
+ end
613
+
614
+ # List all Liens applied to the `parent` resource. Callers of this method will
615
+ # require permission on the `parent` resource. For example, a Lien with a `
616
+ # parent` of `projects/1234` requires permission `resourcemanager.projects.get`.
617
+ # @param [Fixnum] page_size
618
+ # The maximum number of items to return. This is a suggestion for the server.
619
+ # @param [String] page_token
620
+ # The `next_page_token` value returned from a previous List request, if any.
621
+ # @param [String] parent
622
+ # Required. The name of the resource to list all attached Liens. For example, `
623
+ # projects/1234`. (google.api.field_policy).resource_type annotation is not set
624
+ # since the parent depends on the meta api implementation. This field could be a
625
+ # project or other sub project resources.
626
+ # @param [String] fields
627
+ # Selector specifying which fields to include in a partial response.
628
+ # @param [String] quota_user
629
+ # Available to use for quota purposes for server-side applications. Can be any
630
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
631
+ # @param [Google::Apis::RequestOptions] options
632
+ # Request-specific options
633
+ #
634
+ # @yield [result, err] Result & error if block supplied
635
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::ListLiensResponse] parsed result object
636
+ # @yieldparam err [StandardError] error object if request failed
637
+ #
638
+ # @return [Google::Apis::CloudresourcemanagerV3::ListLiensResponse]
639
+ #
640
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
641
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
642
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
643
+ def list_liens(page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
644
+ command = make_simple_command(:get, 'v3/liens', options)
645
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::ListLiensResponse::Representation
646
+ command.response_class = Google::Apis::CloudresourcemanagerV3::ListLiensResponse
647
+ command.query['pageSize'] = page_size unless page_size.nil?
648
+ command.query['pageToken'] = page_token unless page_token.nil?
649
+ command.query['parent'] = parent unless parent.nil?
650
+ command.query['fields'] = fields unless fields.nil?
651
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
652
+ execute_or_queue_command(command, &block)
653
+ end
654
+
655
+ # Gets the latest state of a long-running operation. Clients can use this method
656
+ # to poll the operation result at intervals as recommended by the API service.
657
+ # @param [String] name
658
+ # The name of the operation resource.
659
+ # @param [String] fields
660
+ # Selector specifying which fields to include in a partial response.
661
+ # @param [String] quota_user
662
+ # Available to use for quota purposes for server-side applications. Can be any
663
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
664
+ # @param [Google::Apis::RequestOptions] options
665
+ # Request-specific options
666
+ #
667
+ # @yield [result, err] Result & error if block supplied
668
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
669
+ # @yieldparam err [StandardError] error object if request failed
670
+ #
671
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
672
+ #
673
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
674
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
675
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
676
+ def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
677
+ command = make_simple_command(:get, 'v3/{+name}', options)
678
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
679
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
680
+ command.params['name'] = name unless name.nil?
681
+ command.query['fields'] = fields unless fields.nil?
682
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
683
+ execute_or_queue_command(command, &block)
684
+ end
685
+
686
+ # Fetches an Organization resource identified by the specified resource name.
687
+ # @param [String] name
688
+ # Required. The resource name of the Organization to fetch. This is the
689
+ # organization's relative path in the API, formatted as "organizations/[
690
+ # organizationId]". For example, "organizations/1234".
691
+ # @param [String] fields
692
+ # Selector specifying which fields to include in a partial response.
693
+ # @param [String] quota_user
694
+ # Available to use for quota purposes for server-side applications. Can be any
695
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
696
+ # @param [Google::Apis::RequestOptions] options
697
+ # Request-specific options
698
+ #
699
+ # @yield [result, err] Result & error if block supplied
700
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Organization] parsed result object
701
+ # @yieldparam err [StandardError] error object if request failed
702
+ #
703
+ # @return [Google::Apis::CloudresourcemanagerV3::Organization]
704
+ #
705
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
706
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
707
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
708
+ def get_organization(name, fields: nil, quota_user: nil, options: nil, &block)
709
+ command = make_simple_command(:get, 'v3/{+name}', options)
710
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Organization::Representation
711
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Organization
712
+ command.params['name'] = name unless name.nil?
713
+ command.query['fields'] = fields unless fields.nil?
714
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
715
+ execute_or_queue_command(command, &block)
716
+ end
717
+
718
+ # Gets the access control policy for an Organization resource. May be empty if
719
+ # no such policy or resource exists. The `resource` field should be the
720
+ # organization's resource name, e.g. "organizations/123". Authorization requires
721
+ # the Google IAM permission `resourcemanager.organizations.getIamPolicy` on the
722
+ # specified organization
723
+ # @param [String] resource
724
+ # REQUIRED: The resource for which the policy is being requested. See the
725
+ # operation documentation for the appropriate value for this field.
726
+ # @param [Google::Apis::CloudresourcemanagerV3::GetIamPolicyRequest] get_iam_policy_request_object
727
+ # @param [String] fields
728
+ # Selector specifying which fields to include in a partial response.
729
+ # @param [String] quota_user
730
+ # Available to use for quota purposes for server-side applications. Can be any
731
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
732
+ # @param [Google::Apis::RequestOptions] options
733
+ # Request-specific options
734
+ #
735
+ # @yield [result, err] Result & error if block supplied
736
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Policy] parsed result object
737
+ # @yieldparam err [StandardError] error object if request failed
738
+ #
739
+ # @return [Google::Apis::CloudresourcemanagerV3::Policy]
740
+ #
741
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
742
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
743
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
744
+ def get_organization_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
745
+ command = make_simple_command(:post, 'v3/{+resource}:getIamPolicy', options)
746
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::GetIamPolicyRequest::Representation
747
+ command.request_object = get_iam_policy_request_object
748
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Policy::Representation
749
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Policy
750
+ command.params['resource'] = resource unless resource.nil?
751
+ command.query['fields'] = fields unless fields.nil?
752
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
753
+ execute_or_queue_command(command, &block)
754
+ end
755
+
756
+ # Searches Organization resources that are visible to the user and satisfy the
757
+ # specified filter. This method returns Organizations in an unspecified order.
758
+ # New Organizations do not necessarily appear at the end of the results, and may
759
+ # take a small amount of time to appear. Search will only return organizations
760
+ # on which the user has the permission `resourcemanager.organizations.get`
761
+ # @param [Fixnum] page_size
762
+ # Optional. The maximum number of Organizations to return in the response. If
763
+ # unspecified, server picks an appropriate default.
764
+ # @param [String] page_token
765
+ # Optional. A pagination token returned from a previous call to `
766
+ # SearchOrganizations` that indicates from where listing should continue.
767
+ # @param [String] query
768
+ # Optional. An optional query string used to filter the Organizations to return
769
+ # in the response. Query rules are case-insensitive. | Field | Description | |---
770
+ # ---------------|--------------------------------------------| |
771
+ # directoryCustomerId, owner.directoryCustomerId | Filters by directory customer
772
+ # id. | | domain | Filters by domain. | Organizations may be queried by `
773
+ # directoryCustomerId` or by `domain`, where the domain is a G Suite domain, for
774
+ # example: * Query `directorycustomerid:123456789` returns Organization
775
+ # resources with `owner.directory_customer_id` equal to `123456789`. * Query `
776
+ # domain:google.com` returns Organization resources corresponding to the domain `
777
+ # google.com`.
778
+ # @param [String] fields
779
+ # Selector specifying which fields to include in a partial response.
780
+ # @param [String] quota_user
781
+ # Available to use for quota purposes for server-side applications. Can be any
782
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
783
+ # @param [Google::Apis::RequestOptions] options
784
+ # Request-specific options
785
+ #
786
+ # @yield [result, err] Result & error if block supplied
787
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::SearchOrganizationsResponse] parsed result object
788
+ # @yieldparam err [StandardError] error object if request failed
789
+ #
790
+ # @return [Google::Apis::CloudresourcemanagerV3::SearchOrganizationsResponse]
791
+ #
792
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
793
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
794
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
795
+ def search_organizations(page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
796
+ command = make_simple_command(:get, 'v3/organizations:search', options)
797
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::SearchOrganizationsResponse::Representation
798
+ command.response_class = Google::Apis::CloudresourcemanagerV3::SearchOrganizationsResponse
799
+ command.query['pageSize'] = page_size unless page_size.nil?
800
+ command.query['pageToken'] = page_token unless page_token.nil?
801
+ command.query['query'] = query unless query.nil?
802
+ command.query['fields'] = fields unless fields.nil?
803
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
804
+ execute_or_queue_command(command, &block)
805
+ end
806
+
807
+ # Sets the access control policy on an Organization resource. Replaces any
808
+ # existing policy. The `resource` field should be the organization's resource
809
+ # name, e.g. "organizations/123". Authorization requires the Google IAM
810
+ # permission `resourcemanager.organizations.setIamPolicy` on the specified
811
+ # organization
812
+ # @param [String] resource
813
+ # REQUIRED: The resource for which the policy is being specified. See the
814
+ # operation documentation for the appropriate value for this field.
815
+ # @param [Google::Apis::CloudresourcemanagerV3::SetIamPolicyRequest] set_iam_policy_request_object
816
+ # @param [String] fields
817
+ # Selector specifying which fields to include in a partial response.
818
+ # @param [String] quota_user
819
+ # Available to use for quota purposes for server-side applications. Can be any
820
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
821
+ # @param [Google::Apis::RequestOptions] options
822
+ # Request-specific options
823
+ #
824
+ # @yield [result, err] Result & error if block supplied
825
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Policy] parsed result object
826
+ # @yieldparam err [StandardError] error object if request failed
827
+ #
828
+ # @return [Google::Apis::CloudresourcemanagerV3::Policy]
829
+ #
830
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
831
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
832
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
833
+ def set_organization_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
834
+ command = make_simple_command(:post, 'v3/{+resource}:setIamPolicy', options)
835
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::SetIamPolicyRequest::Representation
836
+ command.request_object = set_iam_policy_request_object
837
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Policy::Representation
838
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Policy
839
+ command.params['resource'] = resource unless resource.nil?
840
+ command.query['fields'] = fields unless fields.nil?
841
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
842
+ execute_or_queue_command(command, &block)
843
+ end
844
+
845
+ # Returns permissions that a caller has on the specified Organization. The `
846
+ # resource` field should be the organization's resource name, e.g. "
847
+ # organizations/123". There are no permissions required for making this API call.
848
+ # @param [String] resource
849
+ # REQUIRED: The resource for which the policy detail is being requested. See the
850
+ # operation documentation for the appropriate value for this field.
851
+ # @param [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsRequest] test_iam_permissions_request_object
852
+ # @param [String] fields
853
+ # Selector specifying which fields to include in a partial response.
854
+ # @param [String] quota_user
855
+ # Available to use for quota purposes for server-side applications. Can be any
856
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
857
+ # @param [Google::Apis::RequestOptions] options
858
+ # Request-specific options
859
+ #
860
+ # @yield [result, err] Result & error if block supplied
861
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse] parsed result object
862
+ # @yieldparam err [StandardError] error object if request failed
863
+ #
864
+ # @return [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse]
865
+ #
866
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
867
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
868
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
869
+ def test_organization_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
870
+ command = make_simple_command(:post, 'v3/{+resource}:testIamPermissions', options)
871
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsRequest::Representation
872
+ command.request_object = test_iam_permissions_request_object
873
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse::Representation
874
+ command.response_class = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse
875
+ command.params['resource'] = resource unless resource.nil?
876
+ command.query['fields'] = fields unless fields.nil?
877
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
878
+ execute_or_queue_command(command, &block)
879
+ end
880
+
881
+ # Request that a new Project be created. The result is an Operation which can be
882
+ # used to track the creation process. This process usually takes a few seconds,
883
+ # but can sometimes take much longer. The tracking Operation is automatically
884
+ # deleted after a few hours, so there is no need to call DeleteOperation.
885
+ # @param [Google::Apis::CloudresourcemanagerV3::Project] project_object
886
+ # @param [String] fields
887
+ # Selector specifying which fields to include in a partial response.
888
+ # @param [String] quota_user
889
+ # Available to use for quota purposes for server-side applications. Can be any
890
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
891
+ # @param [Google::Apis::RequestOptions] options
892
+ # Request-specific options
893
+ #
894
+ # @yield [result, err] Result & error if block supplied
895
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
69
896
  # @yieldparam err [StandardError] error object if request failed
70
897
  #
71
- # @return [Google::Apis::CloudresourcemanagerV3::Lien]
898
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
72
899
  #
73
900
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
74
901
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
75
902
  # @raise [Google::Apis::AuthorizationError] Authorization is required
76
- def create_lien(lien_object = nil, fields: nil, quota_user: nil, options: nil, &block)
77
- command = make_simple_command(:post, 'v3/liens', options)
78
- command.request_representation = Google::Apis::CloudresourcemanagerV3::Lien::Representation
79
- command.request_object = lien_object
80
- command.response_representation = Google::Apis::CloudresourcemanagerV3::Lien::Representation
81
- command.response_class = Google::Apis::CloudresourcemanagerV3::Lien
903
+ def create_project(project_object = nil, fields: nil, quota_user: nil, options: nil, &block)
904
+ command = make_simple_command(:post, 'v3/projects', options)
905
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::Project::Representation
906
+ command.request_object = project_object
907
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
908
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
82
909
  command.query['fields'] = fields unless fields.nil?
83
910
  command.query['quotaUser'] = quota_user unless quota_user.nil?
84
911
  execute_or_queue_command(command, &block)
85
912
  end
86
913
 
87
- # Delete a Lien by `name`. Callers of this method will require permission on the
88
- # `parent` resource. For example, a Lien with a `parent` of `projects/1234`
89
- # requires permission `resourcemanager.projects.updateLiens`.
914
+ # Marks the Project identified by the specified `name` (for example, `projects/
915
+ # 415104041262`) for deletion. This method will only affect the Project if it
916
+ # has a lifecycle state of ACTIVE. This method changes the Project's lifecycle
917
+ # state from ACTIVE to DELETE_REQUESTED. The deletion starts at an unspecified
918
+ # time, at which point the Project is no longer accessible. Until the deletion
919
+ # completes, you can check the lifecycle state checked by retrieving the Project
920
+ # with GetProject, and the Project remains visible to ListProjects. However, you
921
+ # cannot update the project. After the deletion completes, the Project is not
922
+ # retrievable by the GetProject, ListProjects, and SearchProjects methods. This
923
+ # method behaves idempotently (eg., deleting a `DELETE_REQUESTED` project will
924
+ # not be an error, but also won't do anything). The caller must have delete
925
+ # permissions for this Project.
90
926
  # @param [String] name
91
- # Required. The name/identifier of the Lien to delete.
927
+ # Required. The name of the Project (for example, `projects/415104041262`).
92
928
  # @param [String] fields
93
929
  # Selector specifying which fields to include in a partial response.
94
930
  # @param [String] quota_user
@@ -98,29 +934,29 @@ module Google
98
934
  # Request-specific options
99
935
  #
100
936
  # @yield [result, err] Result & error if block supplied
101
- # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Empty] parsed result object
937
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
102
938
  # @yieldparam err [StandardError] error object if request failed
103
939
  #
104
- # @return [Google::Apis::CloudresourcemanagerV3::Empty]
940
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
105
941
  #
106
942
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
107
943
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
108
944
  # @raise [Google::Apis::AuthorizationError] Authorization is required
109
- def delete_lien(name, fields: nil, quota_user: nil, options: nil, &block)
945
+ def delete_project(name, fields: nil, quota_user: nil, options: nil, &block)
110
946
  command = make_simple_command(:delete, 'v3/{+name}', options)
111
- command.response_representation = Google::Apis::CloudresourcemanagerV3::Empty::Representation
112
- command.response_class = Google::Apis::CloudresourcemanagerV3::Empty
947
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
948
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
113
949
  command.params['name'] = name unless name.nil?
114
950
  command.query['fields'] = fields unless fields.nil?
115
951
  command.query['quotaUser'] = quota_user unless quota_user.nil?
116
952
  execute_or_queue_command(command, &block)
117
953
  end
118
954
 
119
- # Retrieve a Lien by `name`. Callers of this method will require permission on
120
- # the `parent` resource. For example, a Lien with a `parent` of `projects/1234`
121
- # requires permission `resourcemanager.projects.get`
955
+ # Retrieves the Project identified by the specified `name` (for example, `
956
+ # projects/415104041262`). The caller must have read permissions for this
957
+ # Project.
122
958
  # @param [String] name
123
- # Required. The name/identifier of the Lien.
959
+ # Required. The name of the project (for example, `projects/415104041262`).
124
960
  # @param [String] fields
125
961
  # Selector specifying which fields to include in a partial response.
126
962
  # @param [String] quota_user
@@ -130,36 +966,79 @@ module Google
130
966
  # Request-specific options
131
967
  #
132
968
  # @yield [result, err] Result & error if block supplied
133
- # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Lien] parsed result object
969
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Project] parsed result object
134
970
  # @yieldparam err [StandardError] error object if request failed
135
971
  #
136
- # @return [Google::Apis::CloudresourcemanagerV3::Lien]
972
+ # @return [Google::Apis::CloudresourcemanagerV3::Project]
137
973
  #
138
974
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
139
975
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
140
976
  # @raise [Google::Apis::AuthorizationError] Authorization is required
141
- def get_lien(name, fields: nil, quota_user: nil, options: nil, &block)
977
+ def get_project(name, fields: nil, quota_user: nil, options: nil, &block)
142
978
  command = make_simple_command(:get, 'v3/{+name}', options)
143
- command.response_representation = Google::Apis::CloudresourcemanagerV3::Lien::Representation
144
- command.response_class = Google::Apis::CloudresourcemanagerV3::Lien
979
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Project::Representation
980
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Project
145
981
  command.params['name'] = name unless name.nil?
146
982
  command.query['fields'] = fields unless fields.nil?
147
983
  command.query['quotaUser'] = quota_user unless quota_user.nil?
148
984
  execute_or_queue_command(command, &block)
149
985
  end
150
986
 
151
- # List all Liens applied to the `parent` resource. Callers of this method will
152
- # require permission on the `parent` resource. For example, a Lien with a `
153
- # parent` of `projects/1234` requires permission `resourcemanager.projects.get`.
987
+ # Returns the IAM access control policy for the specified Project. Permission is
988
+ # denied if the policy or the resource does not exist.
989
+ # @param [String] resource
990
+ # REQUIRED: The resource for which the policy is being requested. See the
991
+ # operation documentation for the appropriate value for this field.
992
+ # @param [Google::Apis::CloudresourcemanagerV3::GetIamPolicyRequest] get_iam_policy_request_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::CloudresourcemanagerV3::Policy] parsed result object
1003
+ # @yieldparam err [StandardError] error object if request failed
1004
+ #
1005
+ # @return [Google::Apis::CloudresourcemanagerV3::Policy]
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 get_project_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1011
+ command = make_simple_command(:post, 'v3/{+resource}:getIamPolicy', options)
1012
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::GetIamPolicyRequest::Representation
1013
+ command.request_object = get_iam_policy_request_object
1014
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Policy::Representation
1015
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Policy
1016
+ command.params['resource'] = resource unless resource.nil?
1017
+ command.query['fields'] = fields unless fields.nil?
1018
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1019
+ execute_or_queue_command(command, &block)
1020
+ end
1021
+
1022
+ # Lists Projects that are direct children of the specified folder or
1023
+ # organization resource. List provides a strongly consistent view of the
1024
+ # Projects underneath the specified parent resource. List returns Projects
1025
+ # sorted based upon the (ascending) lexical ordering of their `display_name`.
1026
+ # The caller must have `resourcemanager.projects.list` permission on the
1027
+ # identified parent.
154
1028
  # @param [Fixnum] page_size
155
- # The maximum number of items to return. This is a suggestion for the server.
1029
+ # Optional. The maximum number of Projects to return in the response. The server
1030
+ # can return fewer Projects than requested. If unspecified, server picks an
1031
+ # appropriate default.
156
1032
  # @param [String] page_token
157
- # The `next_page_token` value returned from a previous List request, if any.
1033
+ # Optional. A pagination token returned from a previous call to ListProjects
1034
+ # that indicates from where listing should continue.
158
1035
  # @param [String] parent
159
- # Required. The name of the resource to list all attached Liens. For example, `
160
- # projects/1234`. (google.api.field_policy).resource_type annotation is not set
161
- # since the parent depends on the meta api implementation. This field could be a
162
- # project or other sub project resources.
1036
+ # Required. The name of the parent resource to list projects under. For example,
1037
+ # setting this field to 'folders/1234' would list all projects directly under
1038
+ # that folder.
1039
+ # @param [Boolean] show_deleted
1040
+ # Optional. Indicate that Projects in the `DELETE_REQUESTED` state should also
1041
+ # be returned. Normally only `ACTIVE` projects are returned.
163
1042
  # @param [String] fields
164
1043
  # Selector specifying which fields to include in a partial response.
165
1044
  # @param [String] quota_user
@@ -169,30 +1048,36 @@ module Google
169
1048
  # Request-specific options
170
1049
  #
171
1050
  # @yield [result, err] Result & error if block supplied
172
- # @yieldparam result [Google::Apis::CloudresourcemanagerV3::ListLiensResponse] parsed result object
1051
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::ListProjectsResponse] parsed result object
173
1052
  # @yieldparam err [StandardError] error object if request failed
174
1053
  #
175
- # @return [Google::Apis::CloudresourcemanagerV3::ListLiensResponse]
1054
+ # @return [Google::Apis::CloudresourcemanagerV3::ListProjectsResponse]
176
1055
  #
177
1056
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
178
1057
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
179
1058
  # @raise [Google::Apis::AuthorizationError] Authorization is required
180
- def list_liens(page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
181
- command = make_simple_command(:get, 'v3/liens', options)
182
- command.response_representation = Google::Apis::CloudresourcemanagerV3::ListLiensResponse::Representation
183
- command.response_class = Google::Apis::CloudresourcemanagerV3::ListLiensResponse
1059
+ def list_projects(page_size: nil, page_token: nil, parent: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil, &block)
1060
+ command = make_simple_command(:get, 'v3/projects', options)
1061
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::ListProjectsResponse::Representation
1062
+ command.response_class = Google::Apis::CloudresourcemanagerV3::ListProjectsResponse
184
1063
  command.query['pageSize'] = page_size unless page_size.nil?
185
1064
  command.query['pageToken'] = page_token unless page_token.nil?
186
1065
  command.query['parent'] = parent unless parent.nil?
1066
+ command.query['showDeleted'] = show_deleted unless show_deleted.nil?
187
1067
  command.query['fields'] = fields unless fields.nil?
188
1068
  command.query['quotaUser'] = quota_user unless quota_user.nil?
189
1069
  execute_or_queue_command(command, &block)
190
1070
  end
191
1071
 
192
- # Gets the latest state of a long-running operation. Clients can use this method
193
- # to poll the operation result at intervals as recommended by the API service.
1072
+ # Move a Project under a new resource parent. Returns an operation which can be
1073
+ # used to track the process of the Project move workflow. Upon success, the
1074
+ # Operation.response field will be populated with the moved Project. The caller
1075
+ # must have `resourcemanager.projects.update` permission on the Project and have
1076
+ # `resourcemanager.projects.move` permission on the Project's current and
1077
+ # proposed new parent.
194
1078
  # @param [String] name
195
- # The name of the operation resource.
1079
+ # Required. The name of the project to move.
1080
+ # @param [Google::Apis::CloudresourcemanagerV3::MoveProjectRequest] move_project_request_object
196
1081
  # @param [String] fields
197
1082
  # Selector specifying which fields to include in a partial response.
198
1083
  # @param [String] quota_user
@@ -210,8 +1095,245 @@ module Google
210
1095
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
211
1096
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
212
1097
  # @raise [Google::Apis::AuthorizationError] Authorization is required
213
- def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
214
- command = make_simple_command(:get, 'v3/{+name}', options)
1098
+ def move_project(name, move_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1099
+ command = make_simple_command(:post, 'v3/{+name}:move', options)
1100
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::MoveProjectRequest::Representation
1101
+ command.request_object = move_project_request_object
1102
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
1103
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
1104
+ command.params['name'] = name unless name.nil?
1105
+ command.query['fields'] = fields unless fields.nil?
1106
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1107
+ execute_or_queue_command(command, &block)
1108
+ end
1109
+
1110
+ # Updates the attributes of the Project identified by the specified `name` (for
1111
+ # example, `projects/415104041262`). At present this is only useful for updating
1112
+ # the display_name and labels. Deleting all labels requires an update mask for
1113
+ # labels field. The caller must have modify permissions for this Project.
1114
+ # @param [String] name
1115
+ # Output only. The unique resource name of the Project. It is an int64 generated
1116
+ # number prefixed by "projects/". Example: `projects/415104041262`
1117
+ # @param [Google::Apis::CloudresourcemanagerV3::Project] project_object
1118
+ # @param [String] update_mask
1119
+ # Optional. An update mask to selectively update fields.
1120
+ # @param [String] fields
1121
+ # Selector specifying which fields to include in a partial response.
1122
+ # @param [String] quota_user
1123
+ # Available to use for quota purposes for server-side applications. Can be any
1124
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1125
+ # @param [Google::Apis::RequestOptions] options
1126
+ # Request-specific options
1127
+ #
1128
+ # @yield [result, err] Result & error if block supplied
1129
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
1130
+ # @yieldparam err [StandardError] error object if request failed
1131
+ #
1132
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
1133
+ #
1134
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1135
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1136
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1137
+ def patch_project(name, project_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1138
+ command = make_simple_command(:patch, 'v3/{+name}', options)
1139
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::Project::Representation
1140
+ command.request_object = project_object
1141
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
1142
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
1143
+ command.params['name'] = name unless name.nil?
1144
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1145
+ command.query['fields'] = fields unless fields.nil?
1146
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1147
+ execute_or_queue_command(command, &block)
1148
+ end
1149
+
1150
+ # Search for Projects that the caller has the `resourcemanager.projects.get`
1151
+ # permission on and satisfy the specified query. This method returns Projects in
1152
+ # an unspecified order. This method is eventually consistent with project
1153
+ # mutations; this means that a newly created project may not appear in the
1154
+ # results or recent updates to an existing project may not be reflected in the
1155
+ # results. To retrieve the latest state of a project, use the GetProject method.
1156
+ # @param [Fixnum] page_size
1157
+ # Optional. The maximum number of Projects to return in the response. The server
1158
+ # can return fewer Projects than requested. If unspecified, server picks an
1159
+ # appropriate default.
1160
+ # @param [String] page_token
1161
+ # Optional. A pagination token returned from a previous call to ListProjects
1162
+ # that indicates from where listing should continue.
1163
+ # @param [String] query
1164
+ # Optional. A query string for searching for projects that the caller has `
1165
+ # resourcemanager.projects.get` permission to. If multiple fields are included
1166
+ # in the query, the it will return results that match any of the fields. Some
1167
+ # eligible fields are: | Field | Description | |-------------------------|-------
1168
+ # ---------------------------------------| | displayName, name | Filters by
1169
+ # displayName. | | parent.type | Parent's type: `folder` or `organization`. | |
1170
+ # parent.id | Parent's id number (e.g. 123) | | parent | Project's parent. (e.g.
1171
+ # folders/123, organizations/*) Prefer parent field over parent.id and parent.
1172
+ # type. | | id, projectId | Filters by projectId. | | state, lifecycleState |
1173
+ # Filters by state. | | labels | Filters by label name or value. | | labels. (
1174
+ # where *key* is the name of a label) | Filters by label name. | Search
1175
+ # expressions are case insensitive. Some examples queries: | Query | Description
1176
+ # | |------------------|-----------------------------------------------------| |
1177
+ # name:how* | The project's name starts with "how". | | name:Howl | The project'
1178
+ # s name is `Howl` or `howl`. | | name:HOWL | Equivalent to above. | | NAME:howl
1179
+ # | Equivalent to above. | | labels.color:* | The project has the label `color`.
1180
+ # | | labels.color:red | The project's label `color` has the value `red`. | |
1181
+ # labels.color:red labels.size:big | The project's label `color` has the value `
1182
+ # red` and its label `size` has the value `big`. | If no query is specified, the
1183
+ # call will return projects for which the user has the `resourcemanager.projects.
1184
+ # get` permission.
1185
+ # @param [String] fields
1186
+ # Selector specifying which fields to include in a partial response.
1187
+ # @param [String] quota_user
1188
+ # Available to use for quota purposes for server-side applications. Can be any
1189
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1190
+ # @param [Google::Apis::RequestOptions] options
1191
+ # Request-specific options
1192
+ #
1193
+ # @yield [result, err] Result & error if block supplied
1194
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::SearchProjectsResponse] parsed result object
1195
+ # @yieldparam err [StandardError] error object if request failed
1196
+ #
1197
+ # @return [Google::Apis::CloudresourcemanagerV3::SearchProjectsResponse]
1198
+ #
1199
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1200
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1201
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1202
+ def search_projects(page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
1203
+ command = make_simple_command(:get, 'v3/projects:search', options)
1204
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::SearchProjectsResponse::Representation
1205
+ command.response_class = Google::Apis::CloudresourcemanagerV3::SearchProjectsResponse
1206
+ command.query['pageSize'] = page_size unless page_size.nil?
1207
+ command.query['pageToken'] = page_token unless page_token.nil?
1208
+ command.query['query'] = query unless query.nil?
1209
+ command.query['fields'] = fields unless fields.nil?
1210
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1211
+ execute_or_queue_command(command, &block)
1212
+ end
1213
+
1214
+ # Sets the IAM access control policy for the specified Project. CAUTION: This
1215
+ # method will replace the existing policy, and cannot be used to append
1216
+ # additional IAM settings. NOTE: Removing service accounts from policies or
1217
+ # changing their roles can render services completely inoperable. It is
1218
+ # important to understand how the service account is being used before removing
1219
+ # or updating its roles. The following constraints apply when using `
1220
+ # setIamPolicy()`: + Project does not support `allUsers` and `
1221
+ # allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner
1222
+ # role can be granted to a `user`, `serviceAccount`, or a group that is part of
1223
+ # an organization. For example, group@myownpersonaldomain.com could be added as
1224
+ # an owner to a project in the myownpersonaldomain.com organization, but not the
1225
+ # examplepetstore.com organization. + Service accounts can be made owners of a
1226
+ # project directly without any restrictions. However, to be added as an owner, a
1227
+ # user must be invited via Cloud Platform console and must accept the invitation.
1228
+ # + A user cannot be granted the owner role using `setIamPolicy()`. The user
1229
+ # must be granted the owner role using the Cloud Platform Console and must
1230
+ # explicitly accept the invitation. + Invitations to grant the owner role cannot
1231
+ # be sent using `setIamPolicy()`; they must be sent only using the Cloud
1232
+ # Platform Console. + Membership changes that leave the project without any
1233
+ # owners that have accepted the Terms of Service (ToS) will be rejected. + If
1234
+ # the project is not part of an organization, there must be at least one owner
1235
+ # who has accepted the Terms of Service (ToS) agreement in the policy. Calling `
1236
+ # setIamPolicy()` to remove the last ToS-accepted owner from the policy will
1237
+ # fail. This restriction also applies to legacy projects that no longer have
1238
+ # owners who have accepted the ToS. Edits to IAM policies will be rejected until
1239
+ # the lack of a ToS-accepting owner is rectified. + Calling this method requires
1240
+ # enabling the App Engine Admin API.
1241
+ # @param [String] resource
1242
+ # REQUIRED: The resource for which the policy is being specified. See the
1243
+ # operation documentation for the appropriate value for this field.
1244
+ # @param [Google::Apis::CloudresourcemanagerV3::SetIamPolicyRequest] set_iam_policy_request_object
1245
+ # @param [String] fields
1246
+ # Selector specifying which fields to include in a partial response.
1247
+ # @param [String] quota_user
1248
+ # Available to use for quota purposes for server-side applications. Can be any
1249
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1250
+ # @param [Google::Apis::RequestOptions] options
1251
+ # Request-specific options
1252
+ #
1253
+ # @yield [result, err] Result & error if block supplied
1254
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Policy] parsed result object
1255
+ # @yieldparam err [StandardError] error object if request failed
1256
+ #
1257
+ # @return [Google::Apis::CloudresourcemanagerV3::Policy]
1258
+ #
1259
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1260
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1261
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1262
+ def set_project_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1263
+ command = make_simple_command(:post, 'v3/{+resource}:setIamPolicy', options)
1264
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::SetIamPolicyRequest::Representation
1265
+ command.request_object = set_iam_policy_request_object
1266
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::Policy::Representation
1267
+ command.response_class = Google::Apis::CloudresourcemanagerV3::Policy
1268
+ command.params['resource'] = resource unless resource.nil?
1269
+ command.query['fields'] = fields unless fields.nil?
1270
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1271
+ execute_or_queue_command(command, &block)
1272
+ end
1273
+
1274
+ # Returns permissions that a caller has on the specified Project.
1275
+ # @param [String] resource
1276
+ # REQUIRED: The resource for which the policy detail is being requested. See the
1277
+ # operation documentation for the appropriate value for this field.
1278
+ # @param [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsRequest] test_iam_permissions_request_object
1279
+ # @param [String] fields
1280
+ # Selector specifying which fields to include in a partial response.
1281
+ # @param [String] quota_user
1282
+ # Available to use for quota purposes for server-side applications. Can be any
1283
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1284
+ # @param [Google::Apis::RequestOptions] options
1285
+ # Request-specific options
1286
+ #
1287
+ # @yield [result, err] Result & error if block supplied
1288
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse] parsed result object
1289
+ # @yieldparam err [StandardError] error object if request failed
1290
+ #
1291
+ # @return [Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse]
1292
+ #
1293
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1294
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1295
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1296
+ def test_project_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1297
+ command = make_simple_command(:post, 'v3/{+resource}:testIamPermissions', options)
1298
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsRequest::Representation
1299
+ command.request_object = test_iam_permissions_request_object
1300
+ command.response_representation = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse::Representation
1301
+ command.response_class = Google::Apis::CloudresourcemanagerV3::TestIamPermissionsResponse
1302
+ command.params['resource'] = resource unless resource.nil?
1303
+ command.query['fields'] = fields unless fields.nil?
1304
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1305
+ execute_or_queue_command(command, &block)
1306
+ end
1307
+
1308
+ # Restores the Project identified by the specified `name` (for example, `
1309
+ # projects/415104041262`). You can only use this method for a Project that has a
1310
+ # lifecycle state of DELETE_REQUESTED. After deletion starts, the Project cannot
1311
+ # be restored. The caller must have undelete permissions for this Project.
1312
+ # @param [String] name
1313
+ # Required. The name of the Project (for example, `projects/415104041262`).
1314
+ # Required.
1315
+ # @param [Google::Apis::CloudresourcemanagerV3::UndeleteProjectRequest] undelete_project_request_object
1316
+ # @param [String] fields
1317
+ # Selector specifying which fields to include in a partial response.
1318
+ # @param [String] quota_user
1319
+ # Available to use for quota purposes for server-side applications. Can be any
1320
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1321
+ # @param [Google::Apis::RequestOptions] options
1322
+ # Request-specific options
1323
+ #
1324
+ # @yield [result, err] Result & error if block supplied
1325
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV3::Operation] parsed result object
1326
+ # @yieldparam err [StandardError] error object if request failed
1327
+ #
1328
+ # @return [Google::Apis::CloudresourcemanagerV3::Operation]
1329
+ #
1330
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1331
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1332
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1333
+ def undelete_project(name, undelete_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1334
+ command = make_simple_command(:post, 'v3/{+name}:undelete', options)
1335
+ command.request_representation = Google::Apis::CloudresourcemanagerV3::UndeleteProjectRequest::Representation
1336
+ command.request_object = undelete_project_request_object
215
1337
  command.response_representation = Google::Apis::CloudresourcemanagerV3::Operation::Representation
216
1338
  command.response_class = Google::Apis::CloudresourcemanagerV3::Operation
217
1339
  command.params['name'] = name unless name.nil?