google-cloud-run-v2 0.28.1 → 0.29.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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/run/v2/build_pb.rb +4 -25
  4. data/lib/google/cloud/run/v2/builds/client.rb +11 -1
  5. data/lib/google/cloud/run/v2/builds/rest/client.rb +11 -1
  6. data/lib/google/cloud/run/v2/condition_pb.rb +3 -25
  7. data/lib/google/cloud/run/v2/container_status_pb.rb +21 -0
  8. data/lib/google/cloud/run/v2/execution_pb.rb +2 -26
  9. data/lib/google/cloud/run/v2/execution_template_pb.rb +2 -24
  10. data/lib/google/cloud/run/v2/executions/client.rb +2 -0
  11. data/lib/google/cloud/run/v2/executions/operations.rb +2 -0
  12. data/lib/google/cloud/run/v2/executions/rest/client.rb +2 -0
  13. data/lib/google/cloud/run/v2/executions/rest/operations.rb +2 -0
  14. data/lib/google/cloud/run/v2/instance_pb.rb +42 -0
  15. data/lib/google/cloud/run/v2/instance_services_pb.rb +55 -0
  16. data/lib/google/cloud/run/v2/instance_split_pb.rb +2 -23
  17. data/lib/google/cloud/run/v2/instances/client.rb +1059 -0
  18. data/lib/google/cloud/run/v2/instances/credentials.rb +47 -0
  19. data/lib/google/cloud/run/v2/instances/operations.rb +851 -0
  20. data/lib/google/cloud/run/v2/instances/paths.rb +178 -0
  21. data/lib/google/cloud/run/v2/instances/rest/client.rb +962 -0
  22. data/lib/google/cloud/run/v2/instances/rest/operations.rb +1095 -0
  23. data/lib/google/cloud/run/v2/instances/rest/service_stub.rb +450 -0
  24. data/lib/google/cloud/run/v2/instances/rest.rb +53 -0
  25. data/lib/google/cloud/run/v2/instances.rb +56 -0
  26. data/lib/google/cloud/run/v2/job_pb.rb +3 -30
  27. data/lib/google/cloud/run/v2/jobs/client.rb +2 -0
  28. data/lib/google/cloud/run/v2/jobs/operations.rb +2 -0
  29. data/lib/google/cloud/run/v2/jobs/rest/client.rb +2 -0
  30. data/lib/google/cloud/run/v2/jobs/rest/operations.rb +2 -0
  31. data/lib/google/cloud/run/v2/k8s.min_pb.rb +5 -24
  32. data/lib/google/cloud/run/v2/rest.rb +1 -0
  33. data/lib/google/cloud/run/v2/revision_pb.rb +2 -29
  34. data/lib/google/cloud/run/v2/revision_template_pb.rb +2 -26
  35. data/lib/google/cloud/run/v2/revisions/client.rb +2 -0
  36. data/lib/google/cloud/run/v2/revisions/operations.rb +2 -0
  37. data/lib/google/cloud/run/v2/revisions/rest/client.rb +2 -0
  38. data/lib/google/cloud/run/v2/revisions/rest/operations.rb +2 -0
  39. data/lib/google/cloud/run/v2/service_pb.rb +4 -30
  40. data/lib/google/cloud/run/v2/services/client.rb +2 -0
  41. data/lib/google/cloud/run/v2/services/operations.rb +2 -0
  42. data/lib/google/cloud/run/v2/services/rest/client.rb +2 -0
  43. data/lib/google/cloud/run/v2/services/rest/operations.rb +2 -0
  44. data/lib/google/cloud/run/v2/status_pb.rb +2 -23
  45. data/lib/google/cloud/run/v2/task_pb.rb +2 -29
  46. data/lib/google/cloud/run/v2/task_template_pb.rb +2 -26
  47. data/lib/google/cloud/run/v2/tasks/client.rb +2 -0
  48. data/lib/google/cloud/run/v2/tasks/rest/client.rb +2 -0
  49. data/lib/google/cloud/run/v2/traffic_target_pb.rb +2 -23
  50. data/lib/google/cloud/run/v2/vendor_settings_pb.rb +3 -24
  51. data/lib/google/cloud/run/v2/version.rb +1 -1
  52. data/lib/google/cloud/run/v2/worker_pool_pb.rb +3 -30
  53. data/lib/google/cloud/run/v2/worker_pool_revision_template_pb.rb +3 -27
  54. data/lib/google/cloud/run/v2/worker_pools/client.rb +2 -0
  55. data/lib/google/cloud/run/v2/worker_pools/operations.rb +2 -0
  56. data/lib/google/cloud/run/v2/worker_pools/rest/client.rb +2 -0
  57. data/lib/google/cloud/run/v2/worker_pools/rest/operations.rb +2 -0
  58. data/lib/google/cloud/run/v2.rb +1 -0
  59. data/proto_docs/google/api/client.rb +149 -29
  60. data/proto_docs/google/api/routing.rb +7 -3
  61. data/proto_docs/google/cloud/run/v2/build.rb +11 -0
  62. data/proto_docs/google/cloud/run/v2/condition.rb +3 -0
  63. data/proto_docs/google/cloud/run/v2/container_status.rb +42 -0
  64. data/proto_docs/google/cloud/run/v2/instance.rb +328 -0
  65. data/proto_docs/google/cloud/run/v2/job.rb +2 -2
  66. data/proto_docs/google/cloud/run/v2/k8s.min.rb +37 -2
  67. data/proto_docs/google/cloud/run/v2/service.rb +32 -7
  68. data/proto_docs/google/cloud/run/v2/vendor_settings.rb +5 -0
  69. data/proto_docs/google/cloud/run/v2/worker_pool.rb +23 -22
  70. data/proto_docs/google/cloud/run/v2/worker_pool_revision_template.rb +3 -0
  71. metadata +18 -4
