google-cloud-connectors-v1 0.1.1 → 0.3.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/connectors/v1/connectors/client.rb +46 -18
- data/lib/google/cloud/connectors/v1/connectors/operations.rb +19 -15
- data/lib/google/cloud/connectors/v1/connectors/rest/client.rb +42 -18
- data/lib/google/cloud/connectors/v1/connectors/rest/operations.rb +50 -38
- data/lib/google/cloud/connectors/v1/connectors/rest/service_stub.rb +150 -104
- data/lib/google/cloud/connectors/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/connectors/v1/authconfig.rb +8 -0
- data/proto_docs/google/cloud/connectors/v1/common.rb +8 -0
- data/proto_docs/google/cloud/connectors/v1/connector_version.rb +4 -0
- data/proto_docs/google/cloud/connectors/v1/destination_config.rb +4 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- data/proto_docs/google/protobuf/struct.rb +12 -0
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b93699e172b422a2faf3803ba631ad17d7287636d870f560a9c9a7f03d39bcf3
|
4
|
+
data.tar.gz: 1f269a52bbc67e8458355a5f2ff40ec15102af082b6959bd937ce1c92a868813
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e705a1a146ed9a67e0312a86b5c202d0eacd5393060309a9f35dbd7338bc93e143fa52469c849cf0faf91b9a52ffd1d904eb80b8ad8dbb228c0d805a3fbf9486
|
7
|
+
data.tar.gz: 0b974b0d7bcc5443fdc22f715d34f23bfd07664a41fd68b0d3c9479ff54fc11f0c74f0bd73d463731d3da66de3601d551011e5a0e28c2034c2a2dce5f6461d81
|
data/README.md
CHANGED
@@ -40,40 +40,50 @@ response = client.list_connections request
|
|
40
40
|
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-connectors-v1/latest)
|
41
41
|
for class and method documentation.
|
42
42
|
|
43
|
-
##
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
43
|
+
## Debug Logging
|
44
|
+
|
45
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
46
|
+
your application's integration with the API. When logging is activated, key
|
47
|
+
events such as requests and responses, along with data payloads and metadata
|
48
|
+
such as headers and client configuration, are logged to the standard error
|
49
|
+
stream.
|
50
|
+
|
51
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
52
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
53
|
+
customers, private keys, or other security data that could be compromising if
|
54
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
55
|
+
the principle of least access. Google also recommends that Client Library Debug
|
56
|
+
Logging be enabled only temporarily during active debugging, and not used
|
57
|
+
permanently in production.
|
58
|
+
|
59
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
60
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
61
|
+
list of client library gem names. This will select the default logging behavior,
|
62
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
63
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
64
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
65
|
+
results in logs appearing alongside your application logs in the
|
66
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
67
|
+
|
68
|
+
You can customize logging by modifying the `logger` configuration when
|
69
|
+
constructing a client object. For example:
|
52
70
|
|
53
71
|
```ruby
|
72
|
+
require "google/cloud/connectors/v1"
|
54
73
|
require "logger"
|
55
74
|
|
56
|
-
|
57
|
-
|
58
|
-
def logger
|
59
|
-
LOGGER
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
64
|
-
module GRPC
|
65
|
-
extend MyLogger
|
75
|
+
client = ::Google::Cloud::Connectors::V1::Connectors::Client.new do |config|
|
76
|
+
config.logger = Logger.new "my-app.log"
|
66
77
|
end
|
67
78
|
```
|
68
79
|
|
69
|
-
|
70
80
|
## Google Cloud Samples
|
71
81
|
|
72
82
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
73
83
|
|
74
84
|
## Supported Ruby Versions
|
75
85
|
|
76
|
-
This library is supported on Ruby
|
86
|
+
This library is supported on Ruby 3.0+.
|
77
87
|
|
78
88
|
Google provides official support for Ruby versions that are actively supported
|
79
89
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -232,14 +232,26 @@ module Google
|
|
232
232
|
universe_domain: @config.universe_domain,
|
233
233
|
channel_args: @config.channel_args,
|
234
234
|
interceptors: @config.interceptors,
|
235
|
-
channel_pool_config: @config.channel_pool
|
235
|
+
channel_pool_config: @config.channel_pool,
|
236
|
+
logger: @config.logger
|
236
237
|
)
|
237
238
|
|
239
|
+
@connectors_stub.stub_logger&.info do |entry|
|
240
|
+
entry.set_system_name
|
241
|
+
entry.set_service
|
242
|
+
entry.message = "Created client for #{entry.service}"
|
243
|
+
entry.set_credentials_fields credentials
|
244
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
245
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
246
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
247
|
+
end
|
248
|
+
|
238
249
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
239
250
|
config.credentials = credentials
|
240
251
|
config.quota_project = @quota_project_id
|
241
252
|
config.endpoint = @connectors_stub.endpoint
|
242
253
|
config.universe_domain = @connectors_stub.universe_domain
|
254
|
+
config.logger = @connectors_stub.logger if config.respond_to? :logger=
|
243
255
|
end
|
244
256
|
|
245
257
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
@@ -247,6 +259,7 @@ module Google
|
|
247
259
|
config.quota_project = @quota_project_id
|
248
260
|
config.endpoint = @connectors_stub.endpoint
|
249
261
|
config.universe_domain = @connectors_stub.universe_domain
|
262
|
+
config.logger = @connectors_stub.logger if config.respond_to? :logger=
|
250
263
|
end
|
251
264
|
end
|
252
265
|
|
@@ -271,6 +284,15 @@ module Google
|
|
271
284
|
#
|
272
285
|
attr_reader :iam_policy_client
|
273
286
|
|
287
|
+
##
|
288
|
+
# The logger used for request/response debug logging.
|
289
|
+
#
|
290
|
+
# @return [Logger]
|
291
|
+
#
|
292
|
+
def logger
|
293
|
+
@connectors_stub.logger
|
294
|
+
end
|
295
|
+
|
274
296
|
# Service calls
|
275
297
|
|
276
298
|
##
|
@@ -370,7 +392,7 @@ module Google
|
|
370
392
|
@connectors_stub.call_rpc :list_connections, request, options: options do |response, operation|
|
371
393
|
response = ::Gapic::PagedEnumerable.new @connectors_stub, :list_connections, request, response, operation, options
|
372
394
|
yield response, operation if block_given?
|
373
|
-
|
395
|
+
throw :response, response
|
374
396
|
end
|
375
397
|
rescue ::GRPC::BadStatus => e
|
376
398
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -460,7 +482,6 @@ module Google
|
|
460
482
|
|
461
483
|
@connectors_stub.call_rpc :get_connection, request, options: options do |response, operation|
|
462
484
|
yield response, operation if block_given?
|
463
|
-
return response
|
464
485
|
end
|
465
486
|
rescue ::GRPC::BadStatus => e
|
466
487
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -560,7 +581,7 @@ module Google
|
|
560
581
|
@connectors_stub.call_rpc :create_connection, request, options: options do |response, operation|
|
561
582
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
562
583
|
yield response, operation if block_given?
|
563
|
-
|
584
|
+
throw :response, response
|
564
585
|
end
|
565
586
|
rescue ::GRPC::BadStatus => e
|
566
587
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -671,7 +692,7 @@ module Google
|
|
671
692
|
@connectors_stub.call_rpc :update_connection, request, options: options do |response, operation|
|
672
693
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
673
694
|
yield response, operation if block_given?
|
674
|
-
|
695
|
+
throw :response, response
|
675
696
|
end
|
676
697
|
rescue ::GRPC::BadStatus => e
|
677
698
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -766,7 +787,7 @@ module Google
|
|
766
787
|
@connectors_stub.call_rpc :delete_connection, request, options: options do |response, operation|
|
767
788
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
768
789
|
yield response, operation if block_given?
|
769
|
-
|
790
|
+
throw :response, response
|
770
791
|
end
|
771
792
|
rescue ::GRPC::BadStatus => e
|
772
793
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -863,7 +884,7 @@ module Google
|
|
863
884
|
@connectors_stub.call_rpc :list_providers, request, options: options do |response, operation|
|
864
885
|
response = ::Gapic::PagedEnumerable.new @connectors_stub, :list_providers, request, response, operation, options
|
865
886
|
yield response, operation if block_given?
|
866
|
-
|
887
|
+
throw :response, response
|
867
888
|
end
|
868
889
|
rescue ::GRPC::BadStatus => e
|
869
890
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -951,7 +972,6 @@ module Google
|
|
951
972
|
|
952
973
|
@connectors_stub.call_rpc :get_provider, request, options: options do |response, operation|
|
953
974
|
yield response, operation if block_given?
|
954
|
-
return response
|
955
975
|
end
|
956
976
|
rescue ::GRPC::BadStatus => e
|
957
977
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1048,7 +1068,7 @@ module Google
|
|
1048
1068
|
@connectors_stub.call_rpc :list_connectors, request, options: options do |response, operation|
|
1049
1069
|
response = ::Gapic::PagedEnumerable.new @connectors_stub, :list_connectors, request, response, operation, options
|
1050
1070
|
yield response, operation if block_given?
|
1051
|
-
|
1071
|
+
throw :response, response
|
1052
1072
|
end
|
1053
1073
|
rescue ::GRPC::BadStatus => e
|
1054
1074
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1136,7 +1156,6 @@ module Google
|
|
1136
1156
|
|
1137
1157
|
@connectors_stub.call_rpc :get_connector, request, options: options do |response, operation|
|
1138
1158
|
yield response, operation if block_given?
|
1139
|
-
return response
|
1140
1159
|
end
|
1141
1160
|
rescue ::GRPC::BadStatus => e
|
1142
1161
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1236,7 +1255,7 @@ module Google
|
|
1236
1255
|
@connectors_stub.call_rpc :list_connector_versions, request, options: options do |response, operation|
|
1237
1256
|
response = ::Gapic::PagedEnumerable.new @connectors_stub, :list_connector_versions, request, response, operation, options
|
1238
1257
|
yield response, operation if block_given?
|
1239
|
-
|
1258
|
+
throw :response, response
|
1240
1259
|
end
|
1241
1260
|
rescue ::GRPC::BadStatus => e
|
1242
1261
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1327,7 +1346,6 @@ module Google
|
|
1327
1346
|
|
1328
1347
|
@connectors_stub.call_rpc :get_connector_version, request, options: options do |response, operation|
|
1329
1348
|
yield response, operation if block_given?
|
1330
|
-
return response
|
1331
1349
|
end
|
1332
1350
|
rescue ::GRPC::BadStatus => e
|
1333
1351
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1416,7 +1434,6 @@ module Google
|
|
1416
1434
|
|
1417
1435
|
@connectors_stub.call_rpc :get_connection_schema_metadata, request, options: options do |response, operation|
|
1418
1436
|
yield response, operation if block_given?
|
1419
|
-
return response
|
1420
1437
|
end
|
1421
1438
|
rescue ::GRPC::BadStatus => e
|
1422
1439
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1512,7 +1529,7 @@ module Google
|
|
1512
1529
|
@connectors_stub.call_rpc :refresh_connection_schema_metadata, request, options: options do |response, operation|
|
1513
1530
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1514
1531
|
yield response, operation if block_given?
|
1515
|
-
|
1532
|
+
throw :response, response
|
1516
1533
|
end
|
1517
1534
|
rescue ::GRPC::BadStatus => e
|
1518
1535
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1616,7 +1633,7 @@ module Google
|
|
1616
1633
|
@connectors_stub.call_rpc :list_runtime_entity_schemas, request, options: options do |response, operation|
|
1617
1634
|
response = ::Gapic::PagedEnumerable.new @connectors_stub, :list_runtime_entity_schemas, request, response, operation, options
|
1618
1635
|
yield response, operation if block_given?
|
1619
|
-
|
1636
|
+
throw :response, response
|
1620
1637
|
end
|
1621
1638
|
rescue ::GRPC::BadStatus => e
|
1622
1639
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1720,7 +1737,7 @@ module Google
|
|
1720
1737
|
@connectors_stub.call_rpc :list_runtime_action_schemas, request, options: options do |response, operation|
|
1721
1738
|
response = ::Gapic::PagedEnumerable.new @connectors_stub, :list_runtime_action_schemas, request, response, operation, options
|
1722
1739
|
yield response, operation if block_given?
|
1723
|
-
|
1740
|
+
throw :response, response
|
1724
1741
|
end
|
1725
1742
|
rescue ::GRPC::BadStatus => e
|
1726
1743
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1808,7 +1825,6 @@ module Google
|
|
1808
1825
|
|
1809
1826
|
@connectors_stub.call_rpc :get_runtime_config, request, options: options do |response, operation|
|
1810
1827
|
yield response, operation if block_given?
|
1811
|
-
return response
|
1812
1828
|
end
|
1813
1829
|
rescue ::GRPC::BadStatus => e
|
1814
1830
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1895,7 +1911,6 @@ module Google
|
|
1895
1911
|
|
1896
1912
|
@connectors_stub.call_rpc :get_global_settings, request, options: options do |response, operation|
|
1897
1913
|
yield response, operation if block_given?
|
1898
|
-
return response
|
1899
1914
|
end
|
1900
1915
|
rescue ::GRPC::BadStatus => e
|
1901
1916
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1945,6 +1960,13 @@ module Google
|
|
1945
1960
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1946
1961
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1947
1962
|
# * (`nil`) indicating no credentials
|
1963
|
+
#
|
1964
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1965
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1966
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1967
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1968
|
+
# For more information, refer to [Validate credential configurations from external
|
1969
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1948
1970
|
# @return [::Object]
|
1949
1971
|
# @!attribute [rw] scope
|
1950
1972
|
# The OAuth scopes
|
@@ -1984,6 +2006,11 @@ module Google
|
|
1984
2006
|
# default endpoint URL. The default value of nil uses the environment
|
1985
2007
|
# universe (usually the default "googleapis.com" universe).
|
1986
2008
|
# @return [::String,nil]
|
2009
|
+
# @!attribute [rw] logger
|
2010
|
+
# A custom logger to use for request/response debug logging, or the value
|
2011
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2012
|
+
# explicitly disable logging.
|
2013
|
+
# @return [::Logger,:default,nil]
|
1987
2014
|
#
|
1988
2015
|
class Configuration
|
1989
2016
|
extend ::Gapic::Config
|
@@ -2008,6 +2035,7 @@ module Google
|
|
2008
2035
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2009
2036
|
config_attr :quota_project, nil, ::String, nil
|
2010
2037
|
config_attr :universe_domain, nil, ::String, nil
|
2038
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2011
2039
|
|
2012
2040
|
# @private
|
2013
2041
|
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
|
@@ -225,15 +225,27 @@ module Google
|
|
225
225
|
endpoint: @config.endpoint,
|
226
226
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
227
227
|
universe_domain: @config.universe_domain,
|
228
|
-
credentials: credentials
|
228
|
+
credentials: credentials,
|
229
|
+
logger: @config.logger
|
229
230
|
)
|
230
231
|
|
232
|
+
@connectors_stub.logger(stub: true)&.info do |entry|
|
233
|
+
entry.set_system_name
|
234
|
+
entry.set_service
|
235
|
+
entry.message = "Created client for #{entry.service}"
|
236
|
+
entry.set_credentials_fields credentials
|
237
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
238
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
239
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
240
|
+
end
|
241
|
+
|
231
242
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
232
243
|
config.credentials = credentials
|
233
244
|
config.quota_project = @quota_project_id
|
234
245
|
config.endpoint = @connectors_stub.endpoint
|
235
246
|
config.universe_domain = @connectors_stub.universe_domain
|
236
247
|
config.bindings_override = @config.bindings_override
|
248
|
+
config.logger = @connectors_stub.logger if config.respond_to? :logger=
|
237
249
|
end
|
238
250
|
|
239
251
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -242,6 +254,7 @@ module Google
|
|
242
254
|
config.endpoint = @connectors_stub.endpoint
|
243
255
|
config.universe_domain = @connectors_stub.universe_domain
|
244
256
|
config.bindings_override = @config.bindings_override
|
257
|
+
config.logger = @connectors_stub.logger if config.respond_to? :logger=
|
245
258
|
end
|
246
259
|
end
|
247
260
|
|
@@ -266,6 +279,15 @@ module Google
|
|
266
279
|
#
|
267
280
|
attr_reader :iam_policy_client
|
268
281
|
|
282
|
+
##
|
283
|
+
# The logger used for request/response debug logging.
|
284
|
+
#
|
285
|
+
# @return [Logger]
|
286
|
+
#
|
287
|
+
def logger
|
288
|
+
@connectors_stub.logger
|
289
|
+
end
|
290
|
+
|
269
291
|
# Service calls
|
270
292
|
|
271
293
|
##
|
@@ -357,7 +379,6 @@ module Google
|
|
357
379
|
|
358
380
|
@connectors_stub.list_connections request, options do |result, operation|
|
359
381
|
yield result, operation if block_given?
|
360
|
-
return result
|
361
382
|
end
|
362
383
|
rescue ::Gapic::Rest::Error => e
|
363
384
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -440,7 +461,6 @@ module Google
|
|
440
461
|
|
441
462
|
@connectors_stub.get_connection request, options do |result, operation|
|
442
463
|
yield result, operation if block_given?
|
443
|
-
return result
|
444
464
|
end
|
445
465
|
rescue ::Gapic::Rest::Error => e
|
446
466
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -533,7 +553,7 @@ module Google
|
|
533
553
|
@connectors_stub.create_connection request, options do |result, operation|
|
534
554
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
535
555
|
yield result, operation if block_given?
|
536
|
-
|
556
|
+
throw :response, result
|
537
557
|
end
|
538
558
|
rescue ::Gapic::Rest::Error => e
|
539
559
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -637,7 +657,7 @@ module Google
|
|
637
657
|
@connectors_stub.update_connection request, options do |result, operation|
|
638
658
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
639
659
|
yield result, operation if block_given?
|
640
|
-
|
660
|
+
throw :response, result
|
641
661
|
end
|
642
662
|
rescue ::Gapic::Rest::Error => e
|
643
663
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -725,7 +745,7 @@ module Google
|
|
725
745
|
@connectors_stub.delete_connection request, options do |result, operation|
|
726
746
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
727
747
|
yield result, operation if block_given?
|
728
|
-
|
748
|
+
throw :response, result
|
729
749
|
end
|
730
750
|
rescue ::Gapic::Rest::Error => e
|
731
751
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -814,7 +834,6 @@ module Google
|
|
814
834
|
|
815
835
|
@connectors_stub.list_providers request, options do |result, operation|
|
816
836
|
yield result, operation if block_given?
|
817
|
-
return result
|
818
837
|
end
|
819
838
|
rescue ::Gapic::Rest::Error => e
|
820
839
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -895,7 +914,6 @@ module Google
|
|
895
914
|
|
896
915
|
@connectors_stub.get_provider request, options do |result, operation|
|
897
916
|
yield result, operation if block_given?
|
898
|
-
return result
|
899
917
|
end
|
900
918
|
rescue ::Gapic::Rest::Error => e
|
901
919
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -984,7 +1002,6 @@ module Google
|
|
984
1002
|
|
985
1003
|
@connectors_stub.list_connectors request, options do |result, operation|
|
986
1004
|
yield result, operation if block_given?
|
987
|
-
return result
|
988
1005
|
end
|
989
1006
|
rescue ::Gapic::Rest::Error => e
|
990
1007
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1065,7 +1082,6 @@ module Google
|
|
1065
1082
|
|
1066
1083
|
@connectors_stub.get_connector request, options do |result, operation|
|
1067
1084
|
yield result, operation if block_given?
|
1068
|
-
return result
|
1069
1085
|
end
|
1070
1086
|
rescue ::Gapic::Rest::Error => e
|
1071
1087
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1157,7 +1173,6 @@ module Google
|
|
1157
1173
|
|
1158
1174
|
@connectors_stub.list_connector_versions request, options do |result, operation|
|
1159
1175
|
yield result, operation if block_given?
|
1160
|
-
return result
|
1161
1176
|
end
|
1162
1177
|
rescue ::Gapic::Rest::Error => e
|
1163
1178
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1241,7 +1256,6 @@ module Google
|
|
1241
1256
|
|
1242
1257
|
@connectors_stub.get_connector_version request, options do |result, operation|
|
1243
1258
|
yield result, operation if block_given?
|
1244
|
-
return result
|
1245
1259
|
end
|
1246
1260
|
rescue ::Gapic::Rest::Error => e
|
1247
1261
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1323,7 +1337,6 @@ module Google
|
|
1323
1337
|
|
1324
1338
|
@connectors_stub.get_connection_schema_metadata request, options do |result, operation|
|
1325
1339
|
yield result, operation if block_given?
|
1326
|
-
return result
|
1327
1340
|
end
|
1328
1341
|
rescue ::Gapic::Rest::Error => e
|
1329
1342
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1412,7 +1425,7 @@ module Google
|
|
1412
1425
|
@connectors_stub.refresh_connection_schema_metadata request, options do |result, operation|
|
1413
1426
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1414
1427
|
yield result, operation if block_given?
|
1415
|
-
|
1428
|
+
throw :response, result
|
1416
1429
|
end
|
1417
1430
|
rescue ::Gapic::Rest::Error => e
|
1418
1431
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1509,7 +1522,7 @@ module Google
|
|
1509
1522
|
@connectors_stub.list_runtime_entity_schemas request, options do |result, operation|
|
1510
1523
|
result = ::Gapic::Rest::PagedEnumerable.new @connectors_stub, :list_runtime_entity_schemas, "runtime_entity_schemas", request, result, options
|
1511
1524
|
yield result, operation if block_given?
|
1512
|
-
|
1525
|
+
throw :response, result
|
1513
1526
|
end
|
1514
1527
|
rescue ::Gapic::Rest::Error => e
|
1515
1528
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1606,7 +1619,7 @@ module Google
|
|
1606
1619
|
@connectors_stub.list_runtime_action_schemas request, options do |result, operation|
|
1607
1620
|
result = ::Gapic::Rest::PagedEnumerable.new @connectors_stub, :list_runtime_action_schemas, "runtime_action_schemas", request, result, options
|
1608
1621
|
yield result, operation if block_given?
|
1609
|
-
|
1622
|
+
throw :response, result
|
1610
1623
|
end
|
1611
1624
|
rescue ::Gapic::Rest::Error => e
|
1612
1625
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1687,7 +1700,6 @@ module Google
|
|
1687
1700
|
|
1688
1701
|
@connectors_stub.get_runtime_config request, options do |result, operation|
|
1689
1702
|
yield result, operation if block_given?
|
1690
|
-
return result
|
1691
1703
|
end
|
1692
1704
|
rescue ::Gapic::Rest::Error => e
|
1693
1705
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1767,7 +1779,6 @@ module Google
|
|
1767
1779
|
|
1768
1780
|
@connectors_stub.get_global_settings request, options do |result, operation|
|
1769
1781
|
yield result, operation if block_given?
|
1770
|
-
return result
|
1771
1782
|
end
|
1772
1783
|
rescue ::Gapic::Rest::Error => e
|
1773
1784
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1815,6 +1826,13 @@ module Google
|
|
1815
1826
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1816
1827
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1817
1828
|
# * (`nil`) indicating no credentials
|
1829
|
+
#
|
1830
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1831
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1832
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1833
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1834
|
+
# For more information, refer to [Validate credential configurations from external
|
1835
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1818
1836
|
# @return [::Object]
|
1819
1837
|
# @!attribute [rw] scope
|
1820
1838
|
# The OAuth scopes
|
@@ -1847,6 +1865,11 @@ module Google
|
|
1847
1865
|
# default endpoint URL. The default value of nil uses the environment
|
1848
1866
|
# universe (usually the default "googleapis.com" universe).
|
1849
1867
|
# @return [::String,nil]
|
1868
|
+
# @!attribute [rw] logger
|
1869
|
+
# A custom logger to use for request/response debug logging, or the value
|
1870
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1871
|
+
# explicitly disable logging.
|
1872
|
+
# @return [::Logger,:default,nil]
|
1850
1873
|
#
|
1851
1874
|
class Configuration
|
1852
1875
|
extend ::Gapic::Config
|
@@ -1875,6 +1898,7 @@ module Google
|
|
1875
1898
|
# by the host service.
|
1876
1899
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1877
1900
|
config_attr :bindings_override, {}, ::Hash, nil
|
1901
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1878
1902
|
|
1879
1903
|
# @private
|
1880
1904
|
def initialize parent_config = nil
|