google-cloud-resource_manager-v3 1.0.1 → 1.1.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/resource_manager/v3/folders/client.rb +34 -12
- data/lib/google/cloud/resource_manager/v3/folders/operations.rb +12 -15
- data/lib/google/cloud/resource_manager/v3/folders/rest/client.rb +34 -12
- data/lib/google/cloud/resource_manager/v3/folders/rest/operations.rb +43 -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 +28 -6
- data/lib/google/cloud/resource_manager/v3/organizations/rest/client.rb +28 -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 +34 -12
- data/lib/google/cloud/resource_manager/v3/projects/operations.rb +12 -15
- data/lib/google/cloud/resource_manager/v3/projects/rest/client.rb +34 -12
- data/lib/google/cloud/resource_manager/v3/projects/rest/operations.rb +43 -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 +31 -5
- data/lib/google/cloud/resource_manager/v3/tag_bindings/operations.rb +12 -15
- data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/client.rb +31 -5
- data/lib/google/cloud/resource_manager/v3/tag_bindings/rest/operations.rb +43 -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 +30 -4
- data/lib/google/cloud/resource_manager/v3/tag_holds/operations.rb +12 -15
- data/lib/google/cloud/resource_manager/v3/tag_holds/rest/client.rb +30 -4
- data/lib/google/cloud/resource_manager/v3/tag_holds/rest/operations.rb +43 -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 +31 -10
- data/lib/google/cloud/resource_manager/v3/tag_keys/operations.rb +12 -15
- data/lib/google/cloud/resource_manager/v3/tag_keys/rest/client.rb +31 -10
- data/lib/google/cloud/resource_manager/v3/tag_keys/rest/operations.rb +43 -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 +31 -10
- data/lib/google/cloud/resource_manager/v3/tag_values/operations.rb +12 -15
- data/lib/google/cloud/resource_manager/v3/tag_values/rest/client.rb +31 -10
- data/lib/google/cloud/resource_manager/v3/tag_values/rest/operations.rb +43 -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 +19 -14
- metadata +5 -5
@@ -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)
|
@@ -1476,6 +1492,11 @@ module Google
|
|
1476
1492
|
# default endpoint URL. The default value of nil uses the environment
|
1477
1493
|
# universe (usually the default "googleapis.com" universe).
|
1478
1494
|
# @return [::String,nil]
|
1495
|
+
# @!attribute [rw] logger
|
1496
|
+
# A custom logger to use for request/response debug logging, or the value
|
1497
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1498
|
+
# explicitly disable logging.
|
1499
|
+
# @return [::Logger,:default,nil]
|
1479
1500
|
#
|
1480
1501
|
class Configuration
|
1481
1502
|
extend ::Gapic::Config
|
@@ -1500,6 +1521,7 @@ module Google
|
|
1500
1521
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1501
1522
|
config_attr :quota_project, nil, ::String, nil
|
1502
1523
|
config_attr :universe_domain, nil, ::String, nil
|
1524
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1503
1525
|
|
1504
1526
|
# @private
|
1505
1527
|
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)
|
@@ -688,6 +679,11 @@ module Google
|
|
688
679
|
# default endpoint URL. The default value of nil uses the environment
|
689
680
|
# universe (usually the default "googleapis.com" universe).
|
690
681
|
# @return [::String,nil]
|
682
|
+
# @!attribute [rw] logger
|
683
|
+
# A custom logger to use for request/response debug logging, or the value
|
684
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
685
|
+
# explicitly disable logging.
|
686
|
+
# @return [::Logger,:default,nil]
|
691
687
|
#
|
692
688
|
class Configuration
|
693
689
|
extend ::Gapic::Config
|
@@ -712,6 +708,7 @@ module Google
|
|
712
708
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
713
709
|
config_attr :quota_project, nil, ::String, nil
|
714
710
|
config_attr :universe_domain, nil, ::String, nil
|
711
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
715
712
|
|
716
713
|
# @private
|
717
714
|
def initialize parent_config = nil
|
@@ -186,8 +186,19 @@ module Google
|
|
186
186
|
endpoint: @config.endpoint,
|
187
187
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
188
188
|
universe_domain: @config.universe_domain,
|
189
|
-
credentials: credentials
|
189
|
+
credentials: credentials,
|
190
|
+
logger: @config.logger
|
190
191
|
)
|
192
|
+
|
193
|
+
@projects_stub.logger(stub: true)&.info do |entry|
|
194
|
+
entry.set_system_name
|
195
|
+
entry.set_service
|
196
|
+
entry.message = "Created client for #{entry.service}"
|
197
|
+
entry.set_credentials_fields credentials
|
198
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
199
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
200
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
201
|
+
end
|
191
202
|
end
|
192
203
|
|
193
204
|
##
|
@@ -197,6 +208,15 @@ module Google
|
|
197
208
|
#
|
198
209
|
attr_reader :operations_client
|
199
210
|
|
211
|
+
##
|
212
|
+
# The logger used for request/response debug logging.
|
213
|
+
#
|
214
|
+
# @return [Logger]
|
215
|
+
#
|
216
|
+
def logger
|
217
|
+
@projects_stub.logger
|
218
|
+
end
|
219
|
+
|
200
220
|
# Service calls
|
201
221
|
|
202
222
|
##
|
@@ -276,7 +296,6 @@ module Google
|
|
276
296
|
|
277
297
|
@projects_stub.get_project request, options do |result, operation|
|
278
298
|
yield result, operation if block_given?
|
279
|
-
return result
|
280
299
|
end
|
281
300
|
rescue ::Gapic::Rest::Error => e
|
282
301
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -381,7 +400,7 @@ module Google
|
|
381
400
|
@projects_stub.list_projects request, options do |result, operation|
|
382
401
|
result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :list_projects, "projects", request, result, options
|
383
402
|
yield result, operation if block_given?
|
384
|
-
|
403
|
+
throw :response, result
|
385
404
|
end
|
386
405
|
rescue ::Gapic::Rest::Error => e
|
387
406
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -514,7 +533,7 @@ module Google
|
|
514
533
|
@projects_stub.search_projects request, options do |result, operation|
|
515
534
|
result = ::Gapic::Rest::PagedEnumerable.new @projects_stub, :search_projects, "projects", request, result, options
|
516
535
|
yield result, operation if block_given?
|
517
|
-
|
536
|
+
throw :response, result
|
518
537
|
end
|
519
538
|
rescue ::Gapic::Rest::Error => e
|
520
539
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -613,7 +632,7 @@ module Google
|
|
613
632
|
@projects_stub.create_project request, options do |result, operation|
|
614
633
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
615
634
|
yield result, operation if block_given?
|
616
|
-
|
635
|
+
throw :response, result
|
617
636
|
end
|
618
637
|
rescue ::Gapic::Rest::Error => e
|
619
638
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -707,7 +726,7 @@ module Google
|
|
707
726
|
@projects_stub.update_project request, options do |result, operation|
|
708
727
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
709
728
|
yield result, operation if block_given?
|
710
|
-
|
729
|
+
throw :response, result
|
711
730
|
end
|
712
731
|
rescue ::Gapic::Rest::Error => e
|
713
732
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -809,7 +828,7 @@ module Google
|
|
809
828
|
@projects_stub.move_project request, options do |result, operation|
|
810
829
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
811
830
|
yield result, operation if block_given?
|
812
|
-
|
831
|
+
throw :response, result
|
813
832
|
end
|
814
833
|
rescue ::Gapic::Rest::Error => e
|
815
834
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -928,7 +947,7 @@ module Google
|
|
928
947
|
@projects_stub.delete_project request, options do |result, operation|
|
929
948
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
930
949
|
yield result, operation if block_given?
|
931
|
-
|
950
|
+
throw :response, result
|
932
951
|
end
|
933
952
|
rescue ::Gapic::Rest::Error => e
|
934
953
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1025,7 +1044,7 @@ module Google
|
|
1025
1044
|
@projects_stub.undelete_project request, options do |result, operation|
|
1026
1045
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1027
1046
|
yield result, operation if block_given?
|
1028
|
-
|
1047
|
+
throw :response, result
|
1029
1048
|
end
|
1030
1049
|
rescue ::Gapic::Rest::Error => e
|
1031
1050
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1110,7 +1129,6 @@ module Google
|
|
1110
1129
|
|
1111
1130
|
@projects_stub.get_iam_policy request, options do |result, operation|
|
1112
1131
|
yield result, operation if block_given?
|
1113
|
-
return result
|
1114
1132
|
end
|
1115
1133
|
rescue ::Gapic::Rest::Error => e
|
1116
1134
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1241,7 +1259,6 @@ module Google
|
|
1241
1259
|
|
1242
1260
|
@projects_stub.set_iam_policy request, options do |result, operation|
|
1243
1261
|
yield result, operation if block_given?
|
1244
|
-
return result
|
1245
1262
|
end
|
1246
1263
|
rescue ::Gapic::Rest::Error => e
|
1247
1264
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1327,7 +1344,6 @@ module Google
|
|
1327
1344
|
|
1328
1345
|
@projects_stub.test_iam_permissions request, options do |result, operation|
|
1329
1346
|
yield result, operation if block_given?
|
1330
|
-
return result
|
1331
1347
|
end
|
1332
1348
|
rescue ::Gapic::Rest::Error => e
|
1333
1349
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1407,6 +1423,11 @@ module Google
|
|
1407
1423
|
# default endpoint URL. The default value of nil uses the environment
|
1408
1424
|
# universe (usually the default "googleapis.com" universe).
|
1409
1425
|
# @return [::String,nil]
|
1426
|
+
# @!attribute [rw] logger
|
1427
|
+
# A custom logger to use for request/response debug logging, or the value
|
1428
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1429
|
+
# explicitly disable logging.
|
1430
|
+
# @return [::Logger,:default,nil]
|
1410
1431
|
#
|
1411
1432
|
class Configuration
|
1412
1433
|
extend ::Gapic::Config
|
@@ -1428,6 +1449,7 @@ module Google
|
|
1428
1449
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1429
1450
|
config_attr :quota_project, nil, ::String, nil
|
1430
1451
|
config_attr :universe_domain, nil, ::String, nil
|
1452
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1431
1453
|
|
1432
1454
|
# @private
|
1433
1455
|
def initialize parent_config = nil
|
@@ -115,14 +115,6 @@ module Google
|
|
115
115
|
# Lists operations that match the specified filter in the request. If the
|
116
116
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
117
117
|
#
|
118
|
-
# NOTE: the `name` binding allows API services to override the binding
|
119
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
120
|
-
# override the binding, API services can add a binding such as
|
121
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
122
|
-
# For backwards compatibility, the default name includes the operations
|
123
|
-
# collection id, however overriding users must ensure the name binding
|
124
|
-
# is the parent resource, without the operations collection id.
|
125
|
-
#
|
126
118
|
# @overload list_operations(request, options = nil)
|
127
119
|
# Pass arguments to `list_operations` via a request object, either of type
|
128
120
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -204,7 +196,7 @@ module Google
|
|
204
196
|
@operations_stub.list_operations request, options do |result, operation|
|
205
197
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
206
198
|
yield result, operation if block_given?
|
207
|
-
|
199
|
+
throw :response, result
|
208
200
|
end
|
209
201
|
rescue ::Gapic::Rest::Error => e
|
210
202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -293,7 +285,7 @@ module Google
|
|
293
285
|
@operations_stub.get_operation request, options do |result, operation|
|
294
286
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
295
287
|
yield result, operation if block_given?
|
296
|
-
|
288
|
+
throw :response, result
|
297
289
|
end
|
298
290
|
rescue ::Gapic::Rest::Error => e
|
299
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -375,7 +367,6 @@ module Google
|
|
375
367
|
|
376
368
|
@operations_stub.delete_operation request, options do |result, operation|
|
377
369
|
yield result, operation if block_given?
|
378
|
-
return result
|
379
370
|
end
|
380
371
|
rescue ::Gapic::Rest::Error => e
|
381
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -390,8 +381,9 @@ module Google
|
|
390
381
|
# other methods to check whether the cancellation succeeded or whether the
|
391
382
|
# operation completed despite cancellation. On successful cancellation,
|
392
383
|
# the operation is not deleted; instead, it becomes an operation with
|
393
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
394
|
-
# corresponding to
|
384
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
385
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
386
|
+
# `Code.CANCELLED`.
|
395
387
|
#
|
396
388
|
# @overload cancel_operation(request, options = nil)
|
397
389
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -463,7 +455,6 @@ module Google
|
|
463
455
|
|
464
456
|
@operations_stub.cancel_operation request, options do |result, operation|
|
465
457
|
yield result, operation if block_given?
|
466
|
-
return result
|
467
458
|
end
|
468
459
|
rescue ::Gapic::Rest::Error => e
|
469
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -543,6 +534,11 @@ module Google
|
|
543
534
|
# default endpoint URL. The default value of nil uses the environment
|
544
535
|
# universe (usually the default "googleapis.com" universe).
|
545
536
|
# @return [::String,nil]
|
537
|
+
# @!attribute [rw] logger
|
538
|
+
# A custom logger to use for request/response debug logging, or the value
|
539
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
540
|
+
# explicitly disable logging.
|
541
|
+
# @return [::Logger,:default,nil]
|
546
542
|
#
|
547
543
|
class Configuration
|
548
544
|
extend ::Gapic::Config
|
@@ -564,6 +560,7 @@ module Google
|
|
564
560
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
565
561
|
config_attr :quota_project, nil, ::String, nil
|
566
562
|
config_attr :universe_domain, nil, ::String, nil
|
563
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
567
564
|
|
568
565
|
# @private
|
569
566
|
def initialize parent_config = nil
|
@@ -683,16 +680,18 @@ module Google
|
|
683
680
|
|
684
681
|
response = @client_stub.make_http_request(
|
685
682
|
verb,
|
686
|
-
uri:
|
687
|
-
body:
|
688
|
-
params:
|
683
|
+
uri: uri,
|
684
|
+
body: body || "",
|
685
|
+
params: query_string_params,
|
686
|
+
method_name: "list_operations",
|
689
687
|
options: options
|
690
688
|
)
|
691
689
|
operation = ::Gapic::Rest::TransportOperation.new response
|
692
690
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
693
|
-
|
694
|
-
|
695
|
-
|
691
|
+
catch :response do
|
692
|
+
yield result, operation if block_given?
|
693
|
+
result
|
694
|
+
end
|
696
695
|
end
|
697
696
|
|
698
697
|
##
|
@@ -721,16 +720,18 @@ module Google
|
|
721
720
|
|
722
721
|
response = @client_stub.make_http_request(
|
723
722
|
verb,
|
724
|
-
uri:
|
725
|
-
body:
|
726
|
-
params:
|
723
|
+
uri: uri,
|
724
|
+
body: body || "",
|
725
|
+
params: query_string_params,
|
726
|
+
method_name: "get_operation",
|
727
727
|
options: options
|
728
728
|
)
|
729
729
|
operation = ::Gapic::Rest::TransportOperation.new response
|
730
730
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
731
|
-
|
732
|
-
|
733
|
-
|
731
|
+
catch :response do
|
732
|
+
yield result, operation if block_given?
|
733
|
+
result
|
734
|
+
end
|
734
735
|
end
|
735
736
|
|
736
737
|
##
|
@@ -759,16 +760,18 @@ module Google
|
|
759
760
|
|
760
761
|
response = @client_stub.make_http_request(
|
761
762
|
verb,
|
762
|
-
uri:
|
763
|
-
body:
|
764
|
-
params:
|
763
|
+
uri: uri,
|
764
|
+
body: body || "",
|
765
|
+
params: query_string_params,
|
766
|
+
method_name: "delete_operation",
|
765
767
|
options: options
|
766
768
|
)
|
767
769
|
operation = ::Gapic::Rest::TransportOperation.new response
|
768
770
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
769
|
-
|
770
|
-
|
771
|
-
|
771
|
+
catch :response do
|
772
|
+
yield result, operation if block_given?
|
773
|
+
result
|
774
|
+
end
|
772
775
|
end
|
773
776
|
|
774
777
|
##
|
@@ -797,16 +800,18 @@ module Google
|
|
797
800
|
|
798
801
|
response = @client_stub.make_http_request(
|
799
802
|
verb,
|
800
|
-
uri:
|
801
|
-
body:
|
802
|
-
params:
|
803
|
+
uri: uri,
|
804
|
+
body: body || "",
|
805
|
+
params: query_string_params,
|
806
|
+
method_name: "cancel_operation",
|
803
807
|
options: options
|
804
808
|
)
|
805
809
|
operation = ::Gapic::Rest::TransportOperation.new response
|
806
810
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
807
|
-
|
808
|
-
|
809
|
-
|
811
|
+
catch :response do
|
812
|
+
yield result, operation if block_given?
|
813
|
+
result
|
814
|
+
end
|
810
815
|
end
|
811
816
|
|
812
817
|
##
|