google-cloud-config-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/config/v1/bindings_override.rb +135 -0
  6. data/lib/google/cloud/config/v1/config/client.rb +2055 -0
  7. data/lib/google/cloud/config/v1/config/credentials.rb +47 -0
  8. data/lib/google/cloud/config/v1/config/operations.rb +770 -0
  9. data/lib/google/cloud/config/v1/config/paths.rb +149 -0
  10. data/lib/google/cloud/config/v1/config/rest/client.rb +1626 -0
  11. data/lib/google/cloud/config/v1/config/rest/operations.rb +795 -0
  12. data/lib/google/cloud/config/v1/config/rest/service_stub.rb +1000 -0
  13. data/lib/google/cloud/config/v1/config/rest.rb +55 -0
  14. data/lib/google/cloud/config/v1/config.rb +57 -0
  15. data/lib/google/cloud/config/v1/config_pb.rb +100 -0
  16. data/lib/google/cloud/config/v1/config_services_pb.rb +79 -0
  17. data/lib/google/cloud/config/v1/rest.rb +38 -0
  18. data/lib/google/cloud/config/v1/version.rb +7 -2
  19. data/lib/google/cloud/config/v1.rb +45 -0
  20. data/lib/google-cloud-config-v1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/client.rb +381 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/api/resource.rb +222 -0
  26. data/proto_docs/google/cloud/config/v1/config.rb +1082 -0
  27. data/proto_docs/google/longrunning/operations.rb +164 -0
  28. data/proto_docs/google/protobuf/any.rb +144 -0
  29. data/proto_docs/google/protobuf/duration.rb +98 -0
  30. data/proto_docs/google/protobuf/empty.rb +34 -0
  31. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  32. data/proto_docs/google/protobuf/struct.rb +96 -0
  33. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  34. data/proto_docs/google/rpc/status.rb +48 -0
  35. data/proto_docs/google/type/expr.rb +75 -0
  36. metadata +230 -13
