google-cloud-run-v2 0.12.0 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -99
  3. data/lib/google/cloud/run/v2/executions/client.rb +39 -14
  4. data/lib/google/cloud/run/v2/executions/operations.rb +28 -6
  5. data/lib/google/cloud/run/v2/executions/rest/client.rb +37 -9
  6. data/lib/google/cloud/run/v2/executions/rest/operations.rb +33 -8
  7. data/lib/google/cloud/run/v2/executions/rest/service_stub.rb +23 -2
  8. data/lib/google/cloud/run/v2/jobs/client.rb +39 -14
  9. data/lib/google/cloud/run/v2/jobs/operations.rb +28 -6
  10. data/lib/google/cloud/run/v2/jobs/rest/client.rb +37 -9
  11. data/lib/google/cloud/run/v2/jobs/rest/operations.rb +33 -8
  12. data/lib/google/cloud/run/v2/jobs/rest/service_stub.rb +23 -2
  13. data/lib/google/cloud/run/v2/revisions/client.rb +39 -14
  14. data/lib/google/cloud/run/v2/revisions/operations.rb +28 -6
  15. data/lib/google/cloud/run/v2/revisions/rest/client.rb +37 -9
  16. data/lib/google/cloud/run/v2/revisions/rest/operations.rb +33 -8
  17. data/lib/google/cloud/run/v2/revisions/rest/service_stub.rb +23 -2
  18. data/lib/google/cloud/run/v2/services/client.rb +39 -14
  19. data/lib/google/cloud/run/v2/services/operations.rb +28 -6
  20. data/lib/google/cloud/run/v2/services/rest/client.rb +37 -9
  21. data/lib/google/cloud/run/v2/services/rest/operations.rb +33 -8
  22. data/lib/google/cloud/run/v2/services/rest/service_stub.rb +23 -2
  23. data/lib/google/cloud/run/v2/tasks/client.rb +38 -14
  24. data/lib/google/cloud/run/v2/tasks/rest/client.rb +36 -9
  25. data/lib/google/cloud/run/v2/tasks/rest/service_stub.rb +23 -2
  26. data/lib/google/cloud/run/v2/version.rb +1 -1
  27. data/proto_docs/google/api/client.rb +14 -0
  28. metadata +7 -7
@@ -26,6 +26,9 @@ module Google
26
26
  module Rest
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
31
+
29
32
  # @private
30
33
  attr_reader :operations_stub
31
34
 
@@ -60,6 +63,15 @@ module Google
60
63
  @config
61
64
  end
62
65
 
66
+ ##
67
+ # The effective universe domain
68
+ #
69
+ # @return [String]
70
+ #
71
+ def universe_domain
72
+ @operations_stub.universe_domain
73
+ end
74
+
63
75
  ##
64
76
  # Create a new Operations client object.
65
77
  #
@@ -84,8 +96,10 @@ module Google
84
96
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
85
97
 
86
98
  @operations_stub = OperationsServiceStub.new(
87
- endpoint: @config.endpoint,
88
- credentials: credentials
99
+ endpoint: @config.endpoint,
100
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
101
+ universe_domain: @config.universe_domain,
102
+ credentials: credentials
89
103
  )
90
104
 
91
105
  # Used by an LRO wrapper for some methods of this service
@@ -576,9 +590,9 @@ module Google
576
590
  # end
577
591
  #
578
592
  # @!attribute [rw] endpoint
579
- # The hostname or hostname:port of the service endpoint.
580
- # Defaults to `"run.googleapis.com"`.
581
- # @return [::String]
593
+ # A custom service endpoint, as a hostname or hostname:port. The default is
594
+ # nil, indicating to use the default endpoint in the current universe domain.
595
+ # @return [::String,nil]
582
596
  # @!attribute [rw] credentials
583
597
  # Credentials to send with calls. You may provide any of the following types:
584
598
  # * (`String`) The path to a service account key file in JSON format
