google-cloud-config_delivery-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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/config_delivery/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/config_delivery/v1/config_delivery/client.rb +3222 -0
  7. data/lib/google/cloud/config_delivery/v1/config_delivery/credentials.rb +47 -0
  8. data/lib/google/cloud/config_delivery/v1/config_delivery/operations.rb +813 -0
  9. data/lib/google/cloud/config_delivery/v1/config_delivery/paths.rb +188 -0
  10. data/lib/google/cloud/config_delivery/v1/config_delivery/rest/client.rb +3029 -0
  11. data/lib/google/cloud/config_delivery/v1/config_delivery/rest/operations.rb +914 -0
  12. data/lib/google/cloud/config_delivery/v1/config_delivery/rest/service_stub.rb +1617 -0
  13. data/lib/google/cloud/config_delivery/v1/config_delivery/rest.rb +55 -0
  14. data/lib/google/cloud/config_delivery/v1/config_delivery.rb +57 -0
  15. data/lib/google/cloud/config_delivery/v1/rest.rb +38 -0
  16. data/lib/google/cloud/config_delivery/v1/version.rb +7 -2
  17. data/lib/google/cloud/config_delivery/v1.rb +45 -0
  18. data/lib/google/cloud/configdelivery/v1/config_delivery_pb.rb +115 -0
  19. data/lib/google/cloud/configdelivery/v1/config_delivery_services_pb.rb +95 -0
  20. data/lib/google-cloud-config_delivery-v1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/client.rb +473 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/field_info.rb +88 -0
  25. data/proto_docs/google/api/launch_stage.rb +71 -0
  26. data/proto_docs/google/api/resource.rb +227 -0
  27. data/proto_docs/google/cloud/configdelivery/v1/config_delivery.rb +1384 -0
  28. data/proto_docs/google/longrunning/operations.rb +173 -0
  29. data/proto_docs/google/protobuf/any.rb +145 -0
  30. data/proto_docs/google/protobuf/duration.rb +98 -0
  31. data/proto_docs/google/protobuf/empty.rb +34 -0
  32. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  33. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  34. data/proto_docs/google/rpc/status.rb +48 -0
  35. metadata +82 -9
