google-apis-serviceconsumermanagement_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,630 @@
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 ServiceconsumermanagementV1
23
+ # Service Consumer Management API
24
+ #
25
+ # Manages the service consumers of a Service Infrastructure service.
26
+ #
27
+ # @example
28
+ # require 'google/apis/serviceconsumermanagement_v1'
29
+ #
30
+ # Serviceconsumermanagement = Google::Apis::ServiceconsumermanagementV1 # Alias the module
31
+ # service = Serviceconsumermanagement::ServiceConsumerManagementService.new
32
+ #
33
+ # @see https://cloud.google.com/service-consumer-management/docs/overview
34
+ class ServiceConsumerManagementService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://serviceconsumermanagement.googleapis.com/', '',
47
+ client_name: 'google-apis-serviceconsumermanagement_v1',
48
+ client_version: Google::Apis::ServiceconsumermanagementV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Starts asynchronous cancellation on a long-running operation. The server makes
53
+ # a best effort to cancel the operation, but success is not guaranteed. If the
54
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
55
+ # Clients can use Operations.GetOperation or other methods to check whether the
56
+ # cancellation succeeded or whether the operation completed despite cancellation.
57
+ # On successful cancellation, the operation is not deleted; instead, it becomes
58
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
59
+ # corresponding to `Code.CANCELLED`.
60
+ # @param [String] name
61
+ # The name of the operation resource to be cancelled.
62
+ # @param [Google::Apis::ServiceconsumermanagementV1::CancelOperationRequest] cancel_operation_request_object
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [String] quota_user
66
+ # Available to use for quota purposes for server-side applications. Can be any
67
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Empty] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::ServiceconsumermanagementV1::Empty]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
81
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
82
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::CancelOperationRequest::Representation
83
+ command.request_object = cancel_operation_request_object
84
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Empty::Representation
85
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Empty
86
+ command.params['name'] = name unless name.nil?
87
+ command.query['fields'] = fields unless fields.nil?
88
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
89
+ execute_or_queue_command(command, &block)
90
+ end
91
+
92
+ # Deletes a long-running operation. This method indicates that the client is no
93
+ # longer interested in the operation result. It does not cancel the operation.
94
+ # If the server doesn't support this method, it returns `google.rpc.Code.
95
+ # UNIMPLEMENTED`.
96
+ # @param [String] name
97
+ # The name of the operation resource to be deleted.
98
+ # @param [String] fields
99
+ # Selector specifying which fields to include in a partial response.
100
+ # @param [String] quota_user
101
+ # Available to use for quota purposes for server-side applications. Can be any
102
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
103
+ # @param [Google::Apis::RequestOptions] options
104
+ # Request-specific options
105
+ #
106
+ # @yield [result, err] Result & error if block supplied
107
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Empty] parsed result object
108
+ # @yieldparam err [StandardError] error object if request failed
109
+ #
110
+ # @return [Google::Apis::ServiceconsumermanagementV1::Empty]
111
+ #
112
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
113
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
114
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
115
+ def delete_operation(name, fields: nil, quota_user: nil, options: nil, &block)
116
+ command = make_simple_command(:delete, 'v1/{+name}', options)
117
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Empty::Representation
118
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Empty
119
+ command.params['name'] = name unless name.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Gets the latest state of a long-running operation. Clients can use this method
126
+ # to poll the operation result at intervals as recommended by the API service.
127
+ # @param [String] name
128
+ # The name of the operation resource.
129
+ # @param [String] fields
130
+ # Selector specifying which fields to include in a partial response.
131
+ # @param [String] quota_user
132
+ # Available to use for quota purposes for server-side applications. Can be any
133
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
134
+ # @param [Google::Apis::RequestOptions] options
135
+ # Request-specific options
136
+ #
137
+ # @yield [result, err] Result & error if block supplied
138
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
139
+ # @yieldparam err [StandardError] error object if request failed
140
+ #
141
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
142
+ #
143
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
144
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
145
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
146
+ def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
147
+ command = make_simple_command(:get, 'v1/{+name}', options)
148
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
149
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
150
+ command.params['name'] = name unless name.nil?
151
+ command.query['fields'] = fields unless fields.nil?
152
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
153
+ execute_or_queue_command(command, &block)
154
+ end
155
+
156
+ # Lists operations that match the specified filter in the request. If the server
157
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
158
+ # binding allows API services to override the binding to use different resource
159
+ # name schemes, such as `users/*/operations`. To override the binding, API
160
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
161
+ # service configuration. For backwards compatibility, the default name includes
162
+ # the operations collection id, however overriding users must ensure the name
163
+ # binding is the parent resource, without the operations collection id.
164
+ # @param [String] name
165
+ # The name of the operation's parent resource.
166
+ # @param [String] filter
167
+ # The standard list filter.
168
+ # @param [Fixnum] page_size
169
+ # The standard list page size.
170
+ # @param [String] page_token
171
+ # The standard list page token.
172
+ # @param [String] fields
173
+ # Selector specifying which fields to include in a partial response.
174
+ # @param [String] quota_user
175
+ # Available to use for quota purposes for server-side applications. Can be any
176
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
177
+ # @param [Google::Apis::RequestOptions] options
178
+ # Request-specific options
179
+ #
180
+ # @yield [result, err] Result & error if block supplied
181
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse] parsed result object
182
+ # @yieldparam err [StandardError] error object if request failed
183
+ #
184
+ # @return [Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse]
185
+ #
186
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
187
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
188
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
189
+ def list_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
190
+ command = make_simple_command(:get, 'v1/{+name}', options)
191
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse::Representation
192
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse
193
+ command.params['name'] = name unless name.nil?
194
+ command.query['filter'] = filter unless filter.nil?
195
+ command.query['pageSize'] = page_size unless page_size.nil?
196
+ command.query['pageToken'] = page_token unless page_token.nil?
197
+ command.query['fields'] = fields unless fields.nil?
198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
199
+ execute_or_queue_command(command, &block)
200
+ end
201
+
202
+ # Search tenancy units for a managed service.
203
+ # @param [String] parent
204
+ # Required. Service for which search is performed. services/`service` `service`
205
+ # the name of a service, for example 'service.googleapis.com'.
206
+ # @param [Fixnum] page_size
207
+ # Optional. The maximum number of results returned by this request. Currently,
208
+ # the default maximum is set to 1000. If `page_size` isn't provided or the size
209
+ # provided is a number larger than 1000, it's automatically set to 1000.
210
+ # @param [String] page_token
211
+ # Optional. The continuation token, which is used to page through large result
212
+ # sets. To get the next page of results, set this parameter to the value of `
213
+ # nextPageToken` from the previous response.
214
+ # @param [String] query
215
+ # Optional. Set a query ``expression`` for querying tenancy units. Your ``
216
+ # expression`` must be in the format: `field_name=literal_string`. The `
217
+ # field_name` is the name of the field you want to compare. Supported fields are
218
+ # `tenant_resources.tag` and `tenant_resources.resource`. For example, to search
219
+ # tenancy units that contain at least one tenant resource with a given tag 'xyz',
220
+ # use the query `tenant_resources.tag=xyz`. To search tenancy units that
221
+ # contain at least one tenant resource with a given resource name 'projects/
222
+ # 123456', use the query `tenant_resources.resource=projects/123456`. Multiple
223
+ # expressions can be joined with `AND`s. Tenancy units must match all
224
+ # expressions to be included in the result set. For example, `tenant_resources.
225
+ # tag=xyz AND tenant_resources.resource=projects/123456`
226
+ # @param [String] fields
227
+ # Selector specifying which fields to include in a partial response.
228
+ # @param [String] quota_user
229
+ # Available to use for quota purposes for server-side applications. Can be any
230
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
231
+ # @param [Google::Apis::RequestOptions] options
232
+ # Request-specific options
233
+ #
234
+ # @yield [result, err] Result & error if block supplied
235
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse] parsed result object
236
+ # @yieldparam err [StandardError] error object if request failed
237
+ #
238
+ # @return [Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse]
239
+ #
240
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
241
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
242
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
243
+ def search_services(parent, page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
244
+ command = make_simple_command(:get, 'v1/{+parent}:search', options)
245
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse::Representation
246
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse
247
+ command.params['parent'] = parent unless parent.nil?
248
+ command.query['pageSize'] = page_size unless page_size.nil?
249
+ command.query['pageToken'] = page_token unless page_token.nil?
250
+ command.query['query'] = query unless query.nil?
251
+ command.query['fields'] = fields unless fields.nil?
252
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
253
+ execute_or_queue_command(command, &block)
254
+ end
255
+
256
+ # Add a new tenant project to the tenancy unit. There can be a maximum of 1024
257
+ # tenant projects in a tenancy unit. If there are previously failed `
258
+ # AddTenantProject` calls, you might need to call `RemoveTenantProject` first to
259
+ # resolve them before you can make another call to `AddTenantProject` with the
260
+ # same tag. Operation.
261
+ # @param [String] parent
262
+ # Required. Name of the tenancy unit. Such as 'services/service.googleapis.com/
263
+ # projects/12345/tenancyUnits/abcd'.
264
+ # @param [Google::Apis::ServiceconsumermanagementV1::AddTenantProjectRequest] add_tenant_project_request_object
265
+ # @param [String] fields
266
+ # Selector specifying which fields to include in a partial response.
267
+ # @param [String] quota_user
268
+ # Available to use for quota purposes for server-side applications. Can be any
269
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
270
+ # @param [Google::Apis::RequestOptions] options
271
+ # Request-specific options
272
+ #
273
+ # @yield [result, err] Result & error if block supplied
274
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
275
+ # @yieldparam err [StandardError] error object if request failed
276
+ #
277
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
278
+ #
279
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
280
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
281
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
282
+ def add_service_tenancy_unit_project(parent, add_tenant_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
283
+ command = make_simple_command(:post, 'v1/{+parent}:addProject', options)
284
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::AddTenantProjectRequest::Representation
285
+ command.request_object = add_tenant_project_request_object
286
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
287
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
288
+ command.params['parent'] = parent unless parent.nil?
289
+ command.query['fields'] = fields unless fields.nil?
290
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
291
+ execute_or_queue_command(command, &block)
292
+ end
293
+
294
+ # Apply a configuration to an existing tenant project. This project must exist
295
+ # in an active state and have the original owner account. The caller must have
296
+ # permission to add a project to the given tenancy unit. The configuration is
297
+ # applied, but any existing settings on the project aren't modified. Specified
298
+ # policy bindings are applied. Existing bindings aren't modified. Specified
299
+ # services are activated. No service is deactivated. If specified, new billing
300
+ # configuration is applied. Omit a billing configuration to keep the existing
301
+ # one. A service account in the project is created if previously non existed.
302
+ # Specified labels will be appended to tenant project, note that the value of
303
+ # existing label key will be updated if the same label key is requested. The
304
+ # specified folder is ignored, as moving a tenant project to a different folder
305
+ # isn't supported. The operation fails if any of the steps fail, but no rollback
306
+ # of already applied configuration changes is attempted. Operation.
307
+ # @param [String] name
308
+ # Required. Name of the tenancy unit. Such as 'services/service.googleapis.com/
309
+ # projects/12345/tenancyUnits/abcd'.
310
+ # @param [Google::Apis::ServiceconsumermanagementV1::ApplyTenantProjectConfigRequest] apply_tenant_project_config_request_object
311
+ # @param [String] fields
312
+ # Selector specifying which fields to include in a partial response.
313
+ # @param [String] quota_user
314
+ # Available to use for quota purposes for server-side applications. Can be any
315
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
316
+ # @param [Google::Apis::RequestOptions] options
317
+ # Request-specific options
318
+ #
319
+ # @yield [result, err] Result & error if block supplied
320
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
321
+ # @yieldparam err [StandardError] error object if request failed
322
+ #
323
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
324
+ #
325
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
326
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
327
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
328
+ def apply_service_tenancy_unit_project_config(name, apply_tenant_project_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
329
+ command = make_simple_command(:post, 'v1/{+name}:applyProjectConfig', options)
330
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::ApplyTenantProjectConfigRequest::Representation
331
+ command.request_object = apply_tenant_project_config_request_object
332
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
333
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
334
+ command.params['name'] = name unless name.nil?
335
+ command.query['fields'] = fields unless fields.nil?
336
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
337
+ execute_or_queue_command(command, &block)
338
+ end
339
+
340
+ # Attach an existing project to the tenancy unit as a new tenant resource. The
341
+ # project could either be the tenant project reserved by calling `
342
+ # AddTenantProject` under a tenancy unit of a service producer's project of a
343
+ # managed service, or from a separate project. The caller is checked against a
344
+ # set of permissions as if calling `AddTenantProject` on the same service
345
+ # consumer. To trigger the attachment, the targeted tenant project must be in a
346
+ # folder. Make sure the ServiceConsumerManagement service account is the owner
347
+ # of that project. These two requirements are already met if the project is
348
+ # reserved by calling `AddTenantProject`. Operation.
349
+ # @param [String] name
350
+ # Required. Name of the tenancy unit that the project will be attached to. Such
351
+ # as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'.
352
+ # @param [Google::Apis::ServiceconsumermanagementV1::AttachTenantProjectRequest] attach_tenant_project_request_object
353
+ # @param [String] fields
354
+ # Selector specifying which fields to include in a partial response.
355
+ # @param [String] quota_user
356
+ # Available to use for quota purposes for server-side applications. Can be any
357
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
358
+ # @param [Google::Apis::RequestOptions] options
359
+ # Request-specific options
360
+ #
361
+ # @yield [result, err] Result & error if block supplied
362
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
363
+ # @yieldparam err [StandardError] error object if request failed
364
+ #
365
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
366
+ #
367
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
368
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
369
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
370
+ def attach_service_tenancy_unit_project(name, attach_tenant_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
371
+ command = make_simple_command(:post, 'v1/{+name}:attachProject', options)
372
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::AttachTenantProjectRequest::Representation
373
+ command.request_object = attach_tenant_project_request_object
374
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
375
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
376
+ command.params['name'] = name unless name.nil?
377
+ command.query['fields'] = fields unless fields.nil?
378
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
379
+ execute_or_queue_command(command, &block)
380
+ end
381
+
382
+ # Creates a tenancy unit with no tenant resources. If tenancy unit already
383
+ # exists, it will be returned, however, in this case, returned TenancyUnit does
384
+ # not have tenant_resources field set and ListTenancyUnits has to be used to get
385
+ # a complete TenancyUnit with all fields populated.
386
+ # @param [String] parent
387
+ # Required. services/`service`/`collection id`/`resource id` `collection id` is
388
+ # the cloud resource collection type representing the service consumer, for
389
+ # example 'projects', or 'organizations'. `resource id` is the consumer numeric
390
+ # id, such as project number: '123456'. `service` the name of a managed service,
391
+ # such as 'service.googleapis.com'. Enables service binding using the new
392
+ # tenancy unit.
393
+ # @param [Google::Apis::ServiceconsumermanagementV1::CreateTenancyUnitRequest] create_tenancy_unit_request_object
394
+ # @param [String] fields
395
+ # Selector specifying which fields to include in a partial response.
396
+ # @param [String] quota_user
397
+ # Available to use for quota purposes for server-side applications. Can be any
398
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
399
+ # @param [Google::Apis::RequestOptions] options
400
+ # Request-specific options
401
+ #
402
+ # @yield [result, err] Result & error if block supplied
403
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::TenancyUnit] parsed result object
404
+ # @yieldparam err [StandardError] error object if request failed
405
+ #
406
+ # @return [Google::Apis::ServiceconsumermanagementV1::TenancyUnit]
407
+ #
408
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
409
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
410
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
411
+ def create_tenancy_unit(parent, create_tenancy_unit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
412
+ command = make_simple_command(:post, 'v1/{+parent}/tenancyUnits', options)
413
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::CreateTenancyUnitRequest::Representation
414
+ command.request_object = create_tenancy_unit_request_object
415
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::TenancyUnit::Representation
416
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::TenancyUnit
417
+ command.params['parent'] = parent unless parent.nil?
418
+ command.query['fields'] = fields unless fields.nil?
419
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
420
+ execute_or_queue_command(command, &block)
421
+ end
422
+
423
+ # Delete a tenancy unit. Before you delete the tenancy unit, there should be no
424
+ # tenant resources in it that aren't in a DELETED state. Operation.
425
+ # @param [String] name
426
+ # Required. Name of the tenancy unit to be deleted.
427
+ # @param [String] fields
428
+ # Selector specifying which fields to include in a partial response.
429
+ # @param [String] quota_user
430
+ # Available to use for quota purposes for server-side applications. Can be any
431
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
432
+ # @param [Google::Apis::RequestOptions] options
433
+ # Request-specific options
434
+ #
435
+ # @yield [result, err] Result & error if block supplied
436
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
437
+ # @yieldparam err [StandardError] error object if request failed
438
+ #
439
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
440
+ #
441
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
442
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
443
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
444
+ def delete_service_tenancy_unit(name, fields: nil, quota_user: nil, options: nil, &block)
445
+ command = make_simple_command(:delete, 'v1/{+name}', options)
446
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
447
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
448
+ command.params['name'] = name unless name.nil?
449
+ command.query['fields'] = fields unless fields.nil?
450
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
451
+ execute_or_queue_command(command, &block)
452
+ end
453
+
454
+ # Deletes the specified project resource identified by a tenant resource tag.
455
+ # The mothod removes a project lien with a 'TenantManager' origin if that was
456
+ # added. It will then attempt to delete the project. If that operation fails,
457
+ # this method also fails. After the project has been deleted, the tenant
458
+ # resource state is set to DELETED. To permanently remove resource metadata,
459
+ # call the `RemoveTenantProject` method. New resources with the same tag can't
460
+ # be added if there are existing resources in a DELETED state. Operation.
461
+ # @param [String] name
462
+ # Required. Name of the tenancy unit. Such as 'services/service.googleapis.com/
463
+ # projects/12345/tenancyUnits/abcd'.
464
+ # @param [Google::Apis::ServiceconsumermanagementV1::DeleteTenantProjectRequest] delete_tenant_project_request_object
465
+ # @param [String] fields
466
+ # Selector specifying which fields to include in a partial response.
467
+ # @param [String] quota_user
468
+ # Available to use for quota purposes for server-side applications. Can be any
469
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
470
+ # @param [Google::Apis::RequestOptions] options
471
+ # Request-specific options
472
+ #
473
+ # @yield [result, err] Result & error if block supplied
474
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
475
+ # @yieldparam err [StandardError] error object if request failed
476
+ #
477
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
478
+ #
479
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
480
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
481
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
482
+ def delete_service_tenancy_unit_project(name, delete_tenant_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
483
+ command = make_simple_command(:post, 'v1/{+name}:deleteProject', options)
484
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::DeleteTenantProjectRequest::Representation
485
+ command.request_object = delete_tenant_project_request_object
486
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
487
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
488
+ command.params['name'] = name unless name.nil?
489
+ command.query['fields'] = fields unless fields.nil?
490
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
491
+ execute_or_queue_command(command, &block)
492
+ end
493
+
494
+ # Find the tenancy unit for a managed service and service consumer. This method
495
+ # shouldn't be used in a service producer's runtime path, for example to find
496
+ # the tenant project number when creating VMs. Service producers must persist
497
+ # the tenant project's information after the project is created.
498
+ # @param [String] parent
499
+ # Required. Managed service and service consumer. Required. services/`service`/`
500
+ # collection id`/`resource id` `collection id` is the cloud resource collection
501
+ # type representing the service consumer, for example 'projects', or '
502
+ # organizations'. `resource id` is the consumer numeric id, such as project
503
+ # number: '123456'. `service` the name of a service, such as 'service.googleapis.
504
+ # com'.
505
+ # @param [String] filter
506
+ # Optional. Filter expression over tenancy resources field. Optional.
507
+ # @param [Fixnum] page_size
508
+ # Optional. The maximum number of results returned by this request.
509
+ # @param [String] page_token
510
+ # Optional. The continuation token, which is used to page through large result
511
+ # sets. To get the next page of results, set this parameter to the value of `
512
+ # nextPageToken` from the previous response.
513
+ # @param [String] fields
514
+ # Selector specifying which fields to include in a partial response.
515
+ # @param [String] quota_user
516
+ # Available to use for quota purposes for server-side applications. Can be any
517
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
518
+ # @param [Google::Apis::RequestOptions] options
519
+ # Request-specific options
520
+ #
521
+ # @yield [result, err] Result & error if block supplied
522
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse] parsed result object
523
+ # @yieldparam err [StandardError] error object if request failed
524
+ #
525
+ # @return [Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse]
526
+ #
527
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
528
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
529
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
530
+ def list_service_tenancy_units(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
531
+ command = make_simple_command(:get, 'v1/{+parent}/tenancyUnits', options)
532
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse::Representation
533
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse
534
+ command.params['parent'] = parent unless parent.nil?
535
+ command.query['filter'] = filter unless filter.nil?
536
+ command.query['pageSize'] = page_size unless page_size.nil?
537
+ command.query['pageToken'] = page_token unless page_token.nil?
538
+ command.query['fields'] = fields unless fields.nil?
539
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
540
+ execute_or_queue_command(command, &block)
541
+ end
542
+
543
+ # Removes the specified project resource identified by a tenant resource tag.
544
+ # The method removes the project lien with 'TenantManager' origin if that was
545
+ # added. It then attempts to delete the project. If that operation fails, this
546
+ # method also fails. Calls to remove already removed or non-existent tenant
547
+ # project succeed. After the project has been deleted, or if was already in a
548
+ # DELETED state, resource metadata is permanently removed from the tenancy unit.
549
+ # Operation.
550
+ # @param [String] name
551
+ # Required. Name of the tenancy unit. Such as 'services/service.googleapis.com/
552
+ # projects/12345/tenancyUnits/abcd'.
553
+ # @param [Google::Apis::ServiceconsumermanagementV1::RemoveTenantProjectRequest] remove_tenant_project_request_object
554
+ # @param [String] fields
555
+ # Selector specifying which fields to include in a partial response.
556
+ # @param [String] quota_user
557
+ # Available to use for quota purposes for server-side applications. Can be any
558
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
559
+ # @param [Google::Apis::RequestOptions] options
560
+ # Request-specific options
561
+ #
562
+ # @yield [result, err] Result & error if block supplied
563
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
564
+ # @yieldparam err [StandardError] error object if request failed
565
+ #
566
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
567
+ #
568
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
569
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
570
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
571
+ def remove_service_tenancy_unit_project(name, remove_tenant_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
572
+ command = make_simple_command(:post, 'v1/{+name}:removeProject', options)
573
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::RemoveTenantProjectRequest::Representation
574
+ command.request_object = remove_tenant_project_request_object
575
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
576
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
577
+ command.params['name'] = name unless name.nil?
578
+ command.query['fields'] = fields unless fields.nil?
579
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
580
+ execute_or_queue_command(command, &block)
581
+ end
582
+
583
+ # Attempts to undelete a previously deleted tenant project. The project must be
584
+ # in a DELETED state. There are no guarantees that an undeleted project will be
585
+ # in a fully restored and functional state. Call the `ApplyTenantProjectConfig`
586
+ # method to update its configuration and then validate all managed service
587
+ # resources. Operation.
588
+ # @param [String] name
589
+ # Required. Name of the tenancy unit. Such as 'services/service.googleapis.com/
590
+ # projects/12345/tenancyUnits/abcd'.
591
+ # @param [Google::Apis::ServiceconsumermanagementV1::UndeleteTenantProjectRequest] undelete_tenant_project_request_object
592
+ # @param [String] fields
593
+ # Selector specifying which fields to include in a partial response.
594
+ # @param [String] quota_user
595
+ # Available to use for quota purposes for server-side applications. Can be any
596
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
597
+ # @param [Google::Apis::RequestOptions] options
598
+ # Request-specific options
599
+ #
600
+ # @yield [result, err] Result & error if block supplied
601
+ # @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
602
+ # @yieldparam err [StandardError] error object if request failed
603
+ #
604
+ # @return [Google::Apis::ServiceconsumermanagementV1::Operation]
605
+ #
606
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
607
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
608
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
609
+ def undelete_service_tenancy_unit_project(name, undelete_tenant_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
610
+ command = make_simple_command(:post, 'v1/{+name}:undeleteProject', options)
611
+ command.request_representation = Google::Apis::ServiceconsumermanagementV1::UndeleteTenantProjectRequest::Representation
612
+ command.request_object = undelete_tenant_project_request_object
613
+ command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
614
+ command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
615
+ command.params['name'] = name unless name.nil?
616
+ command.query['fields'] = fields unless fields.nil?
617
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
618
+ execute_or_queue_command(command, &block)
619
+ end
620
+
621
+ protected
622
+
623
+ def apply_command_defaults(command)
624
+ command.query['key'] = key unless key.nil?
625
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
626
+ end
627
+ end
628
+ end
629
+ end
630
+ end