google-cloud-run-v2 0.12.0 → 0.13.1
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 +4 -4
- data/AUTHENTICATION.md +72 -99
- data/lib/google/cloud/run/v2/executions/client.rb +39 -14
- data/lib/google/cloud/run/v2/executions/operations.rb +28 -6
- data/lib/google/cloud/run/v2/executions/rest/client.rb +37 -9
- data/lib/google/cloud/run/v2/executions/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/executions/rest/service_stub.rb +23 -2
- data/lib/google/cloud/run/v2/jobs/client.rb +39 -14
- data/lib/google/cloud/run/v2/jobs/operations.rb +28 -6
- data/lib/google/cloud/run/v2/jobs/rest/client.rb +37 -9
- data/lib/google/cloud/run/v2/jobs/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/jobs/rest/service_stub.rb +23 -2
- data/lib/google/cloud/run/v2/revisions/client.rb +39 -14
- data/lib/google/cloud/run/v2/revisions/operations.rb +28 -6
- data/lib/google/cloud/run/v2/revisions/rest/client.rb +37 -9
- data/lib/google/cloud/run/v2/revisions/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/revisions/rest/service_stub.rb +23 -2
- data/lib/google/cloud/run/v2/services/client.rb +39 -14
- data/lib/google/cloud/run/v2/services/operations.rb +28 -6
- data/lib/google/cloud/run/v2/services/rest/client.rb +37 -9
- data/lib/google/cloud/run/v2/services/rest/operations.rb +33 -8
- data/lib/google/cloud/run/v2/services/rest/service_stub.rb +23 -2
- data/lib/google/cloud/run/v2/tasks/client.rb +38 -14
- data/lib/google/cloud/run/v2/tasks/rest/client.rb +36 -9
- data/lib/google/cloud/run/v2/tasks/rest/service_stub.rb +23 -2
- data/lib/google/cloud/run/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- metadata +7 -7
@@ -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,
|
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_execution REST call
|
45
66
|
#
|
@@ -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
|
128
|
-
|
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,22 +151,26 @@ module Google
|
|
138
151
|
config.credentials = credentials
|
139
152
|
config.quota_project = @quota_project_id
|
140
153
|
config.endpoint = @config.endpoint
|
141
|
-
|
142
|
-
|
143
|
-
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
144
|
-
config.credentials = credentials
|
145
|
-
config.quota_project = @quota_project_id
|
146
|
-
config.endpoint = @config.endpoint
|
154
|
+
config.universe_domain = @config.universe_domain
|
147
155
|
end
|
148
156
|
|
149
157
|
@jobs_stub = ::Gapic::ServiceStub.new(
|
150
158
|
::Google::Cloud::Run::V2::Jobs::Stub,
|
151
|
-
credentials:
|
152
|
-
endpoint:
|
159
|
+
credentials: credentials,
|
160
|
+
endpoint: @config.endpoint,
|
161
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
162
|
+
universe_domain: @config.universe_domain,
|
153
163
|
channel_args: @config.channel_args,
|
154
164
|
interceptors: @config.interceptors,
|
155
165
|
channel_pool_config: @config.channel_pool
|
156
166
|
)
|
167
|
+
|
168
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
169
|
+
config.credentials = credentials
|
170
|
+
config.quota_project = @quota_project_id
|
171
|
+
config.endpoint = @jobs_stub.endpoint
|
172
|
+
config.universe_domain = @jobs_stub.universe_domain
|
173
|
+
end
|
157
174
|
end
|
158
175
|
|
159
176
|
##
|
@@ -1095,9 +1112,9 @@ module Google
|
|
1095
1112
|
# end
|
1096
1113
|
#
|
1097
1114
|
# @!attribute [rw] endpoint
|
1098
|
-
#
|
1099
|
-
#
|
1100
|
-
# @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]
|
1101
1118
|
# @!attribute [rw] credentials
|
1102
1119
|
# Credentials to send with calls. You may provide any of the following types:
|
1103
1120
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1143,13 +1160,20 @@ module Google
|
|
1143
1160
|
# @!attribute [rw] quota_project
|
1144
1161
|
# A separate project against which to charge quota.
|
1145
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]
|
1146
1168
|
#
|
1147
1169
|
class Configuration
|
1148
1170
|
extend ::Gapic::Config
|
1149
1171
|
|
1172
|
+
# @private
|
1173
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1150
1174
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
1151
1175
|
|
1152
|
-
config_attr :endpoint,
|
1176
|
+
config_attr :endpoint, nil, ::String, nil
|
1153
1177
|
config_attr :credentials, nil do |value|
|
1154
1178
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1155
1179
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1164,6 +1188,7 @@ module Google
|
|
1164
1188
|
config_attr :metadata, nil, ::Hash, nil
|
1165
1189
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1166
1190
|
config_attr :quota_project, nil, ::String, nil
|
1191
|
+
config_attr :universe_domain, nil, ::String, nil
|
1167
1192
|
|
1168
1193
|
# @private
|
1169
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:
|
94
|
-
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
|
-
#
|
625
|
-
#
|
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,
|
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
|
124
|
-
|
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
|
|
154
|
+
@jobs_stub = ::Google::Cloud::Run::V2::Jobs::Rest::ServiceStub.new(
|
155
|
+
endpoint: @config.endpoint,
|
156
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
157
|
+
universe_domain: @config.universe_domain,
|
158
|
+
credentials: credentials
|
159
|
+
)
|
160
|
+
|
140
161
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
141
162
|
config.credentials = credentials
|
142
163
|
config.quota_project = @quota_project_id
|
143
|
-
config.endpoint = @
|
164
|
+
config.endpoint = @jobs_stub.endpoint
|
165
|
+
config.universe_domain = @jobs_stub.universe_domain
|
144
166
|
end
|
145
|
-
|
146
|
-
@jobs_stub = ::Google::Cloud::Run::V2::Jobs::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
147
167
|
end
|
148
168
|
|
149
169
|
##
|
@@ -1004,9 +1024,9 @@ module Google
|
|
1004
1024
|
# end
|
1005
1025
|
#
|
1006
1026
|
# @!attribute [rw] endpoint
|
1007
|
-
#
|
1008
|
-
#
|
1009
|
-
# @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]
|
1010
1030
|
# @!attribute [rw] credentials
|
1011
1031
|
# Credentials to send with calls. You may provide any of the following types:
|
1012
1032
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1043,13 +1063,20 @@ module Google
|
|
1043
1063
|
# @!attribute [rw] quota_project
|
1044
1064
|
# A separate project against which to charge quota.
|
1045
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]
|
1046
1071
|
#
|
1047
1072
|
class Configuration
|
1048
1073
|
extend ::Gapic::Config
|
1049
1074
|
|
1075
|
+
# @private
|
1076
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1050
1077
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
1051
1078
|
|
1052
|
-
config_attr :endpoint,
|
1079
|
+
config_attr :endpoint, nil, ::String, nil
|
1053
1080
|
config_attr :credentials, nil do |value|
|
1054
1081
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1055
1082
|
allowed.any? { |klass| klass === value }
|
@@ -1061,6 +1088,7 @@ module Google
|
|
1061
1088
|
config_attr :metadata, nil, ::Hash, nil
|
1062
1089
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1063
1090
|
config_attr :quota_project, nil, ::String, nil
|
1091
|
+
config_attr :universe_domain, nil, ::String, nil
|
1064
1092
|
|
1065
1093
|
# @private
|
1066
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:
|
88
|
-
|
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
|
-
#
|
580
|
-
#
|
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,
|
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,
|
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,
|
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_job REST call
|
45
66
|
#
|
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# Cloud Run Revision 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
|
+
@revisions_stub.universe_domain
|
104
|
+
end
|
105
|
+
|
94
106
|
##
|
95
107
|
# Create a new Revisions 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
|
128
|
-
|
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,22 +151,26 @@ module Google
|
|
138
151
|
config.credentials = credentials
|
139
152
|
config.quota_project = @quota_project_id
|
140
153
|
config.endpoint = @config.endpoint
|
141
|
-
|
142
|
-
|
143
|
-
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
144
|
-
config.credentials = credentials
|
145
|
-
config.quota_project = @quota_project_id
|
146
|
-
config.endpoint = @config.endpoint
|
154
|
+
config.universe_domain = @config.universe_domain
|
147
155
|
end
|
148
156
|
|
149
157
|
@revisions_stub = ::Gapic::ServiceStub.new(
|
150
158
|
::Google::Cloud::Run::V2::Revisions::Stub,
|
151
|
-
credentials:
|
152
|
-
endpoint:
|
159
|
+
credentials: credentials,
|
160
|
+
endpoint: @config.endpoint,
|
161
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
162
|
+
universe_domain: @config.universe_domain,
|
153
163
|
channel_args: @config.channel_args,
|
154
164
|
interceptors: @config.interceptors,
|
155
165
|
channel_pool_config: @config.channel_pool
|
156
166
|
)
|
167
|
+
|
168
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
169
|
+
config.credentials = credentials
|
170
|
+
config.quota_project = @quota_project_id
|
171
|
+
config.endpoint = @revisions_stub.endpoint
|
172
|
+
config.universe_domain = @revisions_stub.universe_domain
|
173
|
+
end
|
157
174
|
end
|
158
175
|
|
159
176
|
##
|
@@ -499,9 +516,9 @@ module Google
|
|
499
516
|
# end
|
500
517
|
#
|
501
518
|
# @!attribute [rw] endpoint
|
502
|
-
#
|
503
|
-
#
|
504
|
-
# @return [::String]
|
519
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
520
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
521
|
+
# @return [::String,nil]
|
505
522
|
# @!attribute [rw] credentials
|
506
523
|
# Credentials to send with calls. You may provide any of the following types:
|
507
524
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -547,13 +564,20 @@ module Google
|
|
547
564
|
# @!attribute [rw] quota_project
|
548
565
|
# A separate project against which to charge quota.
|
549
566
|
# @return [::String]
|
567
|
+
# @!attribute [rw] universe_domain
|
568
|
+
# The universe domain within which to make requests. This determines the
|
569
|
+
# default endpoint URL. The default value of nil uses the environment
|
570
|
+
# universe (usually the default "googleapis.com" universe).
|
571
|
+
# @return [::String,nil]
|
550
572
|
#
|
551
573
|
class Configuration
|
552
574
|
extend ::Gapic::Config
|
553
575
|
|
576
|
+
# @private
|
577
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
554
578
|
DEFAULT_ENDPOINT = "run.googleapis.com"
|
555
579
|
|
556
|
-
config_attr :endpoint,
|
580
|
+
config_attr :endpoint, nil, ::String, nil
|
557
581
|
config_attr :credentials, nil do |value|
|
558
582
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
559
583
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -568,6 +592,7 @@ module Google
|
|
568
592
|
config_attr :metadata, nil, ::Hash, nil
|
569
593
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
570
594
|
config_attr :quota_project, nil, ::String, nil
|
595
|
+
config_attr :universe_domain, nil, ::String, nil
|
571
596
|
|
572
597
|
# @private
|
573
598
|
def initialize parent_config = nil
|