google-cloud-run-v2 0.11.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -99
  3. data/lib/google/cloud/run/v2/condition_pb.rb +1 -1
  4. data/lib/google/cloud/run/v2/execution_pb.rb +2 -1
  5. data/lib/google/cloud/run/v2/execution_services_pb.rb +2 -0
  6. data/lib/google/cloud/run/v2/executions/client.rb +148 -14
  7. data/lib/google/cloud/run/v2/executions/operations.rb +28 -6
  8. data/lib/google/cloud/run/v2/executions/rest/client.rb +143 -13
  9. data/lib/google/cloud/run/v2/executions/rest/operations.rb +33 -8
  10. data/lib/google/cloud/run/v2/executions/rest/service_stub.rb +74 -2
  11. data/lib/google/cloud/run/v2/job_pb.rb +8 -1
  12. data/lib/google/cloud/run/v2/jobs/client.rb +67 -21
  13. data/lib/google/cloud/run/v2/jobs/operations.rb +28 -6
  14. data/lib/google/cloud/run/v2/jobs/rest/client.rb +39 -8
  15. data/lib/google/cloud/run/v2/jobs/rest/operations.rb +33 -8
  16. data/lib/google/cloud/run/v2/jobs/rest/service_stub.rb +14 -2
  17. data/lib/google/cloud/run/v2/k8s.min_pb.rb +3 -1
  18. data/lib/google/cloud/run/v2/revisions/client.rb +33 -8
  19. data/lib/google/cloud/run/v2/revisions/operations.rb +28 -6
  20. data/lib/google/cloud/run/v2/revisions/rest/client.rb +35 -7
  21. data/lib/google/cloud/run/v2/revisions/rest/operations.rb +33 -8
  22. data/lib/google/cloud/run/v2/revisions/rest/service_stub.rb +14 -2
  23. data/lib/google/cloud/run/v2/services/client.rb +33 -8
  24. data/lib/google/cloud/run/v2/services/operations.rb +28 -6
  25. data/lib/google/cloud/run/v2/services/rest/client.rb +35 -7
  26. data/lib/google/cloud/run/v2/services/rest/operations.rb +33 -8
  27. data/lib/google/cloud/run/v2/services/rest/service_stub.rb +14 -2
  28. data/lib/google/cloud/run/v2/task_pb.rb +1 -1
  29. data/lib/google/cloud/run/v2/tasks/client.rb +32 -8
  30. data/lib/google/cloud/run/v2/tasks/rest/client.rb +34 -7
  31. data/lib/google/cloud/run/v2/tasks/rest/service_stub.rb +14 -2
  32. data/lib/google/cloud/run/v2/vendor_settings_pb.rb +3 -1
  33. data/lib/google/cloud/run/v2/version.rb +1 -1
  34. data/proto_docs/google/api/client.rb +14 -0
  35. data/proto_docs/google/cloud/run/v2/condition.rb +3 -0
  36. data/proto_docs/google/cloud/run/v2/execution.rb +26 -6
  37. data/proto_docs/google/cloud/run/v2/job.rb +42 -0
  38. data/proto_docs/google/cloud/run/v2/k8s.min.rb +44 -4
  39. data/proto_docs/google/cloud/run/v2/task.rb +7 -2
  40. data/proto_docs/google/cloud/run/v2/vendor_settings.rb +33 -5
  41. metadata +7 -7
@@ -31,6 +31,9 @@ module Google
31
31
  # Cloud Run Job 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
+ @jobs_stub.universe_domain
104
+ end
105
+
94
106
  ##
95
107
  # Create a new Jobs 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)
@@ -138,18 +151,22 @@ module Google
138
151
  config.credentials = credentials
139
152
  config.quota_project = @quota_project_id
140
153
  config.endpoint = @config.endpoint
154
+ config.universe_domain = @config.universe_domain
141
155
  end
142
156
 
143
157
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
144
158
  config.credentials = credentials
145
159
  config.quota_project = @quota_project_id
146
160
  config.endpoint = @config.endpoint
161
+ config.universe_domain = @config.universe_domain
147
162
  end
148
163
 