@@ -615,13 +629,20 @@ module Google
615
629
  # @!attribute [rw] quota_project
616
630
  # A separate project against which to charge quota.
617
631
  # @return [::String]
632
+ # @!attribute [rw] universe_domain
633
+ # The universe domain within which to make requests. This determines the
634
+ # default endpoint URL. The default value of nil uses the environment
635
+ # universe (usually the default "googleapis.com" universe).
636
+ # @return [::String,nil]
618
637
  #
619
638
  class Configuration
620
639
  extend ::Gapic::Config
621
640
 
641
+ # @private
642
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
622
643
  DEFAULT_ENDPOINT = "run.googleapis.com"
623
644
 
624
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
645
+ config_attr :endpoint, nil, ::String, nil
625
646
  config_attr :credentials, nil do |value|
626
647
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
627
648
  allowed.any? { |klass| klass === value }
@@ -633,6 +654,7 @@ module Google
633
654
  config_attr :metadata, nil, ::Hash, nil
634
655
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
635
656
  config_attr :quota_project, nil, ::String, nil
657
+ config_attr :universe_domain, nil, ::String, nil
636
658
 
637
659
  # @private
638
660
  def initialize parent_config = nil
@@ -722,12 +744,15 @@ module Google
722
744
  # Service stub contains baseline method implementations
723
745
  # including transcoding, making the REST call, and deserialing the response.
724
746
  class OperationsServiceStub
725
- def initialize endpoint:, credentials:
747
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
726
748
  # These require statements are intentionally placed here to initialize
727
749
  # the REST modules only when it's required.
728
750
  require "gapic/rest"
729
751
 
730
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
752
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
753
+ endpoint_template: endpoint_template,
754
+ universe_domain: universe_domain,
755
+ credentials: credentials
731
756
  end
732
757
 
733
758
  ##
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the create_service REST call
45
66
  #
@@ -31,6 +31,9 @@ module Google
31
31
  # Cloud Run Task Control Plane API.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
36
+
34
37
  include Paths
35
38
 
36
39
  # @private
@@ -91,6 +94,15 @@ module Google
91
94
  @config
92
95
  end
93
96
 
97
+ ##
98
+ # The effective universe domain
99
+ #
100
+ # @return [String]
101
+ #
102
+ def universe_domain
103
+ @tasks_stub.universe_domain
104
+ end
105
+
94
106
  ##
95
107
  # Create a new Tasks client object.
96
108
  #
@@ -124,8 +136,9 @@ module Google
124
136
  credentials = @config.credentials
125
137
  # Use self-signed JWT if the endpoint is unchanged from default,
126
138
  # but only if the default endpoint does not have a region prefix.
127
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
128
- !@config.endpoint.split(".").first.include?("-")
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
129
142
  credentials ||= Credentials.default scope: @config.scope,
130
143
  enable_self_signed_jwt: enable_self_signed_jwt
131
144
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -134,20 +147,23 @@ module Google
134
147
  @quota_project_id = @config.quota_project
135
148
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
136
149
 
137
- @location_client = Google::Cloud::Location::Locations::Client.new do |config|
138
- config.credentials = credentials
139
- config.quota_project = @quota_project_id
140
- config.endpoint = @config.endpoint
141
- end
142
-
143
150
  @tasks_stub = ::Gapic::ServiceStub.new(
144
151
  ::Google::Cloud::Run::V2::Tasks::Stub,
145
- credentials: credentials,
146
- endpoint: @config.endpoint,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
155
+ universe_domain: @config.universe_domain,
147
156
  channel_args: @config.channel_args,
148
157
  interceptors: @config.interceptors,
149
158
  channel_pool_config: @config.channel_pool
150
159
  )
160
+
161
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
162
+ config.credentials = credentials
163
+ config.quota_project = @quota_project_id
164
+ config.endpoint = @tasks_stub.endpoint
165
+ config.universe_domain = @tasks_stub.universe_domain
166
+ end
151
167
  end
