google-cloud-secure_source_manager-v1 1.1.0 → 1.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/secure_source_manager/v1/secure_source_manager/client.rb +46 -17
- data/lib/google/cloud/secure_source_manager/v1/secure_source_manager/operations.rb +19 -15
- data/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/client.rb +45 -17
- data/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/operations.rb +50 -38
- data/lib/google/cloud/secure_source_manager/v1/secure_source_manager/rest/service_stub.rb +142 -98
- data/lib/google/cloud/secure_source_manager/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +25 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- 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: c23dcf560a0f54d12c661e7140b3e43a930b35a6cdda8e3b3bc20b883063b94b
|
4
|
+
data.tar.gz: c5ea6f11916ff8f2a36be980650d278a017df474c11b62104a1c6b745724533d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66b6fc9da1782eae05bfb9c214a81a97e4dea9cae7a2ec9df4ddfabab2ec116513411f153b37cd1f27b8f519dec41f5fb77906f31f50492a2e68647911c2dd4b
|
7
|
+
data.tar.gz: a2b659431f39b330e79a2de34f29739b022a46ebe675041addd462925c20f9a29defdcab2a6d6f81c5a8ff82742011cac75ffaec179bdc8be4fcd56c9ea210f4
|
data/README.md
CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/secure-source-manager/docs/overview)
|
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/secure_source_manager/v1"
|
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::SecureSourceManager::V1::SecureSourceManager::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).
|
76
86
|
|
77
87
|
## Supported Ruby Versions
|
78
88
|
|
79
|
-
This library is supported on Ruby
|
89
|
+
This library is supported on Ruby 3.0+.
|
80
90
|
|
81
91
|
Google provides official support for Ruby versions that are actively supported
|
82
92
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -210,14 +210,26 @@ module Google
|
|
210
210
|
universe_domain: @config.universe_domain,
|
211
211
|
channel_args: @config.channel_args,
|
212
212
|
interceptors: @config.interceptors,
|
213
|
-
channel_pool_config: @config.channel_pool
|
213
|
+
channel_pool_config: @config.channel_pool,
|
214
|
+
logger: @config.logger
|
214
215
|
)
|
215
216
|
|
217
|
+
@secure_source_manager_stub.stub_logger&.info do |entry|
|
218
|
+
entry.set_system_name
|
219
|
+
entry.set_service
|
220
|
+
entry.message = "Created client for #{entry.service}"
|
221
|
+
entry.set_credentials_fields credentials
|
222
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
223
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
224
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
225
|
+
end
|
226
|
+
|
216
227
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
217
228
|
config.credentials = credentials
|
218
229
|
config.quota_project = @quota_project_id
|
219
230
|
config.endpoint = @secure_source_manager_stub.endpoint
|
220
231
|
config.universe_domain = @secure_source_manager_stub.universe_domain
|
232
|
+
config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
|
221
233
|
end
|
222
234
|
|
223
235
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
@@ -225,6 +237,7 @@ module Google
|
|
225
237
|
config.quota_project = @quota_project_id
|
226
238
|
config.endpoint = @secure_source_manager_stub.endpoint
|
227
239
|
config.universe_domain = @secure_source_manager_stub.universe_domain
|
240
|
+
config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
|
228
241
|
end
|
229
242
|
end
|
230
243
|
|
@@ -249,6 +262,15 @@ module Google
|
|
249
262
|
#
|
250
263
|
attr_reader :iam_policy_client
|
251
264
|
|
265
|
+
##
|
266
|
+
# The logger used for request/response debug logging.
|
267
|
+
#
|
268
|
+
# @return [Logger]
|
269
|
+
#
|
270
|
+
def logger
|
271
|
+
@secure_source_manager_stub.logger
|
272
|
+
end
|
273
|
+
|
252
274
|
# Service calls
|
253
275
|
|
254
276
|
##
|
@@ -345,7 +367,7 @@ module Google
|
|
345
367
|
@secure_source_manager_stub.call_rpc :list_instances, request, options: options do |response, operation|
|
346
368
|
response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_instances, request, response, operation, options
|
347
369
|
yield response, operation if block_given?
|
348
|
-
|
370
|
+
throw :response, response
|
349
371
|
end
|
350
372
|
rescue ::GRPC::BadStatus => e
|
351
373
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -431,7 +453,6 @@ module Google
|
|
431
453
|
|
432
454
|
@secure_source_manager_stub.call_rpc :get_instance, request, options: options do |response, operation|
|
433
455
|
yield response, operation if block_given?
|
434
|
-
return response
|
435
456
|
end
|
436
457
|
rescue ::GRPC::BadStatus => e
|
437
458
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -543,7 +564,7 @@ module Google
|
|
543
564
|
@secure_source_manager_stub.call_rpc :create_instance, request, options: options do |response, operation|
|
544
565
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
545
566
|
yield response, operation if block_given?
|
546
|
-
|
567
|
+
throw :response, response
|
547
568
|
end
|
548
569
|
rescue ::GRPC::BadStatus => e
|
549
570
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -651,7 +672,7 @@ module Google
|
|
651
672
|
@secure_source_manager_stub.call_rpc :delete_instance, request, options: options do |response, operation|
|
652
673
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
653
674
|
yield response, operation if block_given?
|
654
|
-
|
675
|
+
throw :response, response
|
655
676
|
end
|
656
677
|
rescue ::GRPC::BadStatus => e
|
657
678
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -759,7 +780,7 @@ module Google
|
|
759
780
|
@secure_source_manager_stub.call_rpc :list_repositories, request, options: options do |response, operation|
|
760
781
|
response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, request, response, operation, options
|
761
782
|
yield response, operation if block_given?
|
762
|
-
|
783
|
+
throw :response, response
|
763
784
|
end
|
764
785
|
rescue ::GRPC::BadStatus => e
|
765
786
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -849,7 +870,6 @@ module Google
|
|
849
870
|
|
850
871
|
@secure_source_manager_stub.call_rpc :get_repository, request, options: options do |response, operation|
|
851
872
|
yield response, operation if block_given?
|
852
|
-
return response
|
853
873
|
end
|
854
874
|
rescue ::GRPC::BadStatus => e
|
855
875
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -952,7 +972,7 @@ module Google
|
|
952
972
|
@secure_source_manager_stub.call_rpc :create_repository, request, options: options do |response, operation|
|
953
973
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
954
974
|
yield response, operation if block_given?
|
955
|
-
|
975
|
+
throw :response, response
|
956
976
|
end
|
957
977
|
rescue ::GRPC::BadStatus => e
|
958
978
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1053,7 +1073,7 @@ module Google
|
|
1053
1073
|
@secure_source_manager_stub.call_rpc :delete_repository, request, options: options do |response, operation|
|
1054
1074
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1055
1075
|
yield response, operation if block_given?
|
1056
|
-
|
1076
|
+
throw :response, response
|
1057
1077
|
end
|
1058
1078
|
rescue ::GRPC::BadStatus => e
|
1059
1079
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1143,7 +1163,6 @@ module Google
|
|
1143
1163
|
|
1144
1164
|
@secure_source_manager_stub.call_rpc :get_iam_policy_repo, request, options: options do |response, operation|
|
1145
1165
|
yield response, operation if block_given?
|
1146
|
-
return response
|
1147
1166
|
end
|
1148
1167
|
rescue ::GRPC::BadStatus => e
|
1149
1168
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1241,7 +1260,6 @@ module Google
|
|
1241
1260
|
|
1242
1261
|
@secure_source_manager_stub.call_rpc :set_iam_policy_repo, request, options: options do |response, operation|
|
1243
1262
|
yield response, operation if block_given?
|
1244
|
-
return response
|
1245
1263
|
end
|
1246
1264
|
rescue ::GRPC::BadStatus => e
|
1247
1265
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1334,7 +1352,6 @@ module Google
|
|
1334
1352
|
|
1335
1353
|
@secure_source_manager_stub.call_rpc :test_iam_permissions_repo, request, options: options do |response, operation|
|
1336
1354
|
yield response, operation if block_given?
|
1337
|
-
return response
|
1338
1355
|
end
|
1339
1356
|
rescue ::GRPC::BadStatus => e
|
1340
1357
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1429,7 +1446,7 @@ module Google
|
|
1429
1446
|
@secure_source_manager_stub.call_rpc :create_branch_rule, request, options: options do |response, operation|
|
1430
1447
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1431
1448
|
yield response, operation if block_given?
|
1432
|
-
|
1449
|
+
throw :response, response
|
1433
1450
|
end
|
1434
1451
|
rescue ::GRPC::BadStatus => e
|
1435
1452
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1521,7 +1538,7 @@ module Google
|
|
1521
1538
|
@secure_source_manager_stub.call_rpc :list_branch_rules, request, options: options do |response, operation|
|
1522
1539
|
response = ::Gapic::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, request, response, operation, options
|
1523
1540
|
yield response, operation if block_given?
|
1524
|
-
|
1541
|
+
throw :response, response
|
1525
1542
|
end
|
1526
1543
|
rescue ::GRPC::BadStatus => e
|
1527
1544
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1609,7 +1626,6 @@ module Google
|
|
1609
1626
|
|
1610
1627
|
@secure_source_manager_stub.call_rpc :get_branch_rule, request, options: options do |response, operation|
|
1611
1628
|
yield response, operation if block_given?
|
1612
|
-
return response
|
1613
1629
|
end
|
1614
1630
|
rescue ::GRPC::BadStatus => e
|
1615
1631
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1711,7 +1727,7 @@ module Google
|
|
1711
1727
|
@secure_source_manager_stub.call_rpc :update_branch_rule, request, options: options do |response, operation|
|
1712
1728
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1713
1729
|
yield response, operation if block_given?
|
1714
|
-
|
1730
|
+
throw :response, response
|
1715
1731
|
end
|
1716
1732
|
rescue ::GRPC::BadStatus => e
|
1717
1733
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1807,7 +1823,7 @@ module Google
|
|
1807
1823
|
@secure_source_manager_stub.call_rpc :delete_branch_rule, request, options: options do |response, operation|
|
1808
1824
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1809
1825
|
yield response, operation if block_given?
|
1810
|
-
|
1826
|
+
throw :response, response
|
1811
1827
|
end
|
1812
1828
|
rescue ::GRPC::BadStatus => e
|
1813
1829
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1857,6 +1873,13 @@ module Google
|
|
1857
1873
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1858
1874
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1859
1875
|
# * (`nil`) indicating no credentials
|
1876
|
+
#
|
1877
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1878
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1879
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1880
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1881
|
+
# For more information, refer to [Validate credential configurations from external
|
1882
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1860
1883
|
# @return [::Object]
|
1861
1884
|
# @!attribute [rw] scope
|
1862
1885
|
# The OAuth scopes
|
@@ -1896,6 +1919,11 @@ module Google
|
|
1896
1919
|
# default endpoint URL. The default value of nil uses the environment
|
1897
1920
|
# universe (usually the default "googleapis.com" universe).
|
1898
1921
|
# @return [::String,nil]
|
1922
|
+
# @!attribute [rw] logger
|
1923
|
+
# A custom logger to use for request/response debug logging, or the value
|
1924
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1925
|
+
# explicitly disable logging.
|
1926
|
+
# @return [::Logger,:default,nil]
|
1899
1927
|
#
|
1900
1928
|
class Configuration
|
1901
1929
|
extend ::Gapic::Config
|
@@ -1920,6 +1948,7 @@ module Google
|
|
1920
1948
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1921
1949
|
config_attr :quota_project, nil, ::String, nil
|
1922
1950
|
config_attr :universe_domain, nil, ::String, nil
|
1951
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1923
1952
|
|
1924
1953
|
# @private
|
1925
1954
|
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
|
@@ -203,15 +203,27 @@ module Google
|
|
203
203
|
endpoint: @config.endpoint,
|
204
204
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
205
205
|
universe_domain: @config.universe_domain,
|
206
|
-
credentials: credentials
|
206
|
+
credentials: credentials,
|
207
|
+
logger: @config.logger
|
207
208
|
)
|
208
209
|
|
210
|
+
@secure_source_manager_stub.logger(stub: true)&.info do |entry|
|
211
|
+
entry.set_system_name
|
212
|
+
entry.set_service
|
213
|
+
entry.message = "Created client for #{entry.service}"
|
214
|
+
entry.set_credentials_fields credentials
|
215
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
216
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
217
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
218
|
+
end
|
219
|
+
|
209
220
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
210
221
|
config.credentials = credentials
|
211
222
|
config.quota_project = @quota_project_id
|
212
223
|
config.endpoint = @secure_source_manager_stub.endpoint
|
213
224
|
config.universe_domain = @secure_source_manager_stub.universe_domain
|
214
225
|
config.bindings_override = @config.bindings_override
|
226
|
+
config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
|
215
227
|
end
|
216
228
|
|
217
229
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -220,6 +232,7 @@ module Google
|
|
220
232
|
config.endpoint = @secure_source_manager_stub.endpoint
|
221
233
|
config.universe_domain = @secure_source_manager_stub.universe_domain
|
222
234
|
config.bindings_override = @config.bindings_override
|
235
|
+
config.logger = @secure_source_manager_stub.logger if config.respond_to? :logger=
|
223
236
|
end
|
224
237
|
end
|
225
238
|
|
@@ -244,6 +257,15 @@ module Google
|
|
244
257
|
#
|
245
258
|
attr_reader :iam_policy_client
|
246
259
|
|
260
|
+
##
|
261
|
+
# The logger used for request/response debug logging.
|
262
|
+
#
|
263
|
+
# @return [Logger]
|
264
|
+
#
|
265
|
+
def logger
|
266
|
+
@secure_source_manager_stub.logger
|
267
|
+
end
|
268
|
+
|
247
269
|
# Service calls
|
248
270
|
|
249
271
|
##
|
@@ -332,7 +354,6 @@ module Google
|
|
332
354
|
|
333
355
|
@secure_source_manager_stub.list_instances request, options do |result, operation|
|
334
356
|
yield result, operation if block_given?
|
335
|
-
return result
|
336
357
|
end
|
337
358
|
rescue ::Gapic::Rest::Error => e
|
338
359
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -411,7 +432,6 @@ module Google
|
|
411
432
|
|
412
433
|
@secure_source_manager_stub.get_instance request, options do |result, operation|
|
413
434
|
yield result, operation if block_given?
|
414
|
-
return result
|
415
435
|
end
|
416
436
|
rescue ::Gapic::Rest::Error => e
|
417
437
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -516,7 +536,7 @@ module Google
|
|
516
536
|
@secure_source_manager_stub.create_instance request, options do |result, operation|
|
517
537
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
518
538
|
yield result, operation if block_given?
|
519
|
-
|
539
|
+
throw :response, result
|
520
540
|
end
|
521
541
|
rescue ::Gapic::Rest::Error => e
|
522
542
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -617,7 +637,7 @@ module Google
|
|
617
637
|
@secure_source_manager_stub.delete_instance request, options do |result, operation|
|
618
638
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
619
639
|
yield result, operation if block_given?
|
620
|
-
|
640
|
+
throw :response, result
|
621
641
|
end
|
622
642
|
rescue ::Gapic::Rest::Error => e
|
623
643
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -718,7 +738,7 @@ module Google
|
|
718
738
|
@secure_source_manager_stub.list_repositories request, options do |result, operation|
|
719
739
|
result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_repositories, "repositories", request, result, options
|
720
740
|
yield result, operation if block_given?
|
721
|
-
|
741
|
+
throw :response, result
|
722
742
|
end
|
723
743
|
rescue ::Gapic::Rest::Error => e
|
724
744
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -801,7 +821,6 @@ module Google
|
|
801
821
|
|
802
822
|
@secure_source_manager_stub.get_repository request, options do |result, operation|
|
803
823
|
yield result, operation if block_given?
|
804
|
-
return result
|
805
824
|
end
|
806
825
|
rescue ::Gapic::Rest::Error => e
|
807
826
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -897,7 +916,7 @@ module Google
|
|
897
916
|
@secure_source_manager_stub.create_repository request, options do |result, operation|
|
898
917
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
899
918
|
yield result, operation if block_given?
|
900
|
-
|
919
|
+
throw :response, result
|
901
920
|
end
|
902
921
|
rescue ::Gapic::Rest::Error => e
|
903
922
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -991,7 +1010,7 @@ module Google
|
|
991
1010
|
@secure_source_manager_stub.delete_repository request, options do |result, operation|
|
992
1011
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
993
1012
|
yield result, operation if block_given?
|
994
|
-
|
1013
|
+
throw :response, result
|
995
1014
|
end
|
996
1015
|
rescue ::Gapic::Rest::Error => e
|
997
1016
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1074,7 +1093,6 @@ module Google
|
|
1074
1093
|
|
1075
1094
|
@secure_source_manager_stub.get_iam_policy_repo request, options do |result, operation|
|
1076
1095
|
yield result, operation if block_given?
|
1077
|
-
return result
|
1078
1096
|
end
|
1079
1097
|
rescue ::Gapic::Rest::Error => e
|
1080
1098
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1165,7 +1183,6 @@ module Google
|
|
1165
1183
|
|
1166
1184
|
@secure_source_manager_stub.set_iam_policy_repo request, options do |result, operation|
|
1167
1185
|
yield result, operation if block_given?
|
1168
|
-
return result
|
1169
1186
|
end
|
1170
1187
|
rescue ::Gapic::Rest::Error => e
|
1171
1188
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1251,7 +1268,6 @@ module Google
|
|
1251
1268
|
|
1252
1269
|
@secure_source_manager_stub.test_iam_permissions_repo request, options do |result, operation|
|
1253
1270
|
yield result, operation if block_given?
|
1254
|
-
return result
|
1255
1271
|
end
|
1256
1272
|
rescue ::Gapic::Rest::Error => e
|
1257
1273
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1339,7 +1355,7 @@ module Google
|
|
1339
1355
|
@secure_source_manager_stub.create_branch_rule request, options do |result, operation|
|
1340
1356
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1341
1357
|
yield result, operation if block_given?
|
1342
|
-
|
1358
|
+
throw :response, result
|
1343
1359
|
end
|
1344
1360
|
rescue ::Gapic::Rest::Error => e
|
1345
1361
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1424,7 +1440,7 @@ module Google
|
|
1424
1440
|
@secure_source_manager_stub.list_branch_rules request, options do |result, operation|
|
1425
1441
|
result = ::Gapic::Rest::PagedEnumerable.new @secure_source_manager_stub, :list_branch_rules, "branch_rules", request, result, options
|
1426
1442
|
yield result, operation if block_given?
|
1427
|
-
|
1443
|
+
throw :response, result
|
1428
1444
|
end
|
1429
1445
|
rescue ::Gapic::Rest::Error => e
|
1430
1446
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1505,7 +1521,6 @@ module Google
|
|
1505
1521
|
|
1506
1522
|
@secure_source_manager_stub.get_branch_rule request, options do |result, operation|
|
1507
1523
|
yield result, operation if block_given?
|
1508
|
-
return result
|
1509
1524
|
end
|
1510
1525
|
rescue ::Gapic::Rest::Error => e
|
1511
1526
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1600,7 +1615,7 @@ module Google
|
|
1600
1615
|
@secure_source_manager_stub.update_branch_rule request, options do |result, operation|
|
1601
1616
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1602
1617
|
yield result, operation if block_given?
|
1603
|
-
|
1618
|
+
throw :response, result
|
1604
1619
|
end
|
1605
1620
|
rescue ::Gapic::Rest::Error => e
|
1606
1621
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1689,7 +1704,7 @@ module Google
|
|
1689
1704
|
@secure_source_manager_stub.delete_branch_rule request, options do |result, operation|
|
1690
1705
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1691
1706
|
yield result, operation if block_given?
|
1692
|
-
|
1707
|
+
throw :response, result
|
1693
1708
|
end
|
1694
1709
|
rescue ::Gapic::Rest::Error => e
|
1695
1710
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1737,6 +1752,13 @@ module Google
|
|
1737
1752
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1738
1753
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1739
1754
|
# * (`nil`) indicating no credentials
|
1755
|
+
#
|
1756
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1757
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1758
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1759
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1760
|
+
# For more information, refer to [Validate credential configurations from external
|
1761
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1740
1762
|
# @return [::Object]
|
1741
1763
|
# @!attribute [rw] scope
|
1742
1764
|
# The OAuth scopes
|
@@ -1769,6 +1791,11 @@ module Google
|
|
1769
1791
|
# default endpoint URL. The default value of nil uses the environment
|
1770
1792
|
# universe (usually the default "googleapis.com" universe).
|
1771
1793
|
# @return [::String,nil]
|
1794
|
+
# @!attribute [rw] logger
|
1795
|
+
# A custom logger to use for request/response debug logging, or the value
|
1796
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1797
|
+
# explicitly disable logging.
|
1798
|
+
# @return [::Logger,:default,nil]
|
1772
1799
|
#
|
1773
1800
|
class Configuration
|
1774
1801
|
extend ::Gapic::Config
|
@@ -1797,6 +1824,7 @@ module Google
|
|
1797
1824
|
# by the host service.
|
1798
1825
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1799
1826
|
config_attr :bindings_override, {}, ::Hash, nil
|
1827
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1800
1828
|
|
1801
1829
|
# @private
|
1802
1830
|
def initialize parent_config = nil
|