@@ -0,0 +1,1059 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/run/v2/instance_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Run
26
+ module V2
27
+ module Instances
28
+ ##
29
+ # Client for the Instances service.
30
+ #
31
+ # The Cloud Run Instances API allows you to manage Cloud Run Instances.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :instances_stub
44
+
45
+ ##
46
+ # Configure the Instances Client class.
47
+ #
48
+ # See {::Google::Cloud::Run::V2::Instances::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all Instances clients
54
+ # ::Google::Cloud::Run::V2::Instances::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Run", "V2"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the Instances Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::Run::V2::Instances::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @instances_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new Instances client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::Run::V2::Instances::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Run::V2::Instances::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the Instances client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/run/v2/instance_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+ @quota_project_id = @config.quota_project
151
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
152
+
153
+ @operations_client = Operations.new do |config|
154
+ config.credentials = credentials
155
+ config.quota_project = @quota_project_id
156
+ config.endpoint = @config.endpoint
157
+ config.universe_domain = @config.universe_domain
158
+ end
159
+
160
+ @instances_stub = ::Gapic::ServiceStub.new(
161
+ ::Google::Cloud::Run::V2::Instances::Stub,
162
+ credentials: credentials,
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ channel_args: @config.channel_args,
167
+ interceptors: @config.interceptors,
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
170
+ )
171
+
172
+ @instances_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+
182
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
183
+ config.credentials = credentials
184
+ config.quota_project = @quota_project_id
185
+ config.endpoint = @instances_stub.endpoint
186
+ config.universe_domain = @instances_stub.universe_domain
187
+ config.logger = @instances_stub.logger if config.respond_to? :logger=
188
+ end
189
+ end
190
+
191
+ ##
192
+ # Get the associated client for long-running operations.
193
+ #
194
+ # @return [::Google::Cloud::Run::V2::Instances::Operations]
195
+ #
196
+ attr_reader :operations_client
197
+
198
+ ##
199
+ # Get the associated client for mix-in of the Locations.
200
+ #
201
+ # @return [Google::Cloud::Location::Locations::Client]
202
+ #
203
+ attr_reader :location_client
204
+
205
+ ##
206
+ # The logger used for request/response debug logging.
207
+ #
208
+ # @return [Logger]
209
+ #
210
+ def logger
211
+ @instances_stub.logger
212
+ end
213
+
214
+ # Service calls
215
+
216
+ ##
217
+ # Creates an Instance.
218
+ #
219
+ # @overload create_instance(request, options = nil)
220
+ # Pass arguments to `create_instance` via a request object, either of type
221
+ # {::Google::Cloud::Run::V2::CreateInstanceRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::Run::V2::CreateInstanceRequest, ::Hash]
224
+ # A request object representing the call parameters. Required. To specify no
225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
226
+ # @param options [::Gapic::CallOptions, ::Hash]
227
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
228
+ #
229
+ # @overload create_instance(parent: nil, instance: nil, instance_id: nil, validate_only: nil)
230
+ # Pass arguments to `create_instance` via keyword arguments. Note that at
231
+ # least one keyword argument is required. To specify no parameters, or to keep all
232
+ # the default parameter values, pass an empty Hash as a request object (see above).
233
+ #
234
+ # @param parent [::String]
235
+ # @param instance [::Google::Cloud::Run::V2::Instance, ::Hash]
236
+ # @param instance_id [::String]
237
+ # Required. The unique identifier for the Instance. It must begin with
238
+ # letter, and cannot end with hyphen; must contain fewer than 50 characters.
239
+ # The name of the instance becomes \\{parent}/instances/\\{instance_id}.
240
+ # @param validate_only [::Boolean]
241
+ # Optional. Indicates that the request should be validated and default values
242
+ # populated, without persisting the request or creating any resources.
243
+ #
244
+ # @yield [response, operation] Access the result along with the RPC operation
245
+ # @yieldparam response [::Gapic::Operation]
246
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
247
+ #
248
+ # @return [::Gapic::Operation]
249
+ #
250
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
251
+ #
252
+ # @example Basic example
253
+ # require "google/cloud/run/v2"
254
+ #
255
+ # # Create a client object. The client can be reused for multiple calls.
256
+ # client = Google::Cloud::Run::V2::Instances::Client.new
257
+ #
258
+ # # Create a request. To set request fields, pass in keyword arguments.
259
+ # request = Google::Cloud::Run::V2::CreateInstanceRequest.new
260
+ #
261
+ # # Call the create_instance method.
262
+ # result = client.create_instance request
263
+ #
264
+ # # The returned object is of type Gapic::Operation. You can use it to
265
+ # # check the status of an operation, cancel it, or wait for results.
266
+ # # Here is how to wait for a response.
267
+ # result.wait_until_done! timeout: 60
268
+ # if result.response?
269
+ # p result.response
270
+ # else
271
+ # puts "No response received."
272
+ # end
273
+ #
274
+ def create_instance request, options = nil
275
+ raise ::ArgumentError, "request must be provided" if request.nil?
276
+
277
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::CreateInstanceRequest
278
+
279
+ # Converts hash and nil to an options object
280
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
281
+
282
+ # Customize the options with defaults
283
+ metadata = @config.rpcs.create_instance.metadata.to_h
284
+
285
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
286
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
287
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
288
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
289
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
290
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
291
+
292
+ header_params = {}
293
+ if request.parent
294
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
295
+ if regex_match
296
+ header_params["location"] = regex_match["location".to_s]
297
+ end
298
+ end
299
+
300
+ request_params_header = URI.encode_www_form header_params
301
+ metadata[:"x-goog-request-params"] ||= request_params_header
302
+
303
+ options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
304
+ metadata: metadata,
305
+ retry_policy: @config.rpcs.create_instance.retry_policy
306
+
307
+ options.apply_defaults timeout: @config.timeout,
308
+ metadata: @config.metadata,
309
+ retry_policy: @config.retry_policy
310
+
311
+ @instances_stub.call_rpc :create_instance, request, options: options do |response, operation|
312
+ response = ::Gapic::Operation.new response, @operations_client, options: options
313
+ yield response, operation if block_given?
314
+ throw :response, response
315
+ end
316
+ rescue ::GRPC::BadStatus => e
317
+ raise ::Google::Cloud::Error.from_error(e)
318
+ end
319
+
320
+ ##
321
+ # Deletes a Instance
322
+ #
323
+ # @overload delete_instance(request, options = nil)
324
+ # Pass arguments to `delete_instance` via a request object, either of type
325
+ # {::Google::Cloud::Run::V2::DeleteInstanceRequest} or an equivalent Hash.
326
+ #
327
+ # @param request [::Google::Cloud::Run::V2::DeleteInstanceRequest, ::Hash]
328
+ # A request object representing the call parameters. Required. To specify no
329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
330
+ # @param options [::Gapic::CallOptions, ::Hash]
331
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
332
+ #
333
+ # @overload delete_instance(name: nil, validate_only: nil, etag: nil)
334
+ # Pass arguments to `delete_instance` via keyword arguments. Note that at
335
+ # least one keyword argument is required. To specify no parameters, or to keep all
336
+ # the default parameter values, pass an empty Hash as a request object (see above).
337
+ #
338
+ # @param name [::String]
339
+ # @param validate_only [::Boolean]
340
+ # Optional. Indicates that the request should be validated without actually
341
+ # deleting any resources.
342
+ # @param etag [::String]
343
+ # Optional. A system-generated fingerprint for this version of the
344
+ # resource. May be used to detect modification conflict during updates.
345
+ #
346
+ # @yield [response, operation] Access the result along with the RPC operation
347
+ # @yieldparam response [::Gapic::Operation]
348
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
349
+ #
350
+ # @return [::Gapic::Operation]
351
+ #
352
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
353
+ #
354
+ # @example Basic example
355
+ # require "google/cloud/run/v2"
356
+ #
357
+ # # Create a client object. The client can be reused for multiple calls.
358
+ # client = Google::Cloud::Run::V2::Instances::Client.new
359
+ #
360
+ # # Create a request. To set request fields, pass in keyword arguments.
361
+ # request = Google::Cloud::Run::V2::DeleteInstanceRequest.new
362
+ #
363
+ # # Call the delete_instance method.
364
+ # result = client.delete_instance request
365
+ #
366
+ # # The returned object is of type Gapic::Operation. You can use it to
367
+ # # check the status of an operation, cancel it, or wait for results.
368
+ # # Here is how to wait for a response.
369
+ # result.wait_until_done! timeout: 60
370
+ # if result.response?
371
+ # p result.response
372
+ # else
373
+ # puts "No response received."
374
+ # end
375
+ #
376
+ def delete_instance request, options = nil
377
+ raise ::ArgumentError, "request must be provided" if request.nil?
378
+
379
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::DeleteInstanceRequest
380
+
381
+ # Converts hash and nil to an options object
382
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
383
+
384
+ # Customize the options with defaults
385
+ metadata = @config.rpcs.delete_instance.metadata.to_h
386
+
387
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
388
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
389
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
390
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
391
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
392
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
393
+
394
+ header_params = {}
395
+ if request.name
396
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.name
397
+ if regex_match
398
+ header_params["location"] = regex_match["location".to_s]
399
+ end
400
+ end
401
+
402
+ request_params_header = URI.encode_www_form header_params
403
+ metadata[:"x-goog-request-params"] ||= request_params_header
404
+
405
+ options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
406
+ metadata: metadata,
407
+ retry_policy: @config.rpcs.delete_instance.retry_policy
408
+
409
+ options.apply_defaults timeout: @config.timeout,
410
+ metadata: @config.metadata,
411
+ retry_policy: @config.retry_policy
412
+
413
+ @instances_stub.call_rpc :delete_instance, request, options: options do |response, operation|
414
+ response = ::Gapic::Operation.new response, @operations_client, options: options
415
+ yield response, operation if block_given?
416
+ throw :response, response
417
+ end
418
+ rescue ::GRPC::BadStatus => e
419
+ raise ::Google::Cloud::Error.from_error(e)
420
+ end
421
+
422
+ ##
423
+ # Gets a Instance
424
+ #
425
+ # @overload get_instance(request, options = nil)
426
+ # Pass arguments to `get_instance` via a request object, either of type
427
+ # {::Google::Cloud::Run::V2::GetInstanceRequest} or an equivalent Hash.
428
+ #
429
+ # @param request [::Google::Cloud::Run::V2::GetInstanceRequest, ::Hash]
430
+ # A request object representing the call parameters. Required. To specify no
431
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
432
+ # @param options [::Gapic::CallOptions, ::Hash]
433
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
434
+ #
435
+ # @overload get_instance(name: nil)
436
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
437
+ # least one keyword argument is required. To specify no parameters, or to keep all
438
+ # the default parameter values, pass an empty Hash as a request object (see above).
439
+ #
440
+ # @param name [::String]
441
+ #
442
+ # @yield [response, operation] Access the result along with the RPC operation
443
+ # @yieldparam response [::Google::Cloud::Run::V2::Instance]
444
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
445
+ #
446
+ # @return [::Google::Cloud::Run::V2::Instance]
447
+ #
448
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
449
+ #
450
+ # @example Basic example
451
+ # require "google/cloud/run/v2"
452
+ #
453
+ # # Create a client object. The client can be reused for multiple calls.
454
+ # client = Google::Cloud::Run::V2::Instances::Client.new
455
+ #
456
+ # # Create a request. To set request fields, pass in keyword arguments.
457
+ # request = Google::Cloud::Run::V2::GetInstanceRequest.new
458
+ #
459
+ # # Call the get_instance method.
460
+ # result = client.get_instance request
461
+ #
462
+ # # The returned object is of type Google::Cloud::Run::V2::Instance.
463
+ # p result
464
+ #
465
+ def get_instance request, options = nil
466
+ raise ::ArgumentError, "request must be provided" if request.nil?
467
+
468
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::GetInstanceRequest
469
+
470
+ # Converts hash and nil to an options object
471
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
472
+
473
+ # Customize the options with defaults
474
+ metadata = @config.rpcs.get_instance.metadata.to_h
475
+
476
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
477
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
478
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
479
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
480
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
481
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
482
+
483
+ header_params = {}
484
+ if request.name
485
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.name
486
+ if regex_match
487
+ header_params["location"] = regex_match["location".to_s]
488
+ end
489
+ end
490
+
491
+ request_params_header = URI.encode_www_form header_params
492
+ metadata[:"x-goog-request-params"] ||= request_params_header
493
+
494
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
495
+ metadata: metadata,
496
+ retry_policy: @config.rpcs.get_instance.retry_policy
497
+
498
+ options.apply_defaults timeout: @config.timeout,
499
+ metadata: @config.metadata,
500
+ retry_policy: @config.retry_policy
501
+
502
+ @instances_stub.call_rpc :get_instance, request, options: options do |response, operation|
503
+ yield response, operation if block_given?
504
+ end
505
+ rescue ::GRPC::BadStatus => e
506
+ raise ::Google::Cloud::Error.from_error(e)
507
+ end
508
+
509
+ ##
510
+ # Lists Instances. Results are sorted by creation time, descending.
511
+ #
512
+ # @overload list_instances(request, options = nil)
513
+ # Pass arguments to `list_instances` via a request object, either of type
514
+ # {::Google::Cloud::Run::V2::ListInstancesRequest} or an equivalent Hash.
515
+ #
516
+ # @param request [::Google::Cloud::Run::V2::ListInstancesRequest, ::Hash]
517
+ # A request object representing the call parameters. Required. To specify no
518
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
519
+ # @param options [::Gapic::CallOptions, ::Hash]
520
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
521
+ #
522
+ # @overload list_instances(parent: nil, page_size: nil, page_token: nil, show_deleted: nil)
523
+ # Pass arguments to `list_instances` via keyword arguments. Note that at
524
+ # least one keyword argument is required. To specify no parameters, or to keep all
525
+ # the default parameter values, pass an empty Hash as a request object (see above).
526
+ #
527
+ # @param parent [::String]
528
+ # Required. The location and project to list resources on.
529
+ # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be
530
+ # project id or number.
531
+ # @param page_size [::Integer]
532
+ # Optional. Maximum number of Instances to return in this call.
533
+ # @param page_token [::String]
534
+ # Optional. A page token received from a previous call to ListInstances.
535
+ # All other parameters must match.
536
+ # @param show_deleted [::Boolean]
537
+ # Optional. If true, returns deleted (but unexpired) resources along with
538
+ # active ones.
539
+ #
540
+ # @yield [response, operation] Access the result along with the RPC operation
541
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Instance>]
542
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
543
+ #
544
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Instance>]
545
+ #
546
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
547
+ #
548
+ # @example Basic example
549
+ # require "google/cloud/run/v2"
550
+ #
551
+ # # Create a client object. The client can be reused for multiple calls.
552
+ # client = Google::Cloud::Run::V2::Instances::Client.new
553
+ #
554
+ # # Create a request. To set request fields, pass in keyword arguments.
555
+ # request = Google::Cloud::Run::V2::ListInstancesRequest.new
556
+ #
557
+ # # Call the list_instances method.
558
+ # result = client.list_instances request
559
+ #
560
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
561
+ # # over elements, and API calls will be issued to fetch pages as needed.
562
+ # result.each do |item|
563
+ # # Each element is of type ::Google::Cloud::Run::V2::Instance.
564
+ # p item
565
+ # end
566
+ #
567
+ def list_instances request, options = nil
568
+ raise ::ArgumentError, "request must be provided" if request.nil?
569
+
570
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::ListInstancesRequest
571
+
572
+ # Converts hash and nil to an options object
573
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
574
+
575
+ # Customize the options with defaults
576
+ metadata = @config.rpcs.list_instances.metadata.to_h
577
+
578
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
579
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
581
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
582
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
583
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
584
+
585
+ header_params = {}
586
+ if request.parent
587
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
588
+ if regex_match
589
+ header_params["location"] = regex_match["location".to_s]
590
+ end
591
+ end
592
+
593
+ request_params_header = URI.encode_www_form header_params
594
+ metadata[:"x-goog-request-params"] ||= request_params_header
595
+
596
+ options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
597
+ metadata: metadata,
598
+ retry_policy: @config.rpcs.list_instances.retry_policy
599
+
600
+ options.apply_defaults timeout: @config.timeout,
601
+ metadata: @config.metadata,
602
+ retry_policy: @config.retry_policy
603
+
604
+ @instances_stub.call_rpc :list_instances, request, options: options do |response, operation|
605
+ response = ::Gapic::PagedEnumerable.new @instances_stub, :list_instances, request, response, operation, options
606
+ yield response, operation if block_given?
607
+ throw :response, response
608
+ end
609
+ rescue ::GRPC::BadStatus => e
610
+ raise ::Google::Cloud::Error.from_error(e)
611
+ end
612
+
613
+ ##
614
+ # Stops an Instance.
615
+ #
616
+ # @overload stop_instance(request, options = nil)
617
+ # Pass arguments to `stop_instance` via a request object, either of type
618
+ # {::Google::Cloud::Run::V2::StopInstanceRequest} or an equivalent Hash.
619
+ #
620
+ # @param request [::Google::Cloud::Run::V2::StopInstanceRequest, ::Hash]
621
+ # A request object representing the call parameters. Required. To specify no
622
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
623
+ # @param options [::Gapic::CallOptions, ::Hash]
624
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
625
+ #
626
+ # @overload stop_instance(name: nil, validate_only: nil, etag: nil)
627
+ # Pass arguments to `stop_instance` via keyword arguments. Note that at
628
+ # least one keyword argument is required. To specify no parameters, or to keep all
629
+ # the default parameter values, pass an empty Hash as a request object (see above).
630
+ #
631
+ # @param name [::String]
632
+ # Required. The name of the Instance to stop.
633
+ # Format:
634
+ # `projects/{project}/locations/{location}/instances/{instance}`,
635
+ # where `{project}` can be project id or number.
636
+ # @param validate_only [::Boolean]
637
+ # Optional. Indicates that the request should be validated without actually
638
+ # stopping any resources.
639
+ # @param etag [::String]
640
+ # Optional. A system-generated fingerprint for this version of the resource.
641
+ # This may be used to detect modification conflict during updates.
642
+ #
643
+ # @yield [response, operation] Access the result along with the RPC operation
644
+ # @yieldparam response [::Gapic::Operation]
645
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
646
+ #
647
+ # @return [::Gapic::Operation]
648
+ #
649
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
650
+ #
651
+ # @example Basic example
652
+ # require "google/cloud/run/v2"
653
+ #
654
+ # # Create a client object. The client can be reused for multiple calls.
655
+ # client = Google::Cloud::Run::V2::Instances::Client.new
656
+ #
657
+ # # Create a request. To set request fields, pass in keyword arguments.
658
+ # request = Google::Cloud::Run::V2::StopInstanceRequest.new
659
+ #
660
+ # # Call the stop_instance method.
661
+ # result = client.stop_instance request
662
+ #
663
+ # # The returned object is of type Gapic::Operation. You can use it to
664
+ # # check the status of an operation, cancel it, or wait for results.
665
+ # # Here is how to wait for a response.
666
+ # result.wait_until_done! timeout: 60
667
+ # if result.response?
668
+ # p result.response
669
+ # else
670
+ # puts "No response received."
671
+ # end
672
+ #
673
+ def stop_instance request, options = nil
674
+ raise ::ArgumentError, "request must be provided" if request.nil?
675
+
676
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::StopInstanceRequest
677
+
678
+ # Converts hash and nil to an options object
679
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
680
+
681
+ # Customize the options with defaults
682
+ metadata = @config.rpcs.stop_instance.metadata.to_h
683
+
684
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
685
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
686
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
687
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
688
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
689
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
690
+
691
+ header_params = {}
692
+ if request.name
693
+ header_params["name"] = request.name
694
+ end
695
+
696
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
697
+ metadata[:"x-goog-request-params"] ||= request_params_header
698
+
699
+ options.apply_defaults timeout: @config.rpcs.stop_instance.timeout,
700
+ metadata: metadata,
701
+ retry_policy: @config.rpcs.stop_instance.retry_policy
702
+
703
+ options.apply_defaults timeout: @config.timeout,
704
+ metadata: @config.metadata,
705
+ retry_policy: @config.retry_policy
706
+
707
+ @instances_stub.call_rpc :stop_instance, request, options: options do |response, operation|
708
+ response = ::Gapic::Operation.new response, @operations_client, options: options
709
+ yield response, operation if block_given?
710
+ throw :response, response
711
+ end
712
+ rescue ::GRPC::BadStatus => e
713
+ raise ::Google::Cloud::Error.from_error(e)
714
+ end
715
+
716
+ ##
717
+ # Starts an Instance.
718
+ #
719
+ # @overload start_instance(request, options = nil)
720
+ # Pass arguments to `start_instance` via a request object, either of type
721
+ # {::Google::Cloud::Run::V2::StartInstanceRequest} or an equivalent Hash.
722
+ #
723
+ # @param request [::Google::Cloud::Run::V2::StartInstanceRequest, ::Hash]
724
+ # A request object representing the call parameters. Required. To specify no
725
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
726
+ # @param options [::Gapic::CallOptions, ::Hash]
727
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
728
+ #
729
+ # @overload start_instance(name: nil, validate_only: nil, etag: nil)
730
+ # Pass arguments to `start_instance` via keyword arguments. Note that at
731
+ # least one keyword argument is required. To specify no parameters, or to keep all
732
+ # the default parameter values, pass an empty Hash as a request object (see above).
733
+ #
734
+ # @param name [::String]
735
+ # Required. The name of the Instance to stop.
736
+ # Format:
737
+ # `projects/{project}/locations/{location}/instances/{instance}`,
738
+ # where `{project}` can be project id or number.
739
+ # @param validate_only [::Boolean]
740
+ # Optional. Indicates that the request should be validated without actually
741
+ # stopping any resources.
742
+ # @param etag [::String]
743
+ # Optional. A system-generated fingerprint for this version of the resource.
744
+ # This may be used to detect modification conflict during updates.
745
+ #
746
+ # @yield [response, operation] Access the result along with the RPC operation
747
+ # @yieldparam response [::Gapic::Operation]
748
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
749
+ #
750
+ # @return [::Gapic::Operation]
751
+ #
752
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
753
+ #
754
+ # @example Basic example
755
+ # require "google/cloud/run/v2"
756
+ #
757
+ # # Create a client object. The client can be reused for multiple calls.
758
+ # client = Google::Cloud::Run::V2::Instances::Client.new
759
+ #
760
+ # # Create a request. To set request fields, pass in keyword arguments.
761
+ # request = Google::Cloud::Run::V2::StartInstanceRequest.new
762
+ #
763
+ # # Call the start_instance method.
764
+ # result = client.start_instance request
765
+ #
766
+ # # The returned object is of type Gapic::Operation. You can use it to
767
+ # # check the status of an operation, cancel it, or wait for results.
768
+ # # Here is how to wait for a response.
769
+ # result.wait_until_done! timeout: 60
770
+ # if result.response?
771
+ # p result.response
772
+ # else
773
+ # puts "No response received."
774
+ # end
775
+ #
776
+ def start_instance request, options = nil
777
+ raise ::ArgumentError, "request must be provided" if request.nil?
778
+
779
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::StartInstanceRequest
780
+
781
+ # Converts hash and nil to an options object
782
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
783
+
784
+ # Customize the options with defaults
785
+ metadata = @config.rpcs.start_instance.metadata.to_h
786
+
787
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
788
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
789
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
790
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
791
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
792
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
793
+
794
+ header_params = {}
795
+ if request.name
796
+ header_params["name"] = request.name
797
+ end
798
+
799
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
800
+ metadata[:"x-goog-request-params"] ||= request_params_header
801
+
802
+ options.apply_defaults timeout: @config.rpcs.start_instance.timeout,
803
+ metadata: metadata,
804
+ retry_policy: @config.rpcs.start_instance.retry_policy
805
+
806
+ options.apply_defaults timeout: @config.timeout,
807
+ metadata: @config.metadata,
808
+ retry_policy: @config.retry_policy
809
+
810
+ @instances_stub.call_rpc :start_instance, request, options: options do |response, operation|
811
+ response = ::Gapic::Operation.new response, @operations_client, options: options
812
+ yield response, operation if block_given?
813
+ throw :response, response
814
+ end
815
+ rescue ::GRPC::BadStatus => e
816
+ raise ::Google::Cloud::Error.from_error(e)
817
+ end
818
+
819
+ ##
820
+ # Configuration class for the Instances API.
821
+ #
822
+ # This class represents the configuration for Instances,
823
+ # providing control over timeouts, retry behavior, logging, transport
824
+ # parameters, and other low-level controls. Certain parameters can also be
825
+ # applied individually to specific RPCs. See
826
+ # {::Google::Cloud::Run::V2::Instances::Client::Configuration::Rpcs}
827
+ # for a list of RPCs that can be configured independently.
828
+ #
829
+ # Configuration can be applied globally to all clients, or to a single client
830
+ # on construction.
831
+ #
832
+ # @example
833
+ #
834
+ # # Modify the global config, setting the timeout for
835
+ # # create_instance to 20 seconds,
836
+ # # and all remaining timeouts to 10 seconds.
837
+ # ::Google::Cloud::Run::V2::Instances::Client.configure do |config|
838
+ # config.timeout = 10.0
839
+ # config.rpcs.create_instance.timeout = 20.0
840
+ # end
841
+ #
842
+ # # Apply the above configuration only to a new client.
843
+ # client = ::Google::Cloud::Run::V2::Instances::Client.new do |config|
844
+ # config.timeout = 10.0
845
+ # config.rpcs.create_instance.timeout = 20.0
846
+ # end
847
+ #
848
+ # @!attribute [rw] endpoint
849
+ # A custom service endpoint, as a hostname or hostname:port. The default is
850
+ # nil, indicating to use the default endpoint in the current universe domain.
851
+ # @return [::String,nil]
852
+ # @!attribute [rw] credentials
853
+ # Credentials to send with calls. You may provide any of the following types:
854
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
855
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
856
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
857
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
858
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
859
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
860
+ # * (`nil`) indicating no credentials
861
+ #
862
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
863
+ # is deprecated. Providing an unvalidated credential configuration to
864
+ # Google APIs can compromise the security of your systems and data.
865
+ #
866
+ # @example
867
+ #
868
+ # # The recommended way to provide credentials is to use the `make_creds` method
869
+ # # on the appropriate credentials class for your environment.
870
+ #
871
+ # require "googleauth"
872
+ #
873
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
874
+ # json_key_io: ::File.open("/path/to/keyfile.json")
875
+ # )
876
+ #
877
+ # client = ::Google::Cloud::Run::V2::Instances::Client.new do |config|
878
+ # config.credentials = credentials
879
+ # end
880
+ #
881
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
882
+ # external source for authentication to Google Cloud, you must validate it before
883
+ # providing it to a Google API client library. Providing an unvalidated credential
884
+ # configuration to Google APIs can compromise the security of your systems and data.
885
+ # For more information, refer to [Validate credential configurations from external
886
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
887
+ # @return [::Object]
888
+ # @!attribute [rw] scope
889
+ # The OAuth scopes
890
+ # @return [::Array<::String>]
891
+ # @!attribute [rw] lib_name
892
+ # The library name as recorded in instrumentation and logging
893
+ # @return [::String]
894
+ # @!attribute [rw] lib_version
895
+ # The library version as recorded in instrumentation and logging
896
+ # @return [::String]
897
+ # @!attribute [rw] channel_args
898
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
899
+ # `GRPC::Core::Channel` object is provided as the credential.
900
+ # @return [::Hash]
901
+ # @!attribute [rw] interceptors
902
+ # An array of interceptors that are run before calls are executed.
903
+ # @return [::Array<::GRPC::ClientInterceptor>]
904
+ # @!attribute [rw] timeout
905
+ # The call timeout in seconds.
906
+ # @return [::Numeric]
907
+ # @!attribute [rw] metadata
908
+ # Additional gRPC headers to be sent with the call.
909
+ # @return [::Hash{::Symbol=>::String}]
910
+ # @!attribute [rw] retry_policy
911
+ # The retry policy. The value is a hash with the following keys:
912
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
913
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
914
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
915
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
916
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
917
+ # trigger a retry.
918
+ # @return [::Hash]
919
+ # @!attribute [rw] quota_project
920
+ # A separate project against which to charge quota.
921
+ # @return [::String]
922
+ # @!attribute [rw] universe_domain
923
+ # The universe domain within which to make requests. This determines the
924
+ # default endpoint URL. The default value of nil uses the environment
925
+ # universe (usually the default "googleapis.com" universe).
926
+ # @return [::String,nil]
927
+ # @!attribute [rw] logger
928
+ # A custom logger to use for request/response debug logging, or the value
929
+ # `:default` (the default) to construct a default logger, or `nil` to
930
+ # explicitly disable logging.
931
+ # @return [::Logger,:default,nil]
932
+ #
933
+ class Configuration
934
+ extend ::Gapic::Config
935
+
936
+ # @private
937
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
938
+ DEFAULT_ENDPOINT = "run.googleapis.com"
939
+
940
+ config_attr :endpoint, nil, ::String, nil
941
+ config_attr :credentials, nil do |value|
942
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
943
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
944
+ allowed.any? { |klass| klass === value }
945
+ end
946
+ config_attr :scope, nil, ::String, ::Array, nil
947
+ config_attr :lib_name, nil, ::String, nil
948
+ config_attr :lib_version, nil, ::String, nil
949
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
950
+ config_attr :interceptors, nil, ::Array, nil
951
+ config_attr :timeout, nil, ::Numeric, nil
952
+ config_attr :metadata, nil, ::Hash, nil
953
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
954
+ config_attr :quota_project, nil, ::String, nil
955
+ config_attr :universe_domain, nil, ::String, nil
956
+ config_attr :logger, :default, ::Logger, nil, :default
957
+
958
+ # @private
959
+ def initialize parent_config = nil
960
+ @parent_config = parent_config unless parent_config.nil?
961
+
962
+ yield self if block_given?
963
+ end
964
+
965
+ ##
966
+ # Configurations for individual RPCs
967
+ # @return [Rpcs]
968
+ #
969
+ def rpcs
970
+ @rpcs ||= begin
971
+ parent_rpcs = nil
972
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
973
+ Rpcs.new parent_rpcs
974
+ end
975
+ end
976
+
977
+ ##
978
+ # Configuration for the channel pool
979
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
980
+ #
981
+ def channel_pool
982
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
983
+ end
984
+
985
+ ##
986
+ # Configuration RPC class for the Instances API.
987
+ #
988
+ # Includes fields providing the configuration for each RPC in this service.
989
+ # Each configuration object is of type `Gapic::Config::Method` and includes
990
+ # the following configuration fields:
991
+ #
992
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
993
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
994
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
995
+ # include the following keys:
996
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
997
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
998
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
999
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1000
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1001
+ # trigger a retry.
1002
+ #
1003
+ class Rpcs
1004
+ ##
1005
+ # RPC-specific configuration for `create_instance`
1006
+ # @return [::Gapic::Config::Method]
1007
+ #
1008
+ attr_reader :create_instance
1009
+ ##
1010
+ # RPC-specific configuration for `delete_instance`
1011
+ # @return [::Gapic::Config::Method]
1012
+ #
1013
+ attr_reader :delete_instance
1014
+ ##
1015
+ # RPC-specific configuration for `get_instance`
1016
+ # @return [::Gapic::Config::Method]
1017
+ #
1018
+ attr_reader :get_instance
1019
+ ##
1020
+ # RPC-specific configuration for `list_instances`
1021
+ # @return [::Gapic::Config::Method]
1022
+ #
1023
+ attr_reader :list_instances
1024
+ ##
1025
+ # RPC-specific configuration for `stop_instance`
1026
+ # @return [::Gapic::Config::Method]
1027
+ #
1028
+ attr_reader :stop_instance
1029
+ ##
1030
+ # RPC-specific configuration for `start_instance`
1031
+ # @return [::Gapic::Config::Method]
1032
+ #
1033
+ attr_reader :start_instance
1034
+
1035
+ # @private
1036
+ def initialize parent_rpcs = nil
1037
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1038
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
1039
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1040
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1041
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1042
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
1043
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1044
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
1045
+ stop_instance_config = parent_rpcs.stop_instance if parent_rpcs.respond_to? :stop_instance
1046
+ @stop_instance = ::Gapic::Config::Method.new stop_instance_config
1047
+ start_instance_config = parent_rpcs.start_instance if parent_rpcs.respond_to? :start_instance
1048
+ @start_instance = ::Gapic::Config::Method.new start_instance_config
1049
+
1050
+ yield self if block_given?
1051
+ end
1052
+ end
1053
+ end
1054
+ end
1055
+ end
1056
+ end
1057
+ end
1058
+ end
1059
+ end