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