google-cloud-resource_manager-v3 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +31 -21
- data/lib/google/cloud/resource_manager/v3/folders/client.rb +41 -12
- data/lib/google/cloud/resource_manager/v3/folders/operations.rb +19 -15
- data/lib/google/cloud/resource_manager/v3/folders/rest/client.rb +41 -12
- data/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb +50 -38
- data/lib/google/cloud/resource_manager/v3/folders/rest/service_stub.rb +102 -68
- data/lib/google/cloud/resource_manager/v3/organizations/client.rb +35 -6
- data/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb +35 -6
- data/lib/google/cloud/resource_manager/v3/organizations/rest/service_stub.rb +54 -32
- data/lib/google/cloud/resource_manager/v3/projects/client.rb +41 -12
- data/lib/google/cloud/resource_manager/v3/projects/operations.rb +19 -15
- data/lib/google/cloud/resource_manager/v3/projects/rest/client.rb +41 -12
- data/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb +50 -38
- data/lib/google/cloud/resource_manager/v3/projects/rest/service_stub.rb +102 -68
- data/lib/google/cloud/resource_manager/v3/tag_bindings/client.rb +38 -5
- data/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb +19 -15
- data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb +38 -5
- data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb +50 -38
- data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/service_stub.rb +46 -26
- data/lib/google/cloud/resource_manager/v3/tag_holds/client.rb +37 -4
- data/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb +19 -15
- data/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb +37 -4
- data/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb +50 -38
- data/lib/google/cloud/resource_manager/v3/tag_holds/rest/service_stub.rb +38 -20
- data/lib/google/cloud/resource_manager/v3/tag_keys/client.rb +38 -10
- data/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb +19 -15
- data/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb +38 -10
- data/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb +50 -38
- data/lib/google/cloud/resource_manager/v3/tag_keys/rest/service_stub.rb +86 -56
- data/lib/google/cloud/resource_manager/v3/tag_values/client.rb +38 -10
- data/lib/google/cloud/resource_manager/v3/tag_values/operations.rb +19 -15
- data/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb +38 -10
- data/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb +50 -38
- data/lib/google/cloud/resource_manager/v3/tag_values/rest/service_stub.rb +86 -56
- data/lib/google/cloud/resource_manager/v3/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- metadata +6 -9
@@ -164,8 +164,28 @@ module Google
|
|
164
164
|
endpoint: @config.endpoint,
|
165
165
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
166
166
|
universe_domain: @config.universe_domain,
|
167
|
-
credentials: credentials
|
167
|
+
credentials: credentials,
|
168
|
+
logger: @config.logger
|
168
169
|
)
|
170
|
+
|
171
|
+
@organizations_stub.logger(stub: true)&.info do |entry|
|
172
|
+
entry.set_system_name
|
173
|
+
entry.set_service
|
174
|
+
entry.message = "Created client for #{entry.service}"
|
175
|
+
entry.set_credentials_fields credentials
|
176
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
177
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
178
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# The logger used for request/response debug logging.
|
184
|
+
#
|
185
|
+
# @return [Logger]
|
186
|
+
#
|
187
|
+
def logger
|
188
|
+
@organizations_stub.logger
|
169
189
|
end
|
170
190
|
|
171
191
|
# Service calls
|
@@ -245,7 +265,6 @@ module Google
|
|
245
265
|
|
246
266
|
@organizations_stub.get_organization request, options do |result, operation|
|
247
267
|
yield result, operation if block_given?
|
248
|
-
return result
|
249
268
|
end
|
250
269
|
rescue ::Gapic::Rest::Error => e
|
251
270
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -360,7 +379,7 @@ module Google
|
|
360
379
|
@organizations_stub.search_organizations request, options do |result, operation|
|
361
380
|
result = ::Gapic::Rest::PagedEnumerable.new @organizations_stub, :search_organizations, "organizations", request, result, options
|
362
381
|
yield result, operation if block_given?
|
363
|
-
|
382
|
+
throw :response, result
|
364
383
|
end
|
365
384
|
rescue ::Gapic::Rest::Error => e
|
366
385
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -448,7 +467,6 @@ module Google
|
|
448
467
|
|
449
468
|
@organizations_stub.get_iam_policy request, options do |result, operation|
|
450
469
|
yield result, operation if block_given?
|
451
|
-
return result
|
452
470
|
end
|
453
471
|
rescue ::Gapic::Rest::Error => e
|
454
472
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -544,7 +562,6 @@ module Google
|
|
544
562
|
|
545
563
|
@organizations_stub.set_iam_policy request, options do |result, operation|
|
546
564
|
yield result, operation if block_given?
|
547
|
-
return result
|
548
565
|
end
|
549
566
|
rescue ::Gapic::Rest::Error => e
|
550
567
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -633,7 +650,6 @@ module Google
|
|
633
650
|
|
634
651
|
@organizations_stub.test_iam_permissions request, options do |result, operation|
|
635
652
|
yield result, operation if block_given?
|
636
|
-
return result
|
637
653
|
end
|
638
654
|
rescue ::Gapic::Rest::Error => e
|
639
655
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -681,6 +697,13 @@ module Google
|
|
681
697
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
682
698
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
683
699
|
# * (`nil`) indicating no credentials
|
700
|
+
#
|
701
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
702
|
+
# external source for authentication to Google Cloud, you must validate it before
|
703
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
704
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
705
|
+
# For more information, refer to [Validate credential configurations from external
|
706
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
684
707
|
# @return [::Object]
|
685
708
|
# @!attribute [rw] scope
|
686
709
|
# The OAuth scopes
|
@@ -713,6 +736,11 @@ module Google
|
|
713
736
|
# default endpoint URL. The default value of nil uses the environment
|
714
737
|
# universe (usually the default "googleapis.com" universe).
|
715
738
|
# @return [::String,nil]
|
739
|
+
# @!attribute [rw] logger
|
740
|
+
# A custom logger to use for request/response debug logging, or the value
|
741
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
742
|
+
# explicitly disable logging.
|
743
|
+
# @return [::Logger,:default,nil]
|
716
744
|
#
|
717
745
|
class Configuration
|
718
746
|
extend ::Gapic::Config
|
@@ -734,6 +762,7 @@ module Google
|
|
734
762
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
735
763
|
config_attr :quota_project, nil, ::String, nil
|
736
764
|
config_attr :universe_domain, nil, ::String, nil
|
765
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
737
766
|
|
738
767
|
# @private
|
739
768
|
def initialize parent_config = nil
|
@@ -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 get_organization 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: "get_organization",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::ResourceManager::V3::Organization.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: "search_organizations",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::ResourceManager::V3::SearchOrganizationsResponse.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: "get_iam_policy",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Iam::V1::Policy.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: "set_iam_policy",
|
207
226
|
options: options
|
208
227
|
)
|
209
228
|
operation = ::Gapic::Rest::TransportOperation.new response
|
210
229
|
result = ::Google::Iam::V1::Policy.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: "test_iam_permissions",
|
245
266
|
options: options
|
246
267
|
)
|
247
268
|
operation = ::Gapic::Rest::TransportOperation.new response
|
248
269
|
result = ::Google::Iam::V1::TestIamPermissionsResponse.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
|
##
|
@@ -193,8 +193,19 @@ module Google
|
|
193
193
|
universe_domain: @config.universe_domain,
|
194
194
|
channel_args: @config.channel_args,
|
195
195
|
interceptors: @config.interceptors,
|
196
|
-
channel_pool_config: @config.channel_pool
|
196
|
+
channel_pool_config: @config.channel_pool,
|
197
|
+
logger: @config.logger
|
197
198
|
)
|
199
|
+
|
200
|
+
@projects_stub.stub_logger&.info do |entry|
|
201
|
+
entry.set_system_name
|
202
|
+
entry.set_service
|
203
|
+
entry.message = "Created client for #{entry.service}"
|
204
|
+
entry.set_credentials_fields credentials
|
205
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
206
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
207
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
208
|
+
end
|
198
209
|
end
|
199
210
|
|
200
211
|
##
|
@@ -204,6 +215,15 @@ module Google
|
|
204
215
|
#
|
205
216
|
attr_reader :operations_client
|
206
217
|
|
218
|
+
##
|
219
|
+
# The logger used for request/response debug logging.
|
220
|
+
#
|
221
|
+
# @return [Logger]
|
222
|
+
#
|
223
|
+
def logger
|
224
|
+
@projects_stub.logger
|
225
|
+
end
|
226
|
+
|
207
227
|
# Service calls
|
208
228
|
|
209
229
|
##
|
@@ -290,7 +310,6 @@ module Google
|
|
290
310
|
|
291
311
|
@projects_stub.call_rpc :get_project, request, options: options do |response, operation|
|
292
312
|
yield response, operation if block_given?
|
293
|
-
return response
|
294
313
|
end
|
295
314
|
rescue ::GRPC::BadStatus => e
|
296
315
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -394,7 +413,7 @@ module Google
|
|
394
413
|
@projects_stub.call_rpc :list_projects, request, options: options do |response, operation|
|
395
414
|
response = ::Gapic::PagedEnumerable.new @projects_stub, :list_projects, request, response, operation, options
|
396
415
|
yield response, operation if block_given?
|
397
|
-
|
416
|
+
throw :response, response
|
398
417
|
end
|
399
418
|
rescue ::GRPC::BadStatus => e
|
400
419
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -526,7 +545,7 @@ module Google
|
|
526
545
|
@projects_stub.call_rpc :search_projects, request, options: options do |response, operation|
|
527
546
|
response = ::Gapic::PagedEnumerable.new @projects_stub, :search_projects, request, response, operation, options
|
528
547
|
yield response, operation if block_given?
|
529
|
-
|
548
|
+
throw :response, response
|
530
549
|
end
|
531
550
|
rescue ::GRPC::BadStatus => e
|
532
551
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -624,7 +643,7 @@ module Google
|
|
624
643
|
@projects_stub.call_rpc :create_project, request, options: options do |response, operation|
|
625
644
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
626
645
|
yield response, operation if block_given?
|
627
|
-
|
646
|
+
throw :response, response
|
628
647
|
end
|
629
648
|
rescue ::GRPC::BadStatus => e
|
630
649
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -725,7 +744,7 @@ module Google
|
|
725
744
|
@projects_stub.call_rpc :update_project, request, options: options do |response, operation|
|
726
745
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
727
746
|
yield response, operation if block_given?
|
728
|
-
|
747
|
+
throw :response, response
|
729
748
|
end
|
730
749
|
rescue ::GRPC::BadStatus => e
|
731
750
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -834,7 +853,7 @@ module Google
|
|
834
853
|
@projects_stub.call_rpc :move_project, request, options: options do |response, operation|
|
835
854
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
836
855
|
yield response, operation if block_given?
|
837
|
-
|
856
|
+
throw :response, response
|
838
857
|
end
|
839
858
|
rescue ::GRPC::BadStatus => e
|
840
859
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -960,7 +979,7 @@ module Google
|
|
960
979
|
@projects_stub.call_rpc :delete_project, request, options: options do |response, operation|
|
961
980
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
962
981
|
yield response, operation if block_given?
|
963
|
-
|
982
|
+
throw :response, response
|
964
983
|
end
|
965
984
|
rescue ::GRPC::BadStatus => e
|
966
985
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1064,7 +1083,7 @@ module Google
|
|
1064
1083
|
@projects_stub.call_rpc :undelete_project, request, options: options do |response, operation|
|
1065
1084
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1066
1085
|
yield response, operation if block_given?
|
1067
|
-
|
1086
|
+
throw :response, response
|
1068
1087
|
end
|
1069
1088
|
rescue ::GRPC::BadStatus => e
|
1070
1089
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1156,7 +1175,6 @@ module Google
|
|
1156
1175
|
|
1157
1176
|
@projects_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
1158
1177
|
yield response, operation if block_given?
|
1159
|
-
return response
|
1160
1178
|
end
|
1161
1179
|
rescue ::GRPC::BadStatus => e
|
1162
1180
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1294,7 +1312,6 @@ module Google
|
|
1294
1312
|
|
1295
1313
|
@projects_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
1296
1314
|
yield response, operation if block_given?
|
1297
|
-
return response
|
1298
1315
|
end
|
1299
1316
|
rescue ::GRPC::BadStatus => e
|
1300
1317
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1387,7 +1404,6 @@ module Google
|
|
1387
1404
|
|
1388
1405
|
@projects_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
1389
1406
|
yield response, operation if block_given?
|
1390
|
-
return response
|
1391
1407
|
end
|
1392
1408
|
rescue ::GRPC::BadStatus => e
|
1393
1409
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1437,6 +1453,13 @@ module Google
|
|
1437
1453
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1438
1454
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1439
1455
|
# * (`nil`) indicating no credentials
|
1456
|
+
#
|
1457
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1458
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1459
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1460
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1461
|
+
# For more information, refer to [Validate credential configurations from external
|
1462
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1440
1463
|
# @return [::Object]
|
1441
1464
|
# @!attribute [rw] scope
|
1442
1465
|
# The OAuth scopes
|
@@ -1476,6 +1499,11 @@ module Google
|
|
1476
1499
|
# default endpoint URL. The default value of nil uses the environment
|
1477
1500
|
# universe (usually the default "googleapis.com" universe).
|
1478
1501
|
# @return [::String,nil]
|
1502
|
+
# @!attribute [rw] logger
|
1503
|
+
# A custom logger to use for request/response debug logging, or the value
|
1504
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1505
|
+
# explicitly disable logging.
|
1506
|
+
# @return [::Logger,:default,nil]
|
1479
1507
|
#
|
1480
1508
|
class Configuration
|
1481
1509
|
extend ::Gapic::Config
|
@@ -1500,6 +1528,7 @@ module Google
|
|
1500
1528
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1501
1529
|
config_attr :quota_project, nil, ::String, nil
|
1502
1530
|
config_attr :universe_domain, nil, ::String, nil
|
1531
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1503
1532
|
|
1504
1533
|
# @private
|
1505
1534
|
def initialize parent_config = nil
|
@@ -124,14 +124,6 @@ module Google
|
|
124
124
|
# Lists operations that match the specified filter in the request. If the
|
125
125
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
126
126
|
#
|
127
|
-
# NOTE: the `name` binding allows API services to override the binding
|
128
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
129
|
-
# override the binding, API services can add a binding such as
|
130
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
131
|
-
# For backwards compatibility, the default name includes the operations
|
132
|
-
# collection id, however overriding users must ensure the name binding
|
133
|
-
# is the parent resource, without the operations collection id.
|
134
|
-
#
|
135
127
|
# @overload list_operations(request, options = nil)
|
136
128
|
# Pass arguments to `list_operations` via a request object, either of type
|
137
129
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -221,7 +213,7 @@ module Google
|
|
221
213
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
222
214
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
223
215
|
yield response, operation if block_given?
|
224
|
-
|
216
|
+
throw :response, response
|
225
217
|
end
|
226
218
|
rescue ::GRPC::BadStatus => e
|
227
219
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -317,7 +309,7 @@ module Google
|
|
317
309
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
318
310
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
319
311
|
yield response, operation if block_given?
|
320
|
-
|
312
|
+
throw :response, response
|
321
313
|
end
|
322
314
|
rescue ::GRPC::BadStatus => e
|
323
315
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -406,7 +398,6 @@ module Google
|
|
406
398
|
|
407
399
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
408
400
|
yield response, operation if block_given?
|
409
|
-
return response
|
410
401
|
end
|
411
402
|
rescue ::GRPC::BadStatus => e
|
412
403
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -421,8 +412,9 @@ module Google
|
|
421
412
|
# other methods to check whether the cancellation succeeded or whether the
|
422
413
|
# operation completed despite cancellation. On successful cancellation,
|
423
414
|
# the operation is not deleted; instead, it becomes an operation with
|
424
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
425
|
-
# corresponding to
|
415
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
416
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
417
|
+
# `Code.CANCELLED`.
|
426
418
|
#
|
427
419
|
# @overload cancel_operation(request, options = nil)
|
428
420
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -501,7 +493,6 @@ module Google
|
|
501
493
|
|
502
494
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
503
495
|
yield response, operation if block_given?
|
504
|
-
return response
|
505
496
|
end
|
506
497
|
rescue ::GRPC::BadStatus => e
|
507
498
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -599,7 +590,7 @@ module Google
|
|
599
590
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
600
591
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
601
592
|
yield response, operation if block_given?
|
602
|
-
|
593
|
+
throw :response, response
|
603
594
|
end
|
604
595
|
rescue ::GRPC::BadStatus => e
|
605
596
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -649,6 +640,13 @@ module Google
|
|
649
640
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
650
641
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
651
642
|
# * (`nil`) indicating no credentials
|
643
|
+
#
|
644
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
645
|
+
# external source for authentication to Google Cloud, you must validate it before
|
646
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
647
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
648
|
+
# For more information, refer to [Validate credential configurations from external
|
649
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
652
650
|
# @return [::Object]
|
653
651
|
# @!attribute [rw] scope
|
654
652
|
# The OAuth scopes
|
@@ -688,6 +686,11 @@ module Google
|
|
688
686
|
# default endpoint URL. The default value of nil uses the environment
|
689
687
|
# universe (usually the default "googleapis.com" universe).
|
690
688
|
# @return [::String,nil]
|
689
|
+
# @!attribute [rw] logger
|
690
|
+
# A custom logger to use for request/response debug logging, or the value
|
691
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
692
|
+
# explicitly disable logging.
|
693
|
+
# @return [::Logger,:default,nil]
|
691
694
|
#
|
692
695
|
class Configuration
|
693
696
|
extend ::Gapic::Config
|
@@ -712,6 +715,7 @@ module Google
|
|
712
715
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
713
716
|
config_attr :quota_project, nil, ::String, nil
|
714
717
|
config_attr :universe_domain, nil, ::String, nil
|
718
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
715
719
|
|
716
720
|
# @private
|
717
721
|
def initialize parent_config = nil
|