152
168
 
153
169
  ##
@@ -376,9 +392,9 @@ module Google
376
392
  # end
377
393
  #
378
394
  # @!attribute [rw] endpoint
379
- # The hostname or hostname:port of the service endpoint.
380
- # Defaults to `"run.googleapis.com"`.
381
- # @return [::String]
395
+ # A custom service endpoint, as a hostname or hostname:port. The default is
396
+ # nil, indicating to use the default endpoint in the current universe domain.
397
+ # @return [::String,nil]
382
398
  # @!attribute [rw] credentials
383
399
  # Credentials to send with calls. You may provide any of the following types:
384
400
  # * (`String`) The path to a service account key file in JSON format
@@ -424,13 +440,20 @@ module Google
424
440
  # @!attribute [rw] quota_project
425
441
  # A separate project against which to charge quota.
426
442
  # @return [::String]
443
+ # @!attribute [rw] universe_domain
444
+ # The universe domain within which to make requests. This determines the
445
+ # default endpoint URL. The default value of nil uses the environment
446
+ # universe (usually the default "googleapis.com" universe).
447
+ # @return [::String,nil]
427
448
  #
428
449
  class Configuration
429
450
  extend ::Gapic::Config
430
451
 
452
+ # @private
453
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
431
454
  DEFAULT_ENDPOINT = "run.googleapis.com"
432
455
 
433
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
456
+ config_attr :endpoint, nil, ::String, nil
434
457
  config_attr :credentials, nil do |value|
435
458
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
436
459
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -445,6 +468,7 @@ module Google
445
468
  config_attr :metadata, nil, ::Hash, nil
446
469
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
447
470
  config_attr :quota_project, nil, ::String, nil
471
+ config_attr :universe_domain, nil, ::String, nil
448
472
 
449
473
  # @private
450
474
  def initialize parent_config = nil
@@ -33,6 +33,9 @@ module Google
33
33
  # Cloud Run Task Control Plane API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
38
+
36
39
  include Paths
37
40
 
38
41
  # @private
@@ -93,6 +96,15 @@ module Google
93
96
  @config
94
97
  end
95
98
 
99
+ ##
100
+ # The effective universe domain
101
+ #
102
+ # @return [String]
103
+ #
104
+ def universe_domain
105
+ @tasks_stub.universe_domain
106
+ end
107
+
96
108
  ##
97
109
  # Create a new Tasks REST client object.
98
110
  #
@@ -120,8 +132,9 @@ module Google
120
132
  credentials = @config.credentials
121
133
  # Use self-signed JWT if the endpoint is unchanged from default,
122
134
  # but only if the default endpoint does not have a region prefix.
123
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
124
- !@config.endpoint.split(".").first.include?("-")
135
+ enable_self_signed_jwt = @config.endpoint.nil? ||
136
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
137
+ !@config.endpoint.split(".").first.include?("-"))
125
138
  credentials ||= Credentials.default scope: @config.scope,
126
139
  enable_self_signed_jwt: enable_self_signed_jwt
127
140
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -131,13 +144,19 @@ module Google
131
144
  @quota_project_id = @config.quota_project
132
145
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
133
146
 
147
+ @tasks_stub = ::Google::Cloud::Run::V2::Tasks::Rest::ServiceStub.new(
148
+ endpoint: @config.endpoint,
149
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
150
+ universe_domain: @config.universe_domain,
151
+ credentials: credentials
152
+ )
153
+
134
154
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
135
155
  config.credentials = credentials
136
156
  config.quota_project = @quota_project_id
137
- config.endpoint = @config.endpoint
157
+ config.endpoint = @tasks_stub.endpoint
158
+ config.universe_domain = @tasks_stub.universe_domain
138
159
  end
139
-
140
- @tasks_stub = ::Google::Cloud::Run::V2::Tasks::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
141
160
  end
142
161
 
