google-cloud-api_keys-v2 0.6.0 → 0.7.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/api_keys/v2/api_keys/client.rb +51 -17
- data/lib/google/cloud/api_keys/v2/api_keys/operations.rb +25 -20
- data/lib/google/cloud/api_keys/v2/api_keys/rest/client.rb +51 -17
- data/lib/google/cloud/api_keys/v2/api_keys/rest/operations.rb +54 -42
- data/lib/google/cloud/api_keys/v2/api_keys/rest/service_stub.rb +78 -50
- data/lib/google/cloud/api_keys/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +74 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71c622db5c127ad420355d07b6875488064a5a89c4e8114ce7fcb4a37217324e
|
4
|
+
data.tar.gz: 518494faf3ef302d1865a75d15b020bbc275c14320b420690f92874bc5977394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87629db0312a88b70bf48402a9c15b126c9a4ebb13e7d4c923b8c362fe380eba9187ad267e73444e11bbfa60ae67f45fc7a480d7adf703c5158b7824e1e3d348
|
7
|
+
data.tar.gz: 8689ee2199cfedf39f8e72a5d597a412a3aea804613ec3786e53f7d53a81c467ed1fc8c28ec352d542056e6c70a2e8100b5822d8684a82bae7703e8542fcbbe4
|
data/README.md
CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/api-keys/)
|
44
44
|
for general usage information.
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
You can customize logging by modifying the `logger` configuration when
|
72
|
+
constructing a client object. For example:
|
55
73
|
|
56
74
|
```ruby
|
75
|
+
require "google/cloud/api_keys/v2"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
78
|
+
client = ::Google::Cloud::ApiKeys::V2::ApiKeys::Client.new do |config|
|
79
|
+
config.logger = Logger.new "my-app.log"
|
69
80
|
end
|
70
81
|
```
|
71
82
|
|
72
|
-
|
73
83
|
## Google Cloud Samples
|
74
84
|
|
75
85
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
@@ -30,6 +30,9 @@ module Google
|
|
30
30
|
# Manages the API keys associated with projects.
|
31
31
|
#
|
32
32
|
class Client
|
33
|
+
# @private
|
34
|
+
API_VERSION = ""
|
35
|
+
|
33
36
|
# @private
|
34
37
|
DEFAULT_ENDPOINT_TEMPLATE = "apikeys.$UNIVERSE_DOMAIN$"
|
35
38
|
|
@@ -163,8 +166,19 @@ module Google
|
|
163
166
|
universe_domain: @config.universe_domain,
|
164
167
|
channel_args: @config.channel_args,
|
165
168
|
interceptors: @config.interceptors,
|
166
|
-
channel_pool_config: @config.channel_pool
|
169
|
+
channel_pool_config: @config.channel_pool,
|
170
|
+
logger: @config.logger
|
167
171
|
)
|
172
|
+
|
173
|
+
@api_keys_stub.stub_logger&.info do |entry|
|
174
|
+
entry.set_system_name
|
175
|
+
entry.set_service
|
176
|
+
entry.message = "Created client for #{entry.service}"
|
177
|
+
entry.set_credentials_fields credentials
|
178
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
179
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
180
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
181
|
+
end
|
168
182
|
end
|
169
183
|
|
170
184
|
##
|
@@ -174,6 +188,15 @@ module Google
|
|
174
188
|
#
|
175
189
|
attr_reader :operations_client
|
176
190
|
|
191
|
+
##
|
192
|
+
# The logger used for request/response debug logging.
|
193
|
+
#
|
194
|
+
# @return [Logger]
|
195
|
+
#
|
196
|
+
def logger
|
197
|
+
@api_keys_stub.logger
|
198
|
+
end
|
199
|
+
|
177
200
|
# Service calls
|
178
201
|
|
179
202
|
##
|
@@ -255,10 +278,11 @@ module Google
|
|
255
278
|
# Customize the options with defaults
|
256
279
|
metadata = @config.rpcs.create_key.metadata.to_h
|
257
280
|
|
258
|
-
# Set x-goog-api-client
|
281
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
259
282
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
260
283
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
261
284
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
285
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
262
286
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
263
287
|
|
264
288
|
header_params = {}
|
@@ -280,7 +304,7 @@ module Google
|
|
280
304
|
@api_keys_stub.call_rpc :create_key, request, options: options do |response, operation|
|
281
305
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
282
306
|
yield response, operation if block_given?
|
283
|
-
|
307
|
+
throw :response, response
|
284
308
|
end
|
285
309
|
rescue ::GRPC::BadStatus => e
|
286
310
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -356,10 +380,11 @@ module Google
|
|
356
380
|
# Customize the options with defaults
|
357
381
|
metadata = @config.rpcs.list_keys.metadata.to_h
|
358
382
|
|
359
|
-
# Set x-goog-api-client
|
383
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
360
384
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
361
385
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
362
386
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
387
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
363
388
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
364
389
|
|
365
390
|
header_params = {}
|
@@ -381,7 +406,7 @@ module Google
|
|
381
406
|
@api_keys_stub.call_rpc :list_keys, request, options: options do |response, operation|
|
382
407
|
response = ::Gapic::PagedEnumerable.new @api_keys_stub, :list_keys, request, response, operation, options
|
383
408
|
yield response, operation if block_given?
|
384
|
-
|
409
|
+
throw :response, response
|
385
410
|
end
|
386
411
|
rescue ::GRPC::BadStatus => e
|
387
412
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -446,10 +471,11 @@ module Google
|
|
446
471
|
# Customize the options with defaults
|
447
472
|
metadata = @config.rpcs.get_key.metadata.to_h
|
448
473
|
|
449
|
-
# Set x-goog-api-client
|
474
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
450
475
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
451
476
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
452
477
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
478
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
453
479
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
454
480
|
|
455
481
|
header_params = {}
|
@@ -470,7 +496,6 @@ module Google
|
|
470
496
|
|
471
497
|
@api_keys_stub.call_rpc :get_key, request, options: options do |response, operation|
|
472
498
|
yield response, operation if block_given?
|
473
|
-
return response
|
474
499
|
end
|
475
500
|
rescue ::GRPC::BadStatus => e
|
476
501
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -534,10 +559,11 @@ module Google
|
|
534
559
|
# Customize the options with defaults
|
535
560
|
metadata = @config.rpcs.get_key_string.metadata.to_h
|
536
561
|
|
537
|
-
# Set x-goog-api-client
|
562
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
538
563
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
539
564
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
540
565
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
566
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
541
567
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
542
568
|
|
543
569
|
header_params = {}
|
@@ -558,7 +584,6 @@ module Google
|
|
558
584
|
|
559
585
|
@api_keys_stub.call_rpc :get_key_string, request, options: options do |response, operation|
|
560
586
|
yield response, operation if block_given?
|
561
|
-
return response
|
562
587
|
end
|
563
588
|
rescue ::GRPC::BadStatus => e
|
564
589
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -640,10 +665,11 @@ module Google
|
|
640
665
|
# Customize the options with defaults
|
641
666
|
metadata = @config.rpcs.update_key.metadata.to_h
|
642
667
|
|
643
|
-
# Set x-goog-api-client
|
668
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
644
669
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
645
670
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
646
671
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
672
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
647
673
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
648
674
|
|
649
675
|
header_params = {}
|
@@ -665,7 +691,7 @@ module Google
|
|
665
691
|
@api_keys_stub.call_rpc :update_key, request, options: options do |response, operation|
|
666
692
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
667
693
|
yield response, operation if block_given?
|
668
|
-
|
694
|
+
throw :response, response
|
669
695
|
end
|
670
696
|
rescue ::GRPC::BadStatus => e
|
671
697
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -740,10 +766,11 @@ module Google
|
|
740
766
|
# Customize the options with defaults
|
741
767
|
metadata = @config.rpcs.delete_key.metadata.to_h
|
742
768
|
|
743
|
-
# Set x-goog-api-client
|
769
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
744
770
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
745
771
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
746
772
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
773
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
747
774
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
748
775
|
|
749
776
|
header_params = {}
|
@@ -765,7 +792,7 @@ module Google
|
|
765
792
|
@api_keys_stub.call_rpc :delete_key, request, options: options do |response, operation|
|
766
793
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
767
794
|
yield response, operation if block_given?
|
768
|
-
|
795
|
+
throw :response, response
|
769
796
|
end
|
770
797
|
rescue ::GRPC::BadStatus => e
|
771
798
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -836,10 +863,11 @@ module Google
|
|
836
863
|
# Customize the options with defaults
|
837
864
|
metadata = @config.rpcs.undelete_key.metadata.to_h
|
838
865
|
|
839
|
-
# Set x-goog-api-client
|
866
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
840
867
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
841
868
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
842
869
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
870
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
843
871
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
844
872
|
|
845
873
|
header_params = {}
|
@@ -861,7 +889,7 @@ module Google
|
|
861
889
|
@api_keys_stub.call_rpc :undelete_key, request, options: options do |response, operation|
|
862
890
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
863
891
|
yield response, operation if block_given?
|
864
|
-
|
892
|
+
throw :response, response
|
865
893
|
end
|
866
894
|
rescue ::GRPC::BadStatus => e
|
867
895
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -926,10 +954,11 @@ module Google
|
|
926
954
|
# Customize the options with defaults
|
927
955
|
metadata = @config.rpcs.lookup_key.metadata.to_h
|
928
956
|
|
929
|
-
# Set x-goog-api-client
|
957
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
930
958
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
931
959
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
932
960
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
961
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
933
962
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
934
963
|
|
935
964
|
options.apply_defaults timeout: @config.rpcs.lookup_key.timeout,
|
@@ -942,7 +971,6 @@ module Google
|
|
942
971
|
|
943
972
|
@api_keys_stub.call_rpc :lookup_key, request, options: options do |response, operation|
|
944
973
|
yield response, operation if block_given?
|
945
|
-
return response
|
946
974
|
end
|
947
975
|
rescue ::GRPC::BadStatus => e
|
948
976
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1031,6 +1059,11 @@ module Google
|
|
1031
1059
|
# default endpoint URL. The default value of nil uses the environment
|
1032
1060
|
# universe (usually the default "googleapis.com" universe).
|
1033
1061
|
# @return [::String,nil]
|
1062
|
+
# @!attribute [rw] logger
|
1063
|
+
# A custom logger to use for request/response debug logging, or the value
|
1064
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1065
|
+
# explicitly disable logging.
|
1066
|
+
# @return [::Logger,:default,nil]
|
1034
1067
|
#
|
1035
1068
|
class Configuration
|
1036
1069
|
extend ::Gapic::Config
|
@@ -1055,6 +1088,7 @@ module Google
|
|
1055
1088
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1056
1089
|
config_attr :quota_project, nil, ::String, nil
|
1057
1090
|
config_attr :universe_domain, nil, ::String, nil
|
1091
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1058
1092
|
|
1059
1093
|
# @private
|
1060
1094
|
def initialize parent_config = nil
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module ApiKeys
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
API_VERSION = ""
|
31
|
+
|
29
32
|
# @private
|
30
33
|
DEFAULT_ENDPOINT_TEMPLATE = "apikeys.$UNIVERSE_DOMAIN$"
|
31
34
|
|
@@ -121,14 +124,6 @@ module Google
|
|
121
124
|
# Lists operations that match the specified filter in the request. If the
|
122
125
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
123
126
|
#
|
124
|
-
# NOTE: the `name` binding allows API services to override the binding
|
125
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
126
|
-
# override the binding, API services can add a binding such as
|
127
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
128
|
-
# For backwards compatibility, the default name includes the operations
|
129
|
-
# collection id, however overriding users must ensure the name binding
|
130
|
-
# is the parent resource, without the operations collection id.
|
131
|
-
#
|
132
127
|
# @overload list_operations(request, options = nil)
|
133
128
|
# Pass arguments to `list_operations` via a request object, either of type
|
134
129
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -191,10 +186,11 @@ module Google
|
|
191
186
|
# Customize the options with defaults
|
192
187
|
metadata = @config.rpcs.list_operations.metadata.to_h
|
193
188
|
|
194
|
-
# Set x-goog-api-client
|
189
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
195
190
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
196
191
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
197
192
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
193
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
198
194
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
199
195
|
|
200
196
|
header_params = {}
|
@@ -217,7 +213,7 @@ module Google
|
|
217
213
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
218
214
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
219
215
|
yield response, operation if block_given?
|
220
|
-
|
216
|
+
throw :response, response
|
221
217
|
end
|
222
218
|
rescue ::GRPC::BadStatus => e
|
223
219
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -287,10 +283,11 @@ module Google
|
|
287
283
|
# Customize the options with defaults
|
288
284
|
metadata = @config.rpcs.get_operation.metadata.to_h
|
289
285
|
|
290
|
-
# Set x-goog-api-client
|
286
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
291
287
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
292
288
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
293
289
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
290
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
294
291
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
295
292
|
|
296
293
|
header_params = {}
|
@@ -312,7 +309,7 @@ module Google
|
|
312
309
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
313
310
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
314
311
|
yield response, operation if block_given?
|
315
|
-
|
312
|
+
throw :response, response
|
316
313
|
end
|
317
314
|
rescue ::GRPC::BadStatus => e
|
318
315
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -376,10 +373,11 @@ module Google
|
|
376
373
|
# Customize the options with defaults
|
377
374
|
metadata = @config.rpcs.delete_operation.metadata.to_h
|
378
375
|
|
379
|
-
# Set x-goog-api-client
|
376
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
380
377
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
381
378
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
382
379
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
380
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
383
381
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
384
382
|
|
385
383
|
header_params = {}
|
@@ -400,7 +398,6 @@ module Google
|
|
400
398
|
|
401
399
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
402
400
|
yield response, operation if block_given?
|
403
|
-
return response
|
404
401
|
end
|
405
402
|
rescue ::GRPC::BadStatus => e
|
406
403
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -415,8 +412,9 @@ module Google
|
|
415
412
|
# other methods to check whether the cancellation succeeded or whether the
|
416
413
|
# operation completed despite cancellation. On successful cancellation,
|
417
414
|
# the operation is not deleted; instead, it becomes an operation with
|
418
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
419
|
-
# 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`.
|
420
418
|
#
|
421
419
|
# @overload cancel_operation(request, options = nil)
|
422
420
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -470,10 +468,11 @@ module Google
|
|
470
468
|
# Customize the options with defaults
|
471
469
|
metadata = @config.rpcs.cancel_operation.metadata.to_h
|
472
470
|
|
473
|
-
# Set x-goog-api-client
|
471
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
474
472
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
475
473
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
476
474
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
475
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
477
476
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
478
477
|
|
479
478
|
header_params = {}
|
@@ -494,7 +493,6 @@ module Google
|
|
494
493
|
|
495
494
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
496
495
|
yield response, operation if block_given?
|
497
|
-
return response
|
498
496
|
end
|
499
497
|
rescue ::GRPC::BadStatus => e
|
500
498
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -574,10 +572,11 @@ module Google
|
|
574
572
|
# Customize the options with defaults
|
575
573
|
metadata = @config.rpcs.wait_operation.metadata.to_h
|
576
574
|
|
577
|
-
# Set x-goog-api-client
|
575
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
578
576
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
579
577
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
580
578
|
gapic_version: ::Google::Cloud::ApiKeys::V2::VERSION
|
579
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
581
580
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
582
581
|
|
583
582
|
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
@@ -591,7 +590,7 @@ module Google
|
|
591
590
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
592
591
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
593
592
|
yield response, operation if block_given?
|
594
|
-
|
593
|
+
throw :response, response
|
595
594
|
end
|
596
595
|
rescue ::GRPC::BadStatus => e
|
597
596
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -680,6 +679,11 @@ module Google
|
|
680
679
|
# default endpoint URL. The default value of nil uses the environment
|
681
680
|
# universe (usually the default "googleapis.com" universe).
|
682
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]
|
683
687
|
#
|
684
688
|
class Configuration
|
685
689
|
extend ::Gapic::Config
|
@@ -704,6 +708,7 @@ module Google
|
|
704
708
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
705
709
|
config_attr :quota_project, nil, ::String, nil
|
706
710
|
config_attr :universe_domain, nil, ::String, nil
|
711
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
707
712
|
|
708
713
|
# @private
|
709
714
|
def initialize parent_config = nil
|