google-cloud-asset-v1beta1 0.1.1 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63527fad022964aec07619bc3e9081bcd855d62cfd82f5587c1ab939ed4831ba
4
- data.tar.gz: 4972231994b7849ef2f5c7cdf143f63df3cd231bb68c31a41e4e22254ff3cd1f
3
+ metadata.gz: 474644dd428dacd5fe094df07331404a8659644663f51234cef89dd8e019a365
4
+ data.tar.gz: 63b645e5fdb9a1a945579ac4ff1476732fd513ae1cfee2770ed75c4aff5a2dad
5
5
  SHA512:
6
- metadata.gz: 88bfa4c96604c7c3c4cd52ac5d5901bc865e279c7e05d318f7ef7ee43ab3d9348ac3334a7e319fb1e5e18530fc7abfef21fb340e5e9cd97435251301af0c05dc
7
- data.tar.gz: 27760f0d5fa8989ba52de1a0dffffa80085968915c5d05f797a50f51c1b259bc864776576f7b6d2c268dbf970dae93913205de8c7a83576fd7d854551d06163a
6
+ metadata.gz: a1f1efdd058b7904cb4830b536a71d4df32dbb210a7b1c88f1206f75e8e8381094aa079a29f51a93544c80d0717e07dac53a6c6ea4ea1a7aae5df813434a826d
7
+ data.tar.gz: 25eacab8f0b2d291d5c65c472b0c673cdaa20c68ee8deee46436a66e7c45dfac852dba97319347290282ae38153cd5757a5eef2b1cd133013fd53e9c1e7500cd
@@ -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
@@ -1,4 +1,4 @@
1
- # Cloud Asset V1beta1
1
+ # Ruby Client for the Cloud Asset V1beta1 API
2
2
 
3
3
  API Client library for the Cloud Asset V1beta1 API
4
4
 
@@ -12,6 +12,53 @@ https://github.com/googleapis/google-cloud-ruby
12
12
  $ gem install google-cloud-asset-v1beta1
