google-cloud-run-client 1.4.0 → 1.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83ec48aa543fedbde16fe74a8448d07953af89eb4797dc06e4ab398825ee7aad
4
- data.tar.gz: b3280abe889dcafdd7f6a0582979f8701bd1bc16c1cd806efba2d32b1e5c2ecd
3
+ metadata.gz: 9deb4e7a17fb17b59e147c9829647380d991fee6b78236845befbf82f3dd2939
4
+ data.tar.gz: f3010e86705e8fbf2fb30ff6e02b7128944fa2795e9f065f99e969f7205398f7
5
5
  SHA512:
6
- metadata.gz: 84a2f8d4ed72ac9019b002b42007454779c9584f1a78a722f4997d99f6fab4bdb53e041c5e658c046376875bf72e67a373a6b99626044189b958e74146164176
7
- data.tar.gz: f1795b28827c67601c1887c0155e2075a00035c0c740822d71a6afd8903c8abdc1f0f95ccbb1e5a2c858178f89138c5d5b2d2c5dea2d2bf9612d1ce56e4f8c81
6
+ metadata.gz: bac9d3d8caa245c7ef3ae42dfa9979b482b449d851e984006d55f6293ef4d805db08c0d8eecd4e13a2e6b21329fcba7294795ecf0139d69b06d1cb84360f254c
7
+ data.tar.gz: d54194d14a57cb4114fe90c70350ef979e355bf0ea35711d2f68dc09d94e290f1fe480fb92c4da64324516ec3b81f984b29a0bad34fe2397f60efd09d5bcce71
data/README.md CHANGED
@@ -7,7 +7,7 @@ Cloud Run deploys and manages user provided container images that scale automati
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-cloud-run-v*`.
9
9
  The gem `google-cloud-run-client` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -18,7 +18,7 @@ module Google
18
18
  module Cloud
19
19
  module Run
20
20
  module Client
21
- VERSION = "1.4.0"
21
+ VERSION = "1.5.0"
22
22
  end
23
23
  end
24
24
  end
@@ -465,6 +465,76 @@ module Google
465
465
  false
466
466
  end
467
467
 
468
+ ##
469
+ # Create a new client object for WorkerPools.
470
+ #
471
+ # By default, this returns an instance of
472
+ # [Google::Cloud::Run::V2::WorkerPools::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-WorkerPools-Client)
473
+ # for a gRPC client for version V2 of the API.
474
+ # However, you can specify a different API version by passing it in the
475
+ # `version` parameter. If the WorkerPools service is
476
+ # supported by that API version, and the corresponding gem is available, the
477
+ # appropriate versioned client will be returned.
478
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
479
+ # the `transport` parameter.
480
+ #
481
+ # Raises an exception if the currently installed versioned client gem for the
482
+ # given API version does not support the given transport of the WorkerPools service.
483
+ # You can determine whether the method will succeed by calling
484
+ # {Google::Cloud::Run.worker_pools_available?}.
485
+ #
486
+ # ## About WorkerPools
487
+ #
488
+ # Cloud Run WorkerPool Control Plane API.
489
+ #
490
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
491
+ # Defaults to `:v2`.
492
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
493
+ # @return [::Object] A client object for the specified version.
494
+ #
495
+ def self.worker_pools version: :v2, transport: :grpc, &block
496
+ require "google/cloud/run/#{version.to_s.downcase}"
497
+
498
+ package_name = Google::Cloud::Run
499
+ .constants
500
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
501
+ .first
502
+ service_module = Google::Cloud::Run.const_get(package_name).const_get(:WorkerPools)
503
+ service_module = service_module.const_get(:Rest) if transport == :rest
504
+ service_module.const_get(:Client).new(&block)
505
+ end
506
+
507
+ ##
508
+ # Determines whether the WorkerPools service is supported by the current client.
509
+ # If true, you can retrieve a client object by calling {Google::Cloud::Run.worker_pools}.
510
+ # If false, that method will raise an exception. This could happen if the given
511
+ # API version does not exist or does not support the WorkerPools service,
512
+ # or if the versioned client gem needs an update to support the WorkerPools service.
513
+ #
514
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
515
+ # Defaults to `:v2`.
516
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
517
+ # @return [boolean] Whether the service is available.
518
+ #
519
+ def self.worker_pools_available? version: :v2, transport: :grpc
520
+ require "google/cloud/run/#{version.to_s.downcase}"
521
+ package_name = Google::Cloud::Run
522
+ .constants
523
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
524
+ .first
525
+ return false unless package_name
526
+ service_module = Google::Cloud::Run.const_get package_name
527
+ return false unless service_module.const_defined? :WorkerPools
528
+ service_module = service_module.const_get :WorkerPools
529
+ if transport == :rest
530
+ return false unless service_module.const_defined? :Rest
531
+ service_module = service_module.const_get :Rest
532
+ end
533
+ service_module.const_defined? :Client
534
+ rescue ::LoadError
535
+ false
536
+ end
537
+
468
538
  ##
469
539
  # Configure the google-cloud-run-client library.
470
540
  #
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-run-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-29 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: google-cloud-core
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 3.6.2
78
+ rubygems_version: 3.6.9
79
79
  specification_version: 4
80
80
  summary: API Client library for the Cloud Run API
81
81
  test_files: []