google-cloud-asset-v1beta1 0.1.2 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +6 -6
- data/README.md +1 -1
- data/lib/google/cloud/asset/v1beta1.rb +1 -1
- data/lib/google/cloud/asset/v1beta1/asset_service.rb +1 -1
- data/lib/google/cloud/asset/v1beta1/asset_service/client.rb +94 -81
- data/lib/google/cloud/asset/v1beta1/asset_service/credentials.rb +1 -1
- data/lib/google/cloud/asset/v1beta1/asset_service/operations.rb +109 -103
- data/lib/google/cloud/asset/v1beta1/version.rb +1 -1
- data/proto_docs/google/api/resource.rb +12 -12
- data/proto_docs/google/cloud/asset/v1beta1/asset_service.rb +28 -28
- data/proto_docs/google/cloud/asset/v1beta1/assets.rb +23 -23
- data/proto_docs/google/cloud/orgpolicy/v1/orgpolicy.rb +21 -21
- data/proto_docs/google/iam/v1/policy.rb +26 -26
- data/proto_docs/google/longrunning/operations.rb +30 -30
- data/proto_docs/google/protobuf/any.rb +4 -4
- data/proto_docs/google/protobuf/empty.rb +2 -2
- data/proto_docs/google/protobuf/struct.rb +18 -18
- data/proto_docs/google/protobuf/timestamp.rb +4 -4
- data/proto_docs/google/rpc/status.rb +6 -6
- data/proto_docs/google/type/expr.rb +6 -6
- metadata +33 -6
- data/lib/google/cloud/common_resources_pb.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94a9e700c606abde6352c9c993df3a0e68c5afcf0c9e178e4f0de6d0d4c4e249
|
4
|
+
data.tar.gz: 1d69fe64330470ec50f9e939a1bbcd5b6ba6d503bb479d6c280bf72758b9dc11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65c362061c64c5e1f0c03e55eab2ad7df57d0251fc3b593ec97596d5ab78e60f720bab047d3c98da8a6fd3cf43f4334819b85a946f72e5f482e08bc5bfaa01f4
|
7
|
+
data.tar.gz: 8fc02f3d5772dad91deff9cb32ecd07922fd58226a0d22cb187f19e16cd06ef3e21916a63d6c3d123343585563b310d7e10933b562f6f84ea2c4034438fbd94a
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export ASSET_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/asset/v1beta1"
|
29
29
|
|
30
|
-
client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
30
|
+
client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
31
31
|
```
|
32
32
|
|
33
33
|
## Credential Lookup
|
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
|
|
64
64
|
|
65
65
|
The environment variables that google-cloud-asset-v1beta1
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{Google::Cloud::Asset::V1beta1::AssetService::Credentials}):
|
67
|
+
{::Google::Cloud::Asset::V1beta1::AssetService::Credentials}):
|
68
68
|
|
69
69
|
1. `ASSET_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
70
|
2. `ASSET_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -77,7 +77,7 @@ require "google/cloud/asset/v1beta1"
|
|
77
77
|
|
78
78
|
ENV["ASSET_CREDENTIALS"] = "path/to/keyfile.json"
|
79
79
|
|
80
|
-
client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
80
|
+
client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
81
81
|
```
|
82
82
|
|
83
83
|
### Configuration
|
@@ -88,7 +88,7 @@ environment variables. Either on an individual client initialization:
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/asset/v1beta1"
|
90
90
|
|
91
|
-
client = Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
|
91
|
+
client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
|
92
92
|
config.credentials = "path/to/keyfile.json"
|
93
93
|
end
|
94
94
|
```
|
@@ -98,11 +98,11 @@ Or configured globally for all clients:
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/asset/v1beta1"
|
100
100
|
|
101
|
-
Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
|
101
|
+
::Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
|
102
102
|
config.credentials = "path/to/keyfile.json"
|
103
103
|
end
|
104
104
|
|
105
|
-
client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
105
|
+
client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
106
106
|
```
|
107
107
|
|
108
108
|
### Cloud SDK
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ In order to use this library, you first need to go through the following steps:
|
|
25
25
|
```ruby
|
26
26
|
require "google/cloud/asset/v1beta1"
|
27
27
|
|
28
|
-
client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
28
|
+
client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
29
29
|
request = my_create_request
|
30
30
|
response = client.export_assets request
|
31
31
|
```
|
@@ -26,7 +26,7 @@ module Google
|
|
26
26
|
# To load this package, including all its services, and instantiate a client:
|
27
27
|
#
|
28
28
|
# require "google/cloud/asset/v1beta1"
|
29
|
-
# client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
29
|
+
# client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
30
30
|
#
|
31
31
|
module V1beta1
|
32
32
|
end
|
@@ -36,7 +36,7 @@ module Google
|
|
36
36
|
# To load this service and instantiate a client:
|
37
37
|
#
|
38
38
|
# require "google/cloud/asset/v1beta1/asset_service"
|
39
|
-
# client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
39
|
+
# client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
40
40
|
#
|
41
41
|
module AssetService
|
42
42
|
end
|
@@ -36,15 +36,15 @@ module Google
|
|
36
36
|
##
|
37
37
|
# Configure the AssetService Client class.
|
38
38
|
#
|
39
|
-
# See {Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
|
39
|
+
# See {::Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
|
40
40
|
# for a description of the configuration fields.
|
41
41
|
#
|
42
42
|
# ## Example
|
43
43
|
#
|
44
44
|
# To modify the configuration for all AssetService clients:
|
45
45
|
#
|
46
|
-
# Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
|
47
|
-
# config.timeout =
|
46
|
+
# ::Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
|
47
|
+
# config.timeout = 10.0
|
48
48
|
# end
|
49
49
|
#
|
50
50
|
# @yield [config] Configure the Client client.
|
@@ -86,7 +86,7 @@ module Google
|
|
86
86
|
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
87
87
|
# should be made on {Client.configure}.
|
88
88
|
#
|
89
|
-
# See {Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
|
89
|
+
# See {::Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
|
90
90
|
# for a description of the configuration fields.
|
91
91
|
#
|
92
92
|
# @yield [config] Configure the Client client.
|
@@ -107,13 +107,13 @@ module Google
|
|
107
107
|
# To create a new AssetService client with the default
|
108
108
|
# configuration:
|
109
109
|
#
|
110
|
-
# client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
110
|
+
# client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
|
111
111
|
#
|
112
112
|
# To create a new AssetService client with a custom
|
113
113
|
# configuration:
|
114
114
|
#
|
115
|
-
# client = Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
|
116
|
-
# config.timeout =
|
115
|
+
# client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
|
116
|
+
# config.timeout = 10.0
|
117
117
|
# end
|
118
118
|
#
|
119
119
|
# @yield [config] Configure the AssetService client.
|
@@ -138,14 +138,16 @@ module Google
|
|
138
138
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
139
139
|
credentials = Credentials.new credentials, scope: @config.scope
|
140
140
|
end
|
141
|
-
@quota_project_id =
|
141
|
+
@quota_project_id = @config.quota_project
|
142
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
142
143
|
|
143
144
|
@operations_client = Operations.new do |config|
|
144
145
|
config.credentials = credentials
|
146
|
+
config.endpoint = @config.endpoint
|
145
147
|
end
|
146
148
|
|
147
|
-
@asset_service_stub = Gapic::ServiceStub.new(
|
148
|
-
Google::Cloud::Asset::V1beta1::AssetService::Stub,
|
149
|
+
@asset_service_stub = ::Gapic::ServiceStub.new(
|
150
|
+
::Google::Cloud::Asset::V1beta1::AssetService::Stub,
|
149
151
|
credentials: credentials,
|
150
152
|
endpoint: @config.endpoint,
|
151
153
|
channel_args: @config.channel_args,
|
@@ -153,23 +155,30 @@ module Google
|
|
153
155
|
)
|
154
156
|
end
|
155
157
|
|
158
|
+
##
|
159
|
+
# Get the associated client for long-running operations.
|
160
|
+
#
|
161
|
+
# @return [::Google::Cloud::Asset::V1beta1::AssetService::Operations]
|
162
|
+
#
|
163
|
+
attr_reader :operations_client
|
164
|
+
|
156
165
|
# Service calls
|
157
166
|
|
158
167
|
##
|
159
168
|
# Exports assets with time and resource types to a given Cloud Storage
|
160
169
|
# location. The output format is newline-delimited JSON.
|
161
170
|
# This API implements the
|
162
|
-
# {Google::Longrunning::Operation google.longrunning.Operation} API allowing
|
171
|
+
# {::Google::Longrunning::Operation google.longrunning.Operation} API allowing
|
163
172
|
# you to keep track of the export.
|
164
173
|
#
|
165
174
|
# @overload export_assets(request, options = nil)
|
166
175
|
# Pass arguments to `export_assets` via a request object, either of type
|
167
|
-
# {Google::Cloud::Asset::V1beta1::ExportAssetsRequest} or an equivalent Hash.
|
176
|
+
# {::Google::Cloud::Asset::V1beta1::ExportAssetsRequest} or an equivalent Hash.
|
168
177
|
#
|
169
|
-
# @param request [Google::Cloud::Asset::V1beta1::ExportAssetsRequest, Hash]
|
178
|
+
# @param request [::Google::Cloud::Asset::V1beta1::ExportAssetsRequest, ::Hash]
|
170
179
|
# A request object representing the call parameters. Required. To specify no
|
171
180
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
172
|
-
# @param options [Gapic::CallOptions, Hash]
|
181
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
173
182
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
174
183
|
#
|
175
184
|
# @overload export_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, output_config: nil)
|
@@ -177,51 +186,51 @@ module Google
|
|
177
186
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
178
187
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
179
188
|
#
|
180
|
-
# @param parent [String]
|
189
|
+
# @param parent [::String]
|
181
190
|
# Required. The relative name of the root asset. This can only be an
|
182
191
|
# organization number (such as "organizations/123"), a project ID (such as
|
183
192
|
# "projects/my-project-id"), a project number (such as "projects/12345"), or
|
184
193
|
# a folder number (such as "folders/123").
|
185
|
-
# @param read_time [Google::Protobuf::Timestamp, Hash]
|
194
|
+
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
186
195
|
# Timestamp to take an asset snapshot. This can only be set to a timestamp
|
187
196
|
# between 2018-10-02 UTC (inclusive) and the current time. If not specified,
|
188
197
|
# the current time will be used. Due to delays in resource data collection
|
189
198
|
# and indexing, there is a volatile window during which running the same
|
190
199
|
# query may get different results.
|
191
|
-
# @param asset_types [Array
|
200
|
+
# @param asset_types [::Array<::String>]
|
192
201
|
# A list of asset types of which to take a snapshot for. For example:
|
193
202
|
# "google.compute.Disk". If specified, only matching assets will be returned.
|
194
203
|
# See [Introduction to Cloud Asset
|
195
204
|
# Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
|
196
205
|
# for all supported asset types.
|
197
|
-
# @param content_type [Google::Cloud::Asset::V1beta1::ContentType]
|
206
|
+
# @param content_type [::Google::Cloud::Asset::V1beta1::ContentType]
|
198
207
|
# Asset content type. If not specified, no content but the asset name will be
|
199
208
|
# returned.
|
200
|
-
# @param output_config [Google::Cloud::Asset::V1beta1::OutputConfig, Hash]
|
209
|
+
# @param output_config [::Google::Cloud::Asset::V1beta1::OutputConfig, ::Hash]
|
201
210
|
# Required. Output configuration indicating where the results will be output
|
202
211
|
# to. All results will be in newline delimited JSON format.
|
203
212
|
#
|
204
213
|
# @yield [response, operation] Access the result along with the RPC operation
|
205
|
-
# @yieldparam response [Gapic::Operation]
|
206
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
214
|
+
# @yieldparam response [::Gapic::Operation]
|
215
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
207
216
|
#
|
208
|
-
# @return [Gapic::Operation]
|
217
|
+
# @return [::Gapic::Operation]
|
209
218
|
#
|
210
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
219
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
211
220
|
#
|
212
221
|
def export_assets request, options = nil
|
213
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
222
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
214
223
|
|
215
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1beta1::ExportAssetsRequest
|
224
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1beta1::ExportAssetsRequest
|
216
225
|
|
217
226
|
# Converts hash and nil to an options object
|
218
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
227
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
219
228
|
|
220
229
|
# Customize the options with defaults
|
221
230
|
metadata = @config.rpcs.export_assets.metadata.to_h
|
222
231
|
|
223
232
|
# Set x-goog-api-client and x-goog-user-project headers
|
224
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
233
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
225
234
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
226
235
|
gapic_version: ::Google::Cloud::Asset::V1beta1::VERSION
|
227
236
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -239,12 +248,12 @@ module Google
|
|
239
248
|
retry_policy: @config.retry_policy
|
240
249
|
|
241
250
|
@asset_service_stub.call_rpc :export_assets, request, options: options do |response, operation|
|
242
|
-
response = Gapic::Operation.new response, @operations_client, options: options
|
251
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
243
252
|
yield response, operation if block_given?
|
244
253
|
return response
|
245
254
|
end
|
246
|
-
rescue GRPC::BadStatus => e
|
247
|
-
raise Google::Cloud::Error.from_error(e)
|
255
|
+
rescue ::GRPC::BadStatus => e
|
256
|
+
raise ::Google::Cloud::Error.from_error(e)
|
248
257
|
end
|
249
258
|
|
250
259
|
##
|
@@ -258,12 +267,12 @@ module Google
|
|
258
267
|
#
|
259
268
|
# @overload batch_get_assets_history(request, options = nil)
|
260
269
|
# Pass arguments to `batch_get_assets_history` via a request object, either of type
|
261
|
-
# {Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest} or an equivalent Hash.
|
270
|
+
# {::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest} or an equivalent Hash.
|
262
271
|
#
|
263
|
-
# @param request [Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest, Hash]
|
272
|
+
# @param request [::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest, ::Hash]
|
264
273
|
# A request object representing the call parameters. Required. To specify no
|
265
274
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
266
|
-
# @param options [Gapic::CallOptions, Hash]
|
275
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
267
276
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
268
277
|
#
|
269
278
|
# @overload batch_get_assets_history(parent: nil, asset_names: nil, content_type: nil, read_time_window: nil)
|
@@ -271,11 +280,11 @@ module Google
|
|
271
280
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
272
281
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
273
282
|
#
|
274
|
-
# @param parent [String]
|
283
|
+
# @param parent [::String]
|
275
284
|
# Required. The relative name of the root asset. It can only be an
|
276
285
|
# organization number (such as "organizations/123"), a project ID (such as
|
277
286
|
# "projects/my-project-id")", or a project number (such as "projects/12345").
|
278
|
-
# @param asset_names [Array
|
287
|
+
# @param asset_names [::Array<::String>]
|
279
288
|
# A list of the full names of the assets. For example:
|
280
289
|
# `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
|
281
290
|
# See [Resource
|
@@ -284,9 +293,9 @@ module Google
|
|
284
293
|
#
|
285
294
|
# The request becomes a no-op if the asset name list is empty, and the max
|
286
295
|
# size of the asset name list is 100 in one request.
|
287
|
-
# @param content_type [Google::Cloud::Asset::V1beta1::ContentType]
|
296
|
+
# @param content_type [::Google::Cloud::Asset::V1beta1::ContentType]
|
288
297
|
# Optional. The content type.
|
289
|
-
# @param read_time_window [Google::Cloud::Asset::V1beta1::TimeWindow, Hash]
|
298
|
+
# @param read_time_window [::Google::Cloud::Asset::V1beta1::TimeWindow, ::Hash]
|
290
299
|
# Optional. The time window for the asset history. Both start_time and
|
291
300
|
# end_time are optional and if set, it must be after 2018-10-02 UTC. If
|
292
301
|
# end_time is not set, it is default to current timestamp. If start_time is
|
@@ -295,26 +304,26 @@ module Google
|
|
295
304
|
# read_time_window.
|
296
305
|
#
|
297
306
|
# @yield [response, operation] Access the result along with the RPC operation
|
298
|
-
# @yieldparam response [Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
|
299
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
307
|
+
# @yieldparam response [::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
|
308
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
300
309
|
#
|
301
|
-
# @return [Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
|
310
|
+
# @return [::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
|
302
311
|
#
|
303
|
-
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
312
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
304
313
|
#
|
305
314
|
def batch_get_assets_history request, options = nil
|
306
|
-
raise ArgumentError, "request must be provided" if request.nil?
|
315
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
307
316
|
|
308
|
-
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest
|
317
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest
|
309
318
|
|
310
319
|
# Converts hash and nil to an options object
|
311
|
-
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
320
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
312
321
|
|
313
322
|
# Customize the options with defaults
|
314
323
|
metadata = @config.rpcs.batch_get_assets_history.metadata.to_h
|
315
324
|
|
316
325
|
# Set x-goog-api-client and x-goog-user-project headers
|
317
|
-
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
326
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
318
327
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
319
328
|
gapic_version: ::Google::Cloud::Asset::V1beta1::VERSION
|
320
329
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
@@ -335,8 +344,8 @@ module Google
|
|
335
344
|
yield response, operation if block_given?
|
336
345
|
return response
|
337
346
|
end
|
338
|
-
rescue GRPC::BadStatus => e
|
339
|
-
raise Google::Cloud::Error.from_error(e)
|
347
|
+
rescue ::GRPC::BadStatus => e
|
348
|
+
raise ::Google::Cloud::Error.from_error(e)
|
340
349
|
end
|
341
350
|
|
342
351
|
##
|
@@ -346,7 +355,7 @@ module Google
|
|
346
355
|
# providing control over timeouts, retry behavior, logging, transport
|
347
356
|
# parameters, and other low-level controls. Certain parameters can also be
|
348
357
|
# applied individually to specific RPCs. See
|
349
|
-
# {Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration::Rpcs}
|
358
|
+
# {::Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration::Rpcs}
|
350
359
|
# for a list of RPCs that can be configured independently.
|
351
360
|
#
|
352
361
|
# Configuration can be applied globally to all clients, or to a single client
|
@@ -357,22 +366,22 @@ module Google
|
|
357
366
|
# To modify the global config, setting the timeout for export_assets
|
358
367
|
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
359
368
|
#
|
360
|
-
# Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
|
361
|
-
# config.timeout =
|
362
|
-
# config.rpcs.export_assets.timeout =
|
369
|
+
# ::Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
|
370
|
+
# config.timeout = 10.0
|
371
|
+
# config.rpcs.export_assets.timeout = 20.0
|
363
372
|
# end
|
364
373
|
#
|
365
374
|
# To apply the above configuration only to a new client:
|
366
375
|
#
|
367
|
-
# client = Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
|
368
|
-
# config.timeout =
|
369
|
-
# config.rpcs.export_assets.timeout =
|
376
|
+
# client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
|
377
|
+
# config.timeout = 10.0
|
378
|
+
# config.rpcs.export_assets.timeout = 20.0
|
370
379
|
# end
|
371
380
|
#
|
372
381
|
# @!attribute [rw] endpoint
|
373
382
|
# The hostname or hostname:port of the service endpoint.
|
374
383
|
# Defaults to `"cloudasset.googleapis.com"`.
|
375
|
-
# @return [String]
|
384
|
+
# @return [::String]
|
376
385
|
# @!attribute [rw] credentials
|
377
386
|
# Credentials to send with calls. You may provide any of the following types:
|
378
387
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -384,29 +393,29 @@ module Google
|
|
384
393
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
385
394
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
386
395
|
# * (`nil`) indicating no credentials
|
387
|
-
# @return [Object]
|
396
|
+
# @return [::Object]
|
388
397
|
# @!attribute [rw] scope
|
389
398
|
# The OAuth scopes
|
390
|
-
# @return [Array
|
399
|
+
# @return [::Array<::String>]
|
391
400
|
# @!attribute [rw] lib_name
|
392
401
|
# The library name as recorded in instrumentation and logging
|
393
|
-
# @return [String]
|
402
|
+
# @return [::String]
|
394
403
|
# @!attribute [rw] lib_version
|
395
404
|
# The library version as recorded in instrumentation and logging
|
396
|
-
# @return [String]
|
405
|
+
# @return [::String]
|
397
406
|
# @!attribute [rw] channel_args
|
398
407
|
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
399
408
|
# `GRPC::Core::Channel` object is provided as the credential.
|
400
|
-
# @return [Hash]
|
409
|
+
# @return [::Hash]
|
401
410
|
# @!attribute [rw] interceptors
|
402
411
|
# An array of interceptors that are run before calls are executed.
|
403
|
-
# @return [Array
|
412
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
404
413
|
# @!attribute [rw] timeout
|
405
|
-
# The call timeout in
|
406
|
-
# @return [Numeric]
|
414
|
+
# The call timeout in seconds.
|
415
|
+
# @return [::Numeric]
|
407
416
|
# @!attribute [rw] metadata
|
408
417
|
# Additional gRPC headers to be sent with the call.
|
409
|
-
# @return [Hash{Symbol
|
418
|
+
# @return [::Hash{::Symbol=>::String}]
|
410
419
|
# @!attribute [rw] retry_policy
|
411
420
|
# The retry policy. The value is a hash with the following keys:
|
412
421
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -414,25 +423,29 @@ module Google
|
|
414
423
|
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
415
424
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
416
425
|
# trigger a retry.
|
417
|
-
# @return [Hash]
|
426
|
+
# @return [::Hash]
|
427
|
+
# @!attribute [rw] quota_project
|
428
|
+
# A separate project against which to charge quota.
|
429
|
+
# @return [::String]
|
418
430
|
#
|
419
431
|
class Configuration
|
420
|
-
extend Gapic::Config
|
432
|
+
extend ::Gapic::Config
|
421
433
|
|
422
|
-
config_attr :endpoint,
|
423
|
-
config_attr :credentials,
|
434
|
+
config_attr :endpoint, "cloudasset.googleapis.com", ::String
|
435
|
+
config_attr :credentials, nil do |value|
|
424
436
|
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
425
437
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
426
438
|
allowed.any? { |klass| klass === value }
|
427
439
|
end
|
428
|
-
config_attr :scope,
|
429
|
-
config_attr :lib_name,
|
430
|
-
config_attr :lib_version,
|
431
|
-
config_attr(:channel_args,
|
432
|
-
config_attr :interceptors,
|
433
|
-
config_attr :timeout,
|
434
|
-
config_attr :metadata,
|
435
|
-
config_attr :retry_policy,
|
440
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
441
|
+
config_attr :lib_name, nil, ::String, nil
|
442
|
+
config_attr :lib_version, nil, ::String, nil
|
443
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
444
|
+
config_attr :interceptors, nil, ::Array, nil
|
445
|
+
config_attr :timeout, nil, ::Numeric, nil
|
446
|
+
config_attr :metadata, nil, ::Hash, nil
|
447
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
448
|
+
config_attr :quota_project, nil, ::String, nil
|
436
449
|
|
437
450
|
# @private
|
438
451
|
def initialize parent_config = nil
|
@@ -448,7 +461,7 @@ module Google
|
|
448
461
|
def rpcs
|
449
462
|
@rpcs ||= begin
|
450
463
|
parent_rpcs = nil
|
451
|
-
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to?
|
464
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
452
465
|
Rpcs.new parent_rpcs
|
453
466
|
end
|
454
467
|
end
|
@@ -473,21 +486,21 @@ module Google
|
|
473
486
|
class Rpcs
|
474
487
|
##
|
475
488
|
# RPC-specific configuration for `export_assets`
|
476
|
-
# @return [Gapic::Config::Method]
|
489
|
+
# @return [::Gapic::Config::Method]
|
477
490
|
#
|
478
491
|
attr_reader :export_assets
|
479
492
|
##
|
480
493
|
# RPC-specific configuration for `batch_get_assets_history`
|
481
|
-
# @return [Gapic::Config::Method]
|
494
|
+
# @return [::Gapic::Config::Method]
|
482
495
|
#
|
483
496
|
attr_reader :batch_get_assets_history
|
484
497
|
|
485
498
|
# @private
|
486
499
|
def initialize parent_rpcs = nil
|
487
500
|
export_assets_config = parent_rpcs&.export_assets if parent_rpcs&.respond_to? :export_assets
|
488
|
-
@export_assets = Gapic::Config::Method.new export_assets_config
|
501
|
+
@export_assets = ::Gapic::Config::Method.new export_assets_config
|
489
502
|
batch_get_assets_history_config = parent_rpcs&.batch_get_assets_history if parent_rpcs&.respond_to? :batch_get_assets_history
|
490
|
-
@batch_get_assets_history = Gapic::Config::Method.new batch_get_assets_history_config
|
503
|
+
@batch_get_assets_history = ::Gapic::Config::Method.new batch_get_assets_history_config
|
491
504
|
|
492
505
|
yield self if block_given?
|
493
506
|
end
|