google-cloud-asset-v1 1.0.1 → 1.1.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 +30 -20
- data/lib/google/cloud/asset/v1/asset_service/client.rb +36 -24
- data/lib/google/cloud/asset/v1/asset_service/operations.rb +12 -15
- data/lib/google/cloud/asset/v1/asset_service/rest/client.rb +36 -24
- data/lib/google/cloud/asset/v1/asset_service/rest/operations.rb +43 -38
- data/lib/google/cloud/asset/v1/asset_service/rest/service_stub.rb +198 -140
- data/lib/google/cloud/asset/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/asset/v1/asset_service.rb +6 -3
- data/proto_docs/google/cloud/asset/v1/assets.rb +2 -3
- 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: d0c9bced7c9bebc177c50b4d59fbcf0d3c45cce1a7321ed963399ae06197a437
|
4
|
+
data.tar.gz: 212556b2b46be05963ce1ad072e7febad3d149f91e069cb15bbdd3fc53f94095
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f9eed54a6fcc397d2f52da9736fecbdf502673ba1dc1b33326e2ed270dd4c0b8eabb2f4b622f87e3440424d60dab1cc6a1d939058e0dc95e0fcc4dbf2dfef2d
|
7
|
+
data.tar.gz: 29b8d47f357c08c2393c6d5b9b7c92903bc0d6b7c7b278395144b5c2315176b4fc88a87efe5e6e1c1e2e932b7c3c1f3b19d7c7edf210f4578a72cfee2c6ffdd1
|
data/README.md
CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/asset-inventory/)
|
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/asset/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::Asset::V1::AssetService::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).
|
@@ -256,8 +256,19 @@ module Google
|
|
256
256
|
universe_domain: @config.universe_domain,
|
257
257
|
channel_args: @config.channel_args,
|
258
258
|
interceptors: @config.interceptors,
|
259
|
-
channel_pool_config: @config.channel_pool
|
259
|
+
channel_pool_config: @config.channel_pool,
|
260
|
+
logger: @config.logger
|
260
261
|
)
|
262
|
+
|
263
|
+
@asset_service_stub.stub_logger&.info do |entry|
|
264
|
+
entry.set_system_name
|
265
|
+
entry.set_service
|
266
|
+
entry.message = "Created client for #{entry.service}"
|
267
|
+
entry.set_credentials_fields credentials
|
268
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
269
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
270
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
271
|
+
end
|
261
272
|
end
|
262
273
|
|
263
274
|
##
|
@@ -267,6 +278,15 @@ module Google
|
|
267
278
|
#
|
268
279
|
attr_reader :operations_client
|
269
280
|
|
281
|
+
##
|
282
|
+
# The logger used for request/response debug logging.
|
283
|
+
#
|
284
|
+
# @return [Logger]
|
285
|
+
#
|
286
|
+
def logger
|
287
|
+
@asset_service_stub.logger
|
288
|
+
end
|
289
|
+
|
270
290
|
# Service calls
|
271
291
|
|
272
292
|
##
|
@@ -417,7 +437,7 @@ module Google
|
|
417
437
|
@asset_service_stub.call_rpc :export_assets, request, options: options do |response, operation|
|
418
438
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
419
439
|
yield response, operation if block_given?
|
420
|
-
|
440
|
+
throw :response, response
|
421
441
|
end
|
422
442
|
rescue ::GRPC::BadStatus => e
|
423
443
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -564,7 +584,7 @@ module Google
|
|
564
584
|
@asset_service_stub.call_rpc :list_assets, request, options: options do |response, operation|
|
565
585
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :list_assets, request, response, operation, options
|
566
586
|
yield response, operation if block_given?
|
567
|
-
|
587
|
+
throw :response, response
|
568
588
|
end
|
569
589
|
rescue ::GRPC::BadStatus => e
|
570
590
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -693,7 +713,6 @@ module Google
|
|
693
713
|
|
694
714
|
@asset_service_stub.call_rpc :batch_get_assets_history, request, options: options do |response, operation|
|
695
715
|
yield response, operation if block_given?
|
696
|
-
return response
|
697
716
|
end
|
698
717
|
rescue ::GRPC::BadStatus => e
|
699
718
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -792,7 +811,6 @@ module Google
|
|
792
811
|
|
793
812
|
@asset_service_stub.call_rpc :create_feed, request, options: options do |response, operation|
|
794
813
|
yield response, operation if block_given?
|
795
|
-
return response
|
796
814
|
end
|
797
815
|
rescue ::GRPC::BadStatus => e
|
798
816
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -881,7 +899,6 @@ module Google
|
|
881
899
|
|
882
900
|
@asset_service_stub.call_rpc :get_feed, request, options: options do |response, operation|
|
883
901
|
yield response, operation if block_given?
|
884
|
-
return response
|
885
902
|
end
|
886
903
|
rescue ::GRPC::BadStatus => e
|
887
904
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -969,7 +986,6 @@ module Google
|
|
969
986
|
|
970
987
|
@asset_service_stub.call_rpc :list_feeds, request, options: options do |response, operation|
|
971
988
|
yield response, operation if block_given?
|
972
|
-
return response
|
973
989
|
end
|
974
990
|
rescue ::GRPC::BadStatus => e
|
975
991
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1063,7 +1079,6 @@ module Google
|
|
1063
1079
|
|
1064
1080
|
@asset_service_stub.call_rpc :update_feed, request, options: options do |response, operation|
|
1065
1081
|
yield response, operation if block_given?
|
1066
|
-
return response
|
1067
1082
|
end
|
1068
1083
|
rescue ::GRPC::BadStatus => e
|
1069
1084
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1152,7 +1167,6 @@ module Google
|
|
1152
1167
|
|
1153
1168
|
@asset_service_stub.call_rpc :delete_feed, request, options: options do |response, operation|
|
1154
1169
|
yield response, operation if block_given?
|
1155
|
-
return response
|
1156
1170
|
end
|
1157
1171
|
rescue ::GRPC::BadStatus => e
|
1158
1172
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1414,7 +1428,7 @@ module Google
|
|
1414
1428
|
@asset_service_stub.call_rpc :search_all_resources, request, options: options do |response, operation|
|
1415
1429
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_resources, request, response, operation, options
|
1416
1430
|
yield response, operation if block_given?
|
1417
|
-
|
1431
|
+
throw :response, response
|
1418
1432
|
end
|
1419
1433
|
rescue ::GRPC::BadStatus => e
|
1420
1434
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1602,7 +1616,7 @@ module Google
|
|
1602
1616
|
@asset_service_stub.call_rpc :search_all_iam_policies, request, options: options do |response, operation|
|
1603
1617
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_iam_policies, request, response, operation, options
|
1604
1618
|
yield response, operation if block_given?
|
1605
|
-
|
1619
|
+
throw :response, response
|
1606
1620
|
end
|
1607
1621
|
rescue ::GRPC::BadStatus => e
|
1608
1622
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1718,7 +1732,6 @@ module Google
|
|
1718
1732
|
|
1719
1733
|
@asset_service_stub.call_rpc :analyze_iam_policy, request, options: options do |response, operation|
|
1720
1734
|
yield response, operation if block_given?
|
1721
|
-
return response
|
1722
1735
|
end
|
1723
1736
|
rescue ::GRPC::BadStatus => e
|
1724
1737
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1841,7 +1854,7 @@ module Google
|
|
1841
1854
|
@asset_service_stub.call_rpc :analyze_iam_policy_longrunning, request, options: options do |response, operation|
|
1842
1855
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1843
1856
|
yield response, operation if block_given?
|
1844
|
-
|
1857
|
+
throw :response, response
|
1845
1858
|
end
|
1846
1859
|
rescue ::GRPC::BadStatus => e
|
1847
1860
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1943,7 +1956,6 @@ module Google
|
|
1943
1956
|
|
1944
1957
|
@asset_service_stub.call_rpc :analyze_move, request, options: options do |response, operation|
|
1945
1958
|
yield response, operation if block_given?
|
1946
|
-
return response
|
1947
1959
|
end
|
1948
1960
|
rescue ::GRPC::BadStatus => e
|
1949
1961
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2094,7 +2106,6 @@ module Google
|
|
2094
2106
|
|
2095
2107
|
@asset_service_stub.call_rpc :query_assets, request, options: options do |response, operation|
|
2096
2108
|
yield response, operation if block_given?
|
2097
|
-
return response
|
2098
2109
|
end
|
2099
2110
|
rescue ::GRPC::BadStatus => e
|
2100
2111
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2197,7 +2208,6 @@ module Google
|
|
2197
2208
|
|
2198
2209
|
@asset_service_stub.call_rpc :create_saved_query, request, options: options do |response, operation|
|
2199
2210
|
yield response, operation if block_given?
|
2200
|
-
return response
|
2201
2211
|
end
|
2202
2212
|
rescue ::GRPC::BadStatus => e
|
2203
2213
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2287,7 +2297,6 @@ module Google
|
|
2287
2297
|
|
2288
2298
|
@asset_service_stub.call_rpc :get_saved_query, request, options: options do |response, operation|
|
2289
2299
|
yield response, operation if block_given?
|
2290
|
-
return response
|
2291
2300
|
end
|
2292
2301
|
rescue ::GRPC::BadStatus => e
|
2293
2302
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2399,7 +2408,7 @@ module Google
|
|
2399
2408
|
@asset_service_stub.call_rpc :list_saved_queries, request, options: options do |response, operation|
|
2400
2409
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :list_saved_queries, request, response, operation, options
|
2401
2410
|
yield response, operation if block_given?
|
2402
|
-
|
2411
|
+
throw :response, response
|
2403
2412
|
end
|
2404
2413
|
rescue ::GRPC::BadStatus => e
|
2405
2414
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2494,7 +2503,6 @@ module Google
|
|
2494
2503
|
|
2495
2504
|
@asset_service_stub.call_rpc :update_saved_query, request, options: options do |response, operation|
|
2496
2505
|
yield response, operation if block_given?
|
2497
|
-
return response
|
2498
2506
|
end
|
2499
2507
|
rescue ::GRPC::BadStatus => e
|
2500
2508
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2585,7 +2593,6 @@ module Google
|
|
2585
2593
|
|
2586
2594
|
@asset_service_stub.call_rpc :delete_saved_query, request, options: options do |response, operation|
|
2587
2595
|
yield response, operation if block_given?
|
2588
|
-
return response
|
2589
2596
|
end
|
2590
2597
|
rescue ::GRPC::BadStatus => e
|
2591
2598
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2687,7 +2694,6 @@ module Google
|
|
2687
2694
|
|
2688
2695
|
@asset_service_stub.call_rpc :batch_get_effective_iam_policies, request, options: options do |response, operation|
|
2689
2696
|
yield response, operation if block_given?
|
2690
|
-
return response
|
2691
2697
|
end
|
2692
2698
|
rescue ::GRPC::BadStatus => e
|
2693
2699
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2803,7 +2809,7 @@ module Google
|
|
2803
2809
|
@asset_service_stub.call_rpc :analyze_org_policies, request, options: options do |response, operation|
|
2804
2810
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policies, request, response, operation, options
|
2805
2811
|
yield response, operation if block_given?
|
2806
|
-
|
2812
|
+
throw :response, response
|
2807
2813
|
end
|
2808
2814
|
rescue ::GRPC::BadStatus => e
|
2809
2815
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2922,7 +2928,7 @@ module Google
|
|
2922
2928
|
@asset_service_stub.call_rpc :analyze_org_policy_governed_containers, request, options: options do |response, operation|
|
2923
2929
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_containers, request, response, operation, options
|
2924
2930
|
yield response, operation if block_given?
|
2925
|
-
|
2931
|
+
throw :response, response
|
2926
2932
|
end
|
2927
2933
|
rescue ::GRPC::BadStatus => e
|
2928
2934
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3104,7 +3110,7 @@ module Google
|
|
3104
3110
|
@asset_service_stub.call_rpc :analyze_org_policy_governed_assets, request, options: options do |response, operation|
|
3105
3111
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_assets, request, response, operation, options
|
3106
3112
|
yield response, operation if block_given?
|
3107
|
-
|
3113
|
+
throw :response, response
|
3108
3114
|
end
|
3109
3115
|
rescue ::GRPC::BadStatus => e
|
3110
3116
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3193,6 +3199,11 @@ module Google
|
|
3193
3199
|
# default endpoint URL. The default value of nil uses the environment
|
3194
3200
|
# universe (usually the default "googleapis.com" universe).
|
3195
3201
|
# @return [::String,nil]
|
3202
|
+
# @!attribute [rw] logger
|
3203
|
+
# A custom logger to use for request/response debug logging, or the value
|
3204
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
3205
|
+
# explicitly disable logging.
|
3206
|
+
# @return [::Logger,:default,nil]
|
3196
3207
|
#
|
3197
3208
|
class Configuration
|
3198
3209
|
extend ::Gapic::Config
|
@@ -3217,6 +3228,7 @@ module Google
|
|
3217
3228
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
3218
3229
|
config_attr :quota_project, nil, ::String, nil
|
3219
3230
|
config_attr :universe_domain, nil, ::String, nil
|
3231
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
3220
3232
|
|
3221
3233
|
# @private
|
3222
3234
|
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
|
@@ -249,8 +249,19 @@ module Google
|
|
249
249
|
endpoint: @config.endpoint,
|
250
250
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
251
251
|
universe_domain: @config.universe_domain,
|
252
|
-
credentials: credentials
|
252
|
+
credentials: credentials,
|
253
|
+
logger: @config.logger
|
253
254
|
)
|
255
|
+
|
256
|
+
@asset_service_stub.logger(stub: true)&.info do |entry|
|
257
|
+
entry.set_system_name
|
258
|
+
entry.set_service
|
259
|
+
entry.message = "Created client for #{entry.service}"
|
260
|
+
entry.set_credentials_fields credentials
|
261
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
262
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
263
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
264
|
+
end
|
254
265
|
end
|
255
266
|
|
256
267
|
##
|
@@ -260,6 +271,15 @@ module Google
|
|
260
271
|
#
|
261
272
|
attr_reader :operations_client
|
262
273
|
|
274
|
+
##
|
275
|
+
# The logger used for request/response debug logging.
|
276
|
+
#
|
277
|
+
# @return [Logger]
|
278
|
+
#
|
279
|
+
def logger
|
280
|
+
@asset_service_stub.logger
|
281
|
+
end
|
282
|
+
|
263
283
|
# Service calls
|
264
284
|
|
265
285
|
##
|
@@ -403,7 +423,7 @@ module Google
|
|
403
423
|
@asset_service_stub.export_assets request, options do |result, operation|
|
404
424
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
405
425
|
yield result, operation if block_given?
|
406
|
-
|
426
|
+
throw :response, result
|
407
427
|
end
|
408
428
|
rescue ::Gapic::Rest::Error => e
|
409
429
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -543,7 +563,7 @@ module Google
|
|
543
563
|
@asset_service_stub.list_assets request, options do |result, operation|
|
544
564
|
result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :list_assets, "assets", request, result, options
|
545
565
|
yield result, operation if block_given?
|
546
|
-
|
566
|
+
throw :response, result
|
547
567
|
end
|
548
568
|
rescue ::Gapic::Rest::Error => e
|
549
569
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -665,7 +685,6 @@ module Google
|
|
665
685
|
|
666
686
|
@asset_service_stub.batch_get_assets_history request, options do |result, operation|
|
667
687
|
yield result, operation if block_given?
|
668
|
-
return result
|
669
688
|
end
|
670
689
|
rescue ::Gapic::Rest::Error => e
|
671
690
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -757,7 +776,6 @@ module Google
|
|
757
776
|
|
758
777
|
@asset_service_stub.create_feed request, options do |result, operation|
|
759
778
|
yield result, operation if block_given?
|
760
|
-
return result
|
761
779
|
end
|
762
780
|
rescue ::Gapic::Rest::Error => e
|
763
781
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -839,7 +857,6 @@ module Google
|
|
839
857
|
|
840
858
|
@asset_service_stub.get_feed request, options do |result, operation|
|
841
859
|
yield result, operation if block_given?
|
842
|
-
return result
|
843
860
|
end
|
844
861
|
rescue ::Gapic::Rest::Error => e
|
845
862
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -920,7 +937,6 @@ module Google
|
|
920
937
|
|
921
938
|
@asset_service_stub.list_feeds request, options do |result, operation|
|
922
939
|
yield result, operation if block_given?
|
923
|
-
return result
|
924
940
|
end
|
925
941
|
rescue ::Gapic::Rest::Error => e
|
926
942
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1007,7 +1023,6 @@ module Google
|
|
1007
1023
|
|
1008
1024
|
@asset_service_stub.update_feed request, options do |result, operation|
|
1009
1025
|
yield result, operation if block_given?
|
1010
|
-
return result
|
1011
1026
|
end
|
1012
1027
|
rescue ::Gapic::Rest::Error => e
|
1013
1028
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1089,7 +1104,6 @@ module Google
|
|
1089
1104
|
|
1090
1105
|
@asset_service_stub.delete_feed request, options do |result, operation|
|
1091
1106
|
yield result, operation if block_given?
|
1092
|
-
return result
|
1093
1107
|
end
|
1094
1108
|
rescue ::Gapic::Rest::Error => e
|
1095
1109
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1344,7 +1358,7 @@ module Google
|
|
1344
1358
|
@asset_service_stub.search_all_resources request, options do |result, operation|
|
1345
1359
|
result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :search_all_resources, "results", request, result, options
|
1346
1360
|
yield result, operation if block_given?
|
1347
|
-
|
1361
|
+
throw :response, result
|
1348
1362
|
end
|
1349
1363
|
rescue ::Gapic::Rest::Error => e
|
1350
1364
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1525,7 +1539,7 @@ module Google
|
|
1525
1539
|
@asset_service_stub.search_all_iam_policies request, options do |result, operation|
|
1526
1540
|
result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :search_all_iam_policies, "results", request, result, options
|
1527
1541
|
yield result, operation if block_given?
|
1528
|
-
|
1542
|
+
throw :response, result
|
1529
1543
|
end
|
1530
1544
|
rescue ::Gapic::Rest::Error => e
|
1531
1545
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1634,7 +1648,6 @@ module Google
|
|
1634
1648
|
|
1635
1649
|
@asset_service_stub.analyze_iam_policy request, options do |result, operation|
|
1636
1650
|
yield result, operation if block_given?
|
1637
|
-
return result
|
1638
1651
|
end
|
1639
1652
|
rescue ::Gapic::Rest::Error => e
|
1640
1653
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1750,7 +1763,7 @@ module Google
|
|
1750
1763
|
@asset_service_stub.analyze_iam_policy_longrunning request, options do |result, operation|
|
1751
1764
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1752
1765
|
yield result, operation if block_given?
|
1753
|
-
|
1766
|
+
throw :response, result
|
1754
1767
|
end
|
1755
1768
|
rescue ::Gapic::Rest::Error => e
|
1756
1769
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1845,7 +1858,6 @@ module Google
|
|
1845
1858
|
|
1846
1859
|
@asset_service_stub.analyze_move request, options do |result, operation|
|
1847
1860
|
yield result, operation if block_given?
|
1848
|
-
return result
|
1849
1861
|
end
|
1850
1862
|
rescue ::Gapic::Rest::Error => e
|
1851
1863
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1989,7 +2001,6 @@ module Google
|
|
1989
2001
|
|
1990
2002
|
@asset_service_stub.query_assets request, options do |result, operation|
|
1991
2003
|
yield result, operation if block_given?
|
1992
|
-
return result
|
1993
2004
|
end
|
1994
2005
|
rescue ::Gapic::Rest::Error => e
|
1995
2006
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2085,7 +2096,6 @@ module Google
|
|
2085
2096
|
|
2086
2097
|
@asset_service_stub.create_saved_query request, options do |result, operation|
|
2087
2098
|
yield result, operation if block_given?
|
2088
|
-
return result
|
2089
2099
|
end
|
2090
2100
|
rescue ::Gapic::Rest::Error => e
|
2091
2101
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2168,7 +2178,6 @@ module Google
|
|
2168
2178
|
|
2169
2179
|
@asset_service_stub.get_saved_query request, options do |result, operation|
|
2170
2180
|
yield result, operation if block_given?
|
2171
|
-
return result
|
2172
2181
|
end
|
2173
2182
|
rescue ::Gapic::Rest::Error => e
|
2174
2183
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2273,7 +2282,7 @@ module Google
|
|
2273
2282
|
@asset_service_stub.list_saved_queries request, options do |result, operation|
|
2274
2283
|
result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :list_saved_queries, "saved_queries", request, result, options
|
2275
2284
|
yield result, operation if block_given?
|
2276
|
-
|
2285
|
+
throw :response, result
|
2277
2286
|
end
|
2278
2287
|
rescue ::Gapic::Rest::Error => e
|
2279
2288
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2361,7 +2370,6 @@ module Google
|
|
2361
2370
|
|
2362
2371
|
@asset_service_stub.update_saved_query request, options do |result, operation|
|
2363
2372
|
yield result, operation if block_given?
|
2364
|
-
return result
|
2365
2373
|
end
|
2366
2374
|
rescue ::Gapic::Rest::Error => e
|
2367
2375
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2445,7 +2453,6 @@ module Google
|
|
2445
2453
|
|
2446
2454
|
@asset_service_stub.delete_saved_query request, options do |result, operation|
|
2447
2455
|
yield result, operation if block_given?
|
2448
|
-
return result
|
2449
2456
|
end
|
2450
2457
|
rescue ::Gapic::Rest::Error => e
|
2451
2458
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2540,7 +2547,6 @@ module Google
|
|
2540
2547
|
|
2541
2548
|
@asset_service_stub.batch_get_effective_iam_policies request, options do |result, operation|
|
2542
2549
|
yield result, operation if block_given?
|
2543
|
-
return result
|
2544
2550
|
end
|
2545
2551
|
rescue ::Gapic::Rest::Error => e
|
2546
2552
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2649,7 +2655,7 @@ module Google
|
|
2649
2655
|
@asset_service_stub.analyze_org_policies request, options do |result, operation|
|
2650
2656
|
result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :analyze_org_policies, "org_policy_results", request, result, options
|
2651
2657
|
yield result, operation if block_given?
|
2652
|
-
|
2658
|
+
throw :response, result
|
2653
2659
|
end
|
2654
2660
|
rescue ::Gapic::Rest::Error => e
|
2655
2661
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2761,7 +2767,7 @@ module Google
|
|
2761
2767
|
@asset_service_stub.analyze_org_policy_governed_containers request, options do |result, operation|
|
2762
2768
|
result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_containers, "governed_containers", request, result, options
|
2763
2769
|
yield result, operation if block_given?
|
2764
|
-
|
2770
|
+
throw :response, result
|
2765
2771
|
end
|
2766
2772
|
rescue ::Gapic::Rest::Error => e
|
2767
2773
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2936,7 +2942,7 @@ module Google
|
|
2936
2942
|
@asset_service_stub.analyze_org_policy_governed_assets request, options do |result, operation|
|
2937
2943
|
result = ::Gapic::Rest::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_assets, "governed_assets", request, result, options
|
2938
2944
|
yield result, operation if block_given?
|
2939
|
-
|
2945
|
+
throw :response, result
|
2940
2946
|
end
|
2941
2947
|
rescue ::Gapic::Rest::Error => e
|
2942
2948
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3016,6 +3022,11 @@ module Google
|
|
3016
3022
|
# default endpoint URL. The default value of nil uses the environment
|
3017
3023
|
# universe (usually the default "googleapis.com" universe).
|
3018
3024
|
# @return [::String,nil]
|
3025
|
+
# @!attribute [rw] logger
|
3026
|
+
# A custom logger to use for request/response debug logging, or the value
|
3027
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
3028
|
+
# explicitly disable logging.
|
3029
|
+
# @return [::Logger,:default,nil]
|
3019
3030
|
#
|
3020
3031
|
class Configuration
|
3021
3032
|
extend ::Gapic::Config
|
@@ -3037,6 +3048,7 @@ module Google
|
|
3037
3048
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
3038
3049
|
config_attr :quota_project, nil, ::String, nil
|
3039
3050
|
config_attr :universe_domain, nil, ::String, nil
|
3051
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
3040
3052
|
|
3041
3053
|
# @private
|
3042
3054
|
def initialize parent_config = nil
|