@@ -0,0 +1,3222 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/configdelivery/v1/config_delivery_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ConfigDelivery
26
+ module V1
27
+ module ConfigDelivery
28
+ ##
29
+ # Client for the ConfigDelivery service.
30
+ #
31
+ # ConfigDelivery service manages the deployment of kubernetes configuration to
32
+ # a fleet of kubernetes clusters.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "configdelivery.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :config_delivery_stub
45
+
46
+ ##
47
+ # Configure the ConfigDelivery Client class.
48
+ #
49
+ # See {::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all ConfigDelivery clients
55
+ # ::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "ConfigDelivery", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.list_resource_bundles.timeout = 60.0
76
+ default_config.rpcs.list_resource_bundles.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.get_resource_bundle.timeout = 60.0
81
+ default_config.rpcs.get_resource_bundle.retry_policy = {
82
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
83
+ }
84
+
85
+ default_config.rpcs.create_resource_bundle.timeout = 60.0
86
+
87
+ default_config.rpcs.update_resource_bundle.timeout = 60.0
88
+
89
+ default_config.rpcs.delete_resource_bundle.timeout = 60.0
90
+
91
+ default_config.rpcs.list_fleet_packages.timeout = 60.0
92
+ default_config.rpcs.list_fleet_packages.retry_policy = {
93
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.get_fleet_package.timeout = 60.0
97
+ default_config.rpcs.get_fleet_package.retry_policy = {
98
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
99
+ }
100
+
101
+ default_config.rpcs.create_fleet_package.timeout = 60.0
102
+
103
+ default_config.rpcs.update_fleet_package.timeout = 60.0
104
+
105
+ default_config.rpcs.delete_fleet_package.timeout = 60.0
106
+
107
+ default_config.rpcs.list_releases.timeout = 60.0
108
+ default_config.rpcs.list_releases.retry_policy = {
109
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
110
+ }
111
+
112
+ default_config.rpcs.get_release.timeout = 60.0
113
+ default_config.rpcs.get_release.retry_policy = {
114
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
115
+ }
116
+
117
+ default_config.rpcs.create_release.timeout = 60.0
118
+
119
+ default_config.rpcs.update_release.timeout = 60.0
120
+
121
+ default_config.rpcs.delete_release.timeout = 60.0
122
+
123
+ default_config.rpcs.list_variants.timeout = 60.0
124
+ default_config.rpcs.list_variants.retry_policy = {
125
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
126
+ }
127
+
128
+ default_config.rpcs.get_variant.timeout = 60.0
129
+ default_config.rpcs.get_variant.retry_policy = {
130
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
131
+ }
132
+
133
+ default_config.rpcs.create_variant.timeout = 60.0
134
+
135
+ default_config.rpcs.update_variant.timeout = 60.0
136
+
137
+ default_config.rpcs.delete_variant.timeout = 60.0
138
+
139
+ default_config.rpcs.list_rollouts.timeout = 60.0
140
+ default_config.rpcs.list_rollouts.retry_policy = {
141
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
142
+ }
143
+
144
+ default_config.rpcs.get_rollout.timeout = 60.0
145
+ default_config.rpcs.get_rollout.retry_policy = {
146
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
147
+ }
148
+
149
+ default_config.rpcs.suspend_rollout.timeout = 60.0
150
+
151
+ default_config.rpcs.resume_rollout.timeout = 60.0
152
+
153
+ default_config.rpcs.abort_rollout.timeout = 60.0
154
+
155
+ default_config
156
+ end
157
+ yield @configure if block_given?
158
+ @configure
159
+ end
160
+
161
+ ##
162
+ # Configure the ConfigDelivery Client instance.
163
+ #
164
+ # The configuration is set to the derived mode, meaning that values can be changed,
165
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
166
+ # should be made on {Client.configure}.
167
+ #
168
+ # See {::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client::Configuration}
169
+ # for a description of the configuration fields.
170
+ #
171
+ # @yield [config] Configure the Client client.
172
+ # @yieldparam config [Client::Configuration]
173
+ #
174
+ # @return [Client::Configuration]
175
+ #
176
+ def configure
177
+ yield @config if block_given?
178
+ @config
179
+ end
180
+
181
+ ##
182
+ # The effective universe domain
183
+ #
184
+ # @return [String]
185
+ #
186
+ def universe_domain
187
+ @config_delivery_stub.universe_domain
188
+ end
189
+
190
+ ##
191
+ # Create a new ConfigDelivery client object.
192
+ #
193
+ # @example
194
+ #
195
+ # # Create a client using the default configuration
196
+ # client = ::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
197
+ #
198
+ # # Create a client using a custom configuration
199
+ # client = ::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new do |config|
200
+ # config.timeout = 10.0
201
+ # end
202
+ #
203
+ # @yield [config] Configure the ConfigDelivery client.
204
+ # @yieldparam config [Client::Configuration]
205
+ #
206
+ def initialize
207
+ # These require statements are intentionally placed here to initialize
208
+ # the gRPC module only when it's required.
209
+ # See https://github.com/googleapis/toolkit/issues/446
210
+ require "gapic/grpc"
211
+ require "google/cloud/configdelivery/v1/config_delivery_services_pb"
212
+
213
+ # Create the configuration object
214
+ @config = Configuration.new Client.configure
215
+
216
+ # Yield the configuration if needed
217
+ yield @config if block_given?
218
+
219
+ # Create credentials
220
+ credentials = @config.credentials
221
+ # Use self-signed JWT if the endpoint is unchanged from default,
222
+ # but only if the default endpoint does not have a region prefix.
223
+ enable_self_signed_jwt = @config.endpoint.nil? ||
224
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
225
+ !@config.endpoint.split(".").first.include?("-"))
226
+ credentials ||= Credentials.default scope: @config.scope,
227
+ enable_self_signed_jwt: enable_self_signed_jwt
228
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
229
+ credentials = Credentials.new credentials, scope: @config.scope
230
+ end
231
+ @quota_project_id = @config.quota_project
232
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
233
+
234
+ @operations_client = Operations.new do |config|
235
+ config.credentials = credentials
236
+ config.quota_project = @quota_project_id
237
+ config.endpoint = @config.endpoint
238
+ config.universe_domain = @config.universe_domain
239
+ end
240
+
241
+ @config_delivery_stub = ::Gapic::ServiceStub.new(
242
+ ::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Stub,
243
+ credentials: credentials,
244
+ endpoint: @config.endpoint,
245
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
246
+ universe_domain: @config.universe_domain,
247
+ channel_args: @config.channel_args,
248
+ interceptors: @config.interceptors,
249
+ channel_pool_config: @config.channel_pool,
250
+ logger: @config.logger
251
+ )
252
+
253
+ @config_delivery_stub.stub_logger&.info do |entry|
254
+ entry.set_system_name
255
+ entry.set_service
256
+ entry.message = "Created client for #{entry.service}"
257
+ entry.set_credentials_fields credentials
258
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
259
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
260
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
261
+ end
262
+
263
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
264
+ config.credentials = credentials
265
+ config.quota_project = @quota_project_id
266
+ config.endpoint = @config_delivery_stub.endpoint
267
+ config.universe_domain = @config_delivery_stub.universe_domain
268
+ config.logger = @config_delivery_stub.logger if config.respond_to? :logger=
269
+ end
270
+ end
271
+
272
+ ##
273
+ # Get the associated client for long-running operations.
274
+ #
275
+ # @return [::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Operations]
276
+ #
277
+ attr_reader :operations_client
278
+
279
+ ##
280
+ # Get the associated client for mix-in of the Locations.
281
+ #
282
+ # @return [Google::Cloud::Location::Locations::Client]
283
+ #
284
+ attr_reader :location_client
285
+
286
+ ##
287
+ # The logger used for request/response debug logging.
288
+ #
289
+ # @return [Logger]
290
+ #
291
+ def logger
292
+ @config_delivery_stub.logger
293
+ end
294
+
295
+ # Service calls
296
+
297
+ ##
298
+ # Lists ResourceBundles in a given project and location.
299
+ #
300
+ # @overload list_resource_bundles(request, options = nil)
301
+ # Pass arguments to `list_resource_bundles` via a request object, either of type
302
+ # {::Google::Cloud::ConfigDelivery::V1::ListResourceBundlesRequest} or an equivalent Hash.
303
+ #
304
+ # @param request [::Google::Cloud::ConfigDelivery::V1::ListResourceBundlesRequest, ::Hash]
305
+ # A request object representing the call parameters. Required. To specify no
306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
307
+ # @param options [::Gapic::CallOptions, ::Hash]
308
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
309
+ #
310
+ # @overload list_resource_bundles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
311
+ # Pass arguments to `list_resource_bundles` via keyword arguments. Note that at
312
+ # least one keyword argument is required. To specify no parameters, or to keep all
313
+ # the default parameter values, pass an empty Hash as a request object (see above).
314
+ #
315
+ # @param parent [::String]
316
+ # Required. Parent value for ListResourceBundlesRequest.
317
+ # @param page_size [::Integer]
318
+ # Optional. Requested page size. Server may return fewer items than
319
+ # requested. If unspecified, server will pick an appropriate default.
320
+ # @param page_token [::String]
321
+ # Optional. A token identifying a page of results the server should return.
322
+ # @param filter [::String]
323
+ # Optional. Filtering results.
324
+ # @param order_by [::String]
325
+ # Optional. Hint for how to order the results.
326
+ #
327
+ # @yield [response, operation] Access the result along with the RPC operation
328
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::ResourceBundle>]
329
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
330
+ #
331
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::ResourceBundle>]
332
+ #
333
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
334
+ #
335
+ # @example Basic example
336
+ # require "google/cloud/config_delivery/v1"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Cloud::ConfigDelivery::V1::ListResourceBundlesRequest.new
343
+ #
344
+ # # Call the list_resource_bundles method.
345
+ # result = client.list_resource_bundles request
346
+ #
347
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
348
+ # # over elements, and API calls will be issued to fetch pages as needed.
349
+ # result.each do |item|
350
+ # # Each element is of type ::Google::Cloud::ConfigDelivery::V1::ResourceBundle.
351
+ # p item
352
+ # end
353
+ #
354
+ def list_resource_bundles request, options = nil
355
+ raise ::ArgumentError, "request must be provided" if request.nil?
356
+
357
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::ListResourceBundlesRequest
358
+
359
+ # Converts hash and nil to an options object
360
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
361
+
362
+ # Customize the options with defaults
363
+ metadata = @config.rpcs.list_resource_bundles.metadata.to_h
364
+
365
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
366
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
367
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
368
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
369
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
370
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
371
+
372
+ header_params = {}
373
+ if request.parent
374
+ header_params["parent"] = request.parent
375
+ end
376
+
377
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
378
+ metadata[:"x-goog-request-params"] ||= request_params_header
379
+
380
+ options.apply_defaults timeout: @config.rpcs.list_resource_bundles.timeout,
381
+ metadata: metadata,
382
+ retry_policy: @config.rpcs.list_resource_bundles.retry_policy
383
+
384
+ options.apply_defaults timeout: @config.timeout,
385
+ metadata: @config.metadata,
386
+ retry_policy: @config.retry_policy
387
+
388
+ @config_delivery_stub.call_rpc :list_resource_bundles, request, options: options do |response, operation|
389
+ response = ::Gapic::PagedEnumerable.new @config_delivery_stub, :list_resource_bundles, request, response, operation, options
390
+ yield response, operation if block_given?
391
+ throw :response, response
392
+ end
393
+ rescue ::GRPC::BadStatus => e
394
+ raise ::Google::Cloud::Error.from_error(e)
395
+ end
396
+
397
+ ##
398
+ # Gets details of a single ResourceBundle.
399
+ #
400
+ # @overload get_resource_bundle(request, options = nil)
401
+ # Pass arguments to `get_resource_bundle` via a request object, either of type
402
+ # {::Google::Cloud::ConfigDelivery::V1::GetResourceBundleRequest} or an equivalent Hash.
403
+ #
404
+ # @param request [::Google::Cloud::ConfigDelivery::V1::GetResourceBundleRequest, ::Hash]
405
+ # A request object representing the call parameters. Required. To specify no
406
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
407
+ # @param options [::Gapic::CallOptions, ::Hash]
408
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
409
+ #
410
+ # @overload get_resource_bundle(name: nil)
411
+ # Pass arguments to `get_resource_bundle` via keyword arguments. Note that at
412
+ # least one keyword argument is required. To specify no parameters, or to keep all
413
+ # the default parameter values, pass an empty Hash as a request object (see above).
414
+ #
415
+ # @param name [::String]
416
+ # Required. Name of the resource.
417
+ #
418
+ # @yield [response, operation] Access the result along with the RPC operation
419
+ # @yieldparam response [::Google::Cloud::ConfigDelivery::V1::ResourceBundle]
420
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
421
+ #
422
+ # @return [::Google::Cloud::ConfigDelivery::V1::ResourceBundle]
423
+ #
424
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
425
+ #
426
+ # @example Basic example
427
+ # require "google/cloud/config_delivery/v1"
428
+ #
429
+ # # Create a client object. The client can be reused for multiple calls.
430
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
431
+ #
432
+ # # Create a request. To set request fields, pass in keyword arguments.
433
+ # request = Google::Cloud::ConfigDelivery::V1::GetResourceBundleRequest.new
434
+ #
435
+ # # Call the get_resource_bundle method.
436
+ # result = client.get_resource_bundle request
437
+ #
438
+ # # The returned object is of type Google::Cloud::ConfigDelivery::V1::ResourceBundle.
439
+ # p result
440
+ #
441
+ def get_resource_bundle request, options = nil
442
+ raise ::ArgumentError, "request must be provided" if request.nil?
443
+
444
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::GetResourceBundleRequest
445
+
446
+ # Converts hash and nil to an options object
447
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
448
+
449
+ # Customize the options with defaults
450
+ metadata = @config.rpcs.get_resource_bundle.metadata.to_h
451
+
452
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
453
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
454
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
455
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
456
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
457
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
458
+
459
+ header_params = {}
460
+ if request.name
461
+ header_params["name"] = request.name
462
+ end
463
+
464
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
465
+ metadata[:"x-goog-request-params"] ||= request_params_header
466
+
467
+ options.apply_defaults timeout: @config.rpcs.get_resource_bundle.timeout,
468
+ metadata: metadata,
469
+ retry_policy: @config.rpcs.get_resource_bundle.retry_policy
470
+
471
+ options.apply_defaults timeout: @config.timeout,
472
+ metadata: @config.metadata,
473
+ retry_policy: @config.retry_policy
474
+
475
+ @config_delivery_stub.call_rpc :get_resource_bundle, request, options: options do |response, operation|
476
+ yield response, operation if block_given?
477
+ end
478
+ rescue ::GRPC::BadStatus => e
479
+ raise ::Google::Cloud::Error.from_error(e)
480
+ end
481
+
482
+ ##
483
+ # Creates a new ResourceBundle in a given project and location.
484
+ #
485
+ # @overload create_resource_bundle(request, options = nil)
486
+ # Pass arguments to `create_resource_bundle` via a request object, either of type
487
+ # {::Google::Cloud::ConfigDelivery::V1::CreateResourceBundleRequest} or an equivalent Hash.
488
+ #
489
+ # @param request [::Google::Cloud::ConfigDelivery::V1::CreateResourceBundleRequest, ::Hash]
490
+ # A request object representing the call parameters. Required. To specify no
491
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
492
+ # @param options [::Gapic::CallOptions, ::Hash]
493
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
494
+ #
495
+ # @overload create_resource_bundle(parent: nil, resource_bundle_id: nil, resource_bundle: nil, request_id: nil)
496
+ # Pass arguments to `create_resource_bundle` via keyword arguments. Note that at
497
+ # least one keyword argument is required. To specify no parameters, or to keep all
498
+ # the default parameter values, pass an empty Hash as a request object (see above).
499
+ #
500
+ # @param parent [::String]
501
+ # Required. Value for parent.
502
+ # @param resource_bundle_id [::String]
503
+ # Required. Id of the requesting object
504
+ # If auto-generating Id server-side, remove this field and
505
+ # resource_bundle_id from the method_signature of Create RPC
506
+ # @param resource_bundle [::Google::Cloud::ConfigDelivery::V1::ResourceBundle, ::Hash]
507
+ # Required. The resource being created
508
+ # @param request_id [::String]
509
+ # Optional. An optional request ID to identify requests. Specify a unique
510
+ # request ID so that if you must retry your request, the server will know to
511
+ # ignore the request if it has already been completed. The server will
512
+ # guarantee that for at least 60 minutes since the first request.
513
+ #
514
+ # For example, consider a situation where you make an initial request and the
515
+ # request times out. If you make the request again with the same request
516
+ # ID, the server can check if original operation with the same request ID
517
+ # was received, and if so, will ignore the second request. This prevents
518
+ # clients from accidentally creating duplicate commitments.
519
+ #
520
+ # The request ID must be a valid UUID with the exception that zero UUID is
521
+ # not supported (00000000-0000-0000-0000-000000000000).
522
+ #
523
+ # @yield [response, operation] Access the result along with the RPC operation
524
+ # @yieldparam response [::Gapic::Operation]
525
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
526
+ #
527
+ # @return [::Gapic::Operation]
528
+ #
529
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
530
+ #
531
+ # @example Basic example
532
+ # require "google/cloud/config_delivery/v1"
533
+ #
534
+ # # Create a client object. The client can be reused for multiple calls.
535
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
536
+ #
537
+ # # Create a request. To set request fields, pass in keyword arguments.
538
+ # request = Google::Cloud::ConfigDelivery::V1::CreateResourceBundleRequest.new
539
+ #
540
+ # # Call the create_resource_bundle method.
541
+ # result = client.create_resource_bundle request
542
+ #
543
+ # # The returned object is of type Gapic::Operation. You can use it to
544
+ # # check the status of an operation, cancel it, or wait for results.
545
+ # # Here is how to wait for a response.
546
+ # result.wait_until_done! timeout: 60
547
+ # if result.response?
548
+ # p result.response
549
+ # else
550
+ # puts "No response received."
551
+ # end
552
+ #
553
+ def create_resource_bundle request, options = nil
554
+ raise ::ArgumentError, "request must be provided" if request.nil?
555
+
556
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::CreateResourceBundleRequest
557
+
558
+ # Converts hash and nil to an options object
559
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
560
+
561
+ # Customize the options with defaults
562
+ metadata = @config.rpcs.create_resource_bundle.metadata.to_h
563
+
564
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
565
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
566
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
567
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
568
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
569
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
570
+
571
+ header_params = {}
572
+ if request.parent
573
+ header_params["parent"] = request.parent
574
+ end
575
+
576
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
577
+ metadata[:"x-goog-request-params"] ||= request_params_header
578
+
579
+ options.apply_defaults timeout: @config.rpcs.create_resource_bundle.timeout,
580
+ metadata: metadata,
581
+ retry_policy: @config.rpcs.create_resource_bundle.retry_policy
582
+
583
+ options.apply_defaults timeout: @config.timeout,
584
+ metadata: @config.metadata,
585
+ retry_policy: @config.retry_policy
586
+
587
+ @config_delivery_stub.call_rpc :create_resource_bundle, request, options: options do |response, operation|
588
+ response = ::Gapic::Operation.new response, @operations_client, options: options
589
+ yield response, operation if block_given?
590
+ throw :response, response
591
+ end
592
+ rescue ::GRPC::BadStatus => e
593
+ raise ::Google::Cloud::Error.from_error(e)
594
+ end
595
+
596
+ ##
597
+ # Updates the parameters of a single ResourceBundle.
598
+ #
599
+ # @overload update_resource_bundle(request, options = nil)
600
+ # Pass arguments to `update_resource_bundle` via a request object, either of type
601
+ # {::Google::Cloud::ConfigDelivery::V1::UpdateResourceBundleRequest} or an equivalent Hash.
602
+ #
603
+ # @param request [::Google::Cloud::ConfigDelivery::V1::UpdateResourceBundleRequest, ::Hash]
604
+ # A request object representing the call parameters. Required. To specify no
605
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
606
+ # @param options [::Gapic::CallOptions, ::Hash]
607
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
608
+ #
609
+ # @overload update_resource_bundle(update_mask: nil, resource_bundle: nil, request_id: nil)
610
+ # Pass arguments to `update_resource_bundle` via keyword arguments. Note that at
611
+ # least one keyword argument is required. To specify no parameters, or to keep all
612
+ # the default parameter values, pass an empty Hash as a request object (see above).
613
+ #
614
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
615
+ # Required. Field mask is used to specify the fields to be overwritten in the
616
+ # ResourceBundle resource by the update.
617
+ # The fields specified in the update_mask are relative to the resource, not
618
+ # the full request. A field will be overwritten if it is in the mask. If the
619
+ # user does not provide a mask then all fields will be overwritten.
620
+ # @param resource_bundle [::Google::Cloud::ConfigDelivery::V1::ResourceBundle, ::Hash]
621
+ # Required. The resource being updated
622
+ # @param request_id [::String]
623
+ # Optional. An optional request ID to identify requests. Specify a unique
624
+ # request ID so that if you must retry your request, the server will know to
625
+ # ignore the request if it has already been completed. The server will
626
+ # guarantee that for at least 60 minutes since the first request.
627
+ #
628
+ # For example, consider a situation where you make an initial request and the
629
+ # request times out. If you make the request again with the same request
630
+ # ID, the server can check if original operation with the same request ID
631
+ # was received, and if so, will ignore the second request. This prevents
632
+ # clients from accidentally creating duplicate commitments.
633
+ #
634
+ # The request ID must be a valid UUID with the exception that zero UUID is
635
+ # not supported (00000000-0000-0000-0000-000000000000).
636
+ #
637
+ # @yield [response, operation] Access the result along with the RPC operation
638
+ # @yieldparam response [::Gapic::Operation]
639
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
640
+ #
641
+ # @return [::Gapic::Operation]
642
+ #
643
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
644
+ #
645
+ # @example Basic example
646
+ # require "google/cloud/config_delivery/v1"
647
+ #
648
+ # # Create a client object. The client can be reused for multiple calls.
649
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
650
+ #
651
+ # # Create a request. To set request fields, pass in keyword arguments.
652
+ # request = Google::Cloud::ConfigDelivery::V1::UpdateResourceBundleRequest.new
653
+ #
654
+ # # Call the update_resource_bundle method.
655
+ # result = client.update_resource_bundle request
656
+ #
657
+ # # The returned object is of type Gapic::Operation. You can use it to
658
+ # # check the status of an operation, cancel it, or wait for results.
659
+ # # Here is how to wait for a response.
660
+ # result.wait_until_done! timeout: 60
661
+ # if result.response?
662
+ # p result.response
663
+ # else
664
+ # puts "No response received."
665
+ # end
666
+ #
667
+ def update_resource_bundle request, options = nil
668
+ raise ::ArgumentError, "request must be provided" if request.nil?
669
+
670
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::UpdateResourceBundleRequest
671
+
672
+ # Converts hash and nil to an options object
673
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
674
+
675
+ # Customize the options with defaults
676
+ metadata = @config.rpcs.update_resource_bundle.metadata.to_h
677
+
678
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
679
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
680
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
681
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
682
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
683
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
684
+
685
+ header_params = {}
686
+ if request.resource_bundle&.name
687
+ header_params["resource_bundle.name"] = request.resource_bundle.name
688
+ end
689
+
690
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
691
+ metadata[:"x-goog-request-params"] ||= request_params_header
692
+
693
+ options.apply_defaults timeout: @config.rpcs.update_resource_bundle.timeout,
694
+ metadata: metadata,
695
+ retry_policy: @config.rpcs.update_resource_bundle.retry_policy
696
+
697
+ options.apply_defaults timeout: @config.timeout,
698
+ metadata: @config.metadata,
699
+ retry_policy: @config.retry_policy
700
+
701
+ @config_delivery_stub.call_rpc :update_resource_bundle, request, options: options do |response, operation|
702
+ response = ::Gapic::Operation.new response, @operations_client, options: options
703
+ yield response, operation if block_given?
704
+ throw :response, response
705
+ end
706
+ rescue ::GRPC::BadStatus => e
707
+ raise ::Google::Cloud::Error.from_error(e)
708
+ end
709
+
710
+ ##
711
+ # Deletes a single ResourceBundle.
712
+ #
713
+ # @overload delete_resource_bundle(request, options = nil)
714
+ # Pass arguments to `delete_resource_bundle` via a request object, either of type
715
+ # {::Google::Cloud::ConfigDelivery::V1::DeleteResourceBundleRequest} or an equivalent Hash.
716
+ #
717
+ # @param request [::Google::Cloud::ConfigDelivery::V1::DeleteResourceBundleRequest, ::Hash]
718
+ # A request object representing the call parameters. Required. To specify no
719
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
720
+ # @param options [::Gapic::CallOptions, ::Hash]
721
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
722
+ #
723
+ # @overload delete_resource_bundle(name: nil, request_id: nil, force: nil)
724
+ # Pass arguments to `delete_resource_bundle` via keyword arguments. Note that at
725
+ # least one keyword argument is required. To specify no parameters, or to keep all
726
+ # the default parameter values, pass an empty Hash as a request object (see above).
727
+ #
728
+ # @param name [::String]
729
+ # Required. Name of the resource
730
+ # @param request_id [::String]
731
+ # Optional. An optional request ID to identify requests. Specify a unique
732
+ # request ID so that if you must retry your request, the server will know to
733
+ # ignore the request if it has already been completed. The server will
734
+ # guarantee that for at least 60 minutes after the first request.
735
+ #
736
+ # For example, consider a situation where you make an initial request and the
737
+ # request times out. If you make the request again with the same request
738
+ # ID, the server can check if original operation with the same request ID
739
+ # was received, and if so, will ignore the second request. This prevents
740
+ # clients from accidentally creating duplicate commitments.
741
+ #
742
+ # The request ID must be a valid UUID with the exception that zero UUID is
743
+ # not supported (00000000-0000-0000-0000-000000000000).
744
+ # @param force [::Boolean]
745
+ # Optional. If set to true, any releases of this resource bundle will also be
746
+ # deleted. (Otherwise, the request will only work if the resource bundle has
747
+ # no releases.)
748
+ #
749
+ # @yield [response, operation] Access the result along with the RPC operation
750
+ # @yieldparam response [::Gapic::Operation]
751
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
752
+ #
753
+ # @return [::Gapic::Operation]
754
+ #
755
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
756
+ #
757
+ # @example Basic example
758
+ # require "google/cloud/config_delivery/v1"
759
+ #
760
+ # # Create a client object. The client can be reused for multiple calls.
761
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
762
+ #
763
+ # # Create a request. To set request fields, pass in keyword arguments.
764
+ # request = Google::Cloud::ConfigDelivery::V1::DeleteResourceBundleRequest.new
765
+ #
766
+ # # Call the delete_resource_bundle method.
767
+ # result = client.delete_resource_bundle request
768
+ #
769
+ # # The returned object is of type Gapic::Operation. You can use it to
770
+ # # check the status of an operation, cancel it, or wait for results.
771
+ # # Here is how to wait for a response.
772
+ # result.wait_until_done! timeout: 60
773
+ # if result.response?
774
+ # p result.response
775
+ # else
776
+ # puts "No response received."
777
+ # end
778
+ #
779
+ def delete_resource_bundle request, options = nil
780
+ raise ::ArgumentError, "request must be provided" if request.nil?
781
+
782
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::DeleteResourceBundleRequest
783
+
784
+ # Converts hash and nil to an options object
785
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
786
+
787
+ # Customize the options with defaults
788
+ metadata = @config.rpcs.delete_resource_bundle.metadata.to_h
789
+
790
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
791
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
792
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
793
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
794
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
795
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
796
+
797
+ header_params = {}
798
+ if request.name
799
+ header_params["name"] = request.name
800
+ end
801
+
802
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
803
+ metadata[:"x-goog-request-params"] ||= request_params_header
804
+
805
+ options.apply_defaults timeout: @config.rpcs.delete_resource_bundle.timeout,
806
+ metadata: metadata,
807
+ retry_policy: @config.rpcs.delete_resource_bundle.retry_policy
808
+
809
+ options.apply_defaults timeout: @config.timeout,
810
+ metadata: @config.metadata,
811
+ retry_policy: @config.retry_policy
812
+
813
+ @config_delivery_stub.call_rpc :delete_resource_bundle, request, options: options do |response, operation|
814
+ response = ::Gapic::Operation.new response, @operations_client, options: options
815
+ yield response, operation if block_given?
816
+ throw :response, response
817
+ end
818
+ rescue ::GRPC::BadStatus => e
819
+ raise ::Google::Cloud::Error.from_error(e)
820
+ end
821
+
822
+ ##
823
+ # Lists FleetPackages in a given project and location.
824
+ #
825
+ # @overload list_fleet_packages(request, options = nil)
826
+ # Pass arguments to `list_fleet_packages` via a request object, either of type
827
+ # {::Google::Cloud::ConfigDelivery::V1::ListFleetPackagesRequest} or an equivalent Hash.
828
+ #
829
+ # @param request [::Google::Cloud::ConfigDelivery::V1::ListFleetPackagesRequest, ::Hash]
830
+ # A request object representing the call parameters. Required. To specify no
831
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
832
+ # @param options [::Gapic::CallOptions, ::Hash]
833
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
834
+ #
835
+ # @overload list_fleet_packages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
836
+ # Pass arguments to `list_fleet_packages` via keyword arguments. Note that at
837
+ # least one keyword argument is required. To specify no parameters, or to keep all
838
+ # the default parameter values, pass an empty Hash as a request object (see above).
839
+ #
840
+ # @param parent [::String]
841
+ # Required. Parent value for ListFleetPackagesRequest.
842
+ # @param page_size [::Integer]
843
+ # Optional. Requested page size. Server may return fewer items than
844
+ # requested. If unspecified, server will pick an appropriate default.
845
+ # @param page_token [::String]
846
+ # Optional. A token identifying a page of results the server should return.
847
+ # @param filter [::String]
848
+ # Optional. Filtering results
849
+ # @param order_by [::String]
850
+ # Optional. Hint for how to order the results
851
+ #
852
+ # @yield [response, operation] Access the result along with the RPC operation
853
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::FleetPackage>]
854
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
855
+ #
856
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::FleetPackage>]
857
+ #
858
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
859
+ #
860
+ # @example Basic example
861
+ # require "google/cloud/config_delivery/v1"
862
+ #
863
+ # # Create a client object. The client can be reused for multiple calls.
864
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
865
+ #
866
+ # # Create a request. To set request fields, pass in keyword arguments.
867
+ # request = Google::Cloud::ConfigDelivery::V1::ListFleetPackagesRequest.new
868
+ #
869
+ # # Call the list_fleet_packages method.
870
+ # result = client.list_fleet_packages request
871
+ #
872
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
873
+ # # over elements, and API calls will be issued to fetch pages as needed.
874
+ # result.each do |item|
875
+ # # Each element is of type ::Google::Cloud::ConfigDelivery::V1::FleetPackage.
876
+ # p item
877
+ # end
878
+ #
879
+ def list_fleet_packages request, options = nil
880
+ raise ::ArgumentError, "request must be provided" if request.nil?
881
+
882
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::ListFleetPackagesRequest
883
+
884
+ # Converts hash and nil to an options object
885
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
886
+
887
+ # Customize the options with defaults
888
+ metadata = @config.rpcs.list_fleet_packages.metadata.to_h
889
+
890
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
891
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
892
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
893
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
894
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
895
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
896
+
897
+ header_params = {}
898
+ if request.parent
899
+ header_params["parent"] = request.parent
900
+ end
901
+
902
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
903
+ metadata[:"x-goog-request-params"] ||= request_params_header
904
+
905
+ options.apply_defaults timeout: @config.rpcs.list_fleet_packages.timeout,
906
+ metadata: metadata,
907
+ retry_policy: @config.rpcs.list_fleet_packages.retry_policy
908
+
909
+ options.apply_defaults timeout: @config.timeout,
910
+ metadata: @config.metadata,
911
+ retry_policy: @config.retry_policy
912
+
913
+ @config_delivery_stub.call_rpc :list_fleet_packages, request, options: options do |response, operation|
914
+ response = ::Gapic::PagedEnumerable.new @config_delivery_stub, :list_fleet_packages, request, response, operation, options
915
+ yield response, operation if block_given?
916
+ throw :response, response
917
+ end
918
+ rescue ::GRPC::BadStatus => e
919
+ raise ::Google::Cloud::Error.from_error(e)
920
+ end
921
+
922
+ ##
923
+ # Gets details of a single FleetPackage.
924
+ #
925
+ # @overload get_fleet_package(request, options = nil)
926
+ # Pass arguments to `get_fleet_package` via a request object, either of type
927
+ # {::Google::Cloud::ConfigDelivery::V1::GetFleetPackageRequest} or an equivalent Hash.
928
+ #
929
+ # @param request [::Google::Cloud::ConfigDelivery::V1::GetFleetPackageRequest, ::Hash]
930
+ # A request object representing the call parameters. Required. To specify no
931
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
932
+ # @param options [::Gapic::CallOptions, ::Hash]
933
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
934
+ #
935
+ # @overload get_fleet_package(name: nil)
936
+ # Pass arguments to `get_fleet_package` via keyword arguments. Note that at
937
+ # least one keyword argument is required. To specify no parameters, or to keep all
938
+ # the default parameter values, pass an empty Hash as a request object (see above).
939
+ #
940
+ # @param name [::String]
941
+ # Required. Name of the resource
942
+ #
943
+ # @yield [response, operation] Access the result along with the RPC operation
944
+ # @yieldparam response [::Google::Cloud::ConfigDelivery::V1::FleetPackage]
945
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
946
+ #
947
+ # @return [::Google::Cloud::ConfigDelivery::V1::FleetPackage]
948
+ #
949
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
950
+ #
951
+ # @example Basic example
952
+ # require "google/cloud/config_delivery/v1"
953
+ #
954
+ # # Create a client object. The client can be reused for multiple calls.
955
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
956
+ #
957
+ # # Create a request. To set request fields, pass in keyword arguments.
958
+ # request = Google::Cloud::ConfigDelivery::V1::GetFleetPackageRequest.new
959
+ #
960
+ # # Call the get_fleet_package method.
961
+ # result = client.get_fleet_package request
962
+ #
963
+ # # The returned object is of type Google::Cloud::ConfigDelivery::V1::FleetPackage.
964
+ # p result
965
+ #
966
+ def get_fleet_package request, options = nil
967
+ raise ::ArgumentError, "request must be provided" if request.nil?
968
+
969
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::GetFleetPackageRequest
970
+
971
+ # Converts hash and nil to an options object
972
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
973
+
974
+ # Customize the options with defaults
975
+ metadata = @config.rpcs.get_fleet_package.metadata.to_h
976
+
977
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
978
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
979
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
980
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
981
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
982
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
983
+
984
+ header_params = {}
985
+ if request.name
986
+ header_params["name"] = request.name
987
+ end
988
+
989
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
990
+ metadata[:"x-goog-request-params"] ||= request_params_header
991
+
992
+ options.apply_defaults timeout: @config.rpcs.get_fleet_package.timeout,
993
+ metadata: metadata,
994
+ retry_policy: @config.rpcs.get_fleet_package.retry_policy
995
+
996
+ options.apply_defaults timeout: @config.timeout,
997
+ metadata: @config.metadata,
998
+ retry_policy: @config.retry_policy
999
+
1000
+ @config_delivery_stub.call_rpc :get_fleet_package, request, options: options do |response, operation|
1001
+ yield response, operation if block_given?
1002
+ end
1003
+ rescue ::GRPC::BadStatus => e
1004
+ raise ::Google::Cloud::Error.from_error(e)
1005
+ end
1006
+
1007
+ ##
1008
+ # Creates a new FleetPackage in a given project and location.
1009
+ #
1010
+ # @overload create_fleet_package(request, options = nil)
1011
+ # Pass arguments to `create_fleet_package` via a request object, either of type
1012
+ # {::Google::Cloud::ConfigDelivery::V1::CreateFleetPackageRequest} or an equivalent Hash.
1013
+ #
1014
+ # @param request [::Google::Cloud::ConfigDelivery::V1::CreateFleetPackageRequest, ::Hash]
1015
+ # A request object representing the call parameters. Required. To specify no
1016
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1017
+ # @param options [::Gapic::CallOptions, ::Hash]
1018
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1019
+ #
1020
+ # @overload create_fleet_package(parent: nil, fleet_package_id: nil, fleet_package: nil, request_id: nil)
1021
+ # Pass arguments to `create_fleet_package` via keyword arguments. Note that at
1022
+ # least one keyword argument is required. To specify no parameters, or to keep all
1023
+ # the default parameter values, pass an empty Hash as a request object (see above).
1024
+ #
1025
+ # @param parent [::String]
1026
+ # Required. Value for parent.
1027
+ # @param fleet_package_id [::String]
1028
+ # Required. Id of the requesting object
1029
+ # If auto-generating Id server-side, remove this field and
1030
+ # fleet_package_id from the method_signature of Create RPC
1031
+ # @param fleet_package [::Google::Cloud::ConfigDelivery::V1::FleetPackage, ::Hash]
1032
+ # Required. The resource being created.
1033
+ # @param request_id [::String]
1034
+ # Optional. An optional request ID to identify requests. Specify a unique
1035
+ # request ID so that if you must retry your request, the server will know to
1036
+ # ignore the request if it has already been completed. The server will
1037
+ # guarantee that for at least 60 minutes since the first request.
1038
+ #
1039
+ # For example, consider a situation where you make an initial request and the
1040
+ # request times out. If you make the request again with the same request
1041
+ # ID, the server can check if original operation with the same request ID
1042
+ # was received, and if so, will ignore the second request. This prevents
1043
+ # clients from accidentally creating duplicate commitments.
1044
+ #
1045
+ # The request ID must be a valid UUID with the exception that zero UUID is
1046
+ # not supported (00000000-0000-0000-0000-000000000000).
1047
+ #
1048
+ # @yield [response, operation] Access the result along with the RPC operation
1049
+ # @yieldparam response [::Gapic::Operation]
1050
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1051
+ #
1052
+ # @return [::Gapic::Operation]
1053
+ #
1054
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1055
+ #
1056
+ # @example Basic example
1057
+ # require "google/cloud/config_delivery/v1"
1058
+ #
1059
+ # # Create a client object. The client can be reused for multiple calls.
1060
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1061
+ #
1062
+ # # Create a request. To set request fields, pass in keyword arguments.
1063
+ # request = Google::Cloud::ConfigDelivery::V1::CreateFleetPackageRequest.new
1064
+ #
1065
+ # # Call the create_fleet_package method.
1066
+ # result = client.create_fleet_package request
1067
+ #
1068
+ # # The returned object is of type Gapic::Operation. You can use it to
1069
+ # # check the status of an operation, cancel it, or wait for results.
1070
+ # # Here is how to wait for a response.
1071
+ # result.wait_until_done! timeout: 60
1072
+ # if result.response?
1073
+ # p result.response
1074
+ # else
1075
+ # puts "No response received."
1076
+ # end
1077
+ #
1078
+ def create_fleet_package request, options = nil
1079
+ raise ::ArgumentError, "request must be provided" if request.nil?
1080
+
1081
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::CreateFleetPackageRequest
1082
+
1083
+ # Converts hash and nil to an options object
1084
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1085
+
1086
+ # Customize the options with defaults
1087
+ metadata = @config.rpcs.create_fleet_package.metadata.to_h
1088
+
1089
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1090
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1091
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1092
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1093
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1094
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1095
+
1096
+ header_params = {}
1097
+ if request.parent
1098
+ header_params["parent"] = request.parent
1099
+ end
1100
+
1101
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1102
+ metadata[:"x-goog-request-params"] ||= request_params_header
1103
+
1104
+ options.apply_defaults timeout: @config.rpcs.create_fleet_package.timeout,
1105
+ metadata: metadata,
1106
+ retry_policy: @config.rpcs.create_fleet_package.retry_policy
1107
+
1108
+ options.apply_defaults timeout: @config.timeout,
1109
+ metadata: @config.metadata,
1110
+ retry_policy: @config.retry_policy
1111
+
1112
+ @config_delivery_stub.call_rpc :create_fleet_package, request, options: options do |response, operation|
1113
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1114
+ yield response, operation if block_given?
1115
+ throw :response, response
1116
+ end
1117
+ rescue ::GRPC::BadStatus => e
1118
+ raise ::Google::Cloud::Error.from_error(e)
1119
+ end
1120
+
1121
+ ##
1122
+ # Updates the parameters of a single FleetPackage.
1123
+ #
1124
+ # @overload update_fleet_package(request, options = nil)
1125
+ # Pass arguments to `update_fleet_package` via a request object, either of type
1126
+ # {::Google::Cloud::ConfigDelivery::V1::UpdateFleetPackageRequest} or an equivalent Hash.
1127
+ #
1128
+ # @param request [::Google::Cloud::ConfigDelivery::V1::UpdateFleetPackageRequest, ::Hash]
1129
+ # A request object representing the call parameters. Required. To specify no
1130
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1131
+ # @param options [::Gapic::CallOptions, ::Hash]
1132
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1133
+ #
1134
+ # @overload update_fleet_package(update_mask: nil, fleet_package: nil, request_id: nil)
1135
+ # Pass arguments to `update_fleet_package` via keyword arguments. Note that at
1136
+ # least one keyword argument is required. To specify no parameters, or to keep all
1137
+ # the default parameter values, pass an empty Hash as a request object (see above).
1138
+ #
1139
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1140
+ # Required. Field mask is used to specify the fields to be overwritten in the
1141
+ # FleetPackage resource by the update.
1142
+ # The fields specified in the update_mask are relative to the resource, not
1143
+ # the full request. A field will be overwritten if it is in the mask. If the
1144
+ # user does not provide a mask then all fields will be overwritten.
1145
+ # @param fleet_package [::Google::Cloud::ConfigDelivery::V1::FleetPackage, ::Hash]
1146
+ # Required. The resource being updated
1147
+ # @param request_id [::String]
1148
+ # Optional. An optional request ID to identify requests. Specify a unique
1149
+ # request ID so that if you must retry your request, the server will know to
1150
+ # ignore the request if it has already been completed. The server will
1151
+ # guarantee that for at least 60 minutes since the first request.
1152
+ #
1153
+ # For example, consider a situation where you make an initial request and the
1154
+ # request times out. If you make the request again with the same request
1155
+ # ID, the server can check if original operation with the same request ID
1156
+ # was received, and if so, will ignore the second request. This prevents
1157
+ # clients from accidentally creating duplicate commitments.
1158
+ #
1159
+ # The request ID must be a valid UUID with the exception that zero UUID is
1160
+ # not supported (00000000-0000-0000-0000-000000000000).
1161
+ #
1162
+ # @yield [response, operation] Access the result along with the RPC operation
1163
+ # @yieldparam response [::Gapic::Operation]
1164
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1165
+ #
1166
+ # @return [::Gapic::Operation]
1167
+ #
1168
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1169
+ #
1170
+ # @example Basic example
1171
+ # require "google/cloud/config_delivery/v1"
1172
+ #
1173
+ # # Create a client object. The client can be reused for multiple calls.
1174
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1175
+ #
1176
+ # # Create a request. To set request fields, pass in keyword arguments.
1177
+ # request = Google::Cloud::ConfigDelivery::V1::UpdateFleetPackageRequest.new
1178
+ #
1179
+ # # Call the update_fleet_package method.
1180
+ # result = client.update_fleet_package request
1181
+ #
1182
+ # # The returned object is of type Gapic::Operation. You can use it to
1183
+ # # check the status of an operation, cancel it, or wait for results.
1184
+ # # Here is how to wait for a response.
1185
+ # result.wait_until_done! timeout: 60
1186
+ # if result.response?
1187
+ # p result.response
1188
+ # else
1189
+ # puts "No response received."
1190
+ # end
1191
+ #
1192
+ def update_fleet_package request, options = nil
1193
+ raise ::ArgumentError, "request must be provided" if request.nil?
1194
+
1195
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::UpdateFleetPackageRequest
1196
+
1197
+ # Converts hash and nil to an options object
1198
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1199
+
1200
+ # Customize the options with defaults
1201
+ metadata = @config.rpcs.update_fleet_package.metadata.to_h
1202
+
1203
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1204
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1205
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1206
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1207
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1208
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1209
+
1210
+ header_params = {}
1211
+ if request.fleet_package&.name
1212
+ header_params["fleet_package.name"] = request.fleet_package.name
1213
+ end
1214
+
1215
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1216
+ metadata[:"x-goog-request-params"] ||= request_params_header
1217
+
1218
+ options.apply_defaults timeout: @config.rpcs.update_fleet_package.timeout,
1219
+ metadata: metadata,
1220
+ retry_policy: @config.rpcs.update_fleet_package.retry_policy
1221
+
1222
+ options.apply_defaults timeout: @config.timeout,
1223
+ metadata: @config.metadata,
1224
+ retry_policy: @config.retry_policy
1225
+
1226
+ @config_delivery_stub.call_rpc :update_fleet_package, request, options: options do |response, operation|
1227
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1228
+ yield response, operation if block_given?
1229
+ throw :response, response
1230
+ end
1231
+ rescue ::GRPC::BadStatus => e
1232
+ raise ::Google::Cloud::Error.from_error(e)
1233
+ end
1234
+
1235
+ ##
1236
+ # Deletes a single FleetPackage.
1237
+ #
1238
+ # @overload delete_fleet_package(request, options = nil)
1239
+ # Pass arguments to `delete_fleet_package` via a request object, either of type
1240
+ # {::Google::Cloud::ConfigDelivery::V1::DeleteFleetPackageRequest} or an equivalent Hash.
1241
+ #
1242
+ # @param request [::Google::Cloud::ConfigDelivery::V1::DeleteFleetPackageRequest, ::Hash]
1243
+ # A request object representing the call parameters. Required. To specify no
1244
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1245
+ # @param options [::Gapic::CallOptions, ::Hash]
1246
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1247
+ #
1248
+ # @overload delete_fleet_package(name: nil, request_id: nil, force: nil, allow_missing: nil)
1249
+ # Pass arguments to `delete_fleet_package` via keyword arguments. Note that at
1250
+ # least one keyword argument is required. To specify no parameters, or to keep all
1251
+ # the default parameter values, pass an empty Hash as a request object (see above).
1252
+ #
1253
+ # @param name [::String]
1254
+ # Required. Name of the resource
1255
+ # @param request_id [::String]
1256
+ # Optional. An optional request ID to identify requests. Specify a unique
1257
+ # request ID so that if you must retry your request, the server will know to
1258
+ # ignore the request if it has already been completed. The server will
1259
+ # guarantee that for at least 60 minutes after the first request.
1260
+ #
1261
+ # For example, consider a situation where you make an initial request and the
1262
+ # request times out. If you make the request again with the same request
1263
+ # ID, the server can check if original operation with the same request ID
1264
+ # was received, and if so, will ignore the second request. This prevents
1265
+ # clients from accidentally creating duplicate commitments.
1266
+ #
1267
+ # The request ID must be a valid UUID with the exception that zero UUID is
1268
+ # not supported (00000000-0000-0000-0000-000000000000).
1269
+ # @param force [::Boolean]
1270
+ # Optional. If set to true, any rollouts for this FleetPackage will also be
1271
+ # deleted. (Otherwise, the request will only work if the fleet package has no
1272
+ # rollouts.)
1273
+ # @param allow_missing [::Boolean]
1274
+ # Optional. If set to true, then deleting an already deleted or non existing
1275
+ # FleetPackage will succeed.
1276
+ #
1277
+ # @yield [response, operation] Access the result along with the RPC operation
1278
+ # @yieldparam response [::Gapic::Operation]
1279
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1280
+ #
1281
+ # @return [::Gapic::Operation]
1282
+ #
1283
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1284
+ #
1285
+ # @example Basic example
1286
+ # require "google/cloud/config_delivery/v1"
1287
+ #
1288
+ # # Create a client object. The client can be reused for multiple calls.
1289
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1290
+ #
1291
+ # # Create a request. To set request fields, pass in keyword arguments.
1292
+ # request = Google::Cloud::ConfigDelivery::V1::DeleteFleetPackageRequest.new
1293
+ #
1294
+ # # Call the delete_fleet_package method.
1295
+ # result = client.delete_fleet_package request
1296
+ #
1297
+ # # The returned object is of type Gapic::Operation. You can use it to
1298
+ # # check the status of an operation, cancel it, or wait for results.
1299
+ # # Here is how to wait for a response.
1300
+ # result.wait_until_done! timeout: 60
1301
+ # if result.response?
1302
+ # p result.response
1303
+ # else
1304
+ # puts "No response received."
1305
+ # end
1306
+ #
1307
+ def delete_fleet_package request, options = nil
1308
+ raise ::ArgumentError, "request must be provided" if request.nil?
1309
+
1310
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::DeleteFleetPackageRequest
1311
+
1312
+ # Converts hash and nil to an options object
1313
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1314
+
1315
+ # Customize the options with defaults
1316
+ metadata = @config.rpcs.delete_fleet_package.metadata.to_h
1317
+
1318
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1319
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1320
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1321
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1322
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1323
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1324
+
1325
+ header_params = {}
1326
+ if request.name
1327
+ header_params["name"] = request.name
1328
+ end
1329
+
1330
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1331
+ metadata[:"x-goog-request-params"] ||= request_params_header
1332
+
1333
+ options.apply_defaults timeout: @config.rpcs.delete_fleet_package.timeout,
1334
+ metadata: metadata,
1335
+ retry_policy: @config.rpcs.delete_fleet_package.retry_policy
1336
+
1337
+ options.apply_defaults timeout: @config.timeout,
1338
+ metadata: @config.metadata,
1339
+ retry_policy: @config.retry_policy
1340
+
1341
+ @config_delivery_stub.call_rpc :delete_fleet_package, request, options: options do |response, operation|
1342
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1343
+ yield response, operation if block_given?
1344
+ throw :response, response
1345
+ end
1346
+ rescue ::GRPC::BadStatus => e
1347
+ raise ::Google::Cloud::Error.from_error(e)
1348
+ end
1349
+
1350
+ ##
1351
+ # Lists Releases in a given project and location.
1352
+ #
1353
+ # @overload list_releases(request, options = nil)
1354
+ # Pass arguments to `list_releases` via a request object, either of type
1355
+ # {::Google::Cloud::ConfigDelivery::V1::ListReleasesRequest} or an equivalent Hash.
1356
+ #
1357
+ # @param request [::Google::Cloud::ConfigDelivery::V1::ListReleasesRequest, ::Hash]
1358
+ # A request object representing the call parameters. Required. To specify no
1359
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1360
+ # @param options [::Gapic::CallOptions, ::Hash]
1361
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1362
+ #
1363
+ # @overload list_releases(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1364
+ # Pass arguments to `list_releases` via keyword arguments. Note that at
1365
+ # least one keyword argument is required. To specify no parameters, or to keep all
1366
+ # the default parameter values, pass an empty Hash as a request object (see above).
1367
+ #
1368
+ # @param parent [::String]
1369
+ # Required. Parent value for ListReleasesRequest.
1370
+ # @param page_size [::Integer]
1371
+ # Optional. Requested page size. Server may return fewer items than
1372
+ # requested. If unspecified, server will pick an appropriate default.
1373
+ # @param page_token [::String]
1374
+ # Optional. A token identifying a page of results the server should return.
1375
+ # @param filter [::String]
1376
+ # Optional. Filtering results.
1377
+ # @param order_by [::String]
1378
+ # Optional. Hint for how to order the results.
1379
+ #
1380
+ # @yield [response, operation] Access the result along with the RPC operation
1381
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::Release>]
1382
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1383
+ #
1384
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::Release>]
1385
+ #
1386
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1387
+ #
1388
+ # @example Basic example
1389
+ # require "google/cloud/config_delivery/v1"
1390
+ #
1391
+ # # Create a client object. The client can be reused for multiple calls.
1392
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1393
+ #
1394
+ # # Create a request. To set request fields, pass in keyword arguments.
1395
+ # request = Google::Cloud::ConfigDelivery::V1::ListReleasesRequest.new
1396
+ #
1397
+ # # Call the list_releases method.
1398
+ # result = client.list_releases request
1399
+ #
1400
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1401
+ # # over elements, and API calls will be issued to fetch pages as needed.
1402
+ # result.each do |item|
1403
+ # # Each element is of type ::Google::Cloud::ConfigDelivery::V1::Release.
1404
+ # p item
1405
+ # end
1406
+ #
1407
+ def list_releases request, options = nil
1408
+ raise ::ArgumentError, "request must be provided" if request.nil?
1409
+
1410
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::ListReleasesRequest
1411
+
1412
+ # Converts hash and nil to an options object
1413
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1414
+
1415
+ # Customize the options with defaults
1416
+ metadata = @config.rpcs.list_releases.metadata.to_h
1417
+
1418
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1419
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1420
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1421
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1422
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1423
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1424
+
1425
+ header_params = {}
1426
+ if request.parent
1427
+ header_params["parent"] = request.parent
1428
+ end
1429
+
1430
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1431
+ metadata[:"x-goog-request-params"] ||= request_params_header
1432
+
1433
+ options.apply_defaults timeout: @config.rpcs.list_releases.timeout,
1434
+ metadata: metadata,
1435
+ retry_policy: @config.rpcs.list_releases.retry_policy
1436
+
1437
+ options.apply_defaults timeout: @config.timeout,
1438
+ metadata: @config.metadata,
1439
+ retry_policy: @config.retry_policy
1440
+
1441
+ @config_delivery_stub.call_rpc :list_releases, request, options: options do |response, operation|
1442
+ response = ::Gapic::PagedEnumerable.new @config_delivery_stub, :list_releases, request, response, operation, options
1443
+ yield response, operation if block_given?
1444
+ throw :response, response
1445
+ end
1446
+ rescue ::GRPC::BadStatus => e
1447
+ raise ::Google::Cloud::Error.from_error(e)
1448
+ end
1449
+
1450
+ ##
1451
+ # Gets details of a single Release.
1452
+ #
1453
+ # @overload get_release(request, options = nil)
1454
+ # Pass arguments to `get_release` via a request object, either of type
1455
+ # {::Google::Cloud::ConfigDelivery::V1::GetReleaseRequest} or an equivalent Hash.
1456
+ #
1457
+ # @param request [::Google::Cloud::ConfigDelivery::V1::GetReleaseRequest, ::Hash]
1458
+ # A request object representing the call parameters. Required. To specify no
1459
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1460
+ # @param options [::Gapic::CallOptions, ::Hash]
1461
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1462
+ #
1463
+ # @overload get_release(name: nil)
1464
+ # Pass arguments to `get_release` via keyword arguments. Note that at
1465
+ # least one keyword argument is required. To specify no parameters, or to keep all
1466
+ # the default parameter values, pass an empty Hash as a request object (see above).
1467
+ #
1468
+ # @param name [::String]
1469
+ # Required. Name of the resource
1470
+ #
1471
+ # @yield [response, operation] Access the result along with the RPC operation
1472
+ # @yieldparam response [::Google::Cloud::ConfigDelivery::V1::Release]
1473
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1474
+ #
1475
+ # @return [::Google::Cloud::ConfigDelivery::V1::Release]
1476
+ #
1477
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1478
+ #
1479
+ # @example Basic example
1480
+ # require "google/cloud/config_delivery/v1"
1481
+ #
1482
+ # # Create a client object. The client can be reused for multiple calls.
1483
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1484
+ #
1485
+ # # Create a request. To set request fields, pass in keyword arguments.
1486
+ # request = Google::Cloud::ConfigDelivery::V1::GetReleaseRequest.new
1487
+ #
1488
+ # # Call the get_release method.
1489
+ # result = client.get_release request
1490
+ #
1491
+ # # The returned object is of type Google::Cloud::ConfigDelivery::V1::Release.
1492
+ # p result
1493
+ #
1494
+ def get_release request, options = nil
1495
+ raise ::ArgumentError, "request must be provided" if request.nil?
1496
+
1497
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::GetReleaseRequest
1498
+
1499
+ # Converts hash and nil to an options object
1500
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1501
+
1502
+ # Customize the options with defaults
1503
+ metadata = @config.rpcs.get_release.metadata.to_h
1504
+
1505
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1506
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1507
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1508
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1509
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1510
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1511
+
1512
+ header_params = {}
1513
+ if request.name
1514
+ header_params["name"] = request.name
1515
+ end
1516
+
1517
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1518
+ metadata[:"x-goog-request-params"] ||= request_params_header
1519
+
1520
+ options.apply_defaults timeout: @config.rpcs.get_release.timeout,
1521
+ metadata: metadata,
1522
+ retry_policy: @config.rpcs.get_release.retry_policy
1523
+
1524
+ options.apply_defaults timeout: @config.timeout,
1525
+ metadata: @config.metadata,
1526
+ retry_policy: @config.retry_policy
1527
+
1528
+ @config_delivery_stub.call_rpc :get_release, request, options: options do |response, operation|
1529
+ yield response, operation if block_given?
1530
+ end
1531
+ rescue ::GRPC::BadStatus => e
1532
+ raise ::Google::Cloud::Error.from_error(e)
1533
+ end
1534
+
1535
+ ##
1536
+ # Creates a new Release in a given project, location and resource bundle.
1537
+ #
1538
+ # @overload create_release(request, options = nil)
1539
+ # Pass arguments to `create_release` via a request object, either of type
1540
+ # {::Google::Cloud::ConfigDelivery::V1::CreateReleaseRequest} or an equivalent Hash.
1541
+ #
1542
+ # @param request [::Google::Cloud::ConfigDelivery::V1::CreateReleaseRequest, ::Hash]
1543
+ # A request object representing the call parameters. Required. To specify no
1544
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1545
+ # @param options [::Gapic::CallOptions, ::Hash]
1546
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1547
+ #
1548
+ # @overload create_release(parent: nil, release_id: nil, release: nil, request_id: nil)
1549
+ # Pass arguments to `create_release` via keyword arguments. Note that at
1550
+ # least one keyword argument is required. To specify no parameters, or to keep all
1551
+ # the default parameter values, pass an empty Hash as a request object (see above).
1552
+ #
1553
+ # @param parent [::String]
1554
+ # Required. Value for parent.
1555
+ # @param release_id [::String]
1556
+ # Required. Id of the requesting object
1557
+ # If auto-generating Id server-side, remove this field and
1558
+ # release_id from the method_signature of Create RPC
1559
+ # @param release [::Google::Cloud::ConfigDelivery::V1::Release, ::Hash]
1560
+ # Required. The resource being created
1561
+ # @param request_id [::String]
1562
+ # Optional. An optional request ID to identify requests. Specify a unique
1563
+ # request ID so that if you must retry your request, the server will know to
1564
+ # ignore the request if it has already been completed. The server will
1565
+ # guarantee that for at least 60 minutes since the first request.
1566
+ #
1567
+ # For example, consider a situation where you make an initial request and the
1568
+ # request times out. If you make the request again with the same request
1569
+ # ID, the server can check if original operation with the same request ID
1570
+ # was received, and if so, will ignore the second request. This prevents
1571
+ # clients from accidentally creating duplicate commitments.
1572
+ #
1573
+ # The request ID must be a valid UUID with the exception that zero UUID is
1574
+ # not supported (00000000-0000-0000-0000-000000000000).
1575
+ #
1576
+ # @yield [response, operation] Access the result along with the RPC operation
1577
+ # @yieldparam response [::Gapic::Operation]
1578
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1579
+ #
1580
+ # @return [::Gapic::Operation]
1581
+ #
1582
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1583
+ #
1584
+ # @example Basic example
1585
+ # require "google/cloud/config_delivery/v1"
1586
+ #
1587
+ # # Create a client object. The client can be reused for multiple calls.
1588
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1589
+ #
1590
+ # # Create a request. To set request fields, pass in keyword arguments.
1591
+ # request = Google::Cloud::ConfigDelivery::V1::CreateReleaseRequest.new
1592
+ #
1593
+ # # Call the create_release method.
1594
+ # result = client.create_release request
1595
+ #
1596
+ # # The returned object is of type Gapic::Operation. You can use it to
1597
+ # # check the status of an operation, cancel it, or wait for results.
1598
+ # # Here is how to wait for a response.
1599
+ # result.wait_until_done! timeout: 60
1600
+ # if result.response?
1601
+ # p result.response
1602
+ # else
1603
+ # puts "No response received."
1604
+ # end
1605
+ #
1606
+ def create_release request, options = nil
1607
+ raise ::ArgumentError, "request must be provided" if request.nil?
1608
+
1609
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::CreateReleaseRequest
1610
+
1611
+ # Converts hash and nil to an options object
1612
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1613
+
1614
+ # Customize the options with defaults
1615
+ metadata = @config.rpcs.create_release.metadata.to_h
1616
+
1617
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1618
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1619
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1620
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1621
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1622
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1623
+
1624
+ header_params = {}
1625
+ if request.parent
1626
+ header_params["parent"] = request.parent
1627
+ end
1628
+
1629
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1630
+ metadata[:"x-goog-request-params"] ||= request_params_header
1631
+
1632
+ options.apply_defaults timeout: @config.rpcs.create_release.timeout,
1633
+ metadata: metadata,
1634
+ retry_policy: @config.rpcs.create_release.retry_policy
1635
+
1636
+ options.apply_defaults timeout: @config.timeout,
1637
+ metadata: @config.metadata,
1638
+ retry_policy: @config.retry_policy
1639
+
1640
+ @config_delivery_stub.call_rpc :create_release, request, options: options do |response, operation|
1641
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1642
+ yield response, operation if block_given?
1643
+ throw :response, response
1644
+ end
1645
+ rescue ::GRPC::BadStatus => e
1646
+ raise ::Google::Cloud::Error.from_error(e)
1647
+ end
1648
+
1649
+ ##
1650
+ # Updates the parameters of a single Release.
1651
+ #
1652
+ # @overload update_release(request, options = nil)
1653
+ # Pass arguments to `update_release` via a request object, either of type
1654
+ # {::Google::Cloud::ConfigDelivery::V1::UpdateReleaseRequest} or an equivalent Hash.
1655
+ #
1656
+ # @param request [::Google::Cloud::ConfigDelivery::V1::UpdateReleaseRequest, ::Hash]
1657
+ # A request object representing the call parameters. Required. To specify no
1658
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1659
+ # @param options [::Gapic::CallOptions, ::Hash]
1660
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1661
+ #
1662
+ # @overload update_release(update_mask: nil, release: nil, request_id: nil)
1663
+ # Pass arguments to `update_release` via keyword arguments. Note that at
1664
+ # least one keyword argument is required. To specify no parameters, or to keep all
1665
+ # the default parameter values, pass an empty Hash as a request object (see above).
1666
+ #
1667
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1668
+ # Required. Field mask is used to specify the fields to be overwritten in the
1669
+ # Release resource by the update.
1670
+ # The fields specified in the update_mask are relative to the resource, not
1671
+ # the full request. A field will be overwritten if it is in the mask. If the
1672
+ # user does not provide a mask then all fields will be overwritten.
1673
+ # @param release [::Google::Cloud::ConfigDelivery::V1::Release, ::Hash]
1674
+ # Required. The resource being updated
1675
+ # @param request_id [::String]
1676
+ # Optional. An optional request ID to identify requests. Specify a unique
1677
+ # request ID so that if you must retry your request, the server will know to
1678
+ # ignore the request if it has already been completed. The server will
1679
+ # guarantee that for at least 60 minutes since the first request.
1680
+ #
1681
+ # For example, consider a situation where you make an initial request and the
1682
+ # request times out. If you make the request again with the same request
1683
+ # ID, the server can check if original operation with the same request ID
1684
+ # was received, and if so, will ignore the second request. This prevents
1685
+ # clients from accidentally creating duplicate commitments.
1686
+ #
1687
+ # The request ID must be a valid UUID with the exception that zero UUID is
1688
+ # not supported (00000000-0000-0000-0000-000000000000).
1689
+ #
1690
+ # @yield [response, operation] Access the result along with the RPC operation
1691
+ # @yieldparam response [::Gapic::Operation]
1692
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1693
+ #
1694
+ # @return [::Gapic::Operation]
1695
+ #
1696
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1697
+ #
1698
+ # @example Basic example
1699
+ # require "google/cloud/config_delivery/v1"
1700
+ #
1701
+ # # Create a client object. The client can be reused for multiple calls.
1702
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1703
+ #
1704
+ # # Create a request. To set request fields, pass in keyword arguments.
1705
+ # request = Google::Cloud::ConfigDelivery::V1::UpdateReleaseRequest.new
1706
+ #
1707
+ # # Call the update_release method.
1708
+ # result = client.update_release request
1709
+ #
1710
+ # # The returned object is of type Gapic::Operation. You can use it to
1711
+ # # check the status of an operation, cancel it, or wait for results.
1712
+ # # Here is how to wait for a response.
1713
+ # result.wait_until_done! timeout: 60
1714
+ # if result.response?
1715
+ # p result.response
1716
+ # else
1717
+ # puts "No response received."
1718
+ # end
1719
+ #
1720
+ def update_release request, options = nil
1721
+ raise ::ArgumentError, "request must be provided" if request.nil?
1722
+
1723
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::UpdateReleaseRequest
1724
+
1725
+ # Converts hash and nil to an options object
1726
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1727
+
1728
+ # Customize the options with defaults
1729
+ metadata = @config.rpcs.update_release.metadata.to_h
1730
+
1731
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1732
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1733
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1734
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1735
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1736
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1737
+
1738
+ header_params = {}
1739
+ if request.release&.name
1740
+ header_params["release.name"] = request.release.name
1741
+ end
1742
+
1743
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1744
+ metadata[:"x-goog-request-params"] ||= request_params_header
1745
+
1746
+ options.apply_defaults timeout: @config.rpcs.update_release.timeout,
1747
+ metadata: metadata,
1748
+ retry_policy: @config.rpcs.update_release.retry_policy
1749
+
1750
+ options.apply_defaults timeout: @config.timeout,
1751
+ metadata: @config.metadata,
1752
+ retry_policy: @config.retry_policy
1753
+
1754
+ @config_delivery_stub.call_rpc :update_release, request, options: options do |response, operation|
1755
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1756
+ yield response, operation if block_given?
1757
+ throw :response, response
1758
+ end
1759
+ rescue ::GRPC::BadStatus => e
1760
+ raise ::Google::Cloud::Error.from_error(e)
1761
+ end
1762
+
1763
+ ##
1764
+ # Deletes a single Release.
1765
+ #
1766
+ # @overload delete_release(request, options = nil)
1767
+ # Pass arguments to `delete_release` via a request object, either of type
1768
+ # {::Google::Cloud::ConfigDelivery::V1::DeleteReleaseRequest} or an equivalent Hash.
1769
+ #
1770
+ # @param request [::Google::Cloud::ConfigDelivery::V1::DeleteReleaseRequest, ::Hash]
1771
+ # A request object representing the call parameters. Required. To specify no
1772
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1773
+ # @param options [::Gapic::CallOptions, ::Hash]
1774
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1775
+ #
1776
+ # @overload delete_release(name: nil, request_id: nil, force: nil)
1777
+ # Pass arguments to `delete_release` via keyword arguments. Note that at
1778
+ # least one keyword argument is required. To specify no parameters, or to keep all
1779
+ # the default parameter values, pass an empty Hash as a request object (see above).
1780
+ #
1781
+ # @param name [::String]
1782
+ # Required. Name of the resource
1783
+ # @param request_id [::String]
1784
+ # Optional. An optional request ID to identify requests. Specify a unique
1785
+ # request ID so that if you must retry your request, the server will know to
1786
+ # ignore the request if it has already been completed. The server will
1787
+ # guarantee that for at least 60 minutes after the first request.
1788
+ #
1789
+ # For example, consider a situation where you make an initial request and the
1790
+ # request times out. If you make the request again with the same request
1791
+ # ID, the server can check if original operation with the same request ID
1792
+ # was received, and if so, will ignore the second request. This prevents
1793
+ # clients from accidentally creating duplicate commitments.
1794
+ #
1795
+ # The request ID must be a valid UUID with the exception that zero UUID is
1796
+ # not supported (00000000-0000-0000-0000-000000000000).
1797
+ # @param force [::Boolean]
1798
+ # Optional. If set to true, any variants of this release will also be
1799
+ # deleted. (Otherwise, the request will only work if the release has no
1800
+ # variants.)
1801
+ #
1802
+ # @yield [response, operation] Access the result along with the RPC operation
1803
+ # @yieldparam response [::Gapic::Operation]
1804
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1805
+ #
1806
+ # @return [::Gapic::Operation]
1807
+ #
1808
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1809
+ #
1810
+ # @example Basic example
1811
+ # require "google/cloud/config_delivery/v1"
1812
+ #
1813
+ # # Create a client object. The client can be reused for multiple calls.
1814
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1815
+ #
1816
+ # # Create a request. To set request fields, pass in keyword arguments.
1817
+ # request = Google::Cloud::ConfigDelivery::V1::DeleteReleaseRequest.new
1818
+ #
1819
+ # # Call the delete_release method.
1820
+ # result = client.delete_release request
1821
+ #
1822
+ # # The returned object is of type Gapic::Operation. You can use it to
1823
+ # # check the status of an operation, cancel it, or wait for results.
1824
+ # # Here is how to wait for a response.
1825
+ # result.wait_until_done! timeout: 60
1826
+ # if result.response?
1827
+ # p result.response
1828
+ # else
1829
+ # puts "No response received."
1830
+ # end
1831
+ #
1832
+ def delete_release request, options = nil
1833
+ raise ::ArgumentError, "request must be provided" if request.nil?
1834
+
1835
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::DeleteReleaseRequest
1836
+
1837
+ # Converts hash and nil to an options object
1838
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1839
+
1840
+ # Customize the options with defaults
1841
+ metadata = @config.rpcs.delete_release.metadata.to_h
1842
+
1843
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1844
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1845
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1846
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1847
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1848
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1849
+
1850
+ header_params = {}
1851
+ if request.name
1852
+ header_params["name"] = request.name
1853
+ end
1854
+
1855
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1856
+ metadata[:"x-goog-request-params"] ||= request_params_header
1857
+
1858
+ options.apply_defaults timeout: @config.rpcs.delete_release.timeout,
1859
+ metadata: metadata,
1860
+ retry_policy: @config.rpcs.delete_release.retry_policy
1861
+
1862
+ options.apply_defaults timeout: @config.timeout,
1863
+ metadata: @config.metadata,
1864
+ retry_policy: @config.retry_policy
1865
+
1866
+ @config_delivery_stub.call_rpc :delete_release, request, options: options do |response, operation|
1867
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1868
+ yield response, operation if block_given?
1869
+ throw :response, response
1870
+ end
1871
+ rescue ::GRPC::BadStatus => e
1872
+ raise ::Google::Cloud::Error.from_error(e)
1873
+ end
1874
+
1875
+ ##
1876
+ # Lists Variants in a given project and location.
1877
+ #
1878
+ # @overload list_variants(request, options = nil)
1879
+ # Pass arguments to `list_variants` via a request object, either of type
1880
+ # {::Google::Cloud::ConfigDelivery::V1::ListVariantsRequest} or an equivalent Hash.
1881
+ #
1882
+ # @param request [::Google::Cloud::ConfigDelivery::V1::ListVariantsRequest, ::Hash]
1883
+ # A request object representing the call parameters. Required. To specify no
1884
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1885
+ # @param options [::Gapic::CallOptions, ::Hash]
1886
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1887
+ #
1888
+ # @overload list_variants(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1889
+ # Pass arguments to `list_variants` via keyword arguments. Note that at
1890
+ # least one keyword argument is required. To specify no parameters, or to keep all
1891
+ # the default parameter values, pass an empty Hash as a request object (see above).
1892
+ #
1893
+ # @param parent [::String]
1894
+ # Required. Parent value for ListVariantsRequest.
1895
+ # @param page_size [::Integer]
1896
+ # Optional. Requested page size. Server may return fewer items than
1897
+ # requested. If unspecified, server will pick an appropriate default.
1898
+ # @param page_token [::String]
1899
+ # Optional. A token identifying a page of results the server should return.
1900
+ # @param filter [::String]
1901
+ # Optional. Filtering results.
1902
+ # @param order_by [::String]
1903
+ # Optional. Hint for how to order the results.
1904
+ #
1905
+ # @yield [response, operation] Access the result along with the RPC operation
1906
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::Variant>]
1907
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1908
+ #
1909
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::Variant>]
1910
+ #
1911
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1912
+ #
1913
+ # @example Basic example
1914
+ # require "google/cloud/config_delivery/v1"
1915
+ #
1916
+ # # Create a client object. The client can be reused for multiple calls.
1917
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
1918
+ #
1919
+ # # Create a request. To set request fields, pass in keyword arguments.
1920
+ # request = Google::Cloud::ConfigDelivery::V1::ListVariantsRequest.new
1921
+ #
1922
+ # # Call the list_variants method.
1923
+ # result = client.list_variants request
1924
+ #
1925
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1926
+ # # over elements, and API calls will be issued to fetch pages as needed.
1927
+ # result.each do |item|
1928
+ # # Each element is of type ::Google::Cloud::ConfigDelivery::V1::Variant.
1929
+ # p item
1930
+ # end
1931
+ #
1932
+ def list_variants request, options = nil
1933
+ raise ::ArgumentError, "request must be provided" if request.nil?
1934
+
1935
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::ListVariantsRequest
1936
+
1937
+ # Converts hash and nil to an options object
1938
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1939
+
1940
+ # Customize the options with defaults
1941
+ metadata = @config.rpcs.list_variants.metadata.to_h
1942
+
1943
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1944
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1945
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1946
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
1947
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1948
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1949
+
1950
+ header_params = {}
1951
+ if request.parent
1952
+ header_params["parent"] = request.parent
1953
+ end
1954
+
1955
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1956
+ metadata[:"x-goog-request-params"] ||= request_params_header
1957
+
1958
+ options.apply_defaults timeout: @config.rpcs.list_variants.timeout,
1959
+ metadata: metadata,
1960
+ retry_policy: @config.rpcs.list_variants.retry_policy
1961
+
1962
+ options.apply_defaults timeout: @config.timeout,
1963
+ metadata: @config.metadata,
1964
+ retry_policy: @config.retry_policy
1965
+
1966
+ @config_delivery_stub.call_rpc :list_variants, request, options: options do |response, operation|
1967
+ response = ::Gapic::PagedEnumerable.new @config_delivery_stub, :list_variants, request, response, operation, options
1968
+ yield response, operation if block_given?
1969
+ throw :response, response
1970
+ end
1971
+ rescue ::GRPC::BadStatus => e
1972
+ raise ::Google::Cloud::Error.from_error(e)
1973
+ end
1974
+
1975
+ ##
1976
+ # Gets details of a single Variant.
1977
+ #
1978
+ # @overload get_variant(request, options = nil)
1979
+ # Pass arguments to `get_variant` via a request object, either of type
1980
+ # {::Google::Cloud::ConfigDelivery::V1::GetVariantRequest} or an equivalent Hash.
1981
+ #
1982
+ # @param request [::Google::Cloud::ConfigDelivery::V1::GetVariantRequest, ::Hash]
1983
+ # A request object representing the call parameters. Required. To specify no
1984
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1985
+ # @param options [::Gapic::CallOptions, ::Hash]
1986
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1987
+ #
1988
+ # @overload get_variant(name: nil)
1989
+ # Pass arguments to `get_variant` via keyword arguments. Note that at
1990
+ # least one keyword argument is required. To specify no parameters, or to keep all
1991
+ # the default parameter values, pass an empty Hash as a request object (see above).
1992
+ #
1993
+ # @param name [::String]
1994
+ # Required. Name of the resource
1995
+ #
1996
+ # @yield [response, operation] Access the result along with the RPC operation
1997
+ # @yieldparam response [::Google::Cloud::ConfigDelivery::V1::Variant]
1998
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1999
+ #
2000
+ # @return [::Google::Cloud::ConfigDelivery::V1::Variant]
2001
+ #
2002
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2003
+ #
2004
+ # @example Basic example
2005
+ # require "google/cloud/config_delivery/v1"
2006
+ #
2007
+ # # Create a client object. The client can be reused for multiple calls.
2008
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2009
+ #
2010
+ # # Create a request. To set request fields, pass in keyword arguments.
2011
+ # request = Google::Cloud::ConfigDelivery::V1::GetVariantRequest.new
2012
+ #
2013
+ # # Call the get_variant method.
2014
+ # result = client.get_variant request
2015
+ #
2016
+ # # The returned object is of type Google::Cloud::ConfigDelivery::V1::Variant.
2017
+ # p result
2018
+ #
2019
+ def get_variant request, options = nil
2020
+ raise ::ArgumentError, "request must be provided" if request.nil?
2021
+
2022
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::GetVariantRequest
2023
+
2024
+ # Converts hash and nil to an options object
2025
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2026
+
2027
+ # Customize the options with defaults
2028
+ metadata = @config.rpcs.get_variant.metadata.to_h
2029
+
2030
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2031
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2032
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2033
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2034
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2035
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2036
+
2037
+ header_params = {}
2038
+ if request.name
2039
+ header_params["name"] = request.name
2040
+ end
2041
+
2042
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2043
+ metadata[:"x-goog-request-params"] ||= request_params_header
2044
+
2045
+ options.apply_defaults timeout: @config.rpcs.get_variant.timeout,
2046
+ metadata: metadata,
2047
+ retry_policy: @config.rpcs.get_variant.retry_policy
2048
+
2049
+ options.apply_defaults timeout: @config.timeout,
2050
+ metadata: @config.metadata,
2051
+ retry_policy: @config.retry_policy
2052
+
2053
+ @config_delivery_stub.call_rpc :get_variant, request, options: options do |response, operation|
2054
+ yield response, operation if block_given?
2055
+ end
2056
+ rescue ::GRPC::BadStatus => e
2057
+ raise ::Google::Cloud::Error.from_error(e)
2058
+ end
2059
+
2060
+ ##
2061
+ # Creates a new Variant in a given project, location, resource bundle, and
2062
+ # release.
2063
+ #
2064
+ # @overload create_variant(request, options = nil)
2065
+ # Pass arguments to `create_variant` via a request object, either of type
2066
+ # {::Google::Cloud::ConfigDelivery::V1::CreateVariantRequest} or an equivalent Hash.
2067
+ #
2068
+ # @param request [::Google::Cloud::ConfigDelivery::V1::CreateVariantRequest, ::Hash]
2069
+ # A request object representing the call parameters. Required. To specify no
2070
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2071
+ # @param options [::Gapic::CallOptions, ::Hash]
2072
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2073
+ #
2074
+ # @overload create_variant(parent: nil, variant_id: nil, variant: nil, request_id: nil)
2075
+ # Pass arguments to `create_variant` via keyword arguments. Note that at
2076
+ # least one keyword argument is required. To specify no parameters, or to keep all
2077
+ # the default parameter values, pass an empty Hash as a request object (see above).
2078
+ #
2079
+ # @param parent [::String]
2080
+ # Required. Value for parent.
2081
+ # @param variant_id [::String]
2082
+ # Required. Id of the requesting object
2083
+ # @param variant [::Google::Cloud::ConfigDelivery::V1::Variant, ::Hash]
2084
+ # Required. The resource being created
2085
+ # @param request_id [::String]
2086
+ # Optional. An optional request ID to identify requests. Specify a unique
2087
+ # request ID so that if you must retry your request, the server will know to
2088
+ # ignore the request if it has already been completed. The server will
2089
+ # guarantee that for at least 60 minutes since the first request.
2090
+ #
2091
+ # For example, consider a situation where you make an initial request and the
2092
+ # request times out. If you make the request again with the same request
2093
+ # ID, the server can check if original operation with the same request ID
2094
+ # was received, and if so, will ignore the second request. This prevents
2095
+ # clients from accidentally creating duplicate commitments.
2096
+ #
2097
+ # The request ID must be a valid UUID with the exception that zero UUID is
2098
+ # not supported (00000000-0000-0000-0000-000000000000).
2099
+ #
2100
+ # @yield [response, operation] Access the result along with the RPC operation
2101
+ # @yieldparam response [::Gapic::Operation]
2102
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2103
+ #
2104
+ # @return [::Gapic::Operation]
2105
+ #
2106
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2107
+ #
2108
+ # @example Basic example
2109
+ # require "google/cloud/config_delivery/v1"
2110
+ #
2111
+ # # Create a client object. The client can be reused for multiple calls.
2112
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2113
+ #
2114
+ # # Create a request. To set request fields, pass in keyword arguments.
2115
+ # request = Google::Cloud::ConfigDelivery::V1::CreateVariantRequest.new
2116
+ #
2117
+ # # Call the create_variant method.
2118
+ # result = client.create_variant request
2119
+ #
2120
+ # # The returned object is of type Gapic::Operation. You can use it to
2121
+ # # check the status of an operation, cancel it, or wait for results.
2122
+ # # Here is how to wait for a response.
2123
+ # result.wait_until_done! timeout: 60
2124
+ # if result.response?
2125
+ # p result.response
2126
+ # else
2127
+ # puts "No response received."
2128
+ # end
2129
+ #
2130
+ def create_variant request, options = nil
2131
+ raise ::ArgumentError, "request must be provided" if request.nil?
2132
+
2133
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::CreateVariantRequest
2134
+
2135
+ # Converts hash and nil to an options object
2136
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2137
+
2138
+ # Customize the options with defaults
2139
+ metadata = @config.rpcs.create_variant.metadata.to_h
2140
+
2141
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2142
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2143
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2144
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2145
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2146
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2147
+
2148
+ header_params = {}
2149
+ if request.parent
2150
+ header_params["parent"] = request.parent
2151
+ end
2152
+
2153
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2154
+ metadata[:"x-goog-request-params"] ||= request_params_header
2155
+
2156
+ options.apply_defaults timeout: @config.rpcs.create_variant.timeout,
2157
+ metadata: metadata,
2158
+ retry_policy: @config.rpcs.create_variant.retry_policy
2159
+
2160
+ options.apply_defaults timeout: @config.timeout,
2161
+ metadata: @config.metadata,
2162
+ retry_policy: @config.retry_policy
2163
+
2164
+ @config_delivery_stub.call_rpc :create_variant, request, options: options do |response, operation|
2165
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2166
+ yield response, operation if block_given?
2167
+ throw :response, response
2168
+ end
2169
+ rescue ::GRPC::BadStatus => e
2170
+ raise ::Google::Cloud::Error.from_error(e)
2171
+ end
2172
+
2173
+ ##
2174
+ # Updates the parameters of a single Variant.
2175
+ #
2176
+ # @overload update_variant(request, options = nil)
2177
+ # Pass arguments to `update_variant` via a request object, either of type
2178
+ # {::Google::Cloud::ConfigDelivery::V1::UpdateVariantRequest} or an equivalent Hash.
2179
+ #
2180
+ # @param request [::Google::Cloud::ConfigDelivery::V1::UpdateVariantRequest, ::Hash]
2181
+ # A request object representing the call parameters. Required. To specify no
2182
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2183
+ # @param options [::Gapic::CallOptions, ::Hash]
2184
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2185
+ #
2186
+ # @overload update_variant(update_mask: nil, variant: nil, request_id: nil)
2187
+ # Pass arguments to `update_variant` via keyword arguments. Note that at
2188
+ # least one keyword argument is required. To specify no parameters, or to keep all
2189
+ # the default parameter values, pass an empty Hash as a request object (see above).
2190
+ #
2191
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2192
+ # Optional. Field mask is used to specify the fields to be overwritten in the
2193
+ # Variant resource by the update.
2194
+ # The fields specified in the update_mask are relative to the resource, not
2195
+ # the full request. A field will be overwritten if it is in the mask. If the
2196
+ # user does not provide a mask then all fields will be overwritten.
2197
+ # @param variant [::Google::Cloud::ConfigDelivery::V1::Variant, ::Hash]
2198
+ # Required. The resource being updated
2199
+ # @param request_id [::String]
2200
+ # Optional. An optional request ID to identify requests. Specify a unique
2201
+ # request ID so that if you must retry your request, the server will know to
2202
+ # ignore the request if it has already been completed. The server will
2203
+ # guarantee that for at least 60 minutes since the first request.
2204
+ #
2205
+ # For example, consider a situation where you make an initial request and the
2206
+ # request times out. If you make the request again with the same request
2207
+ # ID, the server can check if original operation with the same request ID
2208
+ # was received, and if so, will ignore the second request. This prevents
2209
+ # clients from accidentally creating duplicate commitments.
2210
+ #
2211
+ # The request ID must be a valid UUID with the exception that zero UUID is
2212
+ # not supported (00000000-0000-0000-0000-000000000000).
2213
+ #
2214
+ # @yield [response, operation] Access the result along with the RPC operation
2215
+ # @yieldparam response [::Gapic::Operation]
2216
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2217
+ #
2218
+ # @return [::Gapic::Operation]
2219
+ #
2220
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2221
+ #
2222
+ # @example Basic example
2223
+ # require "google/cloud/config_delivery/v1"
2224
+ #
2225
+ # # Create a client object. The client can be reused for multiple calls.
2226
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2227
+ #
2228
+ # # Create a request. To set request fields, pass in keyword arguments.
2229
+ # request = Google::Cloud::ConfigDelivery::V1::UpdateVariantRequest.new
2230
+ #
2231
+ # # Call the update_variant method.
2232
+ # result = client.update_variant request
2233
+ #
2234
+ # # The returned object is of type Gapic::Operation. You can use it to
2235
+ # # check the status of an operation, cancel it, or wait for results.
2236
+ # # Here is how to wait for a response.
2237
+ # result.wait_until_done! timeout: 60
2238
+ # if result.response?
2239
+ # p result.response
2240
+ # else
2241
+ # puts "No response received."
2242
+ # end
2243
+ #
2244
+ def update_variant request, options = nil
2245
+ raise ::ArgumentError, "request must be provided" if request.nil?
2246
+
2247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::UpdateVariantRequest
2248
+
2249
+ # Converts hash and nil to an options object
2250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2251
+
2252
+ # Customize the options with defaults
2253
+ metadata = @config.rpcs.update_variant.metadata.to_h
2254
+
2255
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2256
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2258
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2259
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2260
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2261
+
2262
+ header_params = {}
2263
+ if request.variant&.name
2264
+ header_params["variant.name"] = request.variant.name
2265
+ end
2266
+
2267
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2268
+ metadata[:"x-goog-request-params"] ||= request_params_header
2269
+
2270
+ options.apply_defaults timeout: @config.rpcs.update_variant.timeout,
2271
+ metadata: metadata,
2272
+ retry_policy: @config.rpcs.update_variant.retry_policy
2273
+
2274
+ options.apply_defaults timeout: @config.timeout,
2275
+ metadata: @config.metadata,
2276
+ retry_policy: @config.retry_policy
2277
+
2278
+ @config_delivery_stub.call_rpc :update_variant, request, options: options do |response, operation|
2279
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2280
+ yield response, operation if block_given?
2281
+ throw :response, response
2282
+ end
2283
+ rescue ::GRPC::BadStatus => e
2284
+ raise ::Google::Cloud::Error.from_error(e)
2285
+ end
2286
+
2287
+ ##
2288
+ # Deletes a single Variant.
2289
+ #
2290
+ # @overload delete_variant(request, options = nil)
2291
+ # Pass arguments to `delete_variant` via a request object, either of type
2292
+ # {::Google::Cloud::ConfigDelivery::V1::DeleteVariantRequest} or an equivalent Hash.
2293
+ #
2294
+ # @param request [::Google::Cloud::ConfigDelivery::V1::DeleteVariantRequest, ::Hash]
2295
+ # A request object representing the call parameters. Required. To specify no
2296
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2297
+ # @param options [::Gapic::CallOptions, ::Hash]
2298
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2299
+ #
2300
+ # @overload delete_variant(name: nil, request_id: nil)
2301
+ # Pass arguments to `delete_variant` via keyword arguments. Note that at
2302
+ # least one keyword argument is required. To specify no parameters, or to keep all
2303
+ # the default parameter values, pass an empty Hash as a request object (see above).
2304
+ #
2305
+ # @param name [::String]
2306
+ # Required. Name of the resource
2307
+ # @param request_id [::String]
2308
+ # Optional. An optional request ID to identify requests. Specify a unique
2309
+ # request ID so that if you must retry your request, the server will know to
2310
+ # ignore the request if it has already been completed. The server will
2311
+ # guarantee that for at least 60 minutes after the first request.
2312
+ #
2313
+ # For example, consider a situation where you make an initial request and the
2314
+ # request times out. If you make the request again with the same request
2315
+ # ID, the server can check if original operation with the same request ID
2316
+ # was received, and if so, will ignore the second request. This prevents
2317
+ # clients from accidentally creating duplicate commitments.
2318
+ #
2319
+ # The request ID must be a valid UUID with the exception that zero UUID is
2320
+ # not supported (00000000-0000-0000-0000-000000000000).
2321
+ #
2322
+ # @yield [response, operation] Access the result along with the RPC operation
2323
+ # @yieldparam response [::Gapic::Operation]
2324
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2325
+ #
2326
+ # @return [::Gapic::Operation]
2327
+ #
2328
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2329
+ #
2330
+ # @example Basic example
2331
+ # require "google/cloud/config_delivery/v1"
2332
+ #
2333
+ # # Create a client object. The client can be reused for multiple calls.
2334
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2335
+ #
2336
+ # # Create a request. To set request fields, pass in keyword arguments.
2337
+ # request = Google::Cloud::ConfigDelivery::V1::DeleteVariantRequest.new
2338
+ #
2339
+ # # Call the delete_variant method.
2340
+ # result = client.delete_variant request
2341
+ #
2342
+ # # The returned object is of type Gapic::Operation. You can use it to
2343
+ # # check the status of an operation, cancel it, or wait for results.
2344
+ # # Here is how to wait for a response.
2345
+ # result.wait_until_done! timeout: 60
2346
+ # if result.response?
2347
+ # p result.response
2348
+ # else
2349
+ # puts "No response received."
2350
+ # end
2351
+ #
2352
+ def delete_variant request, options = nil
2353
+ raise ::ArgumentError, "request must be provided" if request.nil?
2354
+
2355
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::DeleteVariantRequest
2356
+
2357
+ # Converts hash and nil to an options object
2358
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2359
+
2360
+ # Customize the options with defaults
2361
+ metadata = @config.rpcs.delete_variant.metadata.to_h
2362
+
2363
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2364
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2365
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2366
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2367
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2368
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2369
+
2370
+ header_params = {}
2371
+ if request.name
2372
+ header_params["name"] = request.name
2373
+ end
2374
+
2375
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2376
+ metadata[:"x-goog-request-params"] ||= request_params_header
2377
+
2378
+ options.apply_defaults timeout: @config.rpcs.delete_variant.timeout,
2379
+ metadata: metadata,
2380
+ retry_policy: @config.rpcs.delete_variant.retry_policy
2381
+
2382
+ options.apply_defaults timeout: @config.timeout,
2383
+ metadata: @config.metadata,
2384
+ retry_policy: @config.retry_policy
2385
+
2386
+ @config_delivery_stub.call_rpc :delete_variant, request, options: options do |response, operation|
2387
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2388
+ yield response, operation if block_given?
2389
+ throw :response, response
2390
+ end
2391
+ rescue ::GRPC::BadStatus => e
2392
+ raise ::Google::Cloud::Error.from_error(e)
2393
+ end
2394
+
2395
+ ##
2396
+ # Lists Rollouts in a given project, location, and Fleet Package.
2397
+ #
2398
+ # @overload list_rollouts(request, options = nil)
2399
+ # Pass arguments to `list_rollouts` via a request object, either of type
2400
+ # {::Google::Cloud::ConfigDelivery::V1::ListRolloutsRequest} or an equivalent Hash.
2401
+ #
2402
+ # @param request [::Google::Cloud::ConfigDelivery::V1::ListRolloutsRequest, ::Hash]
2403
+ # A request object representing the call parameters. Required. To specify no
2404
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2405
+ # @param options [::Gapic::CallOptions, ::Hash]
2406
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2407
+ #
2408
+ # @overload list_rollouts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2409
+ # Pass arguments to `list_rollouts` via keyword arguments. Note that at
2410
+ # least one keyword argument is required. To specify no parameters, or to keep all
2411
+ # the default parameter values, pass an empty Hash as a request object (see above).
2412
+ #
2413
+ # @param parent [::String]
2414
+ # Required. Parent value for ListRolloutsRequest
2415
+ # @param page_size [::Integer]
2416
+ # Optional. Requested page size. Server may return fewer items than
2417
+ # requested. If unspecified, server will pick an appropriate default.
2418
+ # @param page_token [::String]
2419
+ # Optional. A token identifying a page of results the server should return.
2420
+ # @param filter [::String]
2421
+ # Optional. Filtering results
2422
+ # @param order_by [::String]
2423
+ # Optional. Hint for how to order the results
2424
+ #
2425
+ # @yield [response, operation] Access the result along with the RPC operation
2426
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::Rollout>]
2427
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2428
+ #
2429
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ConfigDelivery::V1::Rollout>]
2430
+ #
2431
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2432
+ #
2433
+ # @example Basic example
2434
+ # require "google/cloud/config_delivery/v1"
2435
+ #
2436
+ # # Create a client object. The client can be reused for multiple calls.
2437
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2438
+ #
2439
+ # # Create a request. To set request fields, pass in keyword arguments.
2440
+ # request = Google::Cloud::ConfigDelivery::V1::ListRolloutsRequest.new
2441
+ #
2442
+ # # Call the list_rollouts method.
2443
+ # result = client.list_rollouts request
2444
+ #
2445
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2446
+ # # over elements, and API calls will be issued to fetch pages as needed.
2447
+ # result.each do |item|
2448
+ # # Each element is of type ::Google::Cloud::ConfigDelivery::V1::Rollout.
2449
+ # p item
2450
+ # end
2451
+ #
2452
+ def list_rollouts request, options = nil
2453
+ raise ::ArgumentError, "request must be provided" if request.nil?
2454
+
2455
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::ListRolloutsRequest
2456
+
2457
+ # Converts hash and nil to an options object
2458
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2459
+
2460
+ # Customize the options with defaults
2461
+ metadata = @config.rpcs.list_rollouts.metadata.to_h
2462
+
2463
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2464
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2465
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2466
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2467
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2468
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2469
+
2470
+ header_params = {}
2471
+ if request.parent
2472
+ header_params["parent"] = request.parent
2473
+ end
2474
+
2475
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2476
+ metadata[:"x-goog-request-params"] ||= request_params_header
2477
+
2478
+ options.apply_defaults timeout: @config.rpcs.list_rollouts.timeout,
2479
+ metadata: metadata,
2480
+ retry_policy: @config.rpcs.list_rollouts.retry_policy
2481
+
2482
+ options.apply_defaults timeout: @config.timeout,
2483
+ metadata: @config.metadata,
2484
+ retry_policy: @config.retry_policy
2485
+
2486
+ @config_delivery_stub.call_rpc :list_rollouts, request, options: options do |response, operation|
2487
+ response = ::Gapic::PagedEnumerable.new @config_delivery_stub, :list_rollouts, request, response, operation, options
2488
+ yield response, operation if block_given?
2489
+ throw :response, response
2490
+ end
2491
+ rescue ::GRPC::BadStatus => e
2492
+ raise ::Google::Cloud::Error.from_error(e)
2493
+ end
2494
+
2495
+ ##
2496
+ # Gets details of a single Rollout.
2497
+ #
2498
+ # @overload get_rollout(request, options = nil)
2499
+ # Pass arguments to `get_rollout` via a request object, either of type
2500
+ # {::Google::Cloud::ConfigDelivery::V1::GetRolloutRequest} or an equivalent Hash.
2501
+ #
2502
+ # @param request [::Google::Cloud::ConfigDelivery::V1::GetRolloutRequest, ::Hash]
2503
+ # A request object representing the call parameters. Required. To specify no
2504
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2505
+ # @param options [::Gapic::CallOptions, ::Hash]
2506
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2507
+ #
2508
+ # @overload get_rollout(name: nil)
2509
+ # Pass arguments to `get_rollout` via keyword arguments. Note that at
2510
+ # least one keyword argument is required. To specify no parameters, or to keep all
2511
+ # the default parameter values, pass an empty Hash as a request object (see above).
2512
+ #
2513
+ # @param name [::String]
2514
+ # Required. Name of the resource
2515
+ #
2516
+ # @yield [response, operation] Access the result along with the RPC operation
2517
+ # @yieldparam response [::Google::Cloud::ConfigDelivery::V1::Rollout]
2518
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2519
+ #
2520
+ # @return [::Google::Cloud::ConfigDelivery::V1::Rollout]
2521
+ #
2522
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2523
+ #
2524
+ # @example Basic example
2525
+ # require "google/cloud/config_delivery/v1"
2526
+ #
2527
+ # # Create a client object. The client can be reused for multiple calls.
2528
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2529
+ #
2530
+ # # Create a request. To set request fields, pass in keyword arguments.
2531
+ # request = Google::Cloud::ConfigDelivery::V1::GetRolloutRequest.new
2532
+ #
2533
+ # # Call the get_rollout method.
2534
+ # result = client.get_rollout request
2535
+ #
2536
+ # # The returned object is of type Google::Cloud::ConfigDelivery::V1::Rollout.
2537
+ # p result
2538
+ #
2539
+ def get_rollout request, options = nil
2540
+ raise ::ArgumentError, "request must be provided" if request.nil?
2541
+
2542
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::GetRolloutRequest
2543
+
2544
+ # Converts hash and nil to an options object
2545
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2546
+
2547
+ # Customize the options with defaults
2548
+ metadata = @config.rpcs.get_rollout.metadata.to_h
2549
+
2550
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2551
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2552
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2553
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2554
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2555
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2556
+
2557
+ header_params = {}
2558
+ if request.name
2559
+ header_params["name"] = request.name
2560
+ end
2561
+
2562
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2563
+ metadata[:"x-goog-request-params"] ||= request_params_header
2564
+
2565
+ options.apply_defaults timeout: @config.rpcs.get_rollout.timeout,
2566
+ metadata: metadata,
2567
+ retry_policy: @config.rpcs.get_rollout.retry_policy
2568
+
2569
+ options.apply_defaults timeout: @config.timeout,
2570
+ metadata: @config.metadata,
2571
+ retry_policy: @config.retry_policy
2572
+
2573
+ @config_delivery_stub.call_rpc :get_rollout, request, options: options do |response, operation|
2574
+ yield response, operation if block_given?
2575
+ end
2576
+ rescue ::GRPC::BadStatus => e
2577
+ raise ::Google::Cloud::Error.from_error(e)
2578
+ end
2579
+
2580
+ ##
2581
+ # Suspend a Rollout.
2582
+ #
2583
+ # @overload suspend_rollout(request, options = nil)
2584
+ # Pass arguments to `suspend_rollout` via a request object, either of type
2585
+ # {::Google::Cloud::ConfigDelivery::V1::SuspendRolloutRequest} or an equivalent Hash.
2586
+ #
2587
+ # @param request [::Google::Cloud::ConfigDelivery::V1::SuspendRolloutRequest, ::Hash]
2588
+ # A request object representing the call parameters. Required. To specify no
2589
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2590
+ # @param options [::Gapic::CallOptions, ::Hash]
2591
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2592
+ #
2593
+ # @overload suspend_rollout(name: nil, reason: nil)
2594
+ # Pass arguments to `suspend_rollout` via keyword arguments. Note that at
2595
+ # least one keyword argument is required. To specify no parameters, or to keep all
2596
+ # the default parameter values, pass an empty Hash as a request object (see above).
2597
+ #
2598
+ # @param name [::String]
2599
+ # Required. Name of the Rollout.
2600
+ # @param reason [::String]
2601
+ # Optional. Reason for suspension.
2602
+ #
2603
+ # @yield [response, operation] Access the result along with the RPC operation
2604
+ # @yieldparam response [::Gapic::Operation]
2605
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2606
+ #
2607
+ # @return [::Gapic::Operation]
2608
+ #
2609
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2610
+ #
2611
+ # @example Basic example
2612
+ # require "google/cloud/config_delivery/v1"
2613
+ #
2614
+ # # Create a client object. The client can be reused for multiple calls.
2615
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2616
+ #
2617
+ # # Create a request. To set request fields, pass in keyword arguments.
2618
+ # request = Google::Cloud::ConfigDelivery::V1::SuspendRolloutRequest.new
2619
+ #
2620
+ # # Call the suspend_rollout method.
2621
+ # result = client.suspend_rollout request
2622
+ #
2623
+ # # The returned object is of type Gapic::Operation. You can use it to
2624
+ # # check the status of an operation, cancel it, or wait for results.
2625
+ # # Here is how to wait for a response.
2626
+ # result.wait_until_done! timeout: 60
2627
+ # if result.response?
2628
+ # p result.response
2629
+ # else
2630
+ # puts "No response received."
2631
+ # end
2632
+ #
2633
+ def suspend_rollout request, options = nil
2634
+ raise ::ArgumentError, "request must be provided" if request.nil?
2635
+
2636
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::SuspendRolloutRequest
2637
+
2638
+ # Converts hash and nil to an options object
2639
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2640
+
2641
+ # Customize the options with defaults
2642
+ metadata = @config.rpcs.suspend_rollout.metadata.to_h
2643
+
2644
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2645
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2646
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2647
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2648
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2649
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2650
+
2651
+ header_params = {}
2652
+ if request.name
2653
+ header_params["name"] = request.name
2654
+ end
2655
+
2656
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2657
+ metadata[:"x-goog-request-params"] ||= request_params_header
2658
+
2659
+ options.apply_defaults timeout: @config.rpcs.suspend_rollout.timeout,
2660
+ metadata: metadata,
2661
+ retry_policy: @config.rpcs.suspend_rollout.retry_policy
2662
+
2663
+ options.apply_defaults timeout: @config.timeout,
2664
+ metadata: @config.metadata,
2665
+ retry_policy: @config.retry_policy
2666
+
2667
+ @config_delivery_stub.call_rpc :suspend_rollout, request, options: options do |response, operation|
2668
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2669
+ yield response, operation if block_given?
2670
+ throw :response, response
2671
+ end
2672
+ rescue ::GRPC::BadStatus => e
2673
+ raise ::Google::Cloud::Error.from_error(e)
2674
+ end
2675
+
2676
+ ##
2677
+ # Resume a Rollout.
2678
+ #
2679
+ # @overload resume_rollout(request, options = nil)
2680
+ # Pass arguments to `resume_rollout` via a request object, either of type
2681
+ # {::Google::Cloud::ConfigDelivery::V1::ResumeRolloutRequest} or an equivalent Hash.
2682
+ #
2683
+ # @param request [::Google::Cloud::ConfigDelivery::V1::ResumeRolloutRequest, ::Hash]
2684
+ # A request object representing the call parameters. Required. To specify no
2685
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2686
+ # @param options [::Gapic::CallOptions, ::Hash]
2687
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2688
+ #
2689
+ # @overload resume_rollout(name: nil, reason: nil)
2690
+ # Pass arguments to `resume_rollout` via keyword arguments. Note that at
2691
+ # least one keyword argument is required. To specify no parameters, or to keep all
2692
+ # the default parameter values, pass an empty Hash as a request object (see above).
2693
+ #
2694
+ # @param name [::String]
2695
+ # Required. Name of the Rollout.
2696
+ # @param reason [::String]
2697
+ # Optional. Reason for resuming the rollout.
2698
+ #
2699
+ # @yield [response, operation] Access the result along with the RPC operation
2700
+ # @yieldparam response [::Gapic::Operation]
2701
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2702
+ #
2703
+ # @return [::Gapic::Operation]
2704
+ #
2705
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2706
+ #
2707
+ # @example Basic example
2708
+ # require "google/cloud/config_delivery/v1"
2709
+ #
2710
+ # # Create a client object. The client can be reused for multiple calls.
2711
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2712
+ #
2713
+ # # Create a request. To set request fields, pass in keyword arguments.
2714
+ # request = Google::Cloud::ConfigDelivery::V1::ResumeRolloutRequest.new
2715
+ #
2716
+ # # Call the resume_rollout method.
2717
+ # result = client.resume_rollout request
2718
+ #
2719
+ # # The returned object is of type Gapic::Operation. You can use it to
2720
+ # # check the status of an operation, cancel it, or wait for results.
2721
+ # # Here is how to wait for a response.
2722
+ # result.wait_until_done! timeout: 60
2723
+ # if result.response?
2724
+ # p result.response
2725
+ # else
2726
+ # puts "No response received."
2727
+ # end
2728
+ #
2729
+ def resume_rollout request, options = nil
2730
+ raise ::ArgumentError, "request must be provided" if request.nil?
2731
+
2732
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::ResumeRolloutRequest
2733
+
2734
+ # Converts hash and nil to an options object
2735
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2736
+
2737
+ # Customize the options with defaults
2738
+ metadata = @config.rpcs.resume_rollout.metadata.to_h
2739
+
2740
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2741
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2742
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2743
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2744
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2745
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2746
+
2747
+ header_params = {}
2748
+ if request.name
2749
+ header_params["name"] = request.name
2750
+ end
2751
+
2752
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2753
+ metadata[:"x-goog-request-params"] ||= request_params_header
2754
+
2755
+ options.apply_defaults timeout: @config.rpcs.resume_rollout.timeout,
2756
+ metadata: metadata,
2757
+ retry_policy: @config.rpcs.resume_rollout.retry_policy
2758
+
2759
+ options.apply_defaults timeout: @config.timeout,
2760
+ metadata: @config.metadata,
2761
+ retry_policy: @config.retry_policy
2762
+
2763
+ @config_delivery_stub.call_rpc :resume_rollout, request, options: options do |response, operation|
2764
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2765
+ yield response, operation if block_given?
2766
+ throw :response, response
2767
+ end
2768
+ rescue ::GRPC::BadStatus => e
2769
+ raise ::Google::Cloud::Error.from_error(e)
2770
+ end
2771
+
2772
+ ##
2773
+ # Abort a Rollout.
2774
+ #
2775
+ # @overload abort_rollout(request, options = nil)
2776
+ # Pass arguments to `abort_rollout` via a request object, either of type
2777
+ # {::Google::Cloud::ConfigDelivery::V1::AbortRolloutRequest} or an equivalent Hash.
2778
+ #
2779
+ # @param request [::Google::Cloud::ConfigDelivery::V1::AbortRolloutRequest, ::Hash]
2780
+ # A request object representing the call parameters. Required. To specify no
2781
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2782
+ # @param options [::Gapic::CallOptions, ::Hash]
2783
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2784
+ #
2785
+ # @overload abort_rollout(name: nil, reason: nil)
2786
+ # Pass arguments to `abort_rollout` via keyword arguments. Note that at
2787
+ # least one keyword argument is required. To specify no parameters, or to keep all
2788
+ # the default parameter values, pass an empty Hash as a request object (see above).
2789
+ #
2790
+ # @param name [::String]
2791
+ # Required. Name of the Rollout.
2792
+ # @param reason [::String]
2793
+ # Optional. Reason for aborting.
2794
+ #
2795
+ # @yield [response, operation] Access the result along with the RPC operation
2796
+ # @yieldparam response [::Gapic::Operation]
2797
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2798
+ #
2799
+ # @return [::Gapic::Operation]
2800
+ #
2801
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2802
+ #
2803
+ # @example Basic example
2804
+ # require "google/cloud/config_delivery/v1"
2805
+ #
2806
+ # # Create a client object. The client can be reused for multiple calls.
2807
+ # client = Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new
2808
+ #
2809
+ # # Create a request. To set request fields, pass in keyword arguments.
2810
+ # request = Google::Cloud::ConfigDelivery::V1::AbortRolloutRequest.new
2811
+ #
2812
+ # # Call the abort_rollout method.
2813
+ # result = client.abort_rollout request
2814
+ #
2815
+ # # The returned object is of type Gapic::Operation. You can use it to
2816
+ # # check the status of an operation, cancel it, or wait for results.
2817
+ # # Here is how to wait for a response.
2818
+ # result.wait_until_done! timeout: 60
2819
+ # if result.response?
2820
+ # p result.response
2821
+ # else
2822
+ # puts "No response received."
2823
+ # end
2824
+ #
2825
+ def abort_rollout request, options = nil
2826
+ raise ::ArgumentError, "request must be provided" if request.nil?
2827
+
2828
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigDelivery::V1::AbortRolloutRequest
2829
+
2830
+ # Converts hash and nil to an options object
2831
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2832
+
2833
+ # Customize the options with defaults
2834
+ metadata = @config.rpcs.abort_rollout.metadata.to_h
2835
+
2836
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2837
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2838
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2839
+ gapic_version: ::Google::Cloud::ConfigDelivery::V1::VERSION
2840
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2841
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2842
+
2843
+ header_params = {}
2844
+ if request.name
2845
+ header_params["name"] = request.name
2846
+ end
2847
+
2848
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2849
+ metadata[:"x-goog-request-params"] ||= request_params_header
2850
+
2851
+ options.apply_defaults timeout: @config.rpcs.abort_rollout.timeout,
2852
+ metadata: metadata,
2853
+ retry_policy: @config.rpcs.abort_rollout.retry_policy
2854
+
2855
+ options.apply_defaults timeout: @config.timeout,
2856
+ metadata: @config.metadata,
2857
+ retry_policy: @config.retry_policy
2858
+
2859
+ @config_delivery_stub.call_rpc :abort_rollout, request, options: options do |response, operation|
2860
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2861
+ yield response, operation if block_given?
2862
+ throw :response, response
2863
+ end
2864
+ rescue ::GRPC::BadStatus => e
2865
+ raise ::Google::Cloud::Error.from_error(e)
2866
+ end
2867
+
2868
+ ##
2869
+ # Configuration class for the ConfigDelivery API.
2870
+ #
2871
+ # This class represents the configuration for ConfigDelivery,
2872
+ # providing control over timeouts, retry behavior, logging, transport
2873
+ # parameters, and other low-level controls. Certain parameters can also be
2874
+ # applied individually to specific RPCs. See
2875
+ # {::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client::Configuration::Rpcs}
2876
+ # for a list of RPCs that can be configured independently.
2877
+ #
2878
+ # Configuration can be applied globally to all clients, or to a single client
2879
+ # on construction.
2880
+ #
2881
+ # @example
2882
+ #
2883
+ # # Modify the global config, setting the timeout for
2884
+ # # list_resource_bundles to 20 seconds,
2885
+ # # and all remaining timeouts to 10 seconds.
2886
+ # ::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.configure do |config|
2887
+ # config.timeout = 10.0
2888
+ # config.rpcs.list_resource_bundles.timeout = 20.0
2889
+ # end
2890
+ #
2891
+ # # Apply the above configuration only to a new client.
2892
+ # client = ::Google::Cloud::ConfigDelivery::V1::ConfigDelivery::Client.new do |config|
2893
+ # config.timeout = 10.0
2894
+ # config.rpcs.list_resource_bundles.timeout = 20.0
2895
+ # end
2896
+ #
2897
+ # @!attribute [rw] endpoint
2898
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2899
+ # nil, indicating to use the default endpoint in the current universe domain.
2900
+ # @return [::String,nil]
2901
+ # @!attribute [rw] credentials
2902
+ # Credentials to send with calls. You may provide any of the following types:
2903
+ # * (`String`) The path to a service account key file in JSON format
2904
+ # * (`Hash`) A service account key as a Hash
2905
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2906
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2907
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2908
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2909
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2910
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2911
+ # * (`nil`) indicating no credentials
2912
+ #
2913
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2914
+ # external source for authentication to Google Cloud, you must validate it before
2915
+ # providing it to a Google API client library. Providing an unvalidated credential
2916
+ # configuration to Google APIs can compromise the security of your systems and data.
2917
+ # For more information, refer to [Validate credential configurations from external
2918
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2919
+ # @return [::Object]
2920
+ # @!attribute [rw] scope
2921
+ # The OAuth scopes
2922
+ # @return [::Array<::String>]
2923
+ # @!attribute [rw] lib_name
2924
+ # The library name as recorded in instrumentation and logging
2925
+ # @return [::String]
2926
+ # @!attribute [rw] lib_version
2927
+ # The library version as recorded in instrumentation and logging
2928
+ # @return [::String]
2929
+ # @!attribute [rw] channel_args
2930
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2931
+ # `GRPC::Core::Channel` object is provided as the credential.
2932
+ # @return [::Hash]
2933
+ # @!attribute [rw] interceptors
2934
+ # An array of interceptors that are run before calls are executed.
2935
+ # @return [::Array<::GRPC::ClientInterceptor>]
2936
+ # @!attribute [rw] timeout
2937
+ # The call timeout in seconds.
2938
+ # @return [::Numeric]
2939
+ # @!attribute [rw] metadata
2940
+ # Additional gRPC headers to be sent with the call.
2941
+ # @return [::Hash{::Symbol=>::String}]
2942
+ # @!attribute [rw] retry_policy
2943
+ # The retry policy. The value is a hash with the following keys:
2944
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2945
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2946
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2947
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2948
+ # trigger a retry.
2949
+ # @return [::Hash]
2950
+ # @!attribute [rw] quota_project
2951
+ # A separate project against which to charge quota.
2952
+ # @return [::String]
2953
+ # @!attribute [rw] universe_domain
2954
+ # The universe domain within which to make requests. This determines the
2955
+ # default endpoint URL. The default value of nil uses the environment
2956
+ # universe (usually the default "googleapis.com" universe).
2957
+ # @return [::String,nil]
2958
+ # @!attribute [rw] logger
2959
+ # A custom logger to use for request/response debug logging, or the value
2960
+ # `:default` (the default) to construct a default logger, or `nil` to
2961
+ # explicitly disable logging.
2962
+ # @return [::Logger,:default,nil]
2963
+ #
2964
+ class Configuration
2965
+ extend ::Gapic::Config
2966
+
2967
+ # @private
2968
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2969
+ DEFAULT_ENDPOINT = "configdelivery.googleapis.com"
2970
+
2971
+ config_attr :endpoint, nil, ::String, nil
2972
+ config_attr :credentials, nil do |value|
2973
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
2974
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
2975
+ allowed.any? { |klass| klass === value }
2976
+ end
2977
+ config_attr :scope, nil, ::String, ::Array, nil
2978
+ config_attr :lib_name, nil, ::String, nil
2979
+ config_attr :lib_version, nil, ::String, nil
2980
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2981
+ config_attr :interceptors, nil, ::Array, nil
2982
+ config_attr :timeout, nil, ::Numeric, nil
2983
+ config_attr :metadata, nil, ::Hash, nil
2984
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2985
+ config_attr :quota_project, nil, ::String, nil
2986
+ config_attr :universe_domain, nil, ::String, nil
2987
+ config_attr :logger, :default, ::Logger, nil, :default
2988
+
2989
+ # @private
2990
+ def initialize parent_config = nil
2991
+ @parent_config = parent_config unless parent_config.nil?
2992
+
2993
+ yield self if block_given?
2994
+ end
2995
+
2996
+ ##
2997
+ # Configurations for individual RPCs
2998
+ # @return [Rpcs]
2999
+ #
3000
+ def rpcs
3001
+ @rpcs ||= begin
3002
+ parent_rpcs = nil
3003
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3004
+ Rpcs.new parent_rpcs
3005
+ end
3006
+ end
3007
+
3008
+ ##
3009
+ # Configuration for the channel pool
3010
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
3011
+ #
3012
+ def channel_pool
3013
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
3014
+ end
3015
+
3016
+ ##
3017
+ # Configuration RPC class for the ConfigDelivery API.
3018
+ #
3019
+ # Includes fields providing the configuration for each RPC in this service.
3020
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3021
+ # the following configuration fields:
3022
+ #
3023
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3024
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
3025
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3026
+ # include the following keys:
3027
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3028
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3029
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3030
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3031
+ # trigger a retry.
3032
+ #
3033
+ class Rpcs
3034
+ ##
3035
+ # RPC-specific configuration for `list_resource_bundles`
3036
+ # @return [::Gapic::Config::Method]
3037
+ #
3038
+ attr_reader :list_resource_bundles
3039
+ ##
3040
+ # RPC-specific configuration for `get_resource_bundle`
3041
+ # @return [::Gapic::Config::Method]
3042
+ #
3043
+ attr_reader :get_resource_bundle
3044
+ ##
3045
+ # RPC-specific configuration for `create_resource_bundle`
3046
+ # @return [::Gapic::Config::Method]
3047
+ #
3048
+ attr_reader :create_resource_bundle
3049
+ ##
3050
+ # RPC-specific configuration for `update_resource_bundle`
3051
+ # @return [::Gapic::Config::Method]
3052
+ #
3053
+ attr_reader :update_resource_bundle
3054
+ ##
3055
+ # RPC-specific configuration for `delete_resource_bundle`
3056
+ # @return [::Gapic::Config::Method]
3057
+ #
3058
+ attr_reader :delete_resource_bundle
3059
+ ##
3060
+ # RPC-specific configuration for `list_fleet_packages`
3061
+ # @return [::Gapic::Config::Method]
3062
+ #
3063
+ attr_reader :list_fleet_packages
3064
+ ##
3065
+ # RPC-specific configuration for `get_fleet_package`
3066
+ # @return [::Gapic::Config::Method]
3067
+ #
3068
+ attr_reader :get_fleet_package
3069
+ ##
3070
+ # RPC-specific configuration for `create_fleet_package`
3071
+ # @return [::Gapic::Config::Method]
3072
+ #
3073
+ attr_reader :create_fleet_package
3074
+ ##
3075
+ # RPC-specific configuration for `update_fleet_package`
3076
+ # @return [::Gapic::Config::Method]
3077
+ #
3078
+ attr_reader :update_fleet_package
3079
+ ##
3080
+ # RPC-specific configuration for `delete_fleet_package`
3081
+ # @return [::Gapic::Config::Method]
3082
+ #
3083
+ attr_reader :delete_fleet_package
3084
+ ##
3085
+ # RPC-specific configuration for `list_releases`
3086
+ # @return [::Gapic::Config::Method]
3087
+ #
3088
+ attr_reader :list_releases
3089
+ ##
3090
+ # RPC-specific configuration for `get_release`
3091
+ # @return [::Gapic::Config::Method]
3092
+ #
3093
+ attr_reader :get_release
3094
+ ##
3095
+ # RPC-specific configuration for `create_release`
3096
+ # @return [::Gapic::Config::Method]
3097
+ #
3098
+ attr_reader :create_release
3099
+ ##
3100
+ # RPC-specific configuration for `update_release`
3101
+ # @return [::Gapic::Config::Method]
3102
+ #
3103
+ attr_reader :update_release
3104
+ ##
3105
+ # RPC-specific configuration for `delete_release`
3106
+ # @return [::Gapic::Config::Method]
3107
+ #
3108
+ attr_reader :delete_release
3109
+ ##
3110
+ # RPC-specific configuration for `list_variants`
3111
+ # @return [::Gapic::Config::Method]
3112
+ #
3113
+ attr_reader :list_variants
3114
+ ##
3115
+ # RPC-specific configuration for `get_variant`
3116
+ # @return [::Gapic::Config::Method]
3117
+ #
3118
+ attr_reader :get_variant
3119
+ ##
3120
+ # RPC-specific configuration for `create_variant`
3121
+ # @return [::Gapic::Config::Method]
3122
+ #
3123
+ attr_reader :create_variant
3124
+ ##
3125
+ # RPC-specific configuration for `update_variant`
3126
+ # @return [::Gapic::Config::Method]
3127
+ #
3128
+ attr_reader :update_variant
3129
+ ##
3130
+ # RPC-specific configuration for `delete_variant`
3131
+ # @return [::Gapic::Config::Method]
3132
+ #
3133
+ attr_reader :delete_variant
3134
+ ##
3135
+ # RPC-specific configuration for `list_rollouts`
3136
+ # @return [::Gapic::Config::Method]
3137
+ #
3138
+ attr_reader :list_rollouts
3139
+ ##
3140
+ # RPC-specific configuration for `get_rollout`
3141
+ # @return [::Gapic::Config::Method]
3142
+ #
3143
+ attr_reader :get_rollout
3144
+ ##
3145
+ # RPC-specific configuration for `suspend_rollout`
3146
+ # @return [::Gapic::Config::Method]
3147
+ #
3148
+ attr_reader :suspend_rollout
3149
+ ##
3150
+ # RPC-specific configuration for `resume_rollout`
3151
+ # @return [::Gapic::Config::Method]
3152
+ #
3153
+ attr_reader :resume_rollout
3154
+ ##
3155
+ # RPC-specific configuration for `abort_rollout`
3156
+ # @return [::Gapic::Config::Method]
3157
+ #
3158
+ attr_reader :abort_rollout
3159
+
3160
+ # @private
3161
+ def initialize parent_rpcs = nil
3162
+ list_resource_bundles_config = parent_rpcs.list_resource_bundles if parent_rpcs.respond_to? :list_resource_bundles
3163
+ @list_resource_bundles = ::Gapic::Config::Method.new list_resource_bundles_config
3164
+ get_resource_bundle_config = parent_rpcs.get_resource_bundle if parent_rpcs.respond_to? :get_resource_bundle
3165
+ @get_resource_bundle = ::Gapic::Config::Method.new get_resource_bundle_config
3166
+ create_resource_bundle_config = parent_rpcs.create_resource_bundle if parent_rpcs.respond_to? :create_resource_bundle
3167
+ @create_resource_bundle = ::Gapic::Config::Method.new create_resource_bundle_config
3168
+ update_resource_bundle_config = parent_rpcs.update_resource_bundle if parent_rpcs.respond_to? :update_resource_bundle
3169
+ @update_resource_bundle = ::Gapic::Config::Method.new update_resource_bundle_config
3170
+ delete_resource_bundle_config = parent_rpcs.delete_resource_bundle if parent_rpcs.respond_to? :delete_resource_bundle
3171
+ @delete_resource_bundle = ::Gapic::Config::Method.new delete_resource_bundle_config
3172
+ list_fleet_packages_config = parent_rpcs.list_fleet_packages if parent_rpcs.respond_to? :list_fleet_packages
3173
+ @list_fleet_packages = ::Gapic::Config::Method.new list_fleet_packages_config
3174
+ get_fleet_package_config = parent_rpcs.get_fleet_package if parent_rpcs.respond_to? :get_fleet_package
3175
+ @get_fleet_package = ::Gapic::Config::Method.new get_fleet_package_config
3176
+ create_fleet_package_config = parent_rpcs.create_fleet_package if parent_rpcs.respond_to? :create_fleet_package
3177
+ @create_fleet_package = ::Gapic::Config::Method.new create_fleet_package_config
3178
+ update_fleet_package_config = parent_rpcs.update_fleet_package if parent_rpcs.respond_to? :update_fleet_package
3179
+ @update_fleet_package = ::Gapic::Config::Method.new update_fleet_package_config
3180
+ delete_fleet_package_config = parent_rpcs.delete_fleet_package if parent_rpcs.respond_to? :delete_fleet_package
3181
+ @delete_fleet_package = ::Gapic::Config::Method.new delete_fleet_package_config
3182
+ list_releases_config = parent_rpcs.list_releases if parent_rpcs.respond_to? :list_releases
3183
+ @list_releases = ::Gapic::Config::Method.new list_releases_config
3184
+ get_release_config = parent_rpcs.get_release if parent_rpcs.respond_to? :get_release
3185
+ @get_release = ::Gapic::Config::Method.new get_release_config
3186
+ create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release
3187
+ @create_release = ::Gapic::Config::Method.new create_release_config
3188
+ update_release_config = parent_rpcs.update_release if parent_rpcs.respond_to? :update_release
3189
+ @update_release = ::Gapic::Config::Method.new update_release_config
3190
+ delete_release_config = parent_rpcs.delete_release if parent_rpcs.respond_to? :delete_release
3191
+ @delete_release = ::Gapic::Config::Method.new delete_release_config
3192
+ list_variants_config = parent_rpcs.list_variants if parent_rpcs.respond_to? :list_variants
3193
+ @list_variants = ::Gapic::Config::Method.new list_variants_config
3194
+ get_variant_config = parent_rpcs.get_variant if parent_rpcs.respond_to? :get_variant
3195
+ @get_variant = ::Gapic::Config::Method.new get_variant_config
3196
+ create_variant_config = parent_rpcs.create_variant if parent_rpcs.respond_to? :create_variant
3197
+ @create_variant = ::Gapic::Config::Method.new create_variant_config
3198
+ update_variant_config = parent_rpcs.update_variant if parent_rpcs.respond_to? :update_variant
3199
+ @update_variant = ::Gapic::Config::Method.new update_variant_config
3200
+ delete_variant_config = parent_rpcs.delete_variant if parent_rpcs.respond_to? :delete_variant
3201
+ @delete_variant = ::Gapic::Config::Method.new delete_variant_config
3202
+ list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts
3203
+ @list_rollouts = ::Gapic::Config::Method.new list_rollouts_config
3204
+ get_rollout_config = parent_rpcs.get_rollout if parent_rpcs.respond_to? :get_rollout
3205
+ @get_rollout = ::Gapic::Config::Method.new get_rollout_config
3206
+ suspend_rollout_config = parent_rpcs.suspend_rollout if parent_rpcs.respond_to? :suspend_rollout
3207
+ @suspend_rollout = ::Gapic::Config::Method.new suspend_rollout_config
3208
+ resume_rollout_config = parent_rpcs.resume_rollout if parent_rpcs.respond_to? :resume_rollout
3209
+ @resume_rollout = ::Gapic::Config::Method.new resume_rollout_config
3210
+ abort_rollout_config = parent_rpcs.abort_rollout if parent_rpcs.respond_to? :abort_rollout
3211
+ @abort_rollout = ::Gapic::Config::Method.new abort_rollout_config
3212
+
3213
+ yield self if block_given?
3214
+ end
3215
+ end
3216
+ end
3217
+ end
3218
+ end
3219
+ end
3220
+ end
3221
+ end
3222
+ end