143
162
  ##
@@ -352,9 +371,9 @@ module Google
352
371
  # end
353
372
  #
354
373
  # @!attribute [rw] endpoint
355
- # The hostname or hostname:port of the service endpoint.
356
- # Defaults to `"run.googleapis.com"`.
357
- # @return [::String]
374
+ # A custom service endpoint, as a hostname or hostname:port. The default is
375
+ # nil, indicating to use the default endpoint in the current universe domain.
376
+ # @return [::String,nil]
358
377
  # @!attribute [rw] credentials
359
378
  # Credentials to send with calls. You may provide any of the following types:
360
379
  # * (`String`) The path to a service account key file in JSON format
@@ -391,13 +410,20 @@ module Google
391
410
  # @!attribute [rw] quota_project
392
411
  # A separate project against which to charge quota.
393
412
  # @return [::String]
413
+ # @!attribute [rw] universe_domain
414
+ # The universe domain within which to make requests. This determines the
415
+ # default endpoint URL. The default value of nil uses the environment
416
+ # universe (usually the default "googleapis.com" universe).
417
+ # @return [::String,nil]
394
418
  #
395
419
  class Configuration
396
420
  extend ::Gapic::Config
397
421
 
422
+ # @private
423
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
398
424
  DEFAULT_ENDPOINT = "run.googleapis.com"
399
425
 
400
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
426
+ config_attr :endpoint, nil, ::String, nil
401
427
  config_attr :credentials, nil do |value|
402
428
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
403
429
  allowed.any? { |klass| klass === value }
@@ -409,6 +435,7 @@ module Google
409
435
  config_attr :metadata, nil, ::Hash, nil
410
436
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
411
437
  config_attr :quota_project, nil, ::String, nil
438
+ config_attr :universe_domain, nil, ::String, nil
412
439
 
413
440
  # @private
414
441
  def initialize parent_config = nil
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the get_task REST call
45
66
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Run
23
23
  module V2
24
- VERSION = "0.12.0"
24
+ VERSION = "0.13.1"
25
25
  end
26
26
  end
27
27
  end
@@ -21,6 +21,7 @@ module Google
21
21
  module Api
22
22
  # Required information for every language.
23
23
  # @!attribute [rw] reference_docs_uri
24
+ # @deprecated This field is deprecated and may be removed in the next major version update.
24
25
  # @return [::String]
25
26
  # Link to automatically generated reference documentation. Example:
26
27
  # https://cloud.google.com/nodejs/docs/reference/asset/latest
@@ -304,6 +305,19 @@ module Google
304
305
  # seconds: 360 # 6 minutes
305
306
  # total_poll_timeout:
306
307
  # seconds: 54000 # 90 minutes
308
+ # @!attribute [rw] auto_populated_fields
309
+ # @return [::Array<::String>]
310
+ # List of top-level fields of the request message, that should be
311
+ # automatically populated by the client libraries based on their
312
+ # (google.api.field_info).format. Currently supported format: UUID4.
313
+ #
314
+ # Example of a YAML configuration:
315
+ #
316
+ # publishing:
317
+ # method_settings:
318
+ # - selector: google.example.v1.ExampleService.CreateExample
319
+ # auto_populated_fields:
320
+ # - request_id
307
321
  class MethodSettings
308
322
  include ::Google::Protobuf::MessageExts
309
323
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-run-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-29 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.20.0
19
+ version: 0.21.1
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.20.0
29
+ version: 0.21.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '0.4'
53
+ version: '0.7'
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 2.a
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: '0.4'
63
+ version: '0.7'
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: 2.a
@@ -315,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
315
  - !ruby/object:Gem::Version
316
316
  version: '0'
317
317
  requirements: []
318
- rubygems_version: 3.4.19
318
+ rubygems_version: 3.5.3
319
319
  signing_key:
320
320
  specification_version: 4
321
321
  summary: Deploy and manage user provided container images that scale automatically