google-apis-cloudresourcemanager_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1461 @@
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 CloudresourcemanagerV1
23
+ # Cloud Resource Manager API
24
+ #
25
+ # Creates, reads, and updates metadata for Google Cloud Platform resource
26
+ # containers.
27
+ #
28
+ # @example
29
+ # require 'google/apis/cloudresourcemanager_v1'
30
+ #
31
+ # Cloudresourcemanager = Google::Apis::CloudresourcemanagerV1 # Alias the module
32
+ # service = Cloudresourcemanager::CloudResourceManagerService.new
33
+ #
34
+ # @see https://cloud.google.com/resource-manager
35
+ class CloudResourceManagerService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://cloudresourcemanager.googleapis.com/', '',
48
+ client_name: 'google-apis-cloudresourcemanager_v1',
49
+ client_version: Google::Apis::CloudresourcemanagerV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Clears a `Policy` from a resource.
54
+ # @param [String] resource
55
+ # Name of the resource for the `Policy` to clear.
56
+ # @param [Google::Apis::CloudresourcemanagerV1::ClearOrgPolicyRequest] clear_org_policy_request_object
57
+ # @param [String] fields
58
+ # Selector specifying which fields to include in a partial response.
59
+ # @param [String] quota_user
60
+ # Available to use for quota purposes for server-side applications. Can be any
61
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
62
+ # @param [Google::Apis::RequestOptions] options
63
+ # Request-specific options
64
+ #
65
+ # @yield [result, err] Result & error if block supplied
66
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Empty] parsed result object
67
+ # @yieldparam err [StandardError] error object if request failed
68
+ #
69
+ # @return [Google::Apis::CloudresourcemanagerV1::Empty]
70
+ #
71
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
72
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
73
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
74
+ def clear_folder_org_policy(resource, clear_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
75
+ command = make_simple_command(:post, 'v1/{+resource}:clearOrgPolicy', options)
76
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ClearOrgPolicyRequest::Representation
77
+ command.request_object = clear_org_policy_request_object
78
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Empty::Representation
79
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Empty
80
+ command.params['resource'] = resource unless resource.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
+ # Gets the effective `Policy` on a resource. This is the result of merging `
87
+ # Policies` in the resource hierarchy. The returned `Policy` will not have an `
88
+ # etag`set because it is a computed `Policy` across multiple resources. Subtrees
89
+ # of Resource Manager resource hierarchy with 'under:' prefix will not be
90
+ # expanded.
91
+ # @param [String] resource
92
+ # The name of the resource to start computing the effective `Policy`.
93
+ # @param [Google::Apis::CloudresourcemanagerV1::GetEffectiveOrgPolicyRequest] get_effective_org_policy_request_object
94
+ # @param [String] fields
95
+ # Selector specifying which fields to include in a partial response.
96
+ # @param [String] quota_user
97
+ # Available to use for quota purposes for server-side applications. Can be any
98
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
99
+ # @param [Google::Apis::RequestOptions] options
100
+ # Request-specific options
101
+ #
102
+ # @yield [result, err] Result & error if block supplied
103
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
104
+ # @yieldparam err [StandardError] error object if request failed
105
+ #
106
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
107
+ #
108
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
109
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
110
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
111
+ def get_folder_effective_org_policy(resource, get_effective_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
112
+ command = make_simple_command(:post, 'v1/{+resource}:getEffectiveOrgPolicy', options)
113
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetEffectiveOrgPolicyRequest::Representation
114
+ command.request_object = get_effective_org_policy_request_object
115
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
116
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
117
+ command.params['resource'] = resource unless resource.nil?
118
+ command.query['fields'] = fields unless fields.nil?
119
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
120
+ execute_or_queue_command(command, &block)
121
+ end
122
+
123
+ # Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `
124
+ # Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for
125
+ # the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to
126
+ # create or update a `Policy` during read-modify-write.
127
+ # @param [String] resource
128
+ # Name of the resource the `Policy` is set on.
129
+ # @param [Google::Apis::CloudresourcemanagerV1::GetOrgPolicyRequest] get_org_policy_request_object
130
+ # @param [String] fields
131
+ # Selector specifying which fields to include in a partial response.
132
+ # @param [String] quota_user
133
+ # Available to use for quota purposes for server-side applications. Can be any
134
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
135
+ # @param [Google::Apis::RequestOptions] options
136
+ # Request-specific options
137
+ #
138
+ # @yield [result, err] Result & error if block supplied
139
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
140
+ # @yieldparam err [StandardError] error object if request failed
141
+ #
142
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
143
+ #
144
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
145
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
146
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
147
+ def get_folder_org_policy(resource, get_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
148
+ command = make_simple_command(:post, 'v1/{+resource}:getOrgPolicy', options)
149
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetOrgPolicyRequest::Representation
150
+ command.request_object = get_org_policy_request_object
151
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
152
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
153
+ command.params['resource'] = resource unless resource.nil?
154
+ command.query['fields'] = fields unless fields.nil?
155
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
156
+ execute_or_queue_command(command, &block)
157
+ end
158
+
159
+ # Lists `Constraints` that could be applied on the specified resource.
160
+ # @param [String] resource
161
+ # Name of the resource to list `Constraints` for.
162
+ # @param [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsRequest] list_available_org_policy_constraints_request_object
163
+ # @param [String] fields
164
+ # Selector specifying which fields to include in a partial response.
165
+ # @param [String] quota_user
166
+ # Available to use for quota purposes for server-side applications. Can be any
167
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
168
+ # @param [Google::Apis::RequestOptions] options
169
+ # Request-specific options
170
+ #
171
+ # @yield [result, err] Result & error if block supplied
172
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse] parsed result object
173
+ # @yieldparam err [StandardError] error object if request failed
174
+ #
175
+ # @return [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse]
176
+ #
177
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
178
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
179
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
180
+ def list_folder_available_org_policy_constraints(resource, list_available_org_policy_constraints_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
181
+ command = make_simple_command(:post, 'v1/{+resource}:listAvailableOrgPolicyConstraints', options)
182
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsRequest::Representation
183
+ command.request_object = list_available_org_policy_constraints_request_object
184
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse::Representation
185
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse
186
+ command.params['resource'] = resource unless resource.nil?
187
+ command.query['fields'] = fields unless fields.nil?
188
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
189
+ execute_or_queue_command(command, &block)
190
+ end
191
+
192
+ # Lists all the `Policies` set for a particular resource.
193
+ # @param [String] resource
194
+ # Name of the resource to list Policies for.
195
+ # @param [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesRequest] list_org_policies_request_object
196
+ # @param [String] fields
197
+ # Selector specifying which fields to include in a partial response.
198
+ # @param [String] quota_user
199
+ # Available to use for quota purposes for server-side applications. Can be any
200
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
201
+ # @param [Google::Apis::RequestOptions] options
202
+ # Request-specific options
203
+ #
204
+ # @yield [result, err] Result & error if block supplied
205
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse] parsed result object
206
+ # @yieldparam err [StandardError] error object if request failed
207
+ #
208
+ # @return [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse]
209
+ #
210
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
211
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
212
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
213
+ def list_folder_org_policies(resource, list_org_policies_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
214
+ command = make_simple_command(:post, 'v1/{+resource}:listOrgPolicies', options)
215
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesRequest::Representation
216
+ command.request_object = list_org_policies_request_object
217
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse::Representation
218
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse
219
+ command.params['resource'] = resource unless resource.nil?
220
+ command.query['fields'] = fields unless fields.nil?
221
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
222
+ execute_or_queue_command(command, &block)
223
+ end
224
+
225
+ # Updates the specified `Policy` on the resource. Creates a new `Policy` for
226
+ # that `Constraint` on the resource if one does not exist. Not supplying an `
227
+ # etag` on the request `Policy` results in an unconditional write of the `Policy`
228
+ # .
229
+ # @param [String] resource
230
+ # Resource name of the resource to attach the `Policy`.
231
+ # @param [Google::Apis::CloudresourcemanagerV1::SetOrgPolicyRequest] set_org_policy_request_object
232
+ # @param [String] fields
233
+ # Selector specifying which fields to include in a partial response.
234
+ # @param [String] quota_user
235
+ # Available to use for quota purposes for server-side applications. Can be any
236
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
237
+ # @param [Google::Apis::RequestOptions] options
238
+ # Request-specific options
239
+ #
240
+ # @yield [result, err] Result & error if block supplied
241
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
242
+ # @yieldparam err [StandardError] error object if request failed
243
+ #
244
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
245
+ #
246
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
247
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
248
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
249
+ def set_folder_org_policy(resource, set_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
250
+ command = make_simple_command(:post, 'v1/{+resource}:setOrgPolicy', options)
251
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::SetOrgPolicyRequest::Representation
252
+ command.request_object = set_org_policy_request_object
253
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
254
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
255
+ command.params['resource'] = resource unless resource.nil?
256
+ command.query['fields'] = fields unless fields.nil?
257
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
258
+ execute_or_queue_command(command, &block)
259
+ end
260
+
261
+ # Create a Lien which applies to the resource denoted by the `parent` field.
262
+ # Callers of this method will require permission on the `parent` resource. For
263
+ # example, applying to `projects/1234` requires permission `resourcemanager.
264
+ # projects.updateLiens`. NOTE: Some resources may limit the number of Liens
265
+ # which may be applied.
266
+ # @param [Google::Apis::CloudresourcemanagerV1::Lien] lien_object
267
+ # @param [String] fields
268
+ # Selector specifying which fields to include in a partial response.
269
+ # @param [String] quota_user
270
+ # Available to use for quota purposes for server-side applications. Can be any
271
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
272
+ # @param [Google::Apis::RequestOptions] options
273
+ # Request-specific options
274
+ #
275
+ # @yield [result, err] Result & error if block supplied
276
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Lien] parsed result object
277
+ # @yieldparam err [StandardError] error object if request failed
278
+ #
279
+ # @return [Google::Apis::CloudresourcemanagerV1::Lien]
280
+ #
281
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
282
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
283
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
284
+ def create_lien(lien_object = nil, fields: nil, quota_user: nil, options: nil, &block)
285
+ command = make_simple_command(:post, 'v1/liens', options)
286
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::Lien::Representation
287
+ command.request_object = lien_object
288
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Lien::Representation
289
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Lien
290
+ command.query['fields'] = fields unless fields.nil?
291
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
292
+ execute_or_queue_command(command, &block)
293
+ end
294
+
295
+ # Delete a Lien by `name`. Callers of this method will require permission on the
296
+ # `parent` resource. For example, a Lien with a `parent` of `projects/1234`
297
+ # requires permission `resourcemanager.projects.updateLiens`.
298
+ # @param [String] name
299
+ # Required. The name/identifier of the Lien to delete.
300
+ # @param [String] fields
301
+ # Selector specifying which fields to include in a partial response.
302
+ # @param [String] quota_user
303
+ # Available to use for quota purposes for server-side applications. Can be any
304
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
305
+ # @param [Google::Apis::RequestOptions] options
306
+ # Request-specific options
307
+ #
308
+ # @yield [result, err] Result & error if block supplied
309
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Empty] parsed result object
310
+ # @yieldparam err [StandardError] error object if request failed
311
+ #
312
+ # @return [Google::Apis::CloudresourcemanagerV1::Empty]
313
+ #
314
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
315
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
316
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
317
+ def delete_lien(name, fields: nil, quota_user: nil, options: nil, &block)
318
+ command = make_simple_command(:delete, 'v1/{+name}', options)
319
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Empty::Representation
320
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Empty
321
+ command.params['name'] = name unless name.nil?
322
+ command.query['fields'] = fields unless fields.nil?
323
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
324
+ execute_or_queue_command(command, &block)
325
+ end
326
+
327
+ # Retrieve a Lien by `name`. Callers of this method will require permission on
328
+ # the `parent` resource. For example, a Lien with a `parent` of `projects/1234`
329
+ # requires permission requires permission `resourcemanager.projects.get` or `
330
+ # resourcemanager.projects.updateLiens`.
331
+ # @param [String] name
332
+ # Required. The name/identifier of the Lien.
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 [Google::Apis::CloudresourcemanagerV1::Lien] parsed result object
343
+ # @yieldparam err [StandardError] error object if request failed
344
+ #
345
+ # @return [Google::Apis::CloudresourcemanagerV1::Lien]
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 get_lien(name, fields: nil, quota_user: nil, options: nil, &block)
351
+ command = make_simple_command(:get, 'v1/{+name}', options)
352
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Lien::Representation
353
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Lien
354
+ command.params['name'] = name unless name.nil?
355
+ command.query['fields'] = fields unless fields.nil?
356
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
357
+ execute_or_queue_command(command, &block)
358
+ end
359
+
360
+ # List all Liens applied to the `parent` resource. Callers of this method will
361
+ # require permission on the `parent` resource. For example, a Lien with a `
362
+ # parent` of `projects/1234` requires permission `resourcemanager.projects.get`.
363
+ # @param [Fixnum] page_size
364
+ # The maximum number of items to return. This is a suggestion for the server.
365
+ # @param [String] page_token
366
+ # The `next_page_token` value returned from a previous List request, if any.
367
+ # @param [String] parent
368
+ # Required. The name of the resource to list all attached Liens. For example, `
369
+ # projects/1234`. (google.api.field_policy).resource_type annotation is not set
370
+ # since the parent depends on the meta api implementation. This field could be a
371
+ # project or other sub project resources.
372
+ # @param [String] fields
373
+ # Selector specifying which fields to include in a partial response.
374
+ # @param [String] quota_user
375
+ # Available to use for quota purposes for server-side applications. Can be any
376
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
377
+ # @param [Google::Apis::RequestOptions] options
378
+ # Request-specific options
379
+ #
380
+ # @yield [result, err] Result & error if block supplied
381
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListLiensResponse] parsed result object
382
+ # @yieldparam err [StandardError] error object if request failed
383
+ #
384
+ # @return [Google::Apis::CloudresourcemanagerV1::ListLiensResponse]
385
+ #
386
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
387
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
388
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
389
+ def list_liens(page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: nil, options: nil, &block)
390
+ command = make_simple_command(:get, 'v1/liens', options)
391
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListLiensResponse::Representation
392
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListLiensResponse
393
+ command.query['pageSize'] = page_size unless page_size.nil?
394
+ command.query['pageToken'] = page_token unless page_token.nil?
395
+ command.query['parent'] = parent unless parent.nil?
396
+ command.query['fields'] = fields unless fields.nil?
397
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
398
+ execute_or_queue_command(command, &block)
399
+ end
400
+
401
+ # Gets the latest state of a long-running operation. Clients can use this method
402
+ # to poll the operation result at intervals as recommended by the API service.
403
+ # @param [String] name
404
+ # The name of the operation resource.
405
+ # @param [String] fields
406
+ # Selector specifying which fields to include in a partial response.
407
+ # @param [String] quota_user
408
+ # Available to use for quota purposes for server-side applications. Can be any
409
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
410
+ # @param [Google::Apis::RequestOptions] options
411
+ # Request-specific options
412
+ #
413
+ # @yield [result, err] Result & error if block supplied
414
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Operation] parsed result object
415
+ # @yieldparam err [StandardError] error object if request failed
416
+ #
417
+ # @return [Google::Apis::CloudresourcemanagerV1::Operation]
418
+ #
419
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
420
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
421
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
422
+ def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
423
+ command = make_simple_command(:get, 'v1/{+name}', options)
424
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Operation::Representation
425
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Operation
426
+ command.params['name'] = name unless name.nil?
427
+ command.query['fields'] = fields unless fields.nil?
428
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
429
+ execute_or_queue_command(command, &block)
430
+ end
431
+
432
+ # Clears a `Policy` from a resource.
433
+ # @param [String] resource
434
+ # Name of the resource for the `Policy` to clear.
435
+ # @param [Google::Apis::CloudresourcemanagerV1::ClearOrgPolicyRequest] clear_org_policy_request_object
436
+ # @param [String] fields
437
+ # Selector specifying which fields to include in a partial response.
438
+ # @param [String] quota_user
439
+ # Available to use for quota purposes for server-side applications. Can be any
440
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
441
+ # @param [Google::Apis::RequestOptions] options
442
+ # Request-specific options
443
+ #
444
+ # @yield [result, err] Result & error if block supplied
445
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Empty] parsed result object
446
+ # @yieldparam err [StandardError] error object if request failed
447
+ #
448
+ # @return [Google::Apis::CloudresourcemanagerV1::Empty]
449
+ #
450
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
451
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
452
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
453
+ def clear_organization_org_policy(resource, clear_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
454
+ command = make_simple_command(:post, 'v1/{+resource}:clearOrgPolicy', options)
455
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ClearOrgPolicyRequest::Representation
456
+ command.request_object = clear_org_policy_request_object
457
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Empty::Representation
458
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Empty
459
+ command.params['resource'] = resource unless resource.nil?
460
+ command.query['fields'] = fields unless fields.nil?
461
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
462
+ execute_or_queue_command(command, &block)
463
+ end
464
+
465
+ # Fetches an Organization resource identified by the specified resource name.
466
+ # @param [String] name
467
+ # The resource name of the Organization to fetch. This is the organization's
468
+ # relative path in the API, formatted as "organizations/[organizationId]". For
469
+ # example, "organizations/1234".
470
+ # @param [String] fields
471
+ # Selector specifying which fields to include in a partial response.
472
+ # @param [String] quota_user
473
+ # Available to use for quota purposes for server-side applications. Can be any
474
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
475
+ # @param [Google::Apis::RequestOptions] options
476
+ # Request-specific options
477
+ #
478
+ # @yield [result, err] Result & error if block supplied
479
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Organization] parsed result object
480
+ # @yieldparam err [StandardError] error object if request failed
481
+ #
482
+ # @return [Google::Apis::CloudresourcemanagerV1::Organization]
483
+ #
484
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
485
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
486
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
487
+ def get_organization(name, fields: nil, quota_user: nil, options: nil, &block)
488
+ command = make_simple_command(:get, 'v1/{+name}', options)
489
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Organization::Representation
490
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Organization
491
+ command.params['name'] = name unless name.nil?
492
+ command.query['fields'] = fields unless fields.nil?
493
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
494
+ execute_or_queue_command(command, &block)
495
+ end
496
+
497
+ # Gets the effective `Policy` on a resource. This is the result of merging `
498
+ # Policies` in the resource hierarchy. The returned `Policy` will not have an `
499
+ # etag`set because it is a computed `Policy` across multiple resources. Subtrees
500
+ # of Resource Manager resource hierarchy with 'under:' prefix will not be
501
+ # expanded.
502
+ # @param [String] resource
503
+ # The name of the resource to start computing the effective `Policy`.
504
+ # @param [Google::Apis::CloudresourcemanagerV1::GetEffectiveOrgPolicyRequest] get_effective_org_policy_request_object
505
+ # @param [String] fields
506
+ # Selector specifying which fields to include in a partial response.
507
+ # @param [String] quota_user
508
+ # Available to use for quota purposes for server-side applications. Can be any
509
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
510
+ # @param [Google::Apis::RequestOptions] options
511
+ # Request-specific options
512
+ #
513
+ # @yield [result, err] Result & error if block supplied
514
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
515
+ # @yieldparam err [StandardError] error object if request failed
516
+ #
517
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
518
+ #
519
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
520
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
521
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
522
+ def get_organization_effective_org_policy(resource, get_effective_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
523
+ command = make_simple_command(:post, 'v1/{+resource}:getEffectiveOrgPolicy', options)
524
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetEffectiveOrgPolicyRequest::Representation
525
+ command.request_object = get_effective_org_policy_request_object
526
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
527
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
528
+ command.params['resource'] = resource unless resource.nil?
529
+ command.query['fields'] = fields unless fields.nil?
530
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
531
+ execute_or_queue_command(command, &block)
532
+ end
533
+
534
+ # Gets the access control policy for an Organization resource. May be empty if
535
+ # no such policy or resource exists. The `resource` field should be the
536
+ # organization's resource name, e.g. "organizations/123". Authorization requires
537
+ # the Google IAM permission `resourcemanager.organizations.getIamPolicy` on the
538
+ # specified organization
539
+ # @param [String] resource
540
+ # REQUIRED: The resource for which the policy is being requested. See the
541
+ # operation documentation for the appropriate value for this field.
542
+ # @param [Google::Apis::CloudresourcemanagerV1::GetIamPolicyRequest] get_iam_policy_request_object
543
+ # @param [String] fields
544
+ # Selector specifying which fields to include in a partial response.
545
+ # @param [String] quota_user
546
+ # Available to use for quota purposes for server-side applications. Can be any
547
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
548
+ # @param [Google::Apis::RequestOptions] options
549
+ # Request-specific options
550
+ #
551
+ # @yield [result, err] Result & error if block supplied
552
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Policy] parsed result object
553
+ # @yieldparam err [StandardError] error object if request failed
554
+ #
555
+ # @return [Google::Apis::CloudresourcemanagerV1::Policy]
556
+ #
557
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
558
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
559
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
560
+ def get_organization_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
561
+ command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options)
562
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetIamPolicyRequest::Representation
563
+ command.request_object = get_iam_policy_request_object
564
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Policy::Representation
565
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Policy
566
+ command.params['resource'] = resource unless resource.nil?
567
+ command.query['fields'] = fields unless fields.nil?
568
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
569
+ execute_or_queue_command(command, &block)
570
+ end
571
+
572
+ # Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `
573
+ # Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for
574
+ # the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to
575
+ # create or update a `Policy` during read-modify-write.
576
+ # @param [String] resource
577
+ # Name of the resource the `Policy` is set on.
578
+ # @param [Google::Apis::CloudresourcemanagerV1::GetOrgPolicyRequest] get_org_policy_request_object
579
+ # @param [String] fields
580
+ # Selector specifying which fields to include in a partial response.
581
+ # @param [String] quota_user
582
+ # Available to use for quota purposes for server-side applications. Can be any
583
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
584
+ # @param [Google::Apis::RequestOptions] options
585
+ # Request-specific options
586
+ #
587
+ # @yield [result, err] Result & error if block supplied
588
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
589
+ # @yieldparam err [StandardError] error object if request failed
590
+ #
591
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
592
+ #
593
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
594
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
595
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
596
+ def get_organization_org_policy(resource, get_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
597
+ command = make_simple_command(:post, 'v1/{+resource}:getOrgPolicy', options)
598
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetOrgPolicyRequest::Representation
599
+ command.request_object = get_org_policy_request_object
600
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
601
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
602
+ command.params['resource'] = resource unless resource.nil?
603
+ command.query['fields'] = fields unless fields.nil?
604
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
605
+ execute_or_queue_command(command, &block)
606
+ end
607
+
608
+ # Lists `Constraints` that could be applied on the specified resource.
609
+ # @param [String] resource
610
+ # Name of the resource to list `Constraints` for.
611
+ # @param [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsRequest] list_available_org_policy_constraints_request_object
612
+ # @param [String] fields
613
+ # Selector specifying which fields to include in a partial response.
614
+ # @param [String] quota_user
615
+ # Available to use for quota purposes for server-side applications. Can be any
616
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
617
+ # @param [Google::Apis::RequestOptions] options
618
+ # Request-specific options
619
+ #
620
+ # @yield [result, err] Result & error if block supplied
621
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse] parsed result object
622
+ # @yieldparam err [StandardError] error object if request failed
623
+ #
624
+ # @return [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse]
625
+ #
626
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
627
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
628
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
629
+ def list_organization_available_org_policy_constraints(resource, list_available_org_policy_constraints_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
630
+ command = make_simple_command(:post, 'v1/{+resource}:listAvailableOrgPolicyConstraints', options)
631
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsRequest::Representation
632
+ command.request_object = list_available_org_policy_constraints_request_object
633
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse::Representation
634
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse
635
+ command.params['resource'] = resource unless resource.nil?
636
+ command.query['fields'] = fields unless fields.nil?
637
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
638
+ execute_or_queue_command(command, &block)
639
+ end
640
+
641
+ # Lists all the `Policies` set for a particular resource.
642
+ # @param [String] resource
643
+ # Name of the resource to list Policies for.
644
+ # @param [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesRequest] list_org_policies_request_object
645
+ # @param [String] fields
646
+ # Selector specifying which fields to include in a partial response.
647
+ # @param [String] quota_user
648
+ # Available to use for quota purposes for server-side applications. Can be any
649
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
650
+ # @param [Google::Apis::RequestOptions] options
651
+ # Request-specific options
652
+ #
653
+ # @yield [result, err] Result & error if block supplied
654
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse] parsed result object
655
+ # @yieldparam err [StandardError] error object if request failed
656
+ #
657
+ # @return [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse]
658
+ #
659
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
660
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
661
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
662
+ def list_organization_org_policies(resource, list_org_policies_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
663
+ command = make_simple_command(:post, 'v1/{+resource}:listOrgPolicies', options)
664
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesRequest::Representation
665
+ command.request_object = list_org_policies_request_object
666
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse::Representation
667
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse
668
+ command.params['resource'] = resource unless resource.nil?
669
+ command.query['fields'] = fields unless fields.nil?
670
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
671
+ execute_or_queue_command(command, &block)
672
+ end
673
+
674
+ # Searches Organization resources that are visible to the user and satisfy the
675
+ # specified filter. This method returns Organizations in an unspecified order.
676
+ # New Organizations do not necessarily appear at the end of the results. Search
677
+ # will only return organizations on which the user has the permission `
678
+ # resourcemanager.organizations.get`
679
+ # @param [Google::Apis::CloudresourcemanagerV1::SearchOrganizationsRequest] search_organizations_request_object
680
+ # @param [String] fields
681
+ # Selector specifying which fields to include in a partial response.
682
+ # @param [String] quota_user
683
+ # Available to use for quota purposes for server-side applications. Can be any
684
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
685
+ # @param [Google::Apis::RequestOptions] options
686
+ # Request-specific options
687
+ #
688
+ # @yield [result, err] Result & error if block supplied
689
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::SearchOrganizationsResponse] parsed result object
690
+ # @yieldparam err [StandardError] error object if request failed
691
+ #
692
+ # @return [Google::Apis::CloudresourcemanagerV1::SearchOrganizationsResponse]
693
+ #
694
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
695
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
696
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
697
+ def search_organizations(search_organizations_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
698
+ command = make_simple_command(:post, 'v1/organizations:search', options)
699
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::SearchOrganizationsRequest::Representation
700
+ command.request_object = search_organizations_request_object
701
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::SearchOrganizationsResponse::Representation
702
+ command.response_class = Google::Apis::CloudresourcemanagerV1::SearchOrganizationsResponse
703
+ command.query['fields'] = fields unless fields.nil?
704
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
705
+ execute_or_queue_command(command, &block)
706
+ end
707
+
708
+ # Sets the access control policy on an Organization resource. Replaces any
709
+ # existing policy. The `resource` field should be the organization's resource
710
+ # name, e.g. "organizations/123". Authorization requires the Google IAM
711
+ # permission `resourcemanager.organizations.setIamPolicy` on the specified
712
+ # organization
713
+ # @param [String] resource
714
+ # REQUIRED: The resource for which the policy is being specified. See the
715
+ # operation documentation for the appropriate value for this field.
716
+ # @param [Google::Apis::CloudresourcemanagerV1::SetIamPolicyRequest] set_iam_policy_request_object
717
+ # @param [String] fields
718
+ # Selector specifying which fields to include in a partial response.
719
+ # @param [String] quota_user
720
+ # Available to use for quota purposes for server-side applications. Can be any
721
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
722
+ # @param [Google::Apis::RequestOptions] options
723
+ # Request-specific options
724
+ #
725
+ # @yield [result, err] Result & error if block supplied
726
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Policy] parsed result object
727
+ # @yieldparam err [StandardError] error object if request failed
728
+ #
729
+ # @return [Google::Apis::CloudresourcemanagerV1::Policy]
730
+ #
731
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
732
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
733
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
734
+ def set_organization_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
735
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
736
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::SetIamPolicyRequest::Representation
737
+ command.request_object = set_iam_policy_request_object
738
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Policy::Representation
739
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Policy
740
+ command.params['resource'] = resource unless resource.nil?
741
+ command.query['fields'] = fields unless fields.nil?
742
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
743
+ execute_or_queue_command(command, &block)
744
+ end
745
+
746
+ # Updates the specified `Policy` on the resource. Creates a new `Policy` for
747
+ # that `Constraint` on the resource if one does not exist. Not supplying an `
748
+ # etag` on the request `Policy` results in an unconditional write of the `Policy`
749
+ # .
750
+ # @param [String] resource
751
+ # Resource name of the resource to attach the `Policy`.
752
+ # @param [Google::Apis::CloudresourcemanagerV1::SetOrgPolicyRequest] set_org_policy_request_object
753
+ # @param [String] fields
754
+ # Selector specifying which fields to include in a partial response.
755
+ # @param [String] quota_user
756
+ # Available to use for quota purposes for server-side applications. Can be any
757
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
758
+ # @param [Google::Apis::RequestOptions] options
759
+ # Request-specific options
760
+ #
761
+ # @yield [result, err] Result & error if block supplied
762
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
763
+ # @yieldparam err [StandardError] error object if request failed
764
+ #
765
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
766
+ #
767
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
768
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
769
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
770
+ def set_organization_org_policy(resource, set_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
771
+ command = make_simple_command(:post, 'v1/{+resource}:setOrgPolicy', options)
772
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::SetOrgPolicyRequest::Representation
773
+ command.request_object = set_org_policy_request_object
774
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
775
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
776
+ command.params['resource'] = resource unless resource.nil?
777
+ command.query['fields'] = fields unless fields.nil?
778
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
779
+ execute_or_queue_command(command, &block)
780
+ end
781
+
782
+ # Returns permissions that a caller has on the specified Organization. The `
783
+ # resource` field should be the organization's resource name, e.g. "
784
+ # organizations/123". There are no permissions required for making this API call.
785
+ # @param [String] resource
786
+ # REQUIRED: The resource for which the policy detail is being requested. See the
787
+ # operation documentation for the appropriate value for this field.
788
+ # @param [Google::Apis::CloudresourcemanagerV1::TestIamPermissionsRequest] test_iam_permissions_request_object
789
+ # @param [String] fields
790
+ # Selector specifying which fields to include in a partial response.
791
+ # @param [String] quota_user
792
+ # Available to use for quota purposes for server-side applications. Can be any
793
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
794
+ # @param [Google::Apis::RequestOptions] options
795
+ # Request-specific options
796
+ #
797
+ # @yield [result, err] Result & error if block supplied
798
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse] parsed result object
799
+ # @yieldparam err [StandardError] error object if request failed
800
+ #
801
+ # @return [Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse]
802
+ #
803
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
804
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
805
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
806
+ def test_organization_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
807
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
808
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::TestIamPermissionsRequest::Representation
809
+ command.request_object = test_iam_permissions_request_object
810
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse::Representation
811
+ command.response_class = Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse
812
+ command.params['resource'] = resource unless resource.nil?
813
+ command.query['fields'] = fields unless fields.nil?
814
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
815
+ execute_or_queue_command(command, &block)
816
+ end
817
+
818
+ # Clears a `Policy` from a resource.
819
+ # @param [String] resource
820
+ # Name of the resource for the `Policy` to clear.
821
+ # @param [Google::Apis::CloudresourcemanagerV1::ClearOrgPolicyRequest] clear_org_policy_request_object
822
+ # @param [String] fields
823
+ # Selector specifying which fields to include in a partial response.
824
+ # @param [String] quota_user
825
+ # Available to use for quota purposes for server-side applications. Can be any
826
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
827
+ # @param [Google::Apis::RequestOptions] options
828
+ # Request-specific options
829
+ #
830
+ # @yield [result, err] Result & error if block supplied
831
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Empty] parsed result object
832
+ # @yieldparam err [StandardError] error object if request failed
833
+ #
834
+ # @return [Google::Apis::CloudresourcemanagerV1::Empty]
835
+ #
836
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
837
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
838
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
839
+ def clear_project_org_policy(resource, clear_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
840
+ command = make_simple_command(:post, 'v1/{+resource}:clearOrgPolicy', options)
841
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ClearOrgPolicyRequest::Representation
842
+ command.request_object = clear_org_policy_request_object
843
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Empty::Representation
844
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Empty
845
+ command.params['resource'] = resource unless resource.nil?
846
+ command.query['fields'] = fields unless fields.nil?
847
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
848
+ execute_or_queue_command(command, &block)
849
+ end
850
+
851
+ # Request that a new Project be created. The result is an Operation which can be
852
+ # used to track the creation process. This process usually takes a few seconds,
853
+ # but can sometimes take much longer. The tracking Operation is automatically
854
+ # deleted after a few hours, so there is no need to call DeleteOperation.
855
+ # Authorization requires the Google IAM permission `resourcemanager.projects.
856
+ # create` on the specified parent for the new project. The parent is identified
857
+ # by a specified ResourceId, which must include both an ID and a type, such as
858
+ # organization. This method does not associate the new project with a billing
859
+ # account. You can set or update the billing account associated with a project
860
+ # using the [`projects.updateBillingInfo`] (/billing/reference/rest/v1/projects/
861
+ # updateBillingInfo) method.
862
+ # @param [Google::Apis::CloudresourcemanagerV1::Project] project_object
863
+ # @param [String] fields
864
+ # Selector specifying which fields to include in a partial response.
865
+ # @param [String] quota_user
866
+ # Available to use for quota purposes for server-side applications. Can be any
867
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
868
+ # @param [Google::Apis::RequestOptions] options
869
+ # Request-specific options
870
+ #
871
+ # @yield [result, err] Result & error if block supplied
872
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Operation] parsed result object
873
+ # @yieldparam err [StandardError] error object if request failed
874
+ #
875
+ # @return [Google::Apis::CloudresourcemanagerV1::Operation]
876
+ #
877
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
878
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
879
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
880
+ def create_project(project_object = nil, fields: nil, quota_user: nil, options: nil, &block)
881
+ command = make_simple_command(:post, 'v1/projects', options)
882
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::Project::Representation
883
+ command.request_object = project_object
884
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Operation::Representation
885
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Operation
886
+ command.query['fields'] = fields unless fields.nil?
887
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
888
+ execute_or_queue_command(command, &block)
889
+ end
890
+
891
+ # Marks the Project identified by the specified `project_id` (for example, `my-
892
+ # project-123`) for deletion. This method will only affect the Project if it has
893
+ # a lifecycle state of ACTIVE. This method changes the Project's lifecycle state
894
+ # from ACTIVE to DELETE_REQUESTED. The deletion starts at an unspecified time,
895
+ # at which point the Project is no longer accessible. Until the deletion
896
+ # completes, you can check the lifecycle state checked by retrieving the Project
897
+ # with GetProject, and the Project remains visible to ListProjects. However, you
898
+ # cannot update the project. After the deletion completes, the Project is not
899
+ # retrievable by the GetProject and ListProjects methods. The caller must have
900
+ # delete permissions for this Project.
901
+ # @param [String] project_id
902
+ # The Project ID (for example, `foo-bar-123`). Required.
903
+ # @param [String] fields
904
+ # Selector specifying which fields to include in a partial response.
905
+ # @param [String] quota_user
906
+ # Available to use for quota purposes for server-side applications. Can be any
907
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
908
+ # @param [Google::Apis::RequestOptions] options
909
+ # Request-specific options
910
+ #
911
+ # @yield [result, err] Result & error if block supplied
912
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Empty] parsed result object
913
+ # @yieldparam err [StandardError] error object if request failed
914
+ #
915
+ # @return [Google::Apis::CloudresourcemanagerV1::Empty]
916
+ #
917
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
918
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
919
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
920
+ def delete_project(project_id, fields: nil, quota_user: nil, options: nil, &block)
921
+ command = make_simple_command(:delete, 'v1/projects/{projectId}', options)
922
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Empty::Representation
923
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Empty
924
+ command.params['projectId'] = project_id unless project_id.nil?
925
+ command.query['fields'] = fields unless fields.nil?
926
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
927
+ execute_or_queue_command(command, &block)
928
+ end
929
+
930
+ # Retrieves the Project identified by the specified `project_id` (for example, `
931
+ # my-project-123`). The caller must have read permissions for this Project.
932
+ # @param [String] project_id
933
+ # Required. The Project ID (for example, `my-project-123`).
934
+ # @param [String] fields
935
+ # Selector specifying which fields to include in a partial response.
936
+ # @param [String] quota_user
937
+ # Available to use for quota purposes for server-side applications. Can be any
938
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
939
+ # @param [Google::Apis::RequestOptions] options
940
+ # Request-specific options
941
+ #
942
+ # @yield [result, err] Result & error if block supplied
943
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Project] parsed result object
944
+ # @yieldparam err [StandardError] error object if request failed
945
+ #
946
+ # @return [Google::Apis::CloudresourcemanagerV1::Project]
947
+ #
948
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
949
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
950
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
951
+ def get_project(project_id, fields: nil, quota_user: nil, options: nil, &block)
952
+ command = make_simple_command(:get, 'v1/projects/{projectId}', options)
953
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Project::Representation
954
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Project
955
+ command.params['projectId'] = project_id unless project_id.nil?
956
+ command.query['fields'] = fields unless fields.nil?
957
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
958
+ execute_or_queue_command(command, &block)
959
+ end
960
+
961
+ # Gets a list of ancestors in the resource hierarchy for the Project identified
962
+ # by the specified `project_id` (for example, `my-project-123`). The caller must
963
+ # have read permissions for this Project.
964
+ # @param [String] project_id
965
+ # Required. The Project ID (for example, `my-project-123`).
966
+ # @param [Google::Apis::CloudresourcemanagerV1::GetAncestryRequest] get_ancestry_request_object
967
+ # @param [String] fields
968
+ # Selector specifying which fields to include in a partial response.
969
+ # @param [String] quota_user
970
+ # Available to use for quota purposes for server-side applications. Can be any
971
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
972
+ # @param [Google::Apis::RequestOptions] options
973
+ # Request-specific options
974
+ #
975
+ # @yield [result, err] Result & error if block supplied
976
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::GetAncestryResponse] parsed result object
977
+ # @yieldparam err [StandardError] error object if request failed
978
+ #
979
+ # @return [Google::Apis::CloudresourcemanagerV1::GetAncestryResponse]
980
+ #
981
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
982
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
983
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
984
+ def get_project_ancestry(project_id, get_ancestry_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
985
+ command = make_simple_command(:post, 'v1/projects/{projectId}:getAncestry', options)
986
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetAncestryRequest::Representation
987
+ command.request_object = get_ancestry_request_object
988
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::GetAncestryResponse::Representation
989
+ command.response_class = Google::Apis::CloudresourcemanagerV1::GetAncestryResponse
990
+ command.params['projectId'] = project_id unless project_id.nil?
991
+ command.query['fields'] = fields unless fields.nil?
992
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
993
+ execute_or_queue_command(command, &block)
994
+ end
995
+
996
+ # Gets the effective `Policy` on a resource. This is the result of merging `
997
+ # Policies` in the resource hierarchy. The returned `Policy` will not have an `
998
+ # etag`set because it is a computed `Policy` across multiple resources. Subtrees
999
+ # of Resource Manager resource hierarchy with 'under:' prefix will not be
1000
+ # expanded.
1001
+ # @param [String] resource
1002
+ # The name of the resource to start computing the effective `Policy`.
1003
+ # @param [Google::Apis::CloudresourcemanagerV1::GetEffectiveOrgPolicyRequest] get_effective_org_policy_request_object
1004
+ # @param [String] fields
1005
+ # Selector specifying which fields to include in a partial response.
1006
+ # @param [String] quota_user
1007
+ # Available to use for quota purposes for server-side applications. Can be any
1008
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1009
+ # @param [Google::Apis::RequestOptions] options
1010
+ # Request-specific options
1011
+ #
1012
+ # @yield [result, err] Result & error if block supplied
1013
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
1014
+ # @yieldparam err [StandardError] error object if request failed
1015
+ #
1016
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
1017
+ #
1018
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1019
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1020
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1021
+ def get_project_effective_org_policy(resource, get_effective_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1022
+ command = make_simple_command(:post, 'v1/{+resource}:getEffectiveOrgPolicy', options)
1023
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetEffectiveOrgPolicyRequest::Representation
1024
+ command.request_object = get_effective_org_policy_request_object
1025
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
1026
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
1027
+ command.params['resource'] = resource unless resource.nil?
1028
+ command.query['fields'] = fields unless fields.nil?
1029
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1030
+ execute_or_queue_command(command, &block)
1031
+ end
1032
+
1033
+ # Returns the IAM access control policy for the specified Project. Permission is
1034
+ # denied if the policy or the resource does not exist. Authorization requires
1035
+ # the Google IAM permission `resourcemanager.projects.getIamPolicy` on the
1036
+ # project. For additional information about `resource` (e.g. my-project-id)
1037
+ # structure and identification, see [Resource Names](https://cloud.google.com/
1038
+ # apis/design/resource_names).
1039
+ # @param [String] resource
1040
+ # REQUIRED: The resource for which the policy is being requested. See the
1041
+ # operation documentation for the appropriate value for this field.
1042
+ # @param [Google::Apis::CloudresourcemanagerV1::GetIamPolicyRequest] get_iam_policy_request_object
1043
+ # @param [String] fields
1044
+ # Selector specifying which fields to include in a partial response.
1045
+ # @param [String] quota_user
1046
+ # Available to use for quota purposes for server-side applications. Can be any
1047
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1048
+ # @param [Google::Apis::RequestOptions] options
1049
+ # Request-specific options
1050
+ #
1051
+ # @yield [result, err] Result & error if block supplied
1052
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Policy] parsed result object
1053
+ # @yieldparam err [StandardError] error object if request failed
1054
+ #
1055
+ # @return [Google::Apis::CloudresourcemanagerV1::Policy]
1056
+ #
1057
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1058
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1059
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1060
+ def get_project_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1061
+ command = make_simple_command(:post, 'v1/projects/{resource}:getIamPolicy', options)
1062
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetIamPolicyRequest::Representation
1063
+ command.request_object = get_iam_policy_request_object
1064
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Policy::Representation
1065
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Policy
1066
+ command.params['resource'] = resource unless resource.nil?
1067
+ command.query['fields'] = fields unless fields.nil?
1068
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1069
+ execute_or_queue_command(command, &block)
1070
+ end
1071
+
1072
+ # Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `
1073
+ # Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for
1074
+ # the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to
1075
+ # create or update a `Policy` during read-modify-write.
1076
+ # @param [String] resource
1077
+ # Name of the resource the `Policy` is set on.
1078
+ # @param [Google::Apis::CloudresourcemanagerV1::GetOrgPolicyRequest] get_org_policy_request_object
1079
+ # @param [String] fields
1080
+ # Selector specifying which fields to include in a partial response.
1081
+ # @param [String] quota_user
1082
+ # Available to use for quota purposes for server-side applications. Can be any
1083
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1084
+ # @param [Google::Apis::RequestOptions] options
1085
+ # Request-specific options
1086
+ #
1087
+ # @yield [result, err] Result & error if block supplied
1088
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
1089
+ # @yieldparam err [StandardError] error object if request failed
1090
+ #
1091
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
1092
+ #
1093
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1094
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1095
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1096
+ def get_project_org_policy(resource, get_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1097
+ command = make_simple_command(:post, 'v1/{+resource}:getOrgPolicy', options)
1098
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::GetOrgPolicyRequest::Representation
1099
+ command.request_object = get_org_policy_request_object
1100
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
1101
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
1102
+ command.params['resource'] = resource unless resource.nil?
1103
+ command.query['fields'] = fields unless fields.nil?
1104
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1105
+ execute_or_queue_command(command, &block)
1106
+ end
1107
+
1108
+ # Lists Projects that the caller has the `resourcemanager.projects.get`
1109
+ # permission on and satisfy the specified filter. This method returns Projects
1110
+ # in an unspecified order. This method is eventually consistent with project
1111
+ # mutations; this means that a newly created project may not appear in the
1112
+ # results or recent updates to an existing project may not be reflected in the
1113
+ # results. To retrieve the latest state of a project, use the GetProject method.
1114
+ # NOTE: If the request filter contains a `parent.type` and `parent.id` and the
1115
+ # caller has the `resourcemanager.projects.list` permission on the parent, the
1116
+ # results will be drawn from an alternate index which provides more consistent
1117
+ # results. In future versions of this API, this List method will be split into
1118
+ # List and Search to properly capture the behavioral difference.
1119
+ # @param [String] filter
1120
+ # Optional. An expression for filtering the results of the request. Filter rules
1121
+ # are case insensitive. If multiple fields are included in a filter query, the
1122
+ # query will return results that match any of the fields. Some eligible fields
1123
+ # for filtering are: + `name` + `id` + `labels.` (where *key* is the name of a
1124
+ # label) + `parent.type` + `parent.id` + `lifecycleState` Some examples of
1125
+ # filter strings: | Filter | Description | |------------------|------------------
1126
+ # -----------------------------------| | name:how* | The project's name starts
1127
+ # with "how". | | name:Howl | The project's name is `Howl` or `howl`. | | name:
1128
+ # HOWL | Equivalent to above. | | NAME:howl | Equivalent to above. | | labels.
1129
+ # color:* | The project has the label `color`. | | labels.color:red | The
1130
+ # project's label `color` has the value `red`. | | labels.color:red labels.size:
1131
+ # big | The project's label `color` | : : has the value `red` and its : : :
1132
+ # label`size` has the value : : : `big`. : | lifecycleState:DELETE_REQUESTED |
1133
+ # Only show projects that are | : : pending deletion. : If no filter is
1134
+ # specified, the call will return projects for which the user has the `
1135
+ # resourcemanager.projects.get` permission. NOTE: To perform a by-parent query (
1136
+ # eg., what projects are directly in a Folder), the caller must have the `
1137
+ # resourcemanager.projects.list` permission on the parent and the filter must
1138
+ # contain both a `parent.type` and a `parent.id` restriction (example: "parent.
1139
+ # type:folder parent.id:123"). In this case an alternate search index is used
1140
+ # which provides more consistent results.
1141
+ # @param [Fixnum] page_size
1142
+ # Optional. The maximum number of Projects to return in the response. The server
1143
+ # can return fewer Projects than requested. If unspecified, server picks an
1144
+ # appropriate default.
1145
+ # @param [String] page_token
1146
+ # Optional. A pagination token returned from a previous call to ListProjects
1147
+ # that indicates from where listing should continue.
1148
+ # @param [String] fields
1149
+ # Selector specifying which fields to include in a partial response.
1150
+ # @param [String] quota_user
1151
+ # Available to use for quota purposes for server-side applications. Can be any
1152
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1153
+ # @param [Google::Apis::RequestOptions] options
1154
+ # Request-specific options
1155
+ #
1156
+ # @yield [result, err] Result & error if block supplied
1157
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListProjectsResponse] parsed result object
1158
+ # @yieldparam err [StandardError] error object if request failed
1159
+ #
1160
+ # @return [Google::Apis::CloudresourcemanagerV1::ListProjectsResponse]
1161
+ #
1162
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1163
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1164
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1165
+ def list_projects(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1166
+ command = make_simple_command(:get, 'v1/projects', options)
1167
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListProjectsResponse::Representation
1168
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListProjectsResponse
1169
+ command.query['filter'] = filter unless filter.nil?
1170
+ command.query['pageSize'] = page_size unless page_size.nil?
1171
+ command.query['pageToken'] = page_token unless page_token.nil?
1172
+ command.query['fields'] = fields unless fields.nil?
1173
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1174
+ execute_or_queue_command(command, &block)
1175
+ end
1176
+
1177
+ # Lists `Constraints` that could be applied on the specified resource.
1178
+ # @param [String] resource
1179
+ # Name of the resource to list `Constraints` for.
1180
+ # @param [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsRequest] list_available_org_policy_constraints_request_object
1181
+ # @param [String] fields
1182
+ # Selector specifying which fields to include in a partial response.
1183
+ # @param [String] quota_user
1184
+ # Available to use for quota purposes for server-side applications. Can be any
1185
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1186
+ # @param [Google::Apis::RequestOptions] options
1187
+ # Request-specific options
1188
+ #
1189
+ # @yield [result, err] Result & error if block supplied
1190
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse] parsed result object
1191
+ # @yieldparam err [StandardError] error object if request failed
1192
+ #
1193
+ # @return [Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse]
1194
+ #
1195
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1196
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1197
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1198
+ def list_project_available_org_policy_constraints(resource, list_available_org_policy_constraints_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1199
+ command = make_simple_command(:post, 'v1/{+resource}:listAvailableOrgPolicyConstraints', options)
1200
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsRequest::Representation
1201
+ command.request_object = list_available_org_policy_constraints_request_object
1202
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse::Representation
1203
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListAvailableOrgPolicyConstraintsResponse
1204
+ command.params['resource'] = resource unless resource.nil?
1205
+ command.query['fields'] = fields unless fields.nil?
1206
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1207
+ execute_or_queue_command(command, &block)
1208
+ end
1209
+
1210
+ # Lists all the `Policies` set for a particular resource.
1211
+ # @param [String] resource
1212
+ # Name of the resource to list Policies for.
1213
+ # @param [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesRequest] list_org_policies_request_object
1214
+ # @param [String] fields
1215
+ # Selector specifying which fields to include in a partial response.
1216
+ # @param [String] quota_user
1217
+ # Available to use for quota purposes for server-side applications. Can be any
1218
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1219
+ # @param [Google::Apis::RequestOptions] options
1220
+ # Request-specific options
1221
+ #
1222
+ # @yield [result, err] Result & error if block supplied
1223
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse] parsed result object
1224
+ # @yieldparam err [StandardError] error object if request failed
1225
+ #
1226
+ # @return [Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse]
1227
+ #
1228
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1229
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1230
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1231
+ def list_project_org_policies(resource, list_org_policies_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1232
+ command = make_simple_command(:post, 'v1/{+resource}:listOrgPolicies', options)
1233
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesRequest::Representation
1234
+ command.request_object = list_org_policies_request_object
1235
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse::Representation
1236
+ command.response_class = Google::Apis::CloudresourcemanagerV1::ListOrgPoliciesResponse
1237
+ command.params['resource'] = resource unless resource.nil?
1238
+ command.query['fields'] = fields unless fields.nil?
1239
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1240
+ execute_or_queue_command(command, &block)
1241
+ end
1242
+
1243
+ # Sets the IAM access control policy for the specified Project. CAUTION: This
1244
+ # method will replace the existing policy, and cannot be used to append
1245
+ # additional IAM settings. NOTE: Removing service accounts from policies or
1246
+ # changing their roles can render services completely inoperable. It is
1247
+ # important to understand how the service account is being used before removing
1248
+ # or updating its roles. For additional information about `resource` (e.g. my-
1249
+ # project-id) structure and identification, see [Resource Names](https://cloud.
1250
+ # google.com/apis/design/resource_names). The following constraints apply when
1251
+ # using `setIamPolicy()`: + Project does not support `allUsers` and `
1252
+ # allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner
1253
+ # role can be granted to a `user`, `serviceAccount`, or a group that is part of
1254
+ # an organization. For example, group@myownpersonaldomain.com could be added as
1255
+ # an owner to a project in the myownpersonaldomain.com organization, but not the
1256
+ # examplepetstore.com organization. + Service accounts can be made owners of a
1257
+ # project directly without any restrictions. However, to be added as an owner, a
1258
+ # user must be invited via Cloud Platform console and must accept the invitation.
1259
+ # + A user cannot be granted the owner role using `setIamPolicy()`. The user
1260
+ # must be granted the owner role using the Cloud Platform Console and must
1261
+ # explicitly accept the invitation. + You can only grant ownership of a project
1262
+ # to a member by using the GCP Console. Inviting a member will deliver an
1263
+ # invitation email that they must accept. An invitation email is not generated
1264
+ # if you are granting a role other than owner, or if both the member you are
1265
+ # inviting and the project are part of your organization. + Membership changes
1266
+ # that leave the project without any owners that have accepted the Terms of
1267
+ # Service (ToS) will be rejected. + If the project is not part of an
1268
+ # organization, there must be at least one owner who has accepted the Terms of
1269
+ # Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the
1270
+ # last ToS-accepted owner from the policy will fail. This restriction also
1271
+ # applies to legacy projects that no longer have owners who have accepted the
1272
+ # ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting
1273
+ # owner is rectified. Authorization requires the Google IAM permission `
1274
+ # resourcemanager.projects.setIamPolicy` on the project
1275
+ # @param [String] resource
1276
+ # REQUIRED: The resource for which the policy is being specified. See the
1277
+ # operation documentation for the appropriate value for this field.
1278
+ # @param [Google::Apis::CloudresourcemanagerV1::SetIamPolicyRequest] set_iam_policy_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::CloudresourcemanagerV1::Policy] parsed result object
1289
+ # @yieldparam err [StandardError] error object if request failed
1290
+ #
1291
+ # @return [Google::Apis::CloudresourcemanagerV1::Policy]
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 set_project_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1297
+ command = make_simple_command(:post, 'v1/projects/{resource}:setIamPolicy', options)
1298
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::SetIamPolicyRequest::Representation
1299
+ command.request_object = set_iam_policy_request_object
1300
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Policy::Representation
1301
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Policy
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
+ # Updates the specified `Policy` on the resource. Creates a new `Policy` for
1309
+ # that `Constraint` on the resource if one does not exist. Not supplying an `
1310
+ # etag` on the request `Policy` results in an unconditional write of the `Policy`
1311
+ # .
1312
+ # @param [String] resource
1313
+ # Resource name of the resource to attach the `Policy`.
1314
+ # @param [Google::Apis::CloudresourcemanagerV1::SetOrgPolicyRequest] set_org_policy_request_object
1315
+ # @param [String] fields
1316
+ # Selector specifying which fields to include in a partial response.
1317
+ # @param [String] quota_user
1318
+ # Available to use for quota purposes for server-side applications. Can be any
1319
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1320
+ # @param [Google::Apis::RequestOptions] options
1321
+ # Request-specific options
1322
+ #
1323
+ # @yield [result, err] Result & error if block supplied
1324
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::OrgPolicy] parsed result object
1325
+ # @yieldparam err [StandardError] error object if request failed
1326
+ #
1327
+ # @return [Google::Apis::CloudresourcemanagerV1::OrgPolicy]
1328
+ #
1329
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1330
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1331
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1332
+ def set_project_org_policy(resource, set_org_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1333
+ command = make_simple_command(:post, 'v1/{+resource}:setOrgPolicy', options)
1334
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::SetOrgPolicyRequest::Representation
1335
+ command.request_object = set_org_policy_request_object
1336
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::OrgPolicy::Representation
1337
+ command.response_class = Google::Apis::CloudresourcemanagerV1::OrgPolicy
1338
+ command.params['resource'] = resource unless resource.nil?
1339
+ command.query['fields'] = fields unless fields.nil?
1340
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1341
+ execute_or_queue_command(command, &block)
1342
+ end
1343
+
1344
+ # Returns permissions that a caller has on the specified Project. For additional
1345
+ # information about `resource` (e.g. my-project-id) structure and identification,
1346
+ # see [Resource Names](https://cloud.google.com/apis/design/resource_names).
1347
+ # There are no permissions required for making this API call.
1348
+ # @param [String] resource
1349
+ # REQUIRED: The resource for which the policy detail is being requested. See the
1350
+ # operation documentation for the appropriate value for this field.
1351
+ # @param [Google::Apis::CloudresourcemanagerV1::TestIamPermissionsRequest] test_iam_permissions_request_object
1352
+ # @param [String] fields
1353
+ # Selector specifying which fields to include in a partial response.
1354
+ # @param [String] quota_user
1355
+ # Available to use for quota purposes for server-side applications. Can be any
1356
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1357
+ # @param [Google::Apis::RequestOptions] options
1358
+ # Request-specific options
1359
+ #
1360
+ # @yield [result, err] Result & error if block supplied
1361
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse] parsed result object
1362
+ # @yieldparam err [StandardError] error object if request failed
1363
+ #
1364
+ # @return [Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse]
1365
+ #
1366
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1367
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1368
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1369
+ def test_project_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1370
+ command = make_simple_command(:post, 'v1/projects/{resource}:testIamPermissions', options)
1371
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::TestIamPermissionsRequest::Representation
1372
+ command.request_object = test_iam_permissions_request_object
1373
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse::Representation
1374
+ command.response_class = Google::Apis::CloudresourcemanagerV1::TestIamPermissionsResponse
1375
+ command.params['resource'] = resource unless resource.nil?
1376
+ command.query['fields'] = fields unless fields.nil?
1377
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1378
+ execute_or_queue_command(command, &block)
1379
+ end
1380
+
1381
+ # Restores the Project identified by the specified `project_id` (for example, `
1382
+ # my-project-123`). You can only use this method for a Project that has a
1383
+ # lifecycle state of DELETE_REQUESTED. After deletion starts, the Project cannot
1384
+ # be restored. The caller must have undelete permissions for this Project.
1385
+ # @param [String] project_id
1386
+ # Required. The project ID (for example, `foo-bar-123`).
1387
+ # @param [Google::Apis::CloudresourcemanagerV1::UndeleteProjectRequest] undelete_project_request_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::CloudresourcemanagerV1::Empty] parsed result object
1398
+ # @yieldparam err [StandardError] error object if request failed
1399
+ #
1400
+ # @return [Google::Apis::CloudresourcemanagerV1::Empty]
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 undelete_project(project_id, undelete_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1406
+ command = make_simple_command(:post, 'v1/projects/{projectId}:undelete', options)
1407
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::UndeleteProjectRequest::Representation
1408
+ command.request_object = undelete_project_request_object
1409
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Empty::Representation
1410
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Empty
1411
+ command.params['projectId'] = project_id unless project_id.nil?
1412
+ command.query['fields'] = fields unless fields.nil?
1413
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1414
+ execute_or_queue_command(command, &block)
1415
+ end
1416
+
1417
+ # Updates the attributes of the Project identified by the specified `project_id`
1418
+ # (for example, `my-project-123`). The caller must have modify permissions for
1419
+ # this Project.
1420
+ # @param [String] project_id
1421
+ # The project ID (for example, `my-project-123`). Required.
1422
+ # @param [Google::Apis::CloudresourcemanagerV1::Project] project_object
1423
+ # @param [String] fields
1424
+ # Selector specifying which fields to include in a partial response.
1425
+ # @param [String] quota_user
1426
+ # Available to use for quota purposes for server-side applications. Can be any
1427
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1428
+ # @param [Google::Apis::RequestOptions] options
1429
+ # Request-specific options
1430
+ #
1431
+ # @yield [result, err] Result & error if block supplied
1432
+ # @yieldparam result [Google::Apis::CloudresourcemanagerV1::Project] parsed result object
1433
+ # @yieldparam err [StandardError] error object if request failed
1434
+ #
1435
+ # @return [Google::Apis::CloudresourcemanagerV1::Project]
1436
+ #
1437
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1438
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1439
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1440
+ def update_project(project_id, project_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1441
+ command = make_simple_command(:put, 'v1/projects/{projectId}', options)
1442
+ command.request_representation = Google::Apis::CloudresourcemanagerV1::Project::Representation
1443
+ command.request_object = project_object
1444
+ command.response_representation = Google::Apis::CloudresourcemanagerV1::Project::Representation
1445
+ command.response_class = Google::Apis::CloudresourcemanagerV1::Project
1446
+ command.params['projectId'] = project_id unless project_id.nil?
1447
+ command.query['fields'] = fields unless fields.nil?
1448
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1449
+ execute_or_queue_command(command, &block)
1450
+ end
1451
+
1452
+ protected
1453
+
1454
+ def apply_command_defaults(command)
1455
+ command.query['key'] = key unless key.nil?
1456
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1457
+ end
1458
+ end
1459
+ end
1460
+ end
1461
+ end