@@ -0,0 +1,1626 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/config/v1/config_pb"
21
+ require "google/cloud/config/v1/config/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module Config
28
+ module V1
29
+ module Config
30
+ module Rest
31
+ ##
32
+ # REST client for the Config service.
33
+ #
34
+ # Infrastructure Manager is a managed service that automates the deployment and
35
+ # management of Google Cloud infrastructure resources.
36
+ #
37
+ class Client
38
+ include Paths
39
+
40
+ # @private
41
+ attr_reader :config_stub
42
+
43
+ ##
44
+ # Configure the Config Client class.
45
+ #
46
+ # See {::Google::Cloud::Config::V1::Config::Rest::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all Config clients
52
+ # ::Google::Cloud::Config::V1::Config::Rest::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "Config", "V1"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config
73
+ end
74
+ yield @configure if block_given?
75
+ @configure
76
+ end
77
+
78
+ ##
79
+ # Configure the Config Client instance.
80
+ #
81
+ # The configuration is set to the derived mode, meaning that values can be changed,
82
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
83
+ # should be made on {Client.configure}.
84
+ #
85
+ # See {::Google::Cloud::Config::V1::Config::Rest::Client::Configuration}
86
+ # for a description of the configuration fields.
87
+ #
88
+ # @yield [config] Configure the Client client.
89
+ # @yieldparam config [Client::Configuration]
90
+ #
91
+ # @return [Client::Configuration]
92
+ #
93
+ def configure
94
+ yield @config if block_given?
95
+ @config
96
+ end
97
+
98
+ ##
99
+ # Create a new Config REST client object.
100
+ #
101
+ # @example
102
+ #
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Config::V1::Config::Rest::Client.new
105
+ #
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::Config::V1::Config::Rest::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
110
+ #
111
+ # @yield [config] Configure the Config client.
112
+ # @yieldparam config [Client::Configuration]
113
+ #
114
+ def initialize
115
+ # Create the configuration object
116
+ @config = Configuration.new Client.configure
117
+
118
+ # Yield the configuration if needed
119
+ yield @config if block_given?
120
+
121
+ # Create credentials
122
+ credentials = @config.credentials
123
+ # Use self-signed JWT if the endpoint is unchanged from default,
124
+ # but only if the default endpoint does not have a region prefix.
125
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
126
+ !@config.endpoint.split(".").first.include?("-")
127
+ credentials ||= Credentials.default scope: @config.scope,
128
+ enable_self_signed_jwt: enable_self_signed_jwt
129
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
130
+ credentials = Credentials.new credentials, scope: @config.scope
131
+ end
132
+
133
+ @quota_project_id = @config.quota_project
134
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
135
+
136
+ @operations_client = ::Google::Cloud::Config::V1::Config::Rest::Operations.new do |config|
137
+ config.credentials = credentials
138
+ config.quota_project = @quota_project_id
139
+ config.endpoint = @config.endpoint
140
+ end
141
+
142
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
143
+ config.credentials = credentials
144
+ config.quota_project = @quota_project_id
145
+ config.endpoint = @config.endpoint
146
+ config.bindings_override = @config.bindings_override
147
+ end
148
+
149
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
150
+ config.credentials = credentials
151
+ config.quota_project = @quota_project_id
152
+ config.endpoint = @config.endpoint
153
+ config.bindings_override = @config.bindings_override
154
+ end
155
+
156
+ @config_stub = ::Google::Cloud::Config::V1::Config::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
157
+ end
158
+
159
+ ##
160
+ # Get the associated client for long-running operations.
161
+ #
162
+ # @return [::Google::Cloud::Config::V1::Config::Rest::Operations]
163
+ #
164
+ attr_reader :operations_client
165
+
166
+ ##
167
+ # Get the associated client for mix-in of the Locations.
168
+ #
169
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
170
+ #
171
+ attr_reader :location_client
172
+
173
+ ##
174
+ # Get the associated client for mix-in of the IAMPolicy.
175
+ #
176
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
177
+ #
178
+ attr_reader :iam_policy_client
179
+
180
+ # Service calls
181
+
182
+ ##
183
+ # Lists {::Google::Cloud::Config::V1::Deployment Deployment}s in a given project
184
+ # and location.
185
+ #
186
+ # @overload list_deployments(request, options = nil)
187
+ # Pass arguments to `list_deployments` via a request object, either of type
188
+ # {::Google::Cloud::Config::V1::ListDeploymentsRequest} or an equivalent Hash.
189
+ #
190
+ # @param request [::Google::Cloud::Config::V1::ListDeploymentsRequest, ::Hash]
191
+ # A request object representing the call parameters. Required. To specify no
192
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
193
+ # @param options [::Gapic::CallOptions, ::Hash]
194
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
195
+ #
196
+ # @overload list_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
197
+ # Pass arguments to `list_deployments` via keyword arguments. Note that at
198
+ # least one keyword argument is required. To specify no parameters, or to keep all
199
+ # the default parameter values, pass an empty Hash as a request object (see above).
200
+ #
201
+ # @param parent [::String]
202
+ # Required. The parent in whose context the Deployments are listed. The
203
+ # parent value is in the format:
204
+ # 'projects/\\{project_id}/locations/\\{location}'.
205
+ # @param page_size [::Integer]
206
+ # When requesting a page of resources, 'page_size' specifies number of
207
+ # resources to return. If unspecified or set to 0, all resources will be
208
+ # returned.
209
+ # @param page_token [::String]
210
+ # Token returned by previous call to 'ListDeployments' which specifies the
211
+ # position in the list from where to continue listing the resources.
212
+ # @param filter [::String]
213
+ # Lists the Deployments that match the filter expression. A filter
214
+ # expression filters the resources listed in the response. The expression
215
+ # must be of the form '\\{field} \\{operator} \\{value}' where operators: '<', '>',
216
+ # '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
217
+ # operator which is roughly synonymous with equality). \\{field} can refer to a
218
+ # proto or JSON field, or a synthetic field. Field names can be camelCase or
219
+ # snake_case.
220
+ #
221
+ # Examples:
222
+ # - Filter by name:
223
+ # name = "projects/foo/locations/us-central1/deployments/bar
224
+ #
225
+ # - Filter by labels:
226
+ # - Resources that have a key called 'foo'
227
+ # labels.foo:*
228
+ # - Resources that have a key called 'foo' whose value is 'bar'
229
+ # labels.foo = bar
230
+ #
231
+ # - Filter by state:
232
+ # - Deployments in CREATING state.
233
+ # state=CREATING
234
+ # @param order_by [::String]
235
+ # Field to use to sort the list.
236
+ # @yield [result, operation] Access the result along with the TransportOperation object
237
+ # @yieldparam result [::Google::Cloud::Config::V1::ListDeploymentsResponse]
238
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
239
+ #
240
+ # @return [::Google::Cloud::Config::V1::ListDeploymentsResponse]
241
+ #
242
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
243
+ def list_deployments request, options = nil
244
+ raise ::ArgumentError, "request must be provided" if request.nil?
245
+
246
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListDeploymentsRequest
247
+
248
+ # Converts hash and nil to an options object
249
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
250
+
251
+ # Customize the options with defaults
252
+ call_metadata = @config.rpcs.list_deployments.metadata.to_h
253
+
254
+ # Set x-goog-api-client and x-goog-user-project headers
255
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
256
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
257
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
258
+ transports_version_send: [:rest]
259
+
260
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
+
262
+ options.apply_defaults timeout: @config.rpcs.list_deployments.timeout,
263
+ metadata: call_metadata,
264
+ retry_policy: @config.rpcs.list_deployments.retry_policy
265
+
266
+ options.apply_defaults timeout: @config.timeout,
267
+ metadata: @config.metadata,
268
+ retry_policy: @config.retry_policy
269
+
270
+ @config_stub.list_deployments request, options do |result, operation|
271
+ yield result, operation if block_given?
272
+ return result
273
+ end
274
+ rescue ::Gapic::Rest::Error => e
275
+ raise ::Google::Cloud::Error.from_error(e)
276
+ end
277
+
278
+ ##
279
+ # Gets details about a {::Google::Cloud::Config::V1::Deployment Deployment}.
280
+ #
281
+ # @overload get_deployment(request, options = nil)
282
+ # Pass arguments to `get_deployment` via a request object, either of type
283
+ # {::Google::Cloud::Config::V1::GetDeploymentRequest} or an equivalent Hash.
284
+ #
285
+ # @param request [::Google::Cloud::Config::V1::GetDeploymentRequest, ::Hash]
286
+ # A request object representing the call parameters. Required. To specify no
287
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
288
+ # @param options [::Gapic::CallOptions, ::Hash]
289
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
290
+ #
291
+ # @overload get_deployment(name: nil)
292
+ # Pass arguments to `get_deployment` via keyword arguments. Note that at
293
+ # least one keyword argument is required. To specify no parameters, or to keep all
294
+ # the default parameter values, pass an empty Hash as a request object (see above).
295
+ #
296
+ # @param name [::String]
297
+ # Required. The name of the deployment. Format:
298
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
299
+ # @yield [result, operation] Access the result along with the TransportOperation object
300
+ # @yieldparam result [::Google::Cloud::Config::V1::Deployment]
301
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
302
+ #
303
+ # @return [::Google::Cloud::Config::V1::Deployment]
304
+ #
305
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
306
+ def get_deployment request, options = nil
307
+ raise ::ArgumentError, "request must be provided" if request.nil?
308
+
309
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetDeploymentRequest
310
+
311
+ # Converts hash and nil to an options object
312
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
313
+
314
+ # Customize the options with defaults
315
+ call_metadata = @config.rpcs.get_deployment.metadata.to_h
316
+
317
+ # Set x-goog-api-client and x-goog-user-project headers
318
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
319
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
320
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
321
+ transports_version_send: [:rest]
322
+
323
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
324
+
325
+ options.apply_defaults timeout: @config.rpcs.get_deployment.timeout,
326
+ metadata: call_metadata,
327
+ retry_policy: @config.rpcs.get_deployment.retry_policy
328
+
329
+ options.apply_defaults timeout: @config.timeout,
330
+ metadata: @config.metadata,
331
+ retry_policy: @config.retry_policy
332
+
333
+ @config_stub.get_deployment request, options do |result, operation|
334
+ yield result, operation if block_given?
335
+ return result
336
+ end
337
+ rescue ::Gapic::Rest::Error => e
338
+ raise ::Google::Cloud::Error.from_error(e)
339
+ end
340
+
341
+ ##
342
+ # Creates a {::Google::Cloud::Config::V1::Deployment Deployment}.
343
+ #
344
+ # @overload create_deployment(request, options = nil)
345
+ # Pass arguments to `create_deployment` via a request object, either of type
346
+ # {::Google::Cloud::Config::V1::CreateDeploymentRequest} or an equivalent Hash.
347
+ #
348
+ # @param request [::Google::Cloud::Config::V1::CreateDeploymentRequest, ::Hash]
349
+ # A request object representing the call parameters. Required. To specify no
350
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
351
+ # @param options [::Gapic::CallOptions, ::Hash]
352
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
353
+ #
354
+ # @overload create_deployment(parent: nil, deployment_id: nil, deployment: nil, request_id: nil)
355
+ # Pass arguments to `create_deployment` via keyword arguments. Note that at
356
+ # least one keyword argument is required. To specify no parameters, or to keep all
357
+ # the default parameter values, pass an empty Hash as a request object (see above).
358
+ #
359
+ # @param parent [::String]
360
+ # Required. The parent in whose context the Deployment is created. The parent
361
+ # value is in the format: 'projects/\\{project_id}/locations/\\{location}'.
362
+ # @param deployment_id [::String]
363
+ # Required. The Deployment ID.
364
+ # @param deployment [::Google::Cloud::Config::V1::Deployment, ::Hash]
365
+ # Required. {::Google::Cloud::Config::V1::Deployment Deployment} resource to be
366
+ # created.
367
+ # @param request_id [::String]
368
+ # Optional. An optional request ID to identify requests. Specify a unique
369
+ # request ID so that if you must retry your request, the server will know to
370
+ # ignore the request if it has already been completed. The server will
371
+ # guarantee that for at least 60 minutes since the first request.
372
+ #
373
+ # For example, consider a situation where you make an initial request and the
374
+ # request times out. If you make the request again with the same request ID,
375
+ # the server can check if original operation with the same request ID was
376
+ # received, and if so, will ignore the second request. This prevents clients
377
+ # from accidentally creating duplicate commitments.
378
+ #
379
+ # The request ID must be a valid UUID with the exception that zero UUID is
380
+ # not supported (00000000-0000-0000-0000-000000000000).
381
+ # @yield [result, operation] Access the result along with the TransportOperation object
382
+ # @yieldparam result [::Gapic::Operation]
383
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
384
+ #
385
+ # @return [::Gapic::Operation]
386
+ #
387
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
388
+ def create_deployment request, options = nil
389
+ raise ::ArgumentError, "request must be provided" if request.nil?
390
+
391
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::CreateDeploymentRequest
392
+
393
+ # Converts hash and nil to an options object
394
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
395
+
396
+ # Customize the options with defaults
397
+ call_metadata = @config.rpcs.create_deployment.metadata.to_h
398
+
399
+ # Set x-goog-api-client and x-goog-user-project headers
400
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
401
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
402
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
403
+ transports_version_send: [:rest]
404
+
405
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
406
+
407
+ options.apply_defaults timeout: @config.rpcs.create_deployment.timeout,
408
+ metadata: call_metadata,
409
+ retry_policy: @config.rpcs.create_deployment.retry_policy
410
+
411
+ options.apply_defaults timeout: @config.timeout,
412
+ metadata: @config.metadata,
413
+ retry_policy: @config.retry_policy
414
+
415
+ @config_stub.create_deployment request, options do |result, operation|
416
+ result = ::Gapic::Operation.new result, @operations_client, options: options
417
+ yield result, operation if block_given?
418
+ return result
419
+ end
420
+ rescue ::Gapic::Rest::Error => e
421
+ raise ::Google::Cloud::Error.from_error(e)
422
+ end
423
+
424
+ ##
425
+ # Updates a {::Google::Cloud::Config::V1::Deployment Deployment}.
426
+ #
427
+ # @overload update_deployment(request, options = nil)
428
+ # Pass arguments to `update_deployment` via a request object, either of type
429
+ # {::Google::Cloud::Config::V1::UpdateDeploymentRequest} or an equivalent Hash.
430
+ #
431
+ # @param request [::Google::Cloud::Config::V1::UpdateDeploymentRequest, ::Hash]
432
+ # A request object representing the call parameters. Required. To specify no
433
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
434
+ # @param options [::Gapic::CallOptions, ::Hash]
435
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
436
+ #
437
+ # @overload update_deployment(update_mask: nil, deployment: nil, request_id: nil)
438
+ # Pass arguments to `update_deployment` via keyword arguments. Note that at
439
+ # least one keyword argument is required. To specify no parameters, or to keep all
440
+ # the default parameter values, pass an empty Hash as a request object (see above).
441
+ #
442
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
443
+ # Optional. Field mask used to specify the fields to be overwritten in the
444
+ # Deployment resource by the update.
445
+ #
446
+ # The fields specified in the update_mask are relative to the resource, not
447
+ # the full request. A field will be overwritten if it is in the mask. If the
448
+ # user does not provide a mask then all fields will be overwritten.
449
+ # @param deployment [::Google::Cloud::Config::V1::Deployment, ::Hash]
450
+ # Required. {::Google::Cloud::Config::V1::Deployment Deployment} to update.
451
+ #
452
+ # The deployment's `name` field is used to identify the resource to be
453
+ # updated. Format:
454
+ # `projects/{project}/locations/{location}/deployments/{deployment}`
455
+ # @param request_id [::String]
456
+ # Optional. An optional request ID to identify requests. Specify a unique
457
+ # request ID so that if you must retry your request, the server will know to
458
+ # ignore the request if it has already been completed. The server will
459
+ # guarantee that for at least 60 minutes since the first request.
460
+ #
461
+ # For example, consider a situation where you make an initial request and the
462
+ # request times out. If you make the request again with the same request ID,
463
+ # the server can check if original operation with the same request ID was
464
+ # received, and if so, will ignore the second request. This prevents clients
465
+ # from accidentally creating duplicate commitments.
466
+ #
467
+ # The request ID must be a valid UUID with the exception that zero UUID is
468
+ # not supported (00000000-0000-0000-0000-000000000000).
469
+ # @yield [result, operation] Access the result along with the TransportOperation object
470
+ # @yieldparam result [::Gapic::Operation]
471
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
472
+ #
473
+ # @return [::Gapic::Operation]
474
+ #
475
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
476
+ def update_deployment request, options = nil
477
+ raise ::ArgumentError, "request must be provided" if request.nil?
478
+
479
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::UpdateDeploymentRequest
480
+
481
+ # Converts hash and nil to an options object
482
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
483
+
484
+ # Customize the options with defaults
485
+ call_metadata = @config.rpcs.update_deployment.metadata.to_h
486
+
487
+ # Set x-goog-api-client and x-goog-user-project headers
488
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
489
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
490
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
491
+ transports_version_send: [:rest]
492
+
493
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
494
+
495
+ options.apply_defaults timeout: @config.rpcs.update_deployment.timeout,
496
+ metadata: call_metadata,
497
+ retry_policy: @config.rpcs.update_deployment.retry_policy
498
+
499
+ options.apply_defaults timeout: @config.timeout,
500
+ metadata: @config.metadata,
501
+ retry_policy: @config.retry_policy
502
+
503
+ @config_stub.update_deployment request, options do |result, operation|
504
+ result = ::Gapic::Operation.new result, @operations_client, options: options
505
+ yield result, operation if block_given?
506
+ return result
507
+ end
508
+ rescue ::Gapic::Rest::Error => e
509
+ raise ::Google::Cloud::Error.from_error(e)
510
+ end
511
+
512
+ ##
513
+ # Deletes a {::Google::Cloud::Config::V1::Deployment Deployment}.
514
+ #
515
+ # @overload delete_deployment(request, options = nil)
516
+ # Pass arguments to `delete_deployment` via a request object, either of type
517
+ # {::Google::Cloud::Config::V1::DeleteDeploymentRequest} or an equivalent Hash.
518
+ #
519
+ # @param request [::Google::Cloud::Config::V1::DeleteDeploymentRequest, ::Hash]
520
+ # A request object representing the call parameters. Required. To specify no
521
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
522
+ # @param options [::Gapic::CallOptions, ::Hash]
523
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
524
+ #
525
+ # @overload delete_deployment(name: nil, request_id: nil, force: nil, delete_policy: nil)
526
+ # Pass arguments to `delete_deployment` via keyword arguments. Note that at
527
+ # least one keyword argument is required. To specify no parameters, or to keep all
528
+ # the default parameter values, pass an empty Hash as a request object (see above).
529
+ #
530
+ # @param name [::String]
531
+ # Required. The name of the Deployment in the format:
532
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
533
+ # @param request_id [::String]
534
+ # Optional. An optional request ID to identify requests. Specify a unique
535
+ # request ID so that if you must retry your request, the server will know to
536
+ # ignore the request if it has already been completed. The server will
537
+ # guarantee that for at least 60 minutes after the first request.
538
+ #
539
+ # For example, consider a situation where you make an initial request and the
540
+ # request times out. If you make the request again with the same request ID,
541
+ # the server can check if original operation with the same request ID was
542
+ # received, and if so, will ignore the second request. This prevents clients
543
+ # from accidentally creating duplicate commitments.
544
+ #
545
+ # The request ID must be a valid UUID with the exception that zero UUID is
546
+ # not supported (00000000-0000-0000-0000-000000000000).
547
+ # @param force [::Boolean]
548
+ # Optional. If set to true, any revisions for this deployment will also be
549
+ # deleted. (Otherwise, the request will only work if the deployment has no
550
+ # revisions.)
551
+ # @param delete_policy [::Google::Cloud::Config::V1::DeleteDeploymentRequest::DeletePolicy]
552
+ # Optional. Policy on how resources actuated by the deployment should be
553
+ # deleted. If unspecified, the default behavior is to delete the underlying
554
+ # resources.
555
+ # @yield [result, operation] Access the result along with the TransportOperation object
556
+ # @yieldparam result [::Gapic::Operation]
557
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
558
+ #
559
+ # @return [::Gapic::Operation]
560
+ #
561
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
562
+ def delete_deployment request, options = nil
563
+ raise ::ArgumentError, "request must be provided" if request.nil?
564
+
565
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::DeleteDeploymentRequest
566
+
567
+ # Converts hash and nil to an options object
568
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
569
+
570
+ # Customize the options with defaults
571
+ call_metadata = @config.rpcs.delete_deployment.metadata.to_h
572
+
573
+ # Set x-goog-api-client and x-goog-user-project headers
574
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
575
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
576
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
577
+ transports_version_send: [:rest]
578
+
579
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
580
+
581
+ options.apply_defaults timeout: @config.rpcs.delete_deployment.timeout,
582
+ metadata: call_metadata,
583
+ retry_policy: @config.rpcs.delete_deployment.retry_policy
584
+
585
+ options.apply_defaults timeout: @config.timeout,
586
+ metadata: @config.metadata,
587
+ retry_policy: @config.retry_policy
588
+
589
+ @config_stub.delete_deployment request, options do |result, operation|
590
+ result = ::Gapic::Operation.new result, @operations_client, options: options
591
+ yield result, operation if block_given?
592
+ return result
593
+ end
594
+ rescue ::Gapic::Rest::Error => e
595
+ raise ::Google::Cloud::Error.from_error(e)
596
+ end
597
+
598
+ ##
599
+ # Lists {::Google::Cloud::Config::V1::Revision Revision}s of a deployment.
600
+ #
601
+ # @overload list_revisions(request, options = nil)
602
+ # Pass arguments to `list_revisions` via a request object, either of type
603
+ # {::Google::Cloud::Config::V1::ListRevisionsRequest} or an equivalent Hash.
604
+ #
605
+ # @param request [::Google::Cloud::Config::V1::ListRevisionsRequest, ::Hash]
606
+ # A request object representing the call parameters. Required. To specify no
607
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
608
+ # @param options [::Gapic::CallOptions, ::Hash]
609
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
610
+ #
611
+ # @overload list_revisions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
612
+ # Pass arguments to `list_revisions` via keyword arguments. Note that at
613
+ # least one keyword argument is required. To specify no parameters, or to keep all
614
+ # the default parameter values, pass an empty Hash as a request object (see above).
615
+ #
616
+ # @param parent [::String]
617
+ # Required. The parent in whose context the Revisions are listed. The parent
618
+ # value is in the format:
619
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
620
+ # @param page_size [::Integer]
621
+ # When requesting a page of resources, `page_size` specifies number of
622
+ # resources to return. If unspecified or set to 0, all resources will be
623
+ # returned.
624
+ # @param page_token [::String]
625
+ # Token returned by previous call to 'ListRevisions' which specifies the
626
+ # position in the list from where to continue listing the resources.
627
+ # @param filter [::String]
628
+ # Lists the Revisions that match the filter expression. A filter
629
+ # expression filters the resources listed in the response. The expression
630
+ # must be of the form '\\{field} \\{operator} \\{value}' where operators: '<', '>',
631
+ # '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
632
+ # operator which is roughly synonymous with equality). \\{field} can refer to a
633
+ # proto or JSON field, or a synthetic field. Field names can be camelCase or
634
+ # snake_case.
635
+ #
636
+ # Examples:
637
+ # - Filter by name:
638
+ # name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
639
+ #
640
+ # - Filter by labels:
641
+ # - Resources that have a key called 'foo'
642
+ # labels.foo:*
643
+ # - Resources that have a key called 'foo' whose value is 'bar'
644
+ # labels.foo = bar
645
+ #
646
+ # - Filter by state:
647
+ # - Revisions in CREATING state.
648
+ # state=CREATING
649
+ # @param order_by [::String]
650
+ # Field to use to sort the list.
651
+ # @yield [result, operation] Access the result along with the TransportOperation object
652
+ # @yieldparam result [::Google::Cloud::Config::V1::ListRevisionsResponse]
653
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
654
+ #
655
+ # @return [::Google::Cloud::Config::V1::ListRevisionsResponse]
656
+ #
657
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
658
+ def list_revisions request, options = nil
659
+ raise ::ArgumentError, "request must be provided" if request.nil?
660
+
661
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListRevisionsRequest
662
+
663
+ # Converts hash and nil to an options object
664
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
665
+
666
+ # Customize the options with defaults
667
+ call_metadata = @config.rpcs.list_revisions.metadata.to_h
668
+
669
+ # Set x-goog-api-client and x-goog-user-project headers
670
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
671
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
672
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
673
+ transports_version_send: [:rest]
674
+
675
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
676
+
677
+ options.apply_defaults timeout: @config.rpcs.list_revisions.timeout,
678
+ metadata: call_metadata,
679
+ retry_policy: @config.rpcs.list_revisions.retry_policy
680
+
681
+ options.apply_defaults timeout: @config.timeout,
682
+ metadata: @config.metadata,
683
+ retry_policy: @config.retry_policy
684
+
685
+ @config_stub.list_revisions request, options do |result, operation|
686
+ yield result, operation if block_given?
687
+ return result
688
+ end
689
+ rescue ::Gapic::Rest::Error => e
690
+ raise ::Google::Cloud::Error.from_error(e)
691
+ end
692
+
693
+ ##
694
+ # Gets details about a {::Google::Cloud::Config::V1::Revision Revision}.
695
+ #
696
+ # @overload get_revision(request, options = nil)
697
+ # Pass arguments to `get_revision` via a request object, either of type
698
+ # {::Google::Cloud::Config::V1::GetRevisionRequest} or an equivalent Hash.
699
+ #
700
+ # @param request [::Google::Cloud::Config::V1::GetRevisionRequest, ::Hash]
701
+ # A request object representing the call parameters. Required. To specify no
702
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
703
+ # @param options [::Gapic::CallOptions, ::Hash]
704
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
705
+ #
706
+ # @overload get_revision(name: nil)
707
+ # Pass arguments to `get_revision` via keyword arguments. Note that at
708
+ # least one keyword argument is required. To specify no parameters, or to keep all
709
+ # the default parameter values, pass an empty Hash as a request object (see above).
710
+ #
711
+ # @param name [::String]
712
+ # Required. The name of the Revision in the format:
713
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}/revisions/\\{revision}'.
714
+ # @yield [result, operation] Access the result along with the TransportOperation object
715
+ # @yieldparam result [::Google::Cloud::Config::V1::Revision]
716
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
717
+ #
718
+ # @return [::Google::Cloud::Config::V1::Revision]
719
+ #
720
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
721
+ def get_revision request, options = nil
722
+ raise ::ArgumentError, "request must be provided" if request.nil?
723
+
724
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetRevisionRequest
725
+
726
+ # Converts hash and nil to an options object
727
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
728
+
729
+ # Customize the options with defaults
730
+ call_metadata = @config.rpcs.get_revision.metadata.to_h
731
+
732
+ # Set x-goog-api-client and x-goog-user-project headers
733
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
734
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
735
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
736
+ transports_version_send: [:rest]
737
+
738
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
739
+
740
+ options.apply_defaults timeout: @config.rpcs.get_revision.timeout,
741
+ metadata: call_metadata,
742
+ retry_policy: @config.rpcs.get_revision.retry_policy
743
+
744
+ options.apply_defaults timeout: @config.timeout,
745
+ metadata: @config.metadata,
746
+ retry_policy: @config.retry_policy
747
+
748
+ @config_stub.get_revision request, options do |result, operation|
749
+ yield result, operation if block_given?
750
+ return result
751
+ end
752
+ rescue ::Gapic::Rest::Error => e
753
+ raise ::Google::Cloud::Error.from_error(e)
754
+ end
755
+
756
+ ##
757
+ # Gets details about a {::Google::Cloud::Config::V1::Resource Resource} deployed
758
+ # by Infra Manager.
759
+ #
760
+ # @overload get_resource(request, options = nil)
761
+ # Pass arguments to `get_resource` via a request object, either of type
762
+ # {::Google::Cloud::Config::V1::GetResourceRequest} or an equivalent Hash.
763
+ #
764
+ # @param request [::Google::Cloud::Config::V1::GetResourceRequest, ::Hash]
765
+ # A request object representing the call parameters. Required. To specify no
766
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
767
+ # @param options [::Gapic::CallOptions, ::Hash]
768
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
769
+ #
770
+ # @overload get_resource(name: nil)
771
+ # Pass arguments to `get_resource` via keyword arguments. Note that at
772
+ # least one keyword argument is required. To specify no parameters, or to keep all
773
+ # the default parameter values, pass an empty Hash as a request object (see above).
774
+ #
775
+ # @param name [::String]
776
+ # Required. The name of the Resource in the format:
777
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}/revisions/\\{revision}/resource/\\{resource}'.
778
+ # @yield [result, operation] Access the result along with the TransportOperation object
779
+ # @yieldparam result [::Google::Cloud::Config::V1::Resource]
780
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
781
+ #
782
+ # @return [::Google::Cloud::Config::V1::Resource]
783
+ #
784
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
785
+ def get_resource request, options = nil
786
+ raise ::ArgumentError, "request must be provided" if request.nil?
787
+
788
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetResourceRequest
789
+
790
+ # Converts hash and nil to an options object
791
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
792
+
793
+ # Customize the options with defaults
794
+ call_metadata = @config.rpcs.get_resource.metadata.to_h
795
+
796
+ # Set x-goog-api-client and x-goog-user-project headers
797
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
798
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
799
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
800
+ transports_version_send: [:rest]
801
+
802
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
803
+
804
+ options.apply_defaults timeout: @config.rpcs.get_resource.timeout,
805
+ metadata: call_metadata,
806
+ retry_policy: @config.rpcs.get_resource.retry_policy
807
+
808
+ options.apply_defaults timeout: @config.timeout,
809
+ metadata: @config.metadata,
810
+ retry_policy: @config.retry_policy
811
+
812
+ @config_stub.get_resource request, options do |result, operation|
813
+ yield result, operation if block_given?
814
+ return result
815
+ end
816
+ rescue ::Gapic::Rest::Error => e
817
+ raise ::Google::Cloud::Error.from_error(e)
818
+ end
819
+
820
+ ##
821
+ # Lists {::Google::Cloud::Config::V1::Resource Resource}s in a given revision.
822
+ #
823
+ # @overload list_resources(request, options = nil)
824
+ # Pass arguments to `list_resources` via a request object, either of type
825
+ # {::Google::Cloud::Config::V1::ListResourcesRequest} or an equivalent Hash.
826
+ #
827
+ # @param request [::Google::Cloud::Config::V1::ListResourcesRequest, ::Hash]
828
+ # A request object representing the call parameters. Required. To specify no
829
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
830
+ # @param options [::Gapic::CallOptions, ::Hash]
831
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
832
+ #
833
+ # @overload list_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
834
+ # Pass arguments to `list_resources` via keyword arguments. Note that at
835
+ # least one keyword argument is required. To specify no parameters, or to keep all
836
+ # the default parameter values, pass an empty Hash as a request object (see above).
837
+ #
838
+ # @param parent [::String]
839
+ # Required. The parent in whose context the Resources are listed. The parent
840
+ # value is in the format:
841
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}/revisions/\\{revision}'.
842
+ # @param page_size [::Integer]
843
+ # When requesting a page of resources, 'page_size' specifies number of
844
+ # resources to return. If unspecified or set to 0, all resources will be
845
+ # returned.
846
+ # @param page_token [::String]
847
+ # Token returned by previous call to 'ListResources' which specifies the
848
+ # position in the list from where to continue listing the resources.
849
+ # @param filter [::String]
850
+ # Lists the Resources that match the filter expression. A filter
851
+ # expression filters the resources listed in the response. The expression
852
+ # must be of the form '\\{field} \\{operator} \\{value}' where operators: '<', '>',
853
+ # '<=',
854
+ # '>=',
855
+ # '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
856
+ # roughly synonymous with equality). \\{field} can refer to a proto or JSON
857
+ # field, or a synthetic field. Field names can be camelCase or snake_case.
858
+ #
859
+ # Examples:
860
+ # - Filter by name:
861
+ # name =
862
+ # "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
863
+ # @param order_by [::String]
864
+ # Field to use to sort the list.
865
+ # @yield [result, operation] Access the result along with the TransportOperation object
866
+ # @yieldparam result [::Google::Cloud::Config::V1::ListResourcesResponse]
867
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
868
+ #
869
+ # @return [::Google::Cloud::Config::V1::ListResourcesResponse]
870
+ #
871
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
872
+ def list_resources request, options = nil
873
+ raise ::ArgumentError, "request must be provided" if request.nil?
874
+
875
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListResourcesRequest
876
+
877
+ # Converts hash and nil to an options object
878
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
879
+
880
+ # Customize the options with defaults
881
+ call_metadata = @config.rpcs.list_resources.metadata.to_h
882
+
883
+ # Set x-goog-api-client and x-goog-user-project headers
884
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
885
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
886
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
887
+ transports_version_send: [:rest]
888
+
889
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
890
+
891
+ options.apply_defaults timeout: @config.rpcs.list_resources.timeout,
892
+ metadata: call_metadata,
893
+ retry_policy: @config.rpcs.list_resources.retry_policy
894
+
895
+ options.apply_defaults timeout: @config.timeout,
896
+ metadata: @config.metadata,
897
+ retry_policy: @config.retry_policy
898
+
899
+ @config_stub.list_resources request, options do |result, operation|
900
+ yield result, operation if block_given?
901
+ return result
902
+ end
903
+ rescue ::Gapic::Rest::Error => e
904
+ raise ::Google::Cloud::Error.from_error(e)
905
+ end
906
+
907
+ ##
908
+ # Exports Terraform state file from a given deployment.
909
+ #
910
+ # @overload export_deployment_statefile(request, options = nil)
911
+ # Pass arguments to `export_deployment_statefile` via a request object, either of type
912
+ # {::Google::Cloud::Config::V1::ExportDeploymentStatefileRequest} or an equivalent Hash.
913
+ #
914
+ # @param request [::Google::Cloud::Config::V1::ExportDeploymentStatefileRequest, ::Hash]
915
+ # A request object representing the call parameters. Required. To specify no
916
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
917
+ # @param options [::Gapic::CallOptions, ::Hash]
918
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
919
+ #
920
+ # @overload export_deployment_statefile(parent: nil, draft: nil)
921
+ # Pass arguments to `export_deployment_statefile` via keyword arguments. Note that at
922
+ # least one keyword argument is required. To specify no parameters, or to keep all
923
+ # the default parameter values, pass an empty Hash as a request object (see above).
924
+ #
925
+ # @param parent [::String]
926
+ # Required. The parent in whose context the statefile is listed. The parent
927
+ # value is in the format:
928
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
929
+ # @param draft [::Boolean]
930
+ # Optional. If this flag is set to true, the exported deployment state file
931
+ # will be the draft state. This will enable the draft file to be validated
932
+ # before copying it over to the working state on unlock.
933
+ # @yield [result, operation] Access the result along with the TransportOperation object
934
+ # @yieldparam result [::Google::Cloud::Config::V1::Statefile]
935
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
936
+ #
937
+ # @return [::Google::Cloud::Config::V1::Statefile]
938
+ #
939
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
940
+ def export_deployment_statefile request, options = nil
941
+ raise ::ArgumentError, "request must be provided" if request.nil?
942
+
943
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportDeploymentStatefileRequest
944
+
945
+ # Converts hash and nil to an options object
946
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
947
+
948
+ # Customize the options with defaults
949
+ call_metadata = @config.rpcs.export_deployment_statefile.metadata.to_h
950
+
951
+ # Set x-goog-api-client and x-goog-user-project headers
952
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
953
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
954
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
955
+ transports_version_send: [:rest]
956
+
957
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
958
+
959
+ options.apply_defaults timeout: @config.rpcs.export_deployment_statefile.timeout,
960
+ metadata: call_metadata,
961
+ retry_policy: @config.rpcs.export_deployment_statefile.retry_policy
962
+
963
+ options.apply_defaults timeout: @config.timeout,
964
+ metadata: @config.metadata,
965
+ retry_policy: @config.retry_policy
966
+
967
+ @config_stub.export_deployment_statefile request, options do |result, operation|
968
+ yield result, operation if block_given?
969
+ return result
970
+ end
971
+ rescue ::Gapic::Rest::Error => e
972
+ raise ::Google::Cloud::Error.from_error(e)
973
+ end
974
+
975
+ ##
976
+ # Exports Terraform state file from a given revision.
977
+ #
978
+ # @overload export_revision_statefile(request, options = nil)
979
+ # Pass arguments to `export_revision_statefile` via a request object, either of type
980
+ # {::Google::Cloud::Config::V1::ExportRevisionStatefileRequest} or an equivalent Hash.
981
+ #
982
+ # @param request [::Google::Cloud::Config::V1::ExportRevisionStatefileRequest, ::Hash]
983
+ # A request object representing the call parameters. Required. To specify no
984
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
985
+ # @param options [::Gapic::CallOptions, ::Hash]
986
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
987
+ #
988
+ # @overload export_revision_statefile(parent: nil)
989
+ # Pass arguments to `export_revision_statefile` via keyword arguments. Note that at
990
+ # least one keyword argument is required. To specify no parameters, or to keep all
991
+ # the default parameter values, pass an empty Hash as a request object (see above).
992
+ #
993
+ # @param parent [::String]
994
+ # Required. The parent in whose context the statefile is listed. The parent
995
+ # value is in the format:
996
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}/revisions/\\{revision}'.
997
+ # @yield [result, operation] Access the result along with the TransportOperation object
998
+ # @yieldparam result [::Google::Cloud::Config::V1::Statefile]
999
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1000
+ #
1001
+ # @return [::Google::Cloud::Config::V1::Statefile]
1002
+ #
1003
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1004
+ def export_revision_statefile request, options = nil
1005
+ raise ::ArgumentError, "request must be provided" if request.nil?
1006
+
1007
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportRevisionStatefileRequest
1008
+
1009
+ # Converts hash and nil to an options object
1010
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1011
+
1012
+ # Customize the options with defaults
1013
+ call_metadata = @config.rpcs.export_revision_statefile.metadata.to_h
1014
+
1015
+ # Set x-goog-api-client and x-goog-user-project headers
1016
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1017
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1018
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
1019
+ transports_version_send: [:rest]
1020
+
1021
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1022
+
1023
+ options.apply_defaults timeout: @config.rpcs.export_revision_statefile.timeout,
1024
+ metadata: call_metadata,
1025
+ retry_policy: @config.rpcs.export_revision_statefile.retry_policy
1026
+
1027
+ options.apply_defaults timeout: @config.timeout,
1028
+ metadata: @config.metadata,
1029
+ retry_policy: @config.retry_policy
1030
+
1031
+ @config_stub.export_revision_statefile request, options do |result, operation|
1032
+ yield result, operation if block_given?
1033
+ return result
1034
+ end
1035
+ rescue ::Gapic::Rest::Error => e
1036
+ raise ::Google::Cloud::Error.from_error(e)
1037
+ end
1038
+
1039
+ ##
1040
+ # Imports Terraform state file in a given deployment. The state file does not
1041
+ # take effect until the Deployment has been unlocked.
1042
+ #
1043
+ # @overload import_statefile(request, options = nil)
1044
+ # Pass arguments to `import_statefile` via a request object, either of type
1045
+ # {::Google::Cloud::Config::V1::ImportStatefileRequest} or an equivalent Hash.
1046
+ #
1047
+ # @param request [::Google::Cloud::Config::V1::ImportStatefileRequest, ::Hash]
1048
+ # A request object representing the call parameters. Required. To specify no
1049
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1050
+ # @param options [::Gapic::CallOptions, ::Hash]
1051
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1052
+ #
1053
+ # @overload import_statefile(parent: nil, lock_id: nil, skip_draft: nil)
1054
+ # Pass arguments to `import_statefile` via keyword arguments. Note that at
1055
+ # least one keyword argument is required. To specify no parameters, or to keep all
1056
+ # the default parameter values, pass an empty Hash as a request object (see above).
1057
+ #
1058
+ # @param parent [::String]
1059
+ # Required. The parent in whose context the statefile is listed. The parent
1060
+ # value is in the format:
1061
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
1062
+ # @param lock_id [::Integer]
1063
+ # Required. Lock ID of the lock file to verify that the user who is importing
1064
+ # the state file previously locked the Deployment.
1065
+ # @param skip_draft [::Boolean]
1066
+ # Optional.
1067
+ # @yield [result, operation] Access the result along with the TransportOperation object
1068
+ # @yieldparam result [::Google::Cloud::Config::V1::Statefile]
1069
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1070
+ #
1071
+ # @return [::Google::Cloud::Config::V1::Statefile]
1072
+ #
1073
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1074
+ def import_statefile request, options = nil
1075
+ raise ::ArgumentError, "request must be provided" if request.nil?
1076
+
1077
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ImportStatefileRequest
1078
+
1079
+ # Converts hash and nil to an options object
1080
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1081
+
1082
+ # Customize the options with defaults
1083
+ call_metadata = @config.rpcs.import_statefile.metadata.to_h
1084
+
1085
+ # Set x-goog-api-client and x-goog-user-project headers
1086
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1087
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1088
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
1089
+ transports_version_send: [:rest]
1090
+
1091
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1092
+
1093
+ options.apply_defaults timeout: @config.rpcs.import_statefile.timeout,
1094
+ metadata: call_metadata,
1095
+ retry_policy: @config.rpcs.import_statefile.retry_policy
1096
+
1097
+ options.apply_defaults timeout: @config.timeout,
1098
+ metadata: @config.metadata,
1099
+ retry_policy: @config.retry_policy
1100
+
1101
+ @config_stub.import_statefile request, options do |result, operation|
1102
+ yield result, operation if block_given?
1103
+ return result
1104
+ end
1105
+ rescue ::Gapic::Rest::Error => e
1106
+ raise ::Google::Cloud::Error.from_error(e)
1107
+ end
1108
+
1109
+ ##
1110
+ # Deletes Terraform state file in a given deployment.
1111
+ #
1112
+ # @overload delete_statefile(request, options = nil)
1113
+ # Pass arguments to `delete_statefile` via a request object, either of type
1114
+ # {::Google::Cloud::Config::V1::DeleteStatefileRequest} or an equivalent Hash.
1115
+ #
1116
+ # @param request [::Google::Cloud::Config::V1::DeleteStatefileRequest, ::Hash]
1117
+ # A request object representing the call parameters. Required. To specify no
1118
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1119
+ # @param options [::Gapic::CallOptions, ::Hash]
1120
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1121
+ #
1122
+ # @overload delete_statefile(name: nil, lock_id: nil)
1123
+ # Pass arguments to `delete_statefile` via keyword arguments. Note that at
1124
+ # least one keyword argument is required. To specify no parameters, or to keep all
1125
+ # the default parameter values, pass an empty Hash as a request object (see above).
1126
+ #
1127
+ # @param name [::String]
1128
+ # Required. The name of the deployment in the format:
1129
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
1130
+ # @param lock_id [::Integer]
1131
+ # Required. Lock ID of the lock file to verify that the user who is deleting
1132
+ # the state file previously locked the Deployment.
1133
+ # @yield [result, operation] Access the result along with the TransportOperation object
1134
+ # @yieldparam result [::Google::Protobuf::Empty]
1135
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1136
+ #
1137
+ # @return [::Google::Protobuf::Empty]
1138
+ #
1139
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1140
+ def delete_statefile request, options = nil
1141
+ raise ::ArgumentError, "request must be provided" if request.nil?
1142
+
1143
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::DeleteStatefileRequest
1144
+
1145
+ # Converts hash and nil to an options object
1146
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1147
+
1148
+ # Customize the options with defaults
1149
+ call_metadata = @config.rpcs.delete_statefile.metadata.to_h
1150
+
1151
+ # Set x-goog-api-client and x-goog-user-project headers
1152
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1153
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1154
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
1155
+ transports_version_send: [:rest]
1156
+
1157
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1158
+
1159
+ options.apply_defaults timeout: @config.rpcs.delete_statefile.timeout,
1160
+ metadata: call_metadata,
1161
+ retry_policy: @config.rpcs.delete_statefile.retry_policy
1162
+
1163
+ options.apply_defaults timeout: @config.timeout,
1164
+ metadata: @config.metadata,
1165
+ retry_policy: @config.retry_policy
1166
+
1167
+ @config_stub.delete_statefile request, options do |result, operation|
1168
+ yield result, operation if block_given?
1169
+ return result
1170
+ end
1171
+ rescue ::Gapic::Rest::Error => e
1172
+ raise ::Google::Cloud::Error.from_error(e)
1173
+ end
1174
+
1175
+ ##
1176
+ # Locks a deployment.
1177
+ #
1178
+ # @overload lock_deployment(request, options = nil)
1179
+ # Pass arguments to `lock_deployment` via a request object, either of type
1180
+ # {::Google::Cloud::Config::V1::LockDeploymentRequest} or an equivalent Hash.
1181
+ #
1182
+ # @param request [::Google::Cloud::Config::V1::LockDeploymentRequest, ::Hash]
1183
+ # A request object representing the call parameters. Required. To specify no
1184
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1185
+ # @param options [::Gapic::CallOptions, ::Hash]
1186
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1187
+ #
1188
+ # @overload lock_deployment(name: nil)
1189
+ # Pass arguments to `lock_deployment` via keyword arguments. Note that at
1190
+ # least one keyword argument is required. To specify no parameters, or to keep all
1191
+ # the default parameter values, pass an empty Hash as a request object (see above).
1192
+ #
1193
+ # @param name [::String]
1194
+ # Required. The name of the deployment in the format:
1195
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
1196
+ # @yield [result, operation] Access the result along with the TransportOperation object
1197
+ # @yieldparam result [::Gapic::Operation]
1198
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1199
+ #
1200
+ # @return [::Gapic::Operation]
1201
+ #
1202
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1203
+ def lock_deployment request, options = nil
1204
+ raise ::ArgumentError, "request must be provided" if request.nil?
1205
+
1206
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::LockDeploymentRequest
1207
+
1208
+ # Converts hash and nil to an options object
1209
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1210
+
1211
+ # Customize the options with defaults
1212
+ call_metadata = @config.rpcs.lock_deployment.metadata.to_h
1213
+
1214
+ # Set x-goog-api-client and x-goog-user-project headers
1215
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1216
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1217
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
1218
+ transports_version_send: [:rest]
1219
+
1220
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1221
+
1222
+ options.apply_defaults timeout: @config.rpcs.lock_deployment.timeout,
1223
+ metadata: call_metadata,
1224
+ retry_policy: @config.rpcs.lock_deployment.retry_policy
1225
+
1226
+ options.apply_defaults timeout: @config.timeout,
1227
+ metadata: @config.metadata,
1228
+ retry_policy: @config.retry_policy
1229
+
1230
+ @config_stub.lock_deployment request, options do |result, operation|
1231
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1232
+ yield result, operation if block_given?
1233
+ return result
1234
+ end
1235
+ rescue ::Gapic::Rest::Error => e
1236
+ raise ::Google::Cloud::Error.from_error(e)
1237
+ end
1238
+
1239
+ ##
1240
+ # Unlocks a locked deployment.
1241
+ #
1242
+ # @overload unlock_deployment(request, options = nil)
1243
+ # Pass arguments to `unlock_deployment` via a request object, either of type
1244
+ # {::Google::Cloud::Config::V1::UnlockDeploymentRequest} or an equivalent Hash.
1245
+ #
1246
+ # @param request [::Google::Cloud::Config::V1::UnlockDeploymentRequest, ::Hash]
1247
+ # A request object representing the call parameters. Required. To specify no
1248
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1249
+ # @param options [::Gapic::CallOptions, ::Hash]
1250
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1251
+ #
1252
+ # @overload unlock_deployment(name: nil, lock_id: nil)
1253
+ # Pass arguments to `unlock_deployment` via keyword arguments. Note that at
1254
+ # least one keyword argument is required. To specify no parameters, or to keep all
1255
+ # the default parameter values, pass an empty Hash as a request object (see above).
1256
+ #
1257
+ # @param name [::String]
1258
+ # Required. The name of the deployment in the format:
1259
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
1260
+ # @param lock_id [::Integer]
1261
+ # Required. Lock ID of the lock file to be unlocked.
1262
+ # @yield [result, operation] Access the result along with the TransportOperation object
1263
+ # @yieldparam result [::Gapic::Operation]
1264
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1265
+ #
1266
+ # @return [::Gapic::Operation]
1267
+ #
1268
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1269
+ def unlock_deployment request, options = nil
1270
+ raise ::ArgumentError, "request must be provided" if request.nil?
1271
+
1272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::UnlockDeploymentRequest
1273
+
1274
+ # Converts hash and nil to an options object
1275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1276
+
1277
+ # Customize the options with defaults
1278
+ call_metadata = @config.rpcs.unlock_deployment.metadata.to_h
1279
+
1280
+ # Set x-goog-api-client and x-goog-user-project headers
1281
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1283
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
1284
+ transports_version_send: [:rest]
1285
+
1286
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1287
+
1288
+ options.apply_defaults timeout: @config.rpcs.unlock_deployment.timeout,
1289
+ metadata: call_metadata,
1290
+ retry_policy: @config.rpcs.unlock_deployment.retry_policy
1291
+
1292
+ options.apply_defaults timeout: @config.timeout,
1293
+ metadata: @config.metadata,
1294
+ retry_policy: @config.retry_policy
1295
+
1296
+ @config_stub.unlock_deployment request, options do |result, operation|
1297
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1298
+ yield result, operation if block_given?
1299
+ return result
1300
+ end
1301
+ rescue ::Gapic::Rest::Error => e
1302
+ raise ::Google::Cloud::Error.from_error(e)
1303
+ end
1304
+
1305
+ ##
1306
+ # Exports the lock info on a locked deployment.
1307
+ #
1308
+ # @overload export_lock_info(request, options = nil)
1309
+ # Pass arguments to `export_lock_info` via a request object, either of type
1310
+ # {::Google::Cloud::Config::V1::ExportLockInfoRequest} or an equivalent Hash.
1311
+ #
1312
+ # @param request [::Google::Cloud::Config::V1::ExportLockInfoRequest, ::Hash]
1313
+ # A request object representing the call parameters. Required. To specify no
1314
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1315
+ # @param options [::Gapic::CallOptions, ::Hash]
1316
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1317
+ #
1318
+ # @overload export_lock_info(name: nil)
1319
+ # Pass arguments to `export_lock_info` via keyword arguments. Note that at
1320
+ # least one keyword argument is required. To specify no parameters, or to keep all
1321
+ # the default parameter values, pass an empty Hash as a request object (see above).
1322
+ #
1323
+ # @param name [::String]
1324
+ # Required. The name of the deployment in the format:
1325
+ # 'projects/\\{project_id}/locations/\\{location}/deployments/\\{deployment}'.
1326
+ # @yield [result, operation] Access the result along with the TransportOperation object
1327
+ # @yieldparam result [::Google::Cloud::Config::V1::LockInfo]
1328
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1329
+ #
1330
+ # @return [::Google::Cloud::Config::V1::LockInfo]
1331
+ #
1332
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1333
+ def export_lock_info request, options = nil
1334
+ raise ::ArgumentError, "request must be provided" if request.nil?
1335
+
1336
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportLockInfoRequest
1337
+
1338
+ # Converts hash and nil to an options object
1339
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1340
+
1341
+ # Customize the options with defaults
1342
+ call_metadata = @config.rpcs.export_lock_info.metadata.to_h
1343
+
1344
+ # Set x-goog-api-client and x-goog-user-project headers
1345
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1346
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1347
+ gapic_version: ::Google::Cloud::Config::V1::VERSION,
1348
+ transports_version_send: [:rest]
1349
+
1350
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1351
+
1352
+ options.apply_defaults timeout: @config.rpcs.export_lock_info.timeout,
1353
+ metadata: call_metadata,
1354
+ retry_policy: @config.rpcs.export_lock_info.retry_policy
1355
+
1356
+ options.apply_defaults timeout: @config.timeout,
1357
+ metadata: @config.metadata,
1358
+ retry_policy: @config.retry_policy
1359
+
1360
+ @config_stub.export_lock_info request, options do |result, operation|
1361
+ yield result, operation if block_given?
1362
+ return result
1363
+ end
1364
+ rescue ::Gapic::Rest::Error => e
1365
+ raise ::Google::Cloud::Error.from_error(e)
1366
+ end
1367
+
1368
+ ##
1369
+ # Configuration class for the Config REST API.
1370
+ #
1371
+ # This class represents the configuration for Config REST,
1372
+ # providing control over timeouts, retry behavior, logging, transport
1373
+ # parameters, and other low-level controls. Certain parameters can also be
1374
+ # applied individually to specific RPCs. See
1375
+ # {::Google::Cloud::Config::V1::Config::Rest::Client::Configuration::Rpcs}
1376
+ # for a list of RPCs that can be configured independently.
1377
+ #
1378
+ # Configuration can be applied globally to all clients, or to a single client
1379
+ # on construction.
1380
+ #
1381
+ # @example
1382
+ #
1383
+ # # Modify the global config, setting the timeout for
1384
+ # # list_deployments to 20 seconds,
1385
+ # # and all remaining timeouts to 10 seconds.
1386
+ # ::Google::Cloud::Config::V1::Config::Rest::Client.configure do |config|
1387
+ # config.timeout = 10.0
1388
+ # config.rpcs.list_deployments.timeout = 20.0
1389
+ # end
1390
+ #
1391
+ # # Apply the above configuration only to a new client.
1392
+ # client = ::Google::Cloud::Config::V1::Config::Rest::Client.new do |config|
1393
+ # config.timeout = 10.0
1394
+ # config.rpcs.list_deployments.timeout = 20.0
1395
+ # end
1396
+ #
1397
+ # @!attribute [rw] endpoint
1398
+ # The hostname or hostname:port of the service endpoint.
1399
+ # Defaults to `"config.googleapis.com"`.
1400
+ # @return [::String]
1401
+ # @!attribute [rw] credentials
1402
+ # Credentials to send with calls. You may provide any of the following types:
1403
+ # * (`String`) The path to a service account key file in JSON format
1404
+ # * (`Hash`) A service account key as a Hash
1405
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1406
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1407
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1408
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1409
+ # * (`nil`) indicating no credentials
1410
+ # @return [::Object]
1411
+ # @!attribute [rw] scope
1412
+ # The OAuth scopes
1413
+ # @return [::Array<::String>]
1414
+ # @!attribute [rw] lib_name
1415
+ # The library name as recorded in instrumentation and logging
1416
+ # @return [::String]
1417
+ # @!attribute [rw] lib_version
1418
+ # The library version as recorded in instrumentation and logging
1419
+ # @return [::String]
1420
+ # @!attribute [rw] timeout
1421
+ # The call timeout in seconds.
1422
+ # @return [::Numeric]
1423
+ # @!attribute [rw] metadata
1424
+ # Additional headers to be sent with the call.
1425
+ # @return [::Hash{::Symbol=>::String}]
1426
+ # @!attribute [rw] retry_policy
1427
+ # The retry policy. The value is a hash with the following keys:
1428
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1429
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1430
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1431
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1432
+ # trigger a retry.
1433
+ # @return [::Hash]
1434
+ # @!attribute [rw] quota_project
1435
+ # A separate project against which to charge quota.
1436
+ # @return [::String]
1437
+ #
1438
+ class Configuration
1439
+ extend ::Gapic::Config
1440
+
1441
+ DEFAULT_ENDPOINT = "config.googleapis.com"
1442
+
1443
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1444
+ config_attr :credentials, nil do |value|
1445
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1446
+ allowed.any? { |klass| klass === value }
1447
+ end
1448
+ config_attr :scope, nil, ::String, ::Array, nil
1449
+ config_attr :lib_name, nil, ::String, nil
1450
+ config_attr :lib_version, nil, ::String, nil
1451
+ config_attr :timeout, nil, ::Numeric, nil
1452
+ config_attr :metadata, nil, ::Hash, nil
1453
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1454
+ config_attr :quota_project, nil, ::String, nil
1455
+
1456
+ # @private
1457
+ # Overrides for http bindings for the RPCs of this service
1458
+ # are only used when this service is used as mixin, and only
1459
+ # by the host service.
1460
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1461
+ config_attr :bindings_override, {}, ::Hash, nil
1462
+
1463
+ # @private
1464
+ def initialize parent_config = nil
1465
+ @parent_config = parent_config unless parent_config.nil?
1466
+
1467
+ yield self if block_given?
1468
+ end
1469
+
1470
+ ##
1471
+ # Configurations for individual RPCs
1472
+ # @return [Rpcs]
1473
+ #
1474
+ def rpcs
1475
+ @rpcs ||= begin
1476
+ parent_rpcs = nil
1477
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1478
+ Rpcs.new parent_rpcs
1479
+ end
1480
+ end
1481
+
1482
+ ##
1483
+ # Configuration RPC class for the Config API.
1484
+ #
1485
+ # Includes fields providing the configuration for each RPC in this service.
1486
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1487
+ # the following configuration fields:
1488
+ #
1489
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1490
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1491
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1492
+ # include the following keys:
1493
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1494
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1495
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1496
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1497
+ # trigger a retry.
1498
+ #
1499
+ class Rpcs
1500
+ ##
1501
+ # RPC-specific configuration for `list_deployments`
1502
+ # @return [::Gapic::Config::Method]
1503
+ #
1504
+ attr_reader :list_deployments
1505
+ ##
1506
+ # RPC-specific configuration for `get_deployment`
1507
+ # @return [::Gapic::Config::Method]
1508
+ #
1509
+ attr_reader :get_deployment
1510
+ ##
1511
+ # RPC-specific configuration for `create_deployment`
1512
+ # @return [::Gapic::Config::Method]
1513
+ #
1514
+ attr_reader :create_deployment
1515
+ ##
1516
+ # RPC-specific configuration for `update_deployment`
1517
+ # @return [::Gapic::Config::Method]
1518
+ #
1519
+ attr_reader :update_deployment
1520
+ ##
1521
+ # RPC-specific configuration for `delete_deployment`
1522
+ # @return [::Gapic::Config::Method]
1523
+ #
1524
+ attr_reader :delete_deployment
1525
+ ##
1526
+ # RPC-specific configuration for `list_revisions`
1527
+ # @return [::Gapic::Config::Method]
1528
+ #
1529
+ attr_reader :list_revisions
1530
+ ##
1531
+ # RPC-specific configuration for `get_revision`
1532
+ # @return [::Gapic::Config::Method]
1533
+ #
1534
+ attr_reader :get_revision
1535
+ ##
1536
+ # RPC-specific configuration for `get_resource`
1537
+ # @return [::Gapic::Config::Method]
1538
+ #
1539
+ attr_reader :get_resource
1540
+ ##
1541
+ # RPC-specific configuration for `list_resources`
1542
+ # @return [::Gapic::Config::Method]
1543
+ #
1544
+ attr_reader :list_resources
1545
+ ##
1546
+ # RPC-specific configuration for `export_deployment_statefile`
1547
+ # @return [::Gapic::Config::Method]
1548
+ #
1549
+ attr_reader :export_deployment_statefile
1550
+ ##
1551
+ # RPC-specific configuration for `export_revision_statefile`
1552
+ # @return [::Gapic::Config::Method]
1553
+ #
1554
+ attr_reader :export_revision_statefile
1555
+ ##
1556
+ # RPC-specific configuration for `import_statefile`
1557
+ # @return [::Gapic::Config::Method]
1558
+ #
1559
+ attr_reader :import_statefile
1560
+ ##
1561
+ # RPC-specific configuration for `delete_statefile`
1562
+ # @return [::Gapic::Config::Method]
1563
+ #
1564
+ attr_reader :delete_statefile
1565
+ ##
1566
+ # RPC-specific configuration for `lock_deployment`
1567
+ # @return [::Gapic::Config::Method]
1568
+ #
1569
+ attr_reader :lock_deployment
1570
+ ##
1571
+ # RPC-specific configuration for `unlock_deployment`
1572
+ # @return [::Gapic::Config::Method]
1573
+ #
1574
+ attr_reader :unlock_deployment
1575
+ ##
1576
+ # RPC-specific configuration for `export_lock_info`
1577
+ # @return [::Gapic::Config::Method]
1578
+ #
1579
+ attr_reader :export_lock_info
1580
+
1581
+ # @private
1582
+ def initialize parent_rpcs = nil
1583
+ list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments
1584
+ @list_deployments = ::Gapic::Config::Method.new list_deployments_config
1585
+ get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment
1586
+ @get_deployment = ::Gapic::Config::Method.new get_deployment_config
1587
+ create_deployment_config = parent_rpcs.create_deployment if parent_rpcs.respond_to? :create_deployment
1588
+ @create_deployment = ::Gapic::Config::Method.new create_deployment_config
1589
+ update_deployment_config = parent_rpcs.update_deployment if parent_rpcs.respond_to? :update_deployment
1590
+ @update_deployment = ::Gapic::Config::Method.new update_deployment_config
1591
+ delete_deployment_config = parent_rpcs.delete_deployment if parent_rpcs.respond_to? :delete_deployment
1592
+ @delete_deployment = ::Gapic::Config::Method.new delete_deployment_config
1593
+ list_revisions_config = parent_rpcs.list_revisions if parent_rpcs.respond_to? :list_revisions
1594
+ @list_revisions = ::Gapic::Config::Method.new list_revisions_config
1595
+ get_revision_config = parent_rpcs.get_revision if parent_rpcs.respond_to? :get_revision
1596
+ @get_revision = ::Gapic::Config::Method.new get_revision_config
1597
+ get_resource_config = parent_rpcs.get_resource if parent_rpcs.respond_to? :get_resource
1598
+ @get_resource = ::Gapic::Config::Method.new get_resource_config
1599
+ list_resources_config = parent_rpcs.list_resources if parent_rpcs.respond_to? :list_resources
1600
+ @list_resources = ::Gapic::Config::Method.new list_resources_config
1601
+ export_deployment_statefile_config = parent_rpcs.export_deployment_statefile if parent_rpcs.respond_to? :export_deployment_statefile
1602
+ @export_deployment_statefile = ::Gapic::Config::Method.new export_deployment_statefile_config
1603
+ export_revision_statefile_config = parent_rpcs.export_revision_statefile if parent_rpcs.respond_to? :export_revision_statefile
1604
+ @export_revision_statefile = ::Gapic::Config::Method.new export_revision_statefile_config
1605
+ import_statefile_config = parent_rpcs.import_statefile if parent_rpcs.respond_to? :import_statefile
1606
+ @import_statefile = ::Gapic::Config::Method.new import_statefile_config
1607
+ delete_statefile_config = parent_rpcs.delete_statefile if parent_rpcs.respond_to? :delete_statefile
1608
+ @delete_statefile = ::Gapic::Config::Method.new delete_statefile_config
1609
+ lock_deployment_config = parent_rpcs.lock_deployment if parent_rpcs.respond_to? :lock_deployment
1610
+ @lock_deployment = ::Gapic::Config::Method.new lock_deployment_config
1611
+ unlock_deployment_config = parent_rpcs.unlock_deployment if parent_rpcs.respond_to? :unlock_deployment
1612
+ @unlock_deployment = ::Gapic::Config::Method.new unlock_deployment_config
1613
+ export_lock_info_config = parent_rpcs.export_lock_info if parent_rpcs.respond_to? :export_lock_info
1614
+ @export_lock_info = ::Gapic::Config::Method.new export_lock_info_config
1615
+
1616
+ yield self if block_given?
1617
+ end
1618
+ end
1619
+ end
1620
+ end
1621
+ end
1622
+ end
1623
+ end
1624
+ end
1625
+ end
1626
+ end