13
13
  ```
14
14
 
15
+ ## Before You Begin
16
+
17
+ In order to use this library, you first need to go through the following steps:
18
+
19
+ 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
+ 1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
21
+ 1. {file:AUTHENTICATION.md Set up authentication.}
22
+
23
+ ## Quick Start
24
+
25
+ ```ruby
26
+ require "google/cloud/asset/v1beta1"
27
+
28
+ client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
29
+ request = my_create_request
30
+ response = client.export_assets request
31
+ ```
32
+
33
+ View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-asset-v1beta1/latest)
34
+ for class and method documentation.
35
+
36
+ ## Enabling Logging
37
+
38
+ To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
39
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
40
+ or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
41
+ that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
42
+ and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
43
+
44
+ Configuring a Ruby stdlib logger:
45
+
46
+ ```ruby
47
+ require "logger"
48
+
49
+ module MyLogger
50
+ LOGGER = Logger.new $stderr, level: Logger::WARN
51
+ def logger
52
+ LOGGER
53
+ end
54
+ end
55
+
56
+ # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
57
+ module GRPC
58
+ extend MyLogger
59
+ end
60
+ ```
61
+
15
62
  ## Supported Ruby Versions
16
63
 
17
64
  This library is supported on Ruby 2.4+.
@@ -1 +1,21 @@
1
- require "google/cloud/asset/v1beta1/version"
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/asset/v1beta1"
@@ -17,3 +17,19 @@
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
19
  require "google/cloud/asset/v1beta1/asset_service"
20
+ require "google/cloud/asset/v1beta1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Asset
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/asset/v1beta1"
29
+ # client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
30
+ #
31
+ module V1beta1
32
+ end
33
+ end
34
+ end
35
+ end
@@ -16,6 +16,34 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "google/cloud/asset/v1beta1/asset_service/client"
20
- require "google/cloud/asset/v1beta1/asset_service/operations"
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/asset/v1beta1/version"
24
+
21
25
  require "google/cloud/asset/v1beta1/asset_service/credentials"
26
+ require "google/cloud/asset/v1beta1/asset_service/operations"
27
+ require "google/cloud/asset/v1beta1/asset_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Asset
32
+ module V1beta1
33
+ ##
34
+ # Asset service definition.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/asset/v1beta1/asset_service"
39
+ # client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
40
+ #
41
+ module AssetService
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "asset_service", "helpers.rb"
49
+ require "google/cloud/asset/v1beta1/asset_service/helpers" if ::File.file? helper_path
@@ -16,15 +16,8 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "gapic/common"
20
- require "gapic/config"
21
- require "gapic/config/method"
22
-
23
19
  require "google/cloud/errors"
24
- require "google/cloud/asset/v1beta1/version"
25
20
  require "google/cloud/asset/v1beta1/asset_service_pb"
26
- require "google/cloud/asset/v1beta1/asset_service/credentials"
27
- require "google/cloud/asset/v1beta1/asset_service/operations"
28
21
 
29
22
  module Google
30
23
  module Cloud
@@ -43,15 +36,15 @@ module Google
43
36
  ##
44
37
  # Configure the AssetService Client class.
45
38
  #
46
- # See {Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
39
+ # See {::Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
47
40
  # for a description of the configuration fields.
48
41
  #
49
42
  # ## Example
50
43
  #
51
44
  # To modify the configuration for all AssetService clients:
52
45
  #
53
- # Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
54
- # config.timeout = 10_000
46
+ # ::Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
47
+ # config.timeout = 10.0
55
48
  # end
56
49
  #
57
50
  # @yield [config] Configure the Client client.
@@ -93,7 +86,7 @@ module Google
93
86
  # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
87
  # should be made on {Client.configure}.
95
88
  #
96
- # See {Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
89
+ # See {::Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration}
97
90
  # for a description of the configuration fields.
98
91
  #
99
92
  # @yield [config] Configure the Client client.
@@ -114,13 +107,13 @@ module Google
114
107
  # To create a new AssetService client with the default
115
108
  # configuration:
116
109
  #
117
- # client = Google::Cloud::Asset::V1beta1::AssetService::Client.new
110
+ # client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new
118
111
  #
119
112
  # To create a new AssetService client with a custom
120
113
  # configuration:
121
114
  #
122
- # client = Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
123
- # config.timeout = 10_000
115
+ # client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
116
+ # config.timeout = 10.0
124
117
  # end
125
118
  #
126
119
  # @yield [config] Configure the AssetService client.
@@ -145,14 +138,16 @@ module Google
145
138
  if credentials.is_a?(String) || credentials.is_a?(Hash)
146
139
  credentials = Credentials.new credentials, scope: @config.scope
147
140
  end
148
- @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
141
+ @quota_project_id = @config.quota_project
142
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
143
 
150
144
  @operations_client = Operations.new do |config|
151
145
  config.credentials = credentials
146
+ config.endpoint = @config.endpoint
152
147
  end
153
148
 
154
- @asset_service_stub = Gapic::ServiceStub.new(
155
- Google::Cloud::Asset::V1beta1::AssetService::Stub,
149
+ @asset_service_stub = ::Gapic::ServiceStub.new(
150
+ ::Google::Cloud::Asset::V1beta1::AssetService::Stub,
156
151
  credentials: credentials,
157
152
  endpoint: @config.endpoint,
158
153
  channel_args: @config.channel_args,
@@ -160,72 +155,82 @@ module Google
160
155
  )
161
156
  end
162
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
+
163
165
  # Service calls
164
166
 
165
167
  ##
166
168
  # Exports assets with time and resource types to a given Cloud Storage
167
169
  # location. The output format is newline-delimited JSON.
168
170
  # This API implements the
169
- # {Google::Longrunning::Operation google.longrunning.Operation} API allowing
171
+ # {::Google::Longrunning::Operation google.longrunning.Operation} API allowing
170
172
  # you to keep track of the export.
171
173
  #
172
174
  # @overload export_assets(request, options = nil)
173
- # @param request [Google::Cloud::Asset::V1beta1::ExportAssetsRequest | Hash]
174
- # Exports assets with time and resource types to a given Cloud Storage
175
- # location. The output format is newline-delimited JSON.
176
- # This API implements the
177
- # {Google::Longrunning::Operation google.longrunning.Operation} API allowing
178
- # you to keep track of the export.
179
- # @param options [Gapic::CallOptions, Hash]
175
+ # Pass arguments to `export_assets` via a request object, either of type
176
+ # {::Google::Cloud::Asset::V1beta1::ExportAssetsRequest} or an equivalent Hash.
177
+ #
178
+ # @param request [::Google::Cloud::Asset::V1beta1::ExportAssetsRequest, ::Hash]
179
+ # A request object representing the call parameters. Required. To specify no
180
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
181
+ # @param options [::Gapic::CallOptions, ::Hash]
180
182
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
181
183
  #
182
184
  # @overload export_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, output_config: nil)
183
- # @param parent [String]
185
+ # Pass arguments to `export_assets` via keyword arguments. Note that at
186
+ # least one keyword argument is required. To specify no parameters, or to keep all
187
+ # the default parameter values, pass an empty Hash as a request object (see above).
188
+ #
189
+ # @param parent [::String]
184
190
  # Required. The relative name of the root asset. This can only be an
185
191
  # organization number (such as "organizations/123"), a project ID (such as
186
192
  # "projects/my-project-id"), a project number (such as "projects/12345"), or
187
193
  # a folder number (such as "folders/123").
188
- # @param read_time [Google::Protobuf::Timestamp | Hash]
194
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
189
195
  # Timestamp to take an asset snapshot. This can only be set to a timestamp
190
196
  # between 2018-10-02 UTC (inclusive) and the current time. If not specified,
191
197
  # the current time will be used. Due to delays in resource data collection
192
198
  # and indexing, there is a volatile window during which running the same
193
199
  # query may get different results.
194
- # @param asset_types [Array<String>]
200
+ # @param asset_types [::Array<::String>]
195
201
  # A list of asset types of which to take a snapshot for. For example:
196
202
  # "google.compute.Disk". If specified, only matching assets will be returned.
197
203
  # See [Introduction to Cloud Asset
198
204
  # Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
199
205
  # for all supported asset types.
200
- # @param content_type [Google::Cloud::Asset::V1beta1::ContentType]
206
+ # @param content_type [::Google::Cloud::Asset::V1beta1::ContentType]
201
207
  # Asset content type. If not specified, no content but the asset name will be
202
208
  # returned.
203
- # @param output_config [Google::Cloud::Asset::V1beta1::OutputConfig | Hash]
209
+ # @param output_config [::Google::Cloud::Asset::V1beta1::OutputConfig, ::Hash]
204
210
  # Required. Output configuration indicating where the results will be output
205
211
  # to. All results will be in newline delimited JSON format.
206
212
  #
207
- #
208
213
  # @yield [response, operation] Access the result along with the RPC operation
209
- # @yieldparam response [Gapic::Operation]
210
- # @yieldparam operation [GRPC::ActiveCall::Operation]
214
+ # @yieldparam response [::Gapic::Operation]
215
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
211
216
  #
212
- # @return [Gapic::Operation]
217
+ # @return [::Gapic::Operation]
213
218
  #
214
- # @raise [Google::Cloud::Error] if the RPC is aborted.
219
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
215
220
  #
216
221
  def export_assets request, options = nil
217
- raise ArgumentError, "request must be provided" if request.nil?
222
+ raise ::ArgumentError, "request must be provided" if request.nil?
218
223
 
219
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1beta1::ExportAssetsRequest
224
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1beta1::ExportAssetsRequest
220
225
 
221
226
  # Converts hash and nil to an options object
222
- 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
223
228
 
224
229
  # Customize the options with defaults
225
230
  metadata = @config.rpcs.export_assets.metadata.to_h
226
231
 
227
232
  # Set x-goog-api-client and x-goog-user-project headers
228
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
233
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
229
234
  lib_name: @config.lib_name, lib_version: @config.lib_version,
230
235
  gapic_version: ::Google::Cloud::Asset::V1beta1::VERSION
231
236
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -243,12 +248,12 @@ module Google
243
248
  retry_policy: @config.retry_policy
244
249
 
245
250
  @asset_service_stub.call_rpc :export_assets, request, options: options do |response, operation|
246
- response = Gapic::Operation.new response, @operations_client, options: options
251
+ response = ::Gapic::Operation.new response, @operations_client, options: options
247
252
  yield response, operation if block_given?
248
253
  return response
249
254
  end
250
- rescue GRPC::BadStatus => e
251
- raise Google::Cloud::Error.from_error(e)
255
+ rescue ::GRPC::BadStatus => e
256
+ raise ::Google::Cloud::Error.from_error(e)
252
257
  end
253
258
 
254
259
  ##
@@ -261,23 +266,25 @@ module Google
261
266
  # error.
262
267
  #
263
268
  # @overload batch_get_assets_history(request, options = nil)
264
- # @param request [Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest | Hash]
265
- # Batch gets the update history of assets that overlap a time window.
266
- # For RESOURCE content, this API outputs history with asset in both
267
- # non-delete or deleted status.
268
- # For IAM_POLICY content, this API outputs history when the asset and its
269
- # attached IAM POLICY both exist. This can create gaps in the output history.
270
- # If a specified asset does not exist, this API returns an INVALID_ARGUMENT
271
- # error.
272
- # @param options [Gapic::CallOptions, Hash]
269
+ # Pass arguments to `batch_get_assets_history` via a request object, either of type
270
+ # {::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest} or an equivalent Hash.
271
+ #
272
+ # @param request [::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest, ::Hash]
273
+ # A request object representing the call parameters. Required. To specify no
274
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
275
+ # @param options [::Gapic::CallOptions, ::Hash]
273
276
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
274
277
  #
275
278
  # @overload batch_get_assets_history(parent: nil, asset_names: nil, content_type: nil, read_time_window: nil)
276
- # @param parent [String]
279
+ # Pass arguments to `batch_get_assets_history` via keyword arguments. Note that at
280
+ # least one keyword argument is required. To specify no parameters, or to keep all
281
+ # the default parameter values, pass an empty Hash as a request object (see above).
282
+ #
283
+ # @param parent [::String]
277
284
  # Required. The relative name of the root asset. It can only be an
278
285
  # organization number (such as "organizations/123"), a project ID (such as
279
286
  # "projects/my-project-id")", or a project number (such as "projects/12345").
280
- # @param asset_names [Array<String>]
287
+ # @param asset_names [::Array<::String>]
281
288
  # A list of the full names of the assets. For example:
282
289
  # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
283
290
  # See [Resource
@@ -286,9 +293,9 @@ module Google
286
293
  #
287
294
  # The request becomes a no-op if the asset name list is empty, and the max
288
295
  # size of the asset name list is 100 in one request.
289
- # @param content_type [Google::Cloud::Asset::V1beta1::ContentType]
296
+ # @param content_type [::Google::Cloud::Asset::V1beta1::ContentType]
290
297
  # Optional. The content type.
291
- # @param read_time_window [Google::Cloud::Asset::V1beta1::TimeWindow | Hash]
298
+ # @param read_time_window [::Google::Cloud::Asset::V1beta1::TimeWindow, ::Hash]
292
299
  # Optional. The time window for the asset history. Both start_time and
293
300
  # end_time are optional and if set, it must be after 2018-10-02 UTC. If
294
301
  # end_time is not set, it is default to current timestamp. If start_time is
@@ -296,28 +303,27 @@ module Google
296
303
  # returned results contain all temporal assets whose time window overlap with
297
304
  # read_time_window.
298
305
  #
299
- #
300
306
  # @yield [response, operation] Access the result along with the RPC operation
301
- # @yieldparam response [Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
302
- # @yieldparam operation [GRPC::ActiveCall::Operation]
307
+ # @yieldparam response [::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
308
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
303
309
  #
304
- # @return [Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
310
+ # @return [::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryResponse]
305
311
  #
306
- # @raise [Google::Cloud::Error] if the RPC is aborted.
312
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
307
313
  #
308
314
  def batch_get_assets_history request, options = nil
309
- raise ArgumentError, "request must be provided" if request.nil?
315
+ raise ::ArgumentError, "request must be provided" if request.nil?
310
316
 
311
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest
317
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1beta1::BatchGetAssetsHistoryRequest
312
318
 
313
319
  # Converts hash and nil to an options object
314
- 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
315
321
 
316
322
  # Customize the options with defaults
317
323
  metadata = @config.rpcs.batch_get_assets_history.metadata.to_h
318
324
 
319
325
  # Set x-goog-api-client and x-goog-user-project headers
320
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
326
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
321
327
  lib_name: @config.lib_name, lib_version: @config.lib_version,
322
328
  gapic_version: ::Google::Cloud::Asset::V1beta1::VERSION
323
329
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -338,8 +344,8 @@ module Google
338
344
  yield response, operation if block_given?
339
345
  return response
340
346
  end
341
- rescue GRPC::BadStatus => e
342
- raise Google::Cloud::Error.from_error(e)
347
+ rescue ::GRPC::BadStatus => e
348
+ raise ::Google::Cloud::Error.from_error(e)
343
349
  end
344
350
 
345
351
  ##
@@ -349,7 +355,7 @@ module Google
349
355
  # providing control over timeouts, retry behavior, logging, transport
350
356
  # parameters, and other low-level controls. Certain parameters can also be
351
357
  # applied individually to specific RPCs. See
352
- # {Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration::Rpcs}
358
+ # {::Google::Cloud::Asset::V1beta1::AssetService::Client::Configuration::Rpcs}
353
359
  # for a list of RPCs that can be configured independently.
354
360
  #
355
361
  # Configuration can be applied globally to all clients, or to a single client
@@ -360,22 +366,22 @@ module Google
360
366
  # To modify the global config, setting the timeout for export_assets
361
367
  # to 20 seconds, and all remaining timeouts to 10 seconds:
362
368
  #
363
- # Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
364
- # config.timeout = 10_000
365
- # config.rpcs.export_assets.timeout = 20_000
369
+ # ::Google::Cloud::Asset::V1beta1::AssetService::Client.configure do |config|
370
+ # config.timeout = 10.0
371
+ # config.rpcs.export_assets.timeout = 20.0
366
372
  # end
367
373
  #
368
374
  # To apply the above configuration only to a new client:
369
375
  #
370
- # client = Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
371
- # config.timeout = 10_000
372
- # config.rpcs.export_assets.timeout = 20_000
376
+ # client = ::Google::Cloud::Asset::V1beta1::AssetService::Client.new do |config|
377
+ # config.timeout = 10.0
378
+ # config.rpcs.export_assets.timeout = 20.0
373
379
  # end
374
380
  #
375
381
  # @!attribute [rw] endpoint
376
382
  # The hostname or hostname:port of the service endpoint.
377
383
  # Defaults to `"cloudasset.googleapis.com"`.
378
- # @return [String]
384
+ # @return [::String]
379
385
  # @!attribute [rw] credentials
380
386
  # Credentials to send with calls. You may provide any of the following types:
381
387
  # * (`String`) The path to a service account key file in JSON format
@@ -387,29 +393,29 @@ module Google
387
393
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
388
394
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
389
395
  # * (`nil`) indicating no credentials
390
- # @return [Object]
396
+ # @return [::Object]
391
397
  # @!attribute [rw] scope
392
398
  # The OAuth scopes
393
- # @return [Array<String>]
399
+ # @return [::Array<::String>]
394
400
  # @!attribute [rw] lib_name
395
401
  # The library name as recorded in instrumentation and logging
396
- # @return [String]
402
+ # @return [::String]
397
403
  # @!attribute [rw] lib_version
398
404
  # The library version as recorded in instrumentation and logging
399
- # @return [String]
405
+ # @return [::String]
400
406
  # @!attribute [rw] channel_args
401
407
  # Extra parameters passed to the gRPC channel. Note: this is ignored if a
402
408
  # `GRPC::Core::Channel` object is provided as the credential.
403
- # @return [Hash]
409
+ # @return [::Hash]
404
410
  # @!attribute [rw] interceptors
405
411
  # An array of interceptors that are run before calls are executed.
406
- # @return [Array<GRPC::ClientInterceptor>]
412
+ # @return [::Array<::GRPC::ClientInterceptor>]
407
413
  # @!attribute [rw] timeout
408
- # The call timeout in milliseconds.
409
- # @return [Numeric]
414
+ # The call timeout in seconds.
415
+ # @return [::Numeric]
410
416
  # @!attribute [rw] metadata
411
417
  # Additional gRPC headers to be sent with the call.
412
- # @return [Hash{Symbol=>String}]
418
+ # @return [::Hash{::Symbol=>::String}]
413
419
  # @!attribute [rw] retry_policy
414
420
  # The retry policy. The value is a hash with the following keys:
415
421
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
@@ -417,25 +423,29 @@ module Google
417
423
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
418
424
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
419
425
  # trigger a retry.
420
- # @return [Hash]
426
+ # @return [::Hash]
427
+ # @!attribute [rw] quota_project
428
+ # A separate project against which to charge quota.
429
+ # @return [::String]
421
430
  #
422
431
  class Configuration
423
- extend Gapic::Config
432
+ extend ::Gapic::Config
424
433
 
425
- config_attr :endpoint, "cloudasset.googleapis.com", String
426
- config_attr :credentials, nil do |value|
434
+ config_attr :endpoint, "cloudasset.googleapis.com", ::String
435
+ config_attr :credentials, nil do |value|
427
436
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
428
437
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
429
438
  allowed.any? { |klass| klass === value }
430
439
  end
431
- config_attr :scope, nil, String, Array, nil
432
- config_attr :lib_name, nil, String, nil
433
- config_attr :lib_version, nil, String, nil
434
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
435
- config_attr :interceptors, nil, Array, nil
436
- config_attr :timeout, nil, Numeric, nil
437
- config_attr :metadata, nil, Hash, nil
438
- config_attr :retry_policy, nil, Hash, Proc, nil
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
439
449
 
440
450
  # @private
441
451
  def initialize parent_config = nil
@@ -476,21 +486,21 @@ module Google
476
486
  class Rpcs
477
487
  ##
478
488
  # RPC-specific configuration for `export_assets`
479
- # @return [Gapic::Config::Method]
489
+ # @return [::Gapic::Config::Method]
480
490
  #
481
491
  attr_reader :export_assets
482
492
  ##
483
493
  # RPC-specific configuration for `batch_get_assets_history`
484
- # @return [Gapic::Config::Method]
494
+ # @return [::Gapic::Config::Method]
485
495
  #
486
496
  attr_reader :batch_get_assets_history
487
497
 
488
498
  # @private
489
499
  def initialize parent_rpcs = nil
490
500
  export_assets_config = parent_rpcs&.export_assets if parent_rpcs&.respond_to? :export_assets
491
- @export_assets = Gapic::Config::Method.new export_assets_config
501
+ @export_assets = ::Gapic::Config::Method.new export_assets_config
492
502
  batch_get_assets_history_config = parent_rpcs&.batch_get_assets_history if parent_rpcs&.respond_to? :batch_get_assets_history
493
- @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
494
504
 
495
505
  yield self if block_given?
496
506
  end
@@ -502,13 +512,3 @@ module Google
502
512
  end
503
513
  end
504
514
  end
505
-
506
- # rubocop:disable Lint/HandleExceptions
507
-
508
- # Once client is loaded, load helpers.rb if it exists.
509
- begin
510
- require "google/cloud/asset/v1beta1/asset_service/helpers"
511
- rescue LoadError
512
- end
513
-
514
- # rubocop:enable Lint/HandleExceptions