google-cloud-run-v2 0.19.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/run/v2/builds/client.rb +28 -2
- data/lib/google/cloud/run/v2/builds/rest/client.rb +28 -2
- data/lib/google/cloud/run/v2/builds/rest/service_stub.rb +22 -8
- data/lib/google/cloud/run/v2/executions/client.rb +31 -5
- data/lib/google/cloud/run/v2/executions/operations.rb +9 -5
- data/lib/google/cloud/run/v2/executions/rest/client.rb +31 -5
- data/lib/google/cloud/run/v2/executions/rest/operations.rb +49 -35
- data/lib/google/cloud/run/v2/executions/rest/service_stub.rb +46 -26
- data/lib/google/cloud/run/v2/jobs/client.rb +33 -10
- data/lib/google/cloud/run/v2/jobs/operations.rb +9 -5
- data/lib/google/cloud/run/v2/jobs/rest/client.rb +33 -10
- data/lib/google/cloud/run/v2/jobs/rest/operations.rb +49 -35
- data/lib/google/cloud/run/v2/jobs/rest/service_stub.rb +86 -56
- data/lib/google/cloud/run/v2/revisions/client.rb +30 -4
- data/lib/google/cloud/run/v2/revisions/operations.rb +9 -5
- data/lib/google/cloud/run/v2/revisions/rest/client.rb +30 -4
- data/lib/google/cloud/run/v2/revisions/rest/operations.rb +49 -35
- data/lib/google/cloud/run/v2/revisions/rest/service_stub.rb +38 -20
- data/lib/google/cloud/run/v2/services/client.rb +32 -9
- data/lib/google/cloud/run/v2/services/operations.rb +9 -5
- data/lib/google/cloud/run/v2/services/rest/client.rb +32 -9
- data/lib/google/cloud/run/v2/services/rest/operations.rb +49 -35
- data/lib/google/cloud/run/v2/services/rest/service_stub.rb +78 -50
- data/lib/google/cloud/run/v2/tasks/client.rb +29 -3
- data/lib/google/cloud/run/v2/tasks/rest/client.rb +29 -3
- data/lib/google/cloud/run/v2/tasks/rest/service_stub.rb +30 -14
- data/lib/google/cloud/run/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +19 -0
- metadata +5 -5
@@ -174,14 +174,26 @@ module Google
|
|
174
174
|
endpoint: @config.endpoint,
|
175
175
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
176
176
|
universe_domain: @config.universe_domain,
|
177
|
-
credentials: credentials
|
177
|
+
credentials: credentials,
|
178
|
+
logger: @config.logger
|
178
179
|
)
|
179
180
|
|
181
|
+
@services_stub.logger(stub: true)&.info do |entry|
|
182
|
+
entry.set_system_name
|
183
|
+
entry.set_service
|
184
|
+
entry.message = "Created client for #{entry.service}"
|
185
|
+
entry.set_credentials_fields credentials
|
186
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
187
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
188
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
189
|
+
end
|
190
|
+
|
180
191
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
181
192
|
config.credentials = credentials
|
182
193
|
config.quota_project = @quota_project_id
|
183
194
|
config.endpoint = @services_stub.endpoint
|
184
195
|
config.universe_domain = @services_stub.universe_domain
|
196
|
+
config.logger = @services_stub.logger if config.respond_to? :logger=
|
185
197
|
end
|
186
198
|
end
|
187
199
|
|
@@ -199,6 +211,15 @@ module Google
|
|
199
211
|
#
|
200
212
|
attr_reader :location_client
|
201
213
|
|
214
|
+
##
|
215
|
+
# The logger used for request/response debug logging.
|
216
|
+
#
|
217
|
+
# @return [Logger]
|
218
|
+
#
|
219
|
+
def logger
|
220
|
+
@services_stub.logger
|
221
|
+
end
|
222
|
+
|
202
223
|
# Service calls
|
203
224
|
|
204
225
|
##
|
@@ -293,7 +314,7 @@ module Google
|
|
293
314
|
@services_stub.create_service request, options do |result, operation|
|
294
315
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
295
316
|
yield result, operation if block_given?
|
296
|
-
|
317
|
+
throw :response, result
|
297
318
|
end
|
298
319
|
rescue ::Gapic::Rest::Error => e
|
299
320
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -374,7 +395,6 @@ module Google
|
|
374
395
|
|
375
396
|
@services_stub.get_service request, options do |result, operation|
|
376
397
|
yield result, operation if block_given?
|
377
|
-
return result
|
378
398
|
end
|
379
399
|
rescue ::Gapic::Rest::Error => e
|
380
400
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -468,7 +488,7 @@ module Google
|
|
468
488
|
@services_stub.list_services request, options do |result, operation|
|
469
489
|
result = ::Gapic::Rest::PagedEnumerable.new @services_stub, :list_services, "services", request, result, options
|
470
490
|
yield result, operation if block_given?
|
471
|
-
|
491
|
+
throw :response, result
|
472
492
|
end
|
473
493
|
rescue ::Gapic::Rest::Error => e
|
474
494
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -564,7 +584,7 @@ module Google
|
|
564
584
|
@services_stub.update_service request, options do |result, operation|
|
565
585
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
566
586
|
yield result, operation if block_given?
|
567
|
-
|
587
|
+
throw :response, result
|
568
588
|
end
|
569
589
|
rescue ::Gapic::Rest::Error => e
|
570
590
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -661,7 +681,7 @@ module Google
|
|
661
681
|
@services_stub.delete_service request, options do |result, operation|
|
662
682
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
663
683
|
yield result, operation if block_given?
|
664
|
-
|
684
|
+
throw :response, result
|
665
685
|
end
|
666
686
|
rescue ::Gapic::Rest::Error => e
|
667
687
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -745,7 +765,6 @@ module Google
|
|
745
765
|
|
746
766
|
@services_stub.get_iam_policy request, options do |result, operation|
|
747
767
|
yield result, operation if block_given?
|
748
|
-
return result
|
749
768
|
end
|
750
769
|
rescue ::Gapic::Rest::Error => e
|
751
770
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -837,7 +856,6 @@ module Google
|
|
837
856
|
|
838
857
|
@services_stub.set_iam_policy request, options do |result, operation|
|
839
858
|
yield result, operation if block_given?
|
840
|
-
return result
|
841
859
|
end
|
842
860
|
rescue ::Gapic::Rest::Error => e
|
843
861
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -924,7 +942,6 @@ module Google
|
|
924
942
|
|
925
943
|
@services_stub.test_iam_permissions request, options do |result, operation|
|
926
944
|
yield result, operation if block_given?
|
927
|
-
return result
|
928
945
|
end
|
929
946
|
rescue ::Gapic::Rest::Error => e
|
930
947
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1004,6 +1021,11 @@ module Google
|
|
1004
1021
|
# default endpoint URL. The default value of nil uses the environment
|
1005
1022
|
# universe (usually the default "googleapis.com" universe).
|
1006
1023
|
# @return [::String,nil]
|
1024
|
+
# @!attribute [rw] logger
|
1025
|
+
# A custom logger to use for request/response debug logging, or the value
|
1026
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1027
|
+
# explicitly disable logging.
|
1028
|
+
# @return [::Logger,:default,nil]
|
1007
1029
|
#
|
1008
1030
|
class Configuration
|
1009
1031
|
extend ::Gapic::Config
|
@@ -1025,6 +1047,7 @@ module Google
|
|
1025
1047
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1026
1048
|
config_attr :quota_project, nil, ::String, nil
|
1027
1049
|
config_attr :universe_domain, nil, ::String, nil
|
1050
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1028
1051
|
|
1029
1052
|
# @private
|
1030
1053
|
def initialize parent_config = nil
|
@@ -196,7 +196,7 @@ module Google
|
|
196
196
|
@operations_stub.list_operations request, options do |result, operation|
|
197
197
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
198
198
|
yield result, operation if block_given?
|
199
|
-
|
199
|
+
throw :response, result
|
200
200
|
end
|
201
201
|
rescue ::Gapic::Rest::Error => e
|
202
202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -285,7 +285,7 @@ module Google
|
|
285
285
|
@operations_stub.get_operation request, options do |result, operation|
|
286
286
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
287
287
|
yield result, operation if block_given?
|
288
|
-
|
288
|
+
throw :response, result
|
289
289
|
end
|
290
290
|
rescue ::Gapic::Rest::Error => e
|
291
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -367,7 +367,6 @@ module Google
|
|
367
367
|
|
368
368
|
@operations_stub.delete_operation request, options do |result, operation|
|
369
369
|
yield result, operation if block_given?
|
370
|
-
return result
|
371
370
|
end
|
372
371
|
rescue ::Gapic::Rest::Error => e
|
373
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -456,7 +455,6 @@ module Google
|
|
456
455
|
|
457
456
|
@operations_stub.cancel_operation request, options do |result, operation|
|
458
457
|
yield result, operation if block_given?
|
459
|
-
return result
|
460
458
|
end
|
461
459
|
rescue ::Gapic::Rest::Error => e
|
462
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -555,7 +553,7 @@ module Google
|
|
555
553
|
@operations_stub.wait_operation request, options do |result, operation|
|
556
554
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
557
555
|
yield result, operation if block_given?
|
558
|
-
|
556
|
+
throw :response, result
|
559
557
|
end
|
560
558
|
rescue ::Gapic::Rest::Error => e
|
561
559
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -635,6 +633,11 @@ module Google
|
|
635
633
|
# default endpoint URL. The default value of nil uses the environment
|
636
634
|
# universe (usually the default "googleapis.com" universe).
|
637
635
|
# @return [::String,nil]
|
636
|
+
# @!attribute [rw] logger
|
637
|
+
# A custom logger to use for request/response debug logging, or the value
|
638
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
639
|
+
# explicitly disable logging.
|
640
|
+
# @return [::Logger,:default,nil]
|
638
641
|
#
|
639
642
|
class Configuration
|
640
643
|
extend ::Gapic::Config
|
@@ -656,6 +659,7 @@ module Google
|
|
656
659
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
657
660
|
config_attr :quota_project, nil, ::String, nil
|
658
661
|
config_attr :universe_domain, nil, ::String, nil
|
662
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
659
663
|
|
660
664
|
# @private
|
661
665
|
def initialize parent_config = nil
|
@@ -782,16 +786,18 @@ module Google
|
|
782
786
|
|
783
787
|
response = @client_stub.make_http_request(
|
784
788
|
verb,
|
785
|
-
uri:
|
786
|
-
body:
|
787
|
-
params:
|
789
|
+
uri: uri,
|
790
|
+
body: body || "",
|
791
|
+
params: query_string_params,
|
792
|
+
method_name: "list_operations",
|
788
793
|
options: options
|
789
794
|
)
|
790
795
|
operation = ::Gapic::Rest::TransportOperation.new response
|
791
796
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
792
|
-
|
793
|
-
|
794
|
-
|
797
|
+
catch :response do
|
798
|
+
yield result, operation if block_given?
|
799
|
+
result
|
800
|
+
end
|
795
801
|
end
|
796
802
|
|
797
803
|
##
|
@@ -820,16 +826,18 @@ module Google
|
|
820
826
|
|
821
827
|
response = @client_stub.make_http_request(
|
822
828
|
verb,
|
823
|
-
uri:
|
824
|
-
body:
|
825
|
-
params:
|
829
|
+
uri: uri,
|
830
|
+
body: body || "",
|
831
|
+
params: query_string_params,
|
832
|
+
method_name: "get_operation",
|
826
833
|
options: options
|
827
834
|
)
|
828
835
|
operation = ::Gapic::Rest::TransportOperation.new response
|
829
836
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
830
|
-
|
831
|
-
|
832
|
-
|
837
|
+
catch :response do
|
838
|
+
yield result, operation if block_given?
|
839
|
+
result
|
840
|
+
end
|
833
841
|
end
|
834
842
|
|
835
843
|
##
|
@@ -858,16 +866,18 @@ module Google
|
|
858
866
|
|
859
867
|
response = @client_stub.make_http_request(
|
860
868
|
verb,
|
861
|
-
uri:
|
862
|
-
body:
|
863
|
-
params:
|
869
|
+
uri: uri,
|
870
|
+
body: body || "",
|
871
|
+
params: query_string_params,
|
872
|
+
method_name: "delete_operation",
|
864
873
|
options: options
|
865
874
|
)
|
866
875
|
operation = ::Gapic::Rest::TransportOperation.new response
|
867
876
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
868
|
-
|
869
|
-
|
870
|
-
|
877
|
+
catch :response do
|
878
|
+
yield result, operation if block_given?
|
879
|
+
result
|
880
|
+
end
|
871
881
|
end
|
872
882
|
|
873
883
|
##
|
@@ -896,16 +906,18 @@ module Google
|
|
896
906
|
|
897
907
|
response = @client_stub.make_http_request(
|
898
908
|
verb,
|
899
|
-
uri:
|
900
|
-
body:
|
901
|
-
params:
|
909
|
+
uri: uri,
|
910
|
+
body: body || "",
|
911
|
+
params: query_string_params,
|
912
|
+
method_name: "cancel_operation",
|
902
913
|
options: options
|
903
914
|
)
|
904
915
|
operation = ::Gapic::Rest::TransportOperation.new response
|
905
916
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
906
|
-
|
907
|
-
|
908
|
-
|
917
|
+
catch :response do
|
918
|
+
yield result, operation if block_given?
|
919
|
+
result
|
920
|
+
end
|
909
921
|
end
|
910
922
|
|
911
923
|
##
|
@@ -934,16 +946,18 @@ module Google
|
|
934
946
|
|
935
947
|
response = @client_stub.make_http_request(
|
936
948
|
verb,
|
937
|
-
uri:
|
938
|
-
body:
|
939
|
-
params:
|
949
|
+
uri: uri,
|
950
|
+
body: body || "",
|
951
|
+
params: query_string_params,
|
952
|
+
method_name: "wait_operation",
|
940
953
|
options: options
|
941
954
|
)
|
942
955
|
operation = ::Gapic::Rest::TransportOperation.new response
|
943
956
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
944
|
-
|
945
|
-
|
946
|
-
|
957
|
+
catch :response do
|
958
|
+
yield result, operation if block_given?
|
959
|
+
result
|
960
|
+
end
|
947
961
|
end
|
948
962
|
|
949
963
|
##
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
|
33
|
+
# @private
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
34
35
|
# These require statements are intentionally placed here to initialize
|
35
36
|
# the REST modules only when it's required.
|
36
37
|
require "gapic/rest"
|
@@ -40,7 +41,9 @@ module Google
|
|
40
41
|
universe_domain: universe_domain,
|
41
42
|
credentials: credentials,
|
42
43
|
numeric_enums: true,
|
43
|
-
|
44
|
+
service_name: self.class,
|
45
|
+
raise_faraday_errors: false,
|
46
|
+
logger: logger
|
44
47
|
end
|
45
48
|
|
46
49
|
##
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@client_stub.endpoint
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The logger used for request/response debug logging.
|
69
|
+
#
|
70
|
+
# @return [Logger]
|
71
|
+
#
|
72
|
+
def logger stub: false
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Baseline implementation for the create_service REST call
|
66
78
|
#
|
@@ -87,16 +99,18 @@ module Google
|
|
87
99
|
|
88
100
|
response = @client_stub.make_http_request(
|
89
101
|
verb,
|
90
|
-
uri:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "create_service",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -125,16 +139,18 @@ module Google
|
|
125
139
|
|
126
140
|
response = @client_stub.make_http_request(
|
127
141
|
verb,
|
128
|
-
uri:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "get_service",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Run::V2::Service.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -163,16 +179,18 @@ module Google
|
|
163
179
|
|
164
180
|
response = @client_stub.make_http_request(
|
165
181
|
verb,
|
166
|
-
uri:
|
167
|
-
body:
|
168
|
-
params:
|
182
|
+
uri: uri,
|
183
|
+
body: body || "",
|
184
|
+
params: query_string_params,
|
185
|
+
method_name: "list_services",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Cloud::Run::V2::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true
|
173
|
-
|
174
|
-
|
175
|
-
|
190
|
+
catch :response do
|
191
|
+
yield result, operation if block_given?
|
192
|
+
result
|
193
|
+
end
|
176
194
|
end
|
177
195
|
|
178
196
|
##
|
@@ -201,16 +219,18 @@ module Google
|
|
201
219
|
|
202
220
|
response = @client_stub.make_http_request(
|
203
221
|
verb,
|
204
|
-
uri:
|
205
|
-
body:
|
206
|
-
params:
|
222
|
+
uri: uri,
|
223
|
+
body: body || "",
|
224
|
+
params: query_string_params,
|
225
|
+
method_name: "update_service",
|
207
226
|
options: options
|
208
227
|
)
|
209
228
|
operation = ::Gapic::Rest::TransportOperation.new response
|
210
229
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
211
|
-
|
212
|
-
|
213
|
-
|
230
|
+
catch :response do
|
231
|
+
yield result, operation if block_given?
|
232
|
+
result
|
233
|
+
end
|
214
234
|
end
|
215
235
|
|
216
236
|
##
|
@@ -239,16 +259,18 @@ module Google
|
|
239
259
|
|
240
260
|
response = @client_stub.make_http_request(
|
241
261
|
verb,
|
242
|
-
uri:
|
243
|
-
body:
|
244
|
-
params:
|
262
|
+
uri: uri,
|
263
|
+
body: body || "",
|
264
|
+
params: query_string_params,
|
265
|
+
method_name: "delete_service",
|
245
266
|
options: options
|
246
267
|
)
|
247
268
|
operation = ::Gapic::Rest::TransportOperation.new response
|
248
269
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
249
|
-
|
250
|
-
|
251
|
-
|
270
|
+
catch :response do
|
271
|
+
yield result, operation if block_given?
|
272
|
+
result
|
273
|
+
end
|
252
274
|
end
|
253
275
|
|
254
276
|
##
|
@@ -277,16 +299,18 @@ module Google
|
|
277
299
|
|
278
300
|
response = @client_stub.make_http_request(
|
279
301
|
verb,
|
280
|
-
uri:
|
281
|
-
body:
|
282
|
-
params:
|
302
|
+
uri: uri,
|
303
|
+
body: body || "",
|
304
|
+
params: query_string_params,
|
305
|
+
method_name: "get_iam_policy",
|
283
306
|
options: options
|
284
307
|
)
|
285
308
|
operation = ::Gapic::Rest::TransportOperation.new response
|
286
309
|
result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
|
287
|
-
|
288
|
-
|
289
|
-
|
310
|
+
catch :response do
|
311
|
+
yield result, operation if block_given?
|
312
|
+
result
|
313
|
+
end
|
290
314
|
end
|
291
315
|
|
292
316
|
##
|
@@ -315,16 +339,18 @@ module Google
|
|
315
339
|
|
316
340
|
response = @client_stub.make_http_request(
|
317
341
|
verb,
|
318
|
-
uri:
|
319
|
-
body:
|
320
|
-
params:
|
342
|
+
uri: uri,
|
343
|
+
body: body || "",
|
344
|
+
params: query_string_params,
|
345
|
+
method_name: "set_iam_policy",
|
321
346
|
options: options
|
322
347
|
)
|
323
348
|
operation = ::Gapic::Rest::TransportOperation.new response
|
324
349
|
result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
|
325
|
-
|
326
|
-
|
327
|
-
|
350
|
+
catch :response do
|
351
|
+
yield result, operation if block_given?
|
352
|
+
result
|
353
|
+
end
|
328
354
|
end
|
329
355
|
|
330
356
|
##
|
@@ -353,16 +379,18 @@ module Google
|
|
353
379
|
|
354
380
|
response = @client_stub.make_http_request(
|
355
381
|
verb,
|
356
|
-
uri:
|
357
|
-
body:
|
358
|
-
params:
|
382
|
+
uri: uri,
|
383
|
+
body: body || "",
|
384
|
+
params: query_string_params,
|
385
|
+
method_name: "test_iam_permissions",
|
359
386
|
options: options
|
360
387
|
)
|
361
388
|
operation = ::Gapic::Rest::TransportOperation.new response
|
362
389
|
result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
|
363
|
-
|
364
|
-
|
365
|
-
|
390
|
+
catch :response do
|
391
|
+
yield result, operation if block_given?
|
392
|
+
result
|
393
|
+
end
|
366
394
|
end
|
367
395
|
|
368
396
|
##
|
@@ -158,14 +158,26 @@ module Google
|
|
158
158
|
universe_domain: @config.universe_domain,
|
159
159
|
channel_args: @config.channel_args,
|
160
160
|
interceptors: @config.interceptors,
|
161
|
-
channel_pool_config: @config.channel_pool
|
161
|
+
channel_pool_config: @config.channel_pool,
|
162
|
+
logger: @config.logger
|
162
163
|
)
|
163
164
|
|
165
|
+
@tasks_stub.stub_logger&.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
|
+
|
164
175
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
165
176
|
config.credentials = credentials
|
166
177
|
config.quota_project = @quota_project_id
|
167
178
|
config.endpoint = @tasks_stub.endpoint
|
168
179
|
config.universe_domain = @tasks_stub.universe_domain
|
180
|
+
config.logger = @tasks_stub.logger if config.respond_to? :logger=
|
169
181
|
end
|
170
182
|
end
|
171
183
|
|
@@ -176,6 +188,15 @@ module Google
|
|
176
188
|
#
|
177
189
|
attr_reader :location_client
|
178
190
|
|
191
|
+
##
|
192
|
+
# The logger used for request/response debug logging.
|
193
|
+
#
|
194
|
+
# @return [Logger]
|
195
|
+
#
|
196
|
+
def logger
|
197
|
+
@tasks_stub.logger
|
198
|
+
end
|
199
|
+
|
179
200
|
# Service calls
|
180
201
|
|
181
202
|
##
|
@@ -260,7 +281,6 @@ module Google
|
|
260
281
|
|
261
282
|
@tasks_stub.call_rpc :get_task, request, options: options do |response, operation|
|
262
283
|
yield response, operation if block_given?
|
263
|
-
return response
|
264
284
|
end
|
265
285
|
rescue ::GRPC::BadStatus => e
|
266
286
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -361,7 +381,7 @@ module Google
|
|
361
381
|
@tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation|
|
362
382
|
response = ::Gapic::PagedEnumerable.new @tasks_stub, :list_tasks, request, response, operation, options
|
363
383
|
yield response, operation if block_given?
|
364
|
-
|
384
|
+
throw :response, response
|
365
385
|
end
|
366
386
|
rescue ::GRPC::BadStatus => e
|
367
387
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -450,6 +470,11 @@ module Google
|
|
450
470
|
# default endpoint URL. The default value of nil uses the environment
|
451
471
|
# universe (usually the default "googleapis.com" universe).
|
452
472
|
# @return [::String,nil]
|
473
|
+
# @!attribute [rw] logger
|
474
|
+
# A custom logger to use for request/response debug logging, or the value
|
475
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
476
|
+
# explicitly disable logging.
|
477
|
+
# @return [::Logger,:default,nil]
|
453
478
|
#
|
454
479
|
class Configuration
|
455
480
|
extend ::Gapic::Config
|
@@ -474,6 +499,7 @@ module Google
|
|
474
499
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
475
500
|
config_attr :quota_project, nil, ::String, nil
|
476
501
|
config_attr :universe_domain, nil, ::String, nil
|
502
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
477
503
|
|
478
504
|
# @private
|
479
505
|
def initialize parent_config = nil
|