google-cloud-asset-v1 1.0.2 → 1.2.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/asset/v1/asset_service/client.rb +51 -24
- data/lib/google/cloud/asset/v1/asset_service/operations.rb +19 -15
- data/lib/google/cloud/asset/v1/asset_service/rest/client.rb +51 -24
- data/lib/google/cloud/asset/v1/asset_service/rest/operations.rb +50 -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 +50 -0
- data/proto_docs/google/cloud/asset/v1/assets.rb +10 -0
- data/proto_docs/google/cloud/orgpolicy/v1/orgpolicy.rb +6 -0
- data/proto_docs/google/cloud/osconfig/v1/inventory.rb +22 -0
- data/proto_docs/google/identity/accesscontextmanager/v1/access_level.rb +4 -0
- data/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb +8 -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: f22d12309db48172f94945af0ebc3e243b7e37bfff88eee361670d37714ec227
|
4
|
+
data.tar.gz: f6c8cf6aa8a8e671a79797e365f47cc200f0ad06f7d3a0394d18d1f727e22bb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab84b5e06eeb22c9145840b8f3731a45ec6602fdc79d8ddf640df497c79f21896d4e9b8af58fdb38791ec11eb9def11f502a01d43d95aab2d546c9190ef5882a
|
7
|
+
data.tar.gz: 464c9ce7dc75ea2aae949bb5f419a57b95ad0fb498e402ccbf67df07632d9a823d3e0b2800e6e78d659498f060dbef18df962c89d0595210b28a925151bb4cf7
|
data/README.md
CHANGED
@@ -43,40 +43,50 @@ 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).
|
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
|
@@ -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)
|
@@ -1988,9 +2000,13 @@ module Google
|
|
1988
2000
|
# @param statement [::String]
|
1989
2001
|
# Optional. A SQL statement that's compatible with [BigQuery
|
1990
2002
|
# SQL](https://cloud.google.com/bigquery/docs/introduction-sql).
|
2003
|
+
#
|
2004
|
+
# Note: The following fields are mutually exclusive: `statement`, `job_reference`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
1991
2005
|
# @param job_reference [::String]
|
1992
2006
|
# Optional. Reference to the query job, which is from the
|
1993
2007
|
# `QueryAssetsResponse` of previous `QueryAssets` call.
|
2008
|
+
#
|
2009
|
+
# Note: The following fields are mutually exclusive: `job_reference`, `statement`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
1994
2010
|
# @param page_size [::Integer]
|
1995
2011
|
# Optional. The maximum number of rows to return in the results. Responses
|
1996
2012
|
# are limited to 10 MB and 1000 rows.
|
@@ -2021,9 +2037,13 @@ module Google
|
|
2021
2037
|
# Optional. [start_time] is required. [start_time] must be less than
|
2022
2038
|
# [end_time] Defaults [end_time] to now if [start_time] is set and
|
2023
2039
|
# [end_time] isn't. Maximum permitted time range is 7 days.
|
2040
|
+
#
|
2041
|
+
# Note: The following fields are mutually exclusive: `read_time_window`, `read_time`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
2024
2042
|
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
2025
2043
|
# Optional. Queries cloud assets as they appeared at the specified point in
|
2026
2044
|
# time.
|
2045
|
+
#
|
2046
|
+
# Note: The following fields are mutually exclusive: `read_time`, `read_time_window`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
2027
2047
|
# @param output_config [::Google::Cloud::Asset::V1::QueryAssetsOutputConfig, ::Hash]
|
2028
2048
|
# Optional. Destination where the query results will be saved.
|
2029
2049
|
#
|
@@ -2094,7 +2114,6 @@ module Google
|
|
2094
2114
|
|
2095
2115
|
@asset_service_stub.call_rpc :query_assets, request, options: options do |response, operation|
|
2096
2116
|
yield response, operation if block_given?
|
2097
|
-
return response
|
2098
2117
|
end
|
2099
2118
|
rescue ::GRPC::BadStatus => e
|
2100
2119
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2197,7 +2216,6 @@ module Google
|
|
2197
2216
|
|
2198
2217
|
@asset_service_stub.call_rpc :create_saved_query, request, options: options do |response, operation|
|
2199
2218
|
yield response, operation if block_given?
|
2200
|
-
return response
|
2201
2219
|
end
|
2202
2220
|
rescue ::GRPC::BadStatus => e
|
2203
2221
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2287,7 +2305,6 @@ module Google
|
|
2287
2305
|
|
2288
2306
|
@asset_service_stub.call_rpc :get_saved_query, request, options: options do |response, operation|
|
2289
2307
|
yield response, operation if block_given?
|
2290
|
-
return response
|
2291
2308
|
end
|
2292
2309
|
rescue ::GRPC::BadStatus => e
|
2293
2310
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2399,7 +2416,7 @@ module Google
|
|
2399
2416
|
@asset_service_stub.call_rpc :list_saved_queries, request, options: options do |response, operation|
|
2400
2417
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :list_saved_queries, request, response, operation, options
|
2401
2418
|
yield response, operation if block_given?
|
2402
|
-
|
2419
|
+
throw :response, response
|
2403
2420
|
end
|
2404
2421
|
rescue ::GRPC::BadStatus => e
|
2405
2422
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2494,7 +2511,6 @@ module Google
|
|
2494
2511
|
|
2495
2512
|
@asset_service_stub.call_rpc :update_saved_query, request, options: options do |response, operation|
|
2496
2513
|
yield response, operation if block_given?
|
2497
|
-
return response
|
2498
2514
|
end
|
2499
2515
|
rescue ::GRPC::BadStatus => e
|
2500
2516
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2585,7 +2601,6 @@ module Google
|
|
2585
2601
|
|
2586
2602
|
@asset_service_stub.call_rpc :delete_saved_query, request, options: options do |response, operation|
|
2587
2603
|
yield response, operation if block_given?
|
2588
|
-
return response
|
2589
2604
|
end
|
2590
2605
|
rescue ::GRPC::BadStatus => e
|
2591
2606
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2687,7 +2702,6 @@ module Google
|
|
2687
2702
|
|
2688
2703
|
@asset_service_stub.call_rpc :batch_get_effective_iam_policies, request, options: options do |response, operation|
|
2689
2704
|
yield response, operation if block_given?
|
2690
|
-
return response
|
2691
2705
|
end
|
2692
2706
|
rescue ::GRPC::BadStatus => e
|
2693
2707
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2803,7 +2817,7 @@ module Google
|
|
2803
2817
|
@asset_service_stub.call_rpc :analyze_org_policies, request, options: options do |response, operation|
|
2804
2818
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policies, request, response, operation, options
|
2805
2819
|
yield response, operation if block_given?
|
2806
|
-
|
2820
|
+
throw :response, response
|
2807
2821
|
end
|
2808
2822
|
rescue ::GRPC::BadStatus => e
|
2809
2823
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2922,7 +2936,7 @@ module Google
|
|
2922
2936
|
@asset_service_stub.call_rpc :analyze_org_policy_governed_containers, request, options: options do |response, operation|
|
2923
2937
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_containers, request, response, operation, options
|
2924
2938
|
yield response, operation if block_given?
|
2925
|
-
|
2939
|
+
throw :response, response
|
2926
2940
|
end
|
2927
2941
|
rescue ::GRPC::BadStatus => e
|
2928
2942
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3104,7 +3118,7 @@ module Google
|
|
3104
3118
|
@asset_service_stub.call_rpc :analyze_org_policy_governed_assets, request, options: options do |response, operation|
|
3105
3119
|
response = ::Gapic::PagedEnumerable.new @asset_service_stub, :analyze_org_policy_governed_assets, request, response, operation, options
|
3106
3120
|
yield response, operation if block_given?
|
3107
|
-
|
3121
|
+
throw :response, response
|
3108
3122
|
end
|
3109
3123
|
rescue ::GRPC::BadStatus => e
|
3110
3124
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -3154,6 +3168,13 @@ module Google
|
|
3154
3168
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
3155
3169
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
3156
3170
|
# * (`nil`) indicating no credentials
|
3171
|
+
#
|
3172
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
3173
|
+
# external source for authentication to Google Cloud, you must validate it before
|
3174
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
3175
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
3176
|
+
# For more information, refer to [Validate credential configurations from external
|
3177
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
3157
3178
|
# @return [::Object]
|
3158
3179
|
# @!attribute [rw] scope
|
3159
3180
|
# The OAuth scopes
|
@@ -3193,6 +3214,11 @@ module Google
|
|
3193
3214
|
# default endpoint URL. The default value of nil uses the environment
|
3194
3215
|
# universe (usually the default "googleapis.com" universe).
|
3195
3216
|
# @return [::String,nil]
|
3217
|
+
# @!attribute [rw] logger
|
3218
|
+
# A custom logger to use for request/response debug logging, or the value
|
3219
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
3220
|
+
# explicitly disable logging.
|
3221
|
+
# @return [::Logger,:default,nil]
|
3196
3222
|
#
|
3197
3223
|
class Configuration
|
3198
3224
|
extend ::Gapic::Config
|
@@ -3217,6 +3243,7 @@ module Google
|
|
3217
3243
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
3218
3244
|
config_attr :quota_project, nil, ::String, nil
|
3219
3245
|
config_attr :universe_domain, nil, ::String, nil
|
3246
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
3220
3247
|
|
3221
3248
|
# @private
|
3222
3249
|
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
|