149
164
  @jobs_stub = ::Gapic::ServiceStub.new(
150
165
  ::Google::Cloud::Run::V2::Jobs::Stub,
151
- credentials: credentials,
152
- endpoint: @config.endpoint,
166
+ credentials: credentials,
167
+ endpoint: @config.endpoint,
168
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
169
+ universe_domain: @config.universe_domain,
153
170
  channel_args: @config.channel_args,
154
171
  interceptors: @config.interceptors,
155
172
  channel_pool_config: @config.channel_pool
@@ -252,10 +269,13 @@ module Google
252
269
 
253
270
  header_params = {}
254
271
  if request.parent
255
- header_params["parent"] = request.parent
272
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
273
+ if regex_match
274
+ header_params["location"] = regex_match["location".to_s]
275
+ end
256
276
  end
257
277
 
258
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
278
+ request_params_header = URI.encode_www_form header_params
259
279
  metadata[:"x-goog-request-params"] ||= request_params_header
260
280
 
261
281
  options.apply_defaults timeout: @config.rpcs.create_job.timeout,
@@ -340,10 +360,13 @@ module Google
340
360
 
341
361
  header_params = {}
342
362
  if request.name
343
- header_params["name"] = request.name
363
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.name
364
+ if regex_match
365
+ header_params["location"] = regex_match["location".to_s]
366
+ end
344
367
  end
345
368
 
346
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
369
+ request_params_header = URI.encode_www_form header_params
347
370
  metadata[:"x-goog-request-params"] ||= request_params_header
348
371
 
349
372
  options.apply_defaults timeout: @config.rpcs.get_job.timeout,
@@ -438,10 +461,13 @@ module Google
438
461
 
439
462
  header_params = {}
440
463
  if request.parent
441
- header_params["parent"] = request.parent
464
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
465
+ if regex_match
466
+ header_params["location"] = regex_match["location".to_s]
467
+ end
442
468
  end
443
469
 
444
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
470
+ request_params_header = URI.encode_www_form header_params
445
471
  metadata[:"x-goog-request-params"] ||= request_params_header
446
472
 
447
473
  options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
@@ -538,10 +564,13 @@ module Google
538
564
 
539
565
  header_params = {}
540
566
  if request.job&.name
541
- header_params["job.name"] = request.job.name
567
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.job.name
568
+ if regex_match
569
+ header_params["location"] = regex_match["location".to_s]
570
+ end
542
571
  end
543
572
 
544
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
573
+ request_params_header = URI.encode_www_form header_params
545
574
  metadata[:"x-goog-request-params"] ||= request_params_header
546
575
 
547
576
  options.apply_defaults timeout: @config.rpcs.update_job.timeout,
@@ -639,10 +668,13 @@ module Google
639
668
 
640
669
  header_params = {}
641
670
  if request.name
642
- header_params["name"] = request.name
671
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.name
672
+ if regex_match
673
+ header_params["location"] = regex_match["location".to_s]
674
+ end
643
675
  end
644
676
 
645
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
677
+ request_params_header = URI.encode_www_form header_params
646
678
  metadata[:"x-goog-request-params"] ||= request_params_header
647
679
 
648
680
  options.apply_defaults timeout: @config.rpcs.delete_job.timeout,
@@ -675,7 +707,7 @@ module Google
675
707
  # @param options [::Gapic::CallOptions, ::Hash]
676
708
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
677
709
  #
678
- # @overload run_job(name: nil, validate_only: nil, etag: nil)
710
+ # @overload run_job(name: nil, validate_only: nil, etag: nil, overrides: nil)
679
711
  # Pass arguments to `run_job` via keyword arguments. Note that at
680
712
  # least one keyword argument is required. To specify no parameters, or to keep all
681
713
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -690,6 +722,9 @@ module Google
690
722
  # @param etag [::String]
691
723
  # A system-generated fingerprint for this version of the
692
724
  # resource. May be used to detect modification conflict during updates.
725
+ # @param overrides [::Google::Cloud::Run::V2::RunJobRequest::Overrides, ::Hash]
726
+ # Overrides specification for a given execution of a job. If provided,
727
+ # overrides will be applied to update the execution or task spec.
693
728
  #
694
729
  # @yield [response, operation] Access the result along with the RPC operation
695
730
  # @yieldparam response [::Gapic::Operation]
@@ -740,10 +775,13 @@ module Google
740
775
 
741
776
  header_params = {}
742
777
  if request.name
743
- header_params["name"] = request.name
778
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.name
779
+ if regex_match
780
+ header_params["location"] = regex_match["location".to_s]
781
+ end
744
782
  end
745
783
 
746
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
784
+ request_params_header = URI.encode_www_form header_params
747
785
  metadata[:"x-goog-request-params"] ||= request_params_header
748
786
 
749
787
  options.apply_defaults timeout: @config.rpcs.run_job.timeout,
@@ -1074,9 +1112,9 @@ module Google
1074
1112
  # end
1075
1113
  #
1076
1114
  # @!attribute [rw] endpoint
1077
- # The hostname or hostname:port of the service endpoint.
1078
- # Defaults to `"run.googleapis.com"`.
1079
- # @return [::String]
1115
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1116
+ # nil, indicating to use the default endpoint in the current universe domain.
1117
+ # @return [::String,nil]
1080
1118
  # @!attribute [rw] credentials
1081
1119
  # Credentials to send with calls. You may provide any of the following types:
1082
1120
  # * (`String`) The path to a service account key file in JSON format
@@ -1122,13 +1160,20 @@ module Google
1122
1160
  # @!attribute [rw] quota_project
1123
1161
  # A separate project against which to charge quota.
1124
1162
  # @return [::String]
1163
+ # @!attribute [rw] universe_domain
1164
+ # The universe domain within which to make requests. This determines the
1165
+ # default endpoint URL. The default value of nil uses the environment
1166
+ # universe (usually the default "googleapis.com" universe).
1167
+ # @return [::String,nil]
1125
1168
  #
1126
1169
  class Configuration
1127
1170
  extend ::Gapic::Config
1128
1171
 
1172
+ # @private
1173
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1129
1174
  DEFAULT_ENDPOINT = "run.googleapis.com"
1130
1175
 
1131
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1176
+ config_attr :endpoint, nil, ::String, nil
1132
1177
  config_attr :credentials, nil do |value|
1133
1178
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1134
1179
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1143,6 +1188,7 @@ module Google
1143
1188
  config_attr :metadata, nil, ::Hash, nil
1144
1189
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1145
1190
  config_attr :quota_project, nil, ::String, nil
1191
+ config_attr :universe_domain, nil, ::String, nil
1146
1192
 
1147
1193
  # @private
1148
1194
  def initialize parent_config = nil
@@ -26,6 +26,9 @@ module Google
26
26
  module Jobs
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
  #
@@ -90,8 +102,10 @@ module Google
90
102
 
91
103
  @operations_stub = ::Gapic::ServiceStub.new(
92
104
  ::Google::Longrunning::Operations::Stub,
93
- credentials: credentials,
94
- endpoint: @config.endpoint,
105
+ credentials: credentials,
106
+ endpoint: @config.endpoint,
107
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
108
+ universe_domain: @config.universe_domain,
95
109
  channel_args: @config.channel_args,
96
110
  interceptors: @config.interceptors,
97
111
  channel_pool_config: @config.channel_pool
@@ -621,9 +635,9 @@ module Google
621
635
  # end
622
636
  #
623
637
  # @!attribute [rw] endpoint
624
- # The hostname or hostname:port of the service endpoint.
625
- # Defaults to `"run.googleapis.com"`.
626
- # @return [::String]
638
+ # A custom service endpoint, as a hostname or hostname:port. The default is
639
+ # nil, indicating to use the default endpoint in the current universe domain.
640
+ # @return [::String,nil]
627
641
  # @!attribute [rw] credentials
628
642
  # Credentials to send with calls. You may provide any of the following types:
629
643
  # * (`String`) The path to a service account key file in JSON format
@@ -669,13 +683,20 @@ module Google
669
683
  # @!attribute [rw] quota_project
670
684
  # A separate project against which to charge quota.
671
685
  # @return [::String]
686
+ # @!attribute [rw] universe_domain
687
+ # The universe domain within which to make requests. This determines the
688
+ # default endpoint URL. The default value of nil uses the environment
689
+ # universe (usually the default "googleapis.com" universe).
690
+ # @return [::String,nil]
672
691
  #
673
692
  class Configuration
674
693
  extend ::Gapic::Config
675
694
 
695
+ # @private
696
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
676
697
  DEFAULT_ENDPOINT = "run.googleapis.com"
677
698
 
678
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
699
+ config_attr :endpoint, nil, ::String, nil
679
700
  config_attr :credentials, nil do |value|
680
701
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
681
702
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -690,6 +711,7 @@ module Google
690
711
  config_attr :metadata, nil, ::Hash, nil
691
712
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
692
713
  config_attr :quota_project, nil, ::String, nil
714
+ config_attr :universe_domain, nil, ::String, nil
693
715
 
694
716
  # @private
695
717
  def initialize parent_config = nil
@@ -33,6 +33,9 @@ module Google
33
33
  # Cloud Run Job 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
+ @jobs_stub.universe_domain
106
+ end
107
+
96
108
  ##
97
109
  # Create a new Jobs 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)
@@ -135,15 +148,22 @@ module Google
135
148
  config.credentials = credentials
136
149
  config.quota_project = @quota_project_id
137
150
  config.endpoint = @config.endpoint
151
+ config.universe_domain = @config.universe_domain
138
152
  end
139
153
 
140
154
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
141
155
  config.credentials = credentials
142
156
  config.quota_project = @quota_project_id
143
157
  config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
144
159
  end
145
160
 
146
- @jobs_stub = ::Google::Cloud::Run::V2::Jobs::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
161
+ @jobs_stub = ::Google::Cloud::Run::V2::Jobs::Rest::ServiceStub.new(
162
+ endpoint: @config.endpoint,
163
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
164
+ universe_domain: @config.universe_domain,
165
+ credentials: credentials
166
+ )
147
167
  end
148
168
 
149
169
  ##
@@ -630,7 +650,7 @@ module Google
630
650
  # @param options [::Gapic::CallOptions, ::Hash]
631
651
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
632
652
  #
633
- # @overload run_job(name: nil, validate_only: nil, etag: nil)
653
+ # @overload run_job(name: nil, validate_only: nil, etag: nil, overrides: nil)
634
654
  # Pass arguments to `run_job` via keyword arguments. Note that at
635
655
  # least one keyword argument is required. To specify no parameters, or to keep all
636
656
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -645,6 +665,9 @@ module Google
645
665
  # @param etag [::String]
646
666
  # A system-generated fingerprint for this version of the
647
667
  # resource. May be used to detect modification conflict during updates.
668
+ # @param overrides [::Google::Cloud::Run::V2::RunJobRequest::Overrides, ::Hash]
669
+ # Overrides specification for a given execution of a job. If provided,
670
+ # overrides will be applied to update the execution or task spec.
648
671
  # @yield [result, operation] Access the result along with the TransportOperation object
649
672
  # @yieldparam result [::Gapic::Operation]
650
673
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1001,9 +1024,9 @@ module Google
1001
1024
  # end
1002
1025
  #
1003
1026
  # @!attribute [rw] endpoint
1004
- # The hostname or hostname:port of the service endpoint.
1005
- # Defaults to `"run.googleapis.com"`.
1006
- # @return [::String]
1027
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1028
+ # nil, indicating to use the default endpoint in the current universe domain.
1029
+ # @return [::String,nil]
1007
1030
  # @!attribute [rw] credentials
1008
1031
  # Credentials to send with calls. You may provide any of the following types:
1009
1032
  # * (`String`) The path to a service account key file in JSON format
@@ -1040,13 +1063,20 @@ module Google
1040
1063
  # @!attribute [rw] quota_project
1041
1064
  # A separate project against which to charge quota.
1042
1065
  # @return [::String]
1066
+ # @!attribute [rw] universe_domain
1067
+ # The universe domain within which to make requests. This determines the
1068
+ # default endpoint URL. The default value of nil uses the environment
1069
+ # universe (usually the default "googleapis.com" universe).
1070
+ # @return [::String,nil]
1043
1071
  #
1044
1072
  class Configuration
1045
1073
  extend ::Gapic::Config
1046
1074
 
1075
+ # @private
1076
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1047
1077
  DEFAULT_ENDPOINT = "run.googleapis.com"
1048
1078
 
1049
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1079
+ config_attr :endpoint, nil, ::String, nil
1050
1080
  config_attr :credentials, nil do |value|
1051
1081
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1052
1082
  allowed.any? { |klass| klass === value }
@@ -1058,6 +1088,7 @@ module Google
1058
1088
  config_attr :metadata, nil, ::Hash, nil
1059
1089
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1060
1090
  config_attr :quota_project, nil, ::String, nil
1091
+ config_attr :universe_domain, nil, ::String, nil
1061
1092
 
1062
1093
  # @private
1063
1094
  def initialize parent_config = nil
@@ -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,28 @@ 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
+
43
55
  ##
44
56
  # Baseline implementation for the create_job REST call
45
57
  #
@@ -8,7 +8,7 @@ require 'google/api/field_behavior_pb'
8
8
  require 'google/api/resource_pb'
9
9
 
10
10
 
11
- descriptor_data = "\n!google/cloud/run/v2/k8s.min.proto\x12\x13google.cloud.run.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\x9c\x03\n\tContainer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\x05image\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63ommand\x18\x03 \x03(\t\x12\x0c\n\x04\x61rgs\x18\x04 \x03(\t\x12(\n\x03\x65nv\x18\x05 \x03(\x0b\x32\x1b.google.cloud.run.v2.EnvVar\x12<\n\tresources\x18\x06 \x01(\x0b\x32).google.cloud.run.v2.ResourceRequirements\x12\x31\n\x05ports\x18\x07 \x03(\x0b\x32\".google.cloud.run.v2.ContainerPort\x12\x37\n\rvolume_mounts\x18\x08 \x03(\x0b\x32 .google.cloud.run.v2.VolumeMount\x12\x13\n\x0bworking_dir\x18\t \x01(\t\x12\x32\n\x0eliveness_probe\x18\n \x01(\x0b\x32\x1a.google.cloud.run.v2.Probe\x12\x31\n\rstartup_probe\x18\x0b \x01(\x0b\x32\x1a.google.cloud.run.v2.Probe\"\xb9\x01\n\x14ResourceRequirements\x12\x45\n\x06limits\x18\x01 \x03(\x0b\x32\x35.google.cloud.run.v2.ResourceRequirements.LimitsEntry\x12\x10\n\x08\x63pu_idle\x18\x02 \x01(\x08\x12\x19\n\x11startup_cpu_boost\x18\x03 \x01(\x08\x1a-\n\x0bLimitsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"q\n\x06\x45nvVar\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x05value\x18\x02 \x01(\tH\x00\x12\x39\n\x0cvalue_source\x18\x03 \x01(\x0b\x32!.google.cloud.run.v2.EnvVarSourceH\x00\x42\x08\n\x06values\"N\n\x0c\x45nvVarSource\x12>\n\x0esecret_key_ref\x18\x01 \x01(\x0b\x32&.google.cloud.run.v2.SecretKeySelector\"\x92\x01\n\x11SecretKeySelector\x12;\n\x06secret\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12@\n\x07version\x18\x02 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"5\n\rContainerPort\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x16\n\x0e\x63ontainer_port\x18\x03 \x01(\x05\"9\n\x0bVolumeMount\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nmount_path\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xaa\x01\n\x06Volume\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06secret\x18\x02 \x01(\x0b\x32\'.google.cloud.run.v2.SecretVolumeSourceH\x00\x12\x43\n\x12\x63loud_sql_instance\x18\x03 \x01(\x0b\x32%.google.cloud.run.v2.CloudSqlInstanceH\x00\x42\r\n\x0bvolume_type\"r\n\x12SecretVolumeSource\x12\x13\n\x06secret\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x05items\x18\x02 \x03(\x0b\x32\".google.cloud.run.v2.VersionToPath\x12\x14\n\x0c\x64\x65\x66\x61ult_mode\x18\x03 \x01(\x05\"A\n\rVersionToPath\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0c\n\x04mode\x18\x03 \x01(\x05\"%\n\x10\x43loudSqlInstance\x12\x11\n\tinstances\x18\x01 \x03(\t\"\xa5\x02\n\x05Probe\x12\x1d\n\x15initial_delay_seconds\x18\x01 \x01(\x05\x12\x17\n\x0ftimeout_seconds\x18\x02 \x01(\x05\x12\x16\n\x0eperiod_seconds\x18\x03 \x01(\x05\x12\x19\n\x11\x66\x61ilure_threshold\x18\x04 \x01(\x05\x12\x36\n\x08http_get\x18\x05 \x01(\x0b\x32\".google.cloud.run.v2.HTTPGetActionH\x00\x12:\n\ntcp_socket\x18\x06 \x01(\x0b\x32$.google.cloud.run.v2.TCPSocketActionH\x00\x12/\n\x04grpc\x18\x07 \x01(\x0b\x32\x1f.google.cloud.run.v2.GRPCActionH\x00\x42\x0c\n\nprobe_type\"b\n\rHTTPGetAction\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x35\n\x0chttp_headers\x18\x04 \x03(\x0b\x32\x1f.google.cloud.run.v2.HTTPHeader\x12\x0c\n\x04port\x18\x05 \x01(\x05\".\n\nHTTPHeader\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05value\x18\x02 \x01(\t\"\x1f\n\x0fTCPSocketAction\x12\x0c\n\x04port\x18\x01 \x01(\x05\"+\n\nGRPCAction\x12\x0c\n\x04port\x18\x01 \x01(\x05\x12\x0f\n\x07service\x18\x02 \x01(\tB\xe9\x03\n\x17\x63om.google.cloud.run.v2B\x0bK8sMinProtoP\x01Z)cloud.google.com/go/run/apiv2/runpb;runpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41J\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}\xea\x41\x64\n\"vpcaccess.googleapis.com/Connector\x12>projects/{project}/locations/{location}/connectors/{connector}b\x06proto3"
11
+ descriptor_data = "\n!google/cloud/run/v2/k8s.min.proto\x12\x13google.cloud.run.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xb0\x03\n\tContainer\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\x05image\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07\x63ommand\x18\x03 \x03(\t\x12\x0c\n\x04\x61rgs\x18\x04 \x03(\t\x12(\n\x03\x65nv\x18\x05 \x03(\x0b\x32\x1b.google.cloud.run.v2.EnvVar\x12<\n\tresources\x18\x06 \x01(\x0b\x32).google.cloud.run.v2.ResourceRequirements\x12\x31\n\x05ports\x18\x07 \x03(\x0b\x32\".google.cloud.run.v2.ContainerPort\x12\x37\n\rvolume_mounts\x18\x08 \x03(\x0b\x32 .google.cloud.run.v2.VolumeMount\x12\x13\n\x0bworking_dir\x18\t \x01(\t\x12\x32\n\x0eliveness_probe\x18\n \x01(\x0b\x32\x1a.google.cloud.run.v2.Probe\x12\x31\n\rstartup_probe\x18\x0b \x01(\x0b\x32\x1a.google.cloud.run.v2.Probe\x12\x12\n\ndepends_on\x18\x0c \x03(\t\"\xb9\x01\n\x14ResourceRequirements\x12\x45\n\x06limits\x18\x01 \x03(\x0b\x32\x35.google.cloud.run.v2.ResourceRequirements.LimitsEntry\x12\x10\n\x08\x63pu_idle\x18\x02 \x01(\x08\x12\x19\n\x11startup_cpu_boost\x18\x03 \x01(\x08\x1a-\n\x0bLimitsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"q\n\x06\x45nvVar\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x05value\x18\x02 \x01(\tH\x00\x12\x39\n\x0cvalue_source\x18\x03 \x01(\x0b\x32!.google.cloud.run.v2.EnvVarSourceH\x00\x42\x08\n\x06values\"N\n\x0c\x45nvVarSource\x12>\n\x0esecret_key_ref\x18\x01 \x01(\x0b\x32&.google.cloud.run.v2.SecretKeySelector\"\x92\x01\n\x11SecretKeySelector\x12;\n\x06secret\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12@\n\x07version\x18\x02 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"5\n\rContainerPort\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x16\n\x0e\x63ontainer_port\x18\x03 \x01(\x05\"9\n\x0bVolumeMount\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nmount_path\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xea\x01\n\x06Volume\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06secret\x18\x02 \x01(\x0b\x32\'.google.cloud.run.v2.SecretVolumeSourceH\x00\x12\x43\n\x12\x63loud_sql_instance\x18\x03 \x01(\x0b\x32%.google.cloud.run.v2.CloudSqlInstanceH\x00\x12>\n\tempty_dir\x18\x04 \x01(\x0b\x32).google.cloud.run.v2.EmptyDirVolumeSourceH\x00\x42\r\n\x0bvolume_type\"r\n\x12SecretVolumeSource\x12\x13\n\x06secret\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x05items\x18\x02 \x03(\x0b\x32\".google.cloud.run.v2.VersionToPath\x12\x14\n\x0c\x64\x65\x66\x61ult_mode\x18\x03 \x01(\x05\"A\n\rVersionToPath\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0c\n\x04mode\x18\x03 \x01(\x05\"%\n\x10\x43loudSqlInstance\x12\x11\n\tinstances\x18\x01 \x03(\t\"\x9a\x01\n\x14\x45mptyDirVolumeSource\x12@\n\x06medium\x18\x01 \x01(\x0e\x32\x30.google.cloud.run.v2.EmptyDirVolumeSource.Medium\x12\x12\n\nsize_limit\x18\x02 \x01(\t\",\n\x06Medium\x12\x16\n\x12MEDIUM_UNSPECIFIED\x10\x00\x12\n\n\x06MEMORY\x10\x01\"\xa5\x02\n\x05Probe\x12\x1d\n\x15initial_delay_seconds\x18\x01 \x01(\x05\x12\x17\n\x0ftimeout_seconds\x18\x02 \x01(\x05\x12\x16\n\x0eperiod_seconds\x18\x03 \x01(\x05\x12\x19\n\x11\x66\x61ilure_threshold\x18\x04 \x01(\x05\x12\x36\n\x08http_get\x18\x05 \x01(\x0b\x32\".google.cloud.run.v2.HTTPGetActionH\x00\x12:\n\ntcp_socket\x18\x06 \x01(\x0b\x32$.google.cloud.run.v2.TCPSocketActionH\x00\x12/\n\x04grpc\x18\x07 \x01(\x0b\x32\x1f.google.cloud.run.v2.GRPCActionH\x00\x42\x0c\n\nprobe_type\"b\n\rHTTPGetAction\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x35\n\x0chttp_headers\x18\x04 \x03(\x0b\x32\x1f.google.cloud.run.v2.HTTPHeader\x12\x0c\n\x04port\x18\x05 \x01(\x05\".\n\nHTTPHeader\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\r\n\x05value\x18\x02 \x01(\t\"\x1f\n\x0fTCPSocketAction\x12\x0c\n\x04port\x18\x01 \x01(\x05\"+\n\nGRPCAction\x12\x0c\n\x04port\x18\x01 \x01(\x05\x12\x0f\n\x07service\x18\x02 \x01(\tB\xe9\x03\n\x17\x63om.google.cloud.run.v2B\x0bK8sMinProtoP\x01Z)cloud.google.com/go/run/apiv2/runpb;runpb\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41J\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}\xea\x41\x64\n\"vpcaccess.googleapis.com/Connector\x12>projects/{project}/locations/{location}/connectors/{connector}b\x06proto3"
12
12
 
13
13
  pool = Google::Protobuf::DescriptorPool.generated_pool
14
14
 
@@ -49,6 +49,8 @@ module Google
49
49
  SecretVolumeSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.SecretVolumeSource").msgclass
50
50
  VersionToPath = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.VersionToPath").msgclass
51
51
  CloudSqlInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.CloudSqlInstance").msgclass
52
+ EmptyDirVolumeSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.EmptyDirVolumeSource").msgclass
53
+ EmptyDirVolumeSource::Medium = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.EmptyDirVolumeSource.Medium").enummodule
52
54
  Probe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.Probe").msgclass
53
55
  HTTPGetAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.HTTPGetAction").msgclass
54
56
  HTTPHeader = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.HTTPHeader").msgclass