google-cloud-billing-v1 0.4.0 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51a5fee4769dcdbc3bec23725feb7ef0699e4751fa0780e80a99448dc91184d2
4
- data.tar.gz: 7fa3b0689fe1fbda27eee3e7837766a25f67dceca4f53fa2b3c35f97250e0a69
3
+ metadata.gz: 89f7da3ecb6c2ae6dcddf4d0d2bfd2a2693aab670733ddd251a1115d1755f492
4
+ data.tar.gz: 3998ec6d4e0b718860cd0ed5f8d3506bb40cd78274595cb12de80a5aecdc4b36
5
5
  SHA512:
6
- metadata.gz: b68ed50284f329084142d03ec5f73efef6d651f2c22df1e9cd9ffdeeb228517c911a8c5aa21a7ad851cdfd10b2fe3755bba83b0754dd2f9ea4e5e868c16d2b57
7
- data.tar.gz: 6f83a4a319b07f9f44d24e5c29e743fe10233275f5bf96ea6ac143a6159e6069672e9fe3730264db900308568f88101cbfb2157e258447154ded400fb3037a2c
6
+ metadata.gz: bc83fc57ca20d023383c8dbbadefd566edfc80d59983bbc6285f798b049fb36a6d835df937b3e6cdeb0516eee58c2c6820dc61c1f0228ce241b49c85d792a737
7
+ data.tar.gz: 4c1b54179909722e19d7eb029b8e0a880292a343d3fc0a43aff43774bc63f13c9bb3d993dd4b4b3f876a92a1a425618e81178112a703061dd79c061409b730c1
@@ -27,7 +27,7 @@ export BILLING_CREDENTIALS=path/to/keyfile.json
27
27
  ```ruby
28
28
  require "google/cloud/billing/v1"
29
29
 
30
- client = Google::Cloud::Billing::V1::CloudBilling::Client.new
30
+ client = ::Google::Cloud::Billing::V1::CloudBilling::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-billing-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
- {Google::Cloud::Billing::V1::CloudBilling::Credentials}):
67
+ {::Google::Cloud::Billing::V1::CloudBilling::Credentials}):
68
68
 
69
69
  1. `BILLING_CREDENTIALS` - Path to JSON file, or JSON contents
70
70
  2. `BILLING_KEYFILE` - Path to JSON file, or JSON contents
@@ -77,7 +77,7 @@ require "google/cloud/billing/v1"
77
77
 
78
78
  ENV["BILLING_CREDENTIALS"] = "path/to/keyfile.json"
79
79
 
80
- client = Google::Cloud::Billing::V1::CloudBilling::Client.new
80
+ client = ::Google::Cloud::Billing::V1::CloudBilling::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/billing/v1"
90
90
 
91
- client = Google::Cloud::Billing::V1::CloudBilling::Client.new do |config|
91
+ client = ::Google::Cloud::Billing::V1::CloudBilling::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/billing/v1"
100
100
 
101
- Google::Cloud::Billing::V1::CloudBilling::Client.configure do |config|
101
+ ::Google::Cloud::Billing::V1::CloudBilling::Client.configure do |config|
102
102
  config.credentials = "path/to/keyfile.json"
103
103
  end
104
104
 
105
- client = Google::Cloud::Billing::V1::CloudBilling::Client.new
105
+ client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new
106
106
  ```
107
107
 
108
108
  ### Cloud SDK
data/README.md CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
18
18
 
19
19
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
20
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
21
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudbilling.googleapis.com)
21
22
  1. {file:AUTHENTICATION.md Set up authentication.}
22
23
 
23
24
  ## Quick Start
@@ -25,7 +26,7 @@ In order to use this library, you first need to go through the following steps:
25
26
  ```ruby
26
27
  require "google/cloud/billing/v1"
27
28
 
28
- client = Google::Cloud::Billing::V1::CloudBilling::Client.new
29
+ client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new
29
30
  request = my_create_request
30
31
  response = client.get_billing_account request
31
32
  ```
@@ -33,6 +34,9 @@ response = client.get_billing_account request
33
34
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-billing-v1/latest)
34
35
  for class and method documentation.
35
36
 
37
+ See also the [Product Documentation](https://cloud.google.com/billing)
38
+ for general usage information.
39
+
36
40
  ## Enabling Logging
37
41
 
38
42
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -27,7 +27,7 @@ module Google
27
27
  # To load this package, including all its services, and instantiate a client:
28
28
  #
29
29
  # require "google/cloud/billing/v1"
30
- # client = Google::Cloud::Billing::V1::CloudBilling::Client.new
30
+ # client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new
31
31
  #
32
32
  module V1
33
33
  end
@@ -36,7 +36,7 @@ module Google
36
36
  # To load this service and instantiate a client:
37
37
  #
38
38
  # require "google/cloud/billing/v1/cloud_billing"
39
- # client = Google::Cloud::Billing::V1::CloudBilling::Client.new
39
+ # client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new
40
40
  #
41
41
  module CloudBilling
42
42
  end
@@ -38,15 +38,15 @@ module Google
38
38
  ##
39
39
  # Configure the CloudBilling Client class.
40
40
  #
41
- # See {Google::Cloud::Billing::V1::CloudBilling::Client::Configuration}
41
+ # See {::Google::Cloud::Billing::V1::CloudBilling::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
44
  # ## Example
45
45
  #
46
46
  # To modify the configuration for all CloudBilling clients:
47
47
  #
48
- # Google::Cloud::Billing::V1::CloudBilling::Client.configure do |config|
49
- # config.timeout = 10_000
48
+ # ::Google::Cloud::Billing::V1::CloudBilling::Client.configure do |config|
49
+ # config.timeout = 10.0
50
50
  # end
51
51
  #
52
52
  # @yield [config] Configure the Client client.
@@ -152,7 +152,7 @@ module Google
152
152
  # but structural changes (adding new fields, etc.) are not allowed. Structural changes
153
153
  # should be made on {Client.configure}.
154
154
  #
155
- # See {Google::Cloud::Billing::V1::CloudBilling::Client::Configuration}
155
+ # See {::Google::Cloud::Billing::V1::CloudBilling::Client::Configuration}
156
156
  # for a description of the configuration fields.
157
157
  #
158
158
  # @yield [config] Configure the Client client.
@@ -173,13 +173,13 @@ module Google
173
173
  # To create a new CloudBilling client with the default
174
174
  # configuration:
175
175
  #
176
- # client = Google::Cloud::Billing::V1::CloudBilling::Client.new
176
+ # client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new
177
177
  #
178
178
  # To create a new CloudBilling client with a custom
179
179
  # configuration:
180
180
  #
181
- # client = Google::Cloud::Billing::V1::CloudBilling::Client.new do |config|
182
- # config.timeout = 10_000
181
+ # client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config|
182
+ # config.timeout = 10.0
183
183
  # end
184
184
  #
185
185
  # @yield [config] Configure the CloudBilling client.
@@ -204,10 +204,11 @@ module Google
204
204
  if credentials.is_a?(String) || credentials.is_a?(Hash)
205
205
  credentials = Credentials.new credentials, scope: @config.scope
206
206
  end
207
- @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
207
+ @quota_project_id = @config.quota_project
208
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
208
209
 
209
- @cloud_billing_stub = Gapic::ServiceStub.new(
210
- Google::Cloud::Billing::V1::CloudBilling::Stub,
210
+ @cloud_billing_stub = ::Gapic::ServiceStub.new(
211
+ ::Google::Cloud::Billing::V1::CloudBilling::Stub,
211
212
  credentials: credentials,
212
213
  endpoint: @config.endpoint,
213
214
  channel_args: @config.channel_args,
@@ -224,12 +225,12 @@ module Google
224
225
  #
225
226
  # @overload get_billing_account(request, options = nil)
226
227
  # Pass arguments to `get_billing_account` via a request object, either of type
227
- # {Google::Cloud::Billing::V1::GetBillingAccountRequest} or an equivalent Hash.
228
+ # {::Google::Cloud::Billing::V1::GetBillingAccountRequest} or an equivalent Hash.
228
229
  #
229
- # @param request [Google::Cloud::Billing::V1::GetBillingAccountRequest, Hash]
230
+ # @param request [::Google::Cloud::Billing::V1::GetBillingAccountRequest, ::Hash]
230
231
  # A request object representing the call parameters. Required. To specify no
231
232
  # parameters, or to keep all the default parameter values, pass an empty Hash.
232
- # @param options [Gapic::CallOptions, Hash]
233
+ # @param options [::Gapic::CallOptions, ::Hash]
233
234
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
234
235
  #
235
236
  # @overload get_billing_account(name: nil)
@@ -237,31 +238,31 @@ module Google
237
238
  # least one keyword argument is required. To specify no parameters, or to keep all
238
239
  # the default parameter values, pass an empty Hash as a request object (see above).
239
240
  #
240
- # @param name [String]
241
+ # @param name [::String]
241
242
  # Required. The resource name of the billing account to retrieve. For example,
242
243
  # `billingAccounts/012345-567890-ABCDEF`.
243
244
  #
244
245
  # @yield [response, operation] Access the result along with the RPC operation
245
- # @yieldparam response [Google::Cloud::Billing::V1::BillingAccount]
246
- # @yieldparam operation [GRPC::ActiveCall::Operation]
246
+ # @yieldparam response [::Google::Cloud::Billing::V1::BillingAccount]
247
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
247
248
  #
248
- # @return [Google::Cloud::Billing::V1::BillingAccount]
249
+ # @return [::Google::Cloud::Billing::V1::BillingAccount]
249
250
  #
250
- # @raise [Google::Cloud::Error] if the RPC is aborted.
251
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
251
252
  #
252
253
  def get_billing_account request, options = nil
253
- raise ArgumentError, "request must be provided" if request.nil?
254
+ raise ::ArgumentError, "request must be provided" if request.nil?
254
255
 
255
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Billing::V1::GetBillingAccountRequest
256
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Billing::V1::GetBillingAccountRequest
256
257
 
257
258
  # Converts hash and nil to an options object
258
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
259
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
259
260
 
260
261
  # Customize the options with defaults
261
262
  metadata = @config.rpcs.get_billing_account.metadata.to_h
262
263
 
263
264
  # Set x-goog-api-client and x-goog-user-project headers
264
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
265
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
265
266
  lib_name: @config.lib_name, lib_version: @config.lib_version,
266
267
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
267
268
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -282,8 +283,8 @@ module Google
282
283
  yield response, operation if block_given?
283
284
  return response
284
285
  end
285
- rescue GRPC::BadStatus => e
286
- raise Google::Cloud::Error.from_error(e)
286
+ rescue ::GRPC::BadStatus => e
287
+ raise ::Google::Cloud::Error.from_error(e)
287
288
  end
288
289
 
289
290
  ##
@@ -293,12 +294,12 @@ module Google
293
294
  #
294
295
  # @overload list_billing_accounts(request, options = nil)
295
296
  # Pass arguments to `list_billing_accounts` via a request object, either of type
296
- # {Google::Cloud::Billing::V1::ListBillingAccountsRequest} or an equivalent Hash.
297
+ # {::Google::Cloud::Billing::V1::ListBillingAccountsRequest} or an equivalent Hash.
297
298
  #
298
- # @param request [Google::Cloud::Billing::V1::ListBillingAccountsRequest, Hash]
299
+ # @param request [::Google::Cloud::Billing::V1::ListBillingAccountsRequest, ::Hash]
299
300
  # A request object representing the call parameters. Required. To specify no
300
301
  # parameters, or to keep all the default parameter values, pass an empty Hash.
301
- # @param options [Gapic::CallOptions, Hash]
302
+ # @param options [::Gapic::CallOptions, ::Hash]
302
303
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
303
304
  #
304
305
  # @overload list_billing_accounts(page_size: nil, page_token: nil, filter: nil)
@@ -306,14 +307,14 @@ module Google
306
307
  # least one keyword argument is required. To specify no parameters, or to keep all
307
308
  # the default parameter values, pass an empty Hash as a request object (see above).
308
309
  #
309
- # @param page_size [Integer]
310
+ # @param page_size [::Integer]
310
311
  # Requested page size. The maximum page size is 100; this is also the
311
312
  # default.
312
- # @param page_token [String]
313
+ # @param page_token [::String]
313
314
  # A token identifying a page of results to return. This should be a
314
315
  # `next_page_token` value returned from a previous `ListBillingAccounts`
315
316
  # call. If unspecified, the first page of results is returned.
316
- # @param filter [String]
317
+ # @param filter [::String]
317
318
  # Options for how to filter the returned billing accounts.
318
319
  # Currently this only supports filtering for
319
320
  # [subaccounts](https://cloud.google.com/billing/docs/concepts) under a
@@ -322,26 +323,26 @@ module Google
322
323
  # Boolean algebra and other fields are not currently supported.
323
324
  #
324
325
  # @yield [response, operation] Access the result along with the RPC operation
325
- # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Billing::V1::BillingAccount>]
326
- # @yieldparam operation [GRPC::ActiveCall::Operation]
326
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Billing::V1::BillingAccount>]
327
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
327
328
  #
328
- # @return [Gapic::PagedEnumerable<Google::Cloud::Billing::V1::BillingAccount>]
329
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Billing::V1::BillingAccount>]
329
330
  #
330
- # @raise [Google::Cloud::Error] if the RPC is aborted.
331
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
331
332
  #
332
333
  def list_billing_accounts request, options = nil
333
- raise ArgumentError, "request must be provided" if request.nil?
334
+ raise ::ArgumentError, "request must be provided" if request.nil?
334
335
 
335
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Billing::V1::ListBillingAccountsRequest
336
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Billing::V1::ListBillingAccountsRequest
336
337
 
337
338
  # Converts hash and nil to an options object
338
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
339
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
339
340
 
340
341
  # Customize the options with defaults
341
342
  metadata = @config.rpcs.list_billing_accounts.metadata.to_h
342
343
 
343
344
  # Set x-goog-api-client and x-goog-user-project headers
344
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
345
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
345
346
  lib_name: @config.lib_name, lib_version: @config.lib_version,
346
347
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
347
348
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -353,12 +354,12 @@ module Google
353
354
  retry_policy: @config.retry_policy
354
355
 
355
356
  @cloud_billing_stub.call_rpc :list_billing_accounts, request, options: options do |response, operation|
356
- response = Gapic::PagedEnumerable.new @cloud_billing_stub, :list_billing_accounts, request, response, operation, options
357
+ response = ::Gapic::PagedEnumerable.new @cloud_billing_stub, :list_billing_accounts, request, response, operation, options
357
358
  yield response, operation if block_given?
358
359
  return response
359
360
  end
360
- rescue GRPC::BadStatus => e
361
- raise Google::Cloud::Error.from_error(e)
361
+ rescue ::GRPC::BadStatus => e
362
+ raise ::Google::Cloud::Error.from_error(e)
362
363
  end
363
364
 
364
365
  ##
@@ -371,12 +372,12 @@ module Google
371
372
  #
372
373
  # @overload update_billing_account(request, options = nil)
373
374
  # Pass arguments to `update_billing_account` via a request object, either of type
374
- # {Google::Cloud::Billing::V1::UpdateBillingAccountRequest} or an equivalent Hash.
375
+ # {::Google::Cloud::Billing::V1::UpdateBillingAccountRequest} or an equivalent Hash.
375
376
  #
376
- # @param request [Google::Cloud::Billing::V1::UpdateBillingAccountRequest, Hash]
377
+ # @param request [::Google::Cloud::Billing::V1::UpdateBillingAccountRequest, ::Hash]
377
378
  # A request object representing the call parameters. Required. To specify no
378
379
  # parameters, or to keep all the default parameter values, pass an empty Hash.
379
- # @param options [Gapic::CallOptions, Hash]
380
+ # @param options [::Gapic::CallOptions, ::Hash]
380
381
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
381
382
  #
382
383
  # @overload update_billing_account(name: nil, account: nil, update_mask: nil)
@@ -384,35 +385,35 @@ module Google
384
385
  # least one keyword argument is required. To specify no parameters, or to keep all
385
386
  # the default parameter values, pass an empty Hash as a request object (see above).
386
387
  #
387
- # @param name [String]
388
+ # @param name [::String]
388
389
  # Required. The name of the billing account resource to be updated.
389
- # @param account [Google::Cloud::Billing::V1::BillingAccount, Hash]
390
+ # @param account [::Google::Cloud::Billing::V1::BillingAccount, ::Hash]
390
391
  # Required. The billing account resource to replace the resource on the server.
391
- # @param update_mask [Google::Protobuf::FieldMask, Hash]
392
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
392
393
  # The update mask applied to the resource.
393
394
  # Only "display_name" is currently supported.
394
395
  #
395
396
  # @yield [response, operation] Access the result along with the RPC operation
396
- # @yieldparam response [Google::Cloud::Billing::V1::BillingAccount]
397
- # @yieldparam operation [GRPC::ActiveCall::Operation]
397
+ # @yieldparam response [::Google::Cloud::Billing::V1::BillingAccount]
398
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
398
399
  #
399
- # @return [Google::Cloud::Billing::V1::BillingAccount]
400
+ # @return [::Google::Cloud::Billing::V1::BillingAccount]
400
401
  #
401
- # @raise [Google::Cloud::Error] if the RPC is aborted.
402
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
402
403
  #
403
404
  def update_billing_account request, options = nil
404
- raise ArgumentError, "request must be provided" if request.nil?
405
+ raise ::ArgumentError, "request must be provided" if request.nil?
405
406
 
406
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Billing::V1::UpdateBillingAccountRequest
407
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Billing::V1::UpdateBillingAccountRequest
407
408
 
408
409
  # Converts hash and nil to an options object
409
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
410
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
410
411
 
411
412
  # Customize the options with defaults
412
413
  metadata = @config.rpcs.update_billing_account.metadata.to_h
413
414
 
414
415
  # Set x-goog-api-client and x-goog-user-project headers
415
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
416
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
416
417
  lib_name: @config.lib_name, lib_version: @config.lib_version,
417
418
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
418
419
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -433,8 +434,8 @@ module Google
433
434
  yield response, operation if block_given?
434
435
  return response
435
436
  end
436
- rescue GRPC::BadStatus => e
437
- raise Google::Cloud::Error.from_error(e)
437
+ rescue ::GRPC::BadStatus => e
438
+ raise ::Google::Cloud::Error.from_error(e)
438
439
  end
439
440
 
440
441
  ##
@@ -451,12 +452,12 @@ module Google
451
452
  #
452
453
  # @overload create_billing_account(request, options = nil)
453
454
  # Pass arguments to `create_billing_account` via a request object, either of type
454
- # {Google::Cloud::Billing::V1::CreateBillingAccountRequest} or an equivalent Hash.
455
+ # {::Google::Cloud::Billing::V1::CreateBillingAccountRequest} or an equivalent Hash.
455
456
  #
456
- # @param request [Google::Cloud::Billing::V1::CreateBillingAccountRequest, Hash]
457
+ # @param request [::Google::Cloud::Billing::V1::CreateBillingAccountRequest, ::Hash]
457
458
  # A request object representing the call parameters. Required. To specify no
458
459
  # parameters, or to keep all the default parameter values, pass an empty Hash.
459
- # @param options [Gapic::CallOptions, Hash]
460
+ # @param options [::Gapic::CallOptions, ::Hash]
460
461
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
461
462
  #
462
463
  # @overload create_billing_account(billing_account: nil)
@@ -464,33 +465,33 @@ module Google
464
465
  # least one keyword argument is required. To specify no parameters, or to keep all
465
466
  # the default parameter values, pass an empty Hash as a request object (see above).
466
467
  #
467
- # @param billing_account [Google::Cloud::Billing::V1::BillingAccount, Hash]
468
+ # @param billing_account [::Google::Cloud::Billing::V1::BillingAccount, ::Hash]
468
469
  # Required. The billing account resource to create.
469
470
  # Currently CreateBillingAccount only supports subaccount creation, so
470
471
  # any created billing accounts must be under a provided master billing
471
472
  # account.
472
473
  #
473
474
  # @yield [response, operation] Access the result along with the RPC operation
474
- # @yieldparam response [Google::Cloud::Billing::V1::BillingAccount]
475
- # @yieldparam operation [GRPC::ActiveCall::Operation]
475
+ # @yieldparam response [::Google::Cloud::Billing::V1::BillingAccount]
476
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
476
477
  #
477
- # @return [Google::Cloud::Billing::V1::BillingAccount]
478
+ # @return [::Google::Cloud::Billing::V1::BillingAccount]
478
479
  #
479
- # @raise [Google::Cloud::Error] if the RPC is aborted.
480
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
480
481
  #
481
482
  def create_billing_account request, options = nil
482
- raise ArgumentError, "request must be provided" if request.nil?
483
+ raise ::ArgumentError, "request must be provided" if request.nil?
483
484
 
484
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Billing::V1::CreateBillingAccountRequest
485
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Billing::V1::CreateBillingAccountRequest
485
486
 
486
487
  # Converts hash and nil to an options object
487
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
488
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
488
489
 
489
490
  # Customize the options with defaults
490
491
  metadata = @config.rpcs.create_billing_account.metadata.to_h
491
492
 
492
493
  # Set x-goog-api-client and x-goog-user-project headers
493
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
494
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
494
495
  lib_name: @config.lib_name, lib_version: @config.lib_version,
495
496
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
496
497
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -505,8 +506,8 @@ module Google
505
506
  yield response, operation if block_given?
506
507
  return response
507
508
  end
508
- rescue GRPC::BadStatus => e
509
- raise Google::Cloud::Error.from_error(e)
509
+ rescue ::GRPC::BadStatus => e
510
+ raise ::Google::Cloud::Error.from_error(e)
510
511
  end
511
512
 
512
513
  ##
@@ -517,12 +518,12 @@ module Google
517
518
  #
518
519
  # @overload list_project_billing_info(request, options = nil)
519
520
  # Pass arguments to `list_project_billing_info` via a request object, either of type
520
- # {Google::Cloud::Billing::V1::ListProjectBillingInfoRequest} or an equivalent Hash.
521
+ # {::Google::Cloud::Billing::V1::ListProjectBillingInfoRequest} or an equivalent Hash.
521
522
  #
522
- # @param request [Google::Cloud::Billing::V1::ListProjectBillingInfoRequest, Hash]
523
+ # @param request [::Google::Cloud::Billing::V1::ListProjectBillingInfoRequest, ::Hash]
523
524
  # A request object representing the call parameters. Required. To specify no
524
525
  # parameters, or to keep all the default parameter values, pass an empty Hash.
525
- # @param options [Gapic::CallOptions, Hash]
526
+ # @param options [::Gapic::CallOptions, ::Hash]
526
527
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
527
528
  #
528
529
  # @overload list_project_billing_info(name: nil, page_size: nil, page_token: nil)
@@ -530,38 +531,38 @@ module Google
530
531
  # least one keyword argument is required. To specify no parameters, or to keep all
531
532
  # the default parameter values, pass an empty Hash as a request object (see above).
532
533
  #
533
- # @param name [String]
534
+ # @param name [::String]
534
535
  # Required. The resource name of the billing account associated with the projects that
535
536
  # you want to list. For example, `billingAccounts/012345-567890-ABCDEF`.
536
- # @param page_size [Integer]
537
+ # @param page_size [::Integer]
537
538
  # Requested page size. The maximum page size is 100; this is also the
538
539
  # default.
539
- # @param page_token [String]
540
+ # @param page_token [::String]
540
541
  # A token identifying a page of results to be returned. This should be a
541
542
  # `next_page_token` value returned from a previous `ListProjectBillingInfo`
542
543
  # call. If unspecified, the first page of results is returned.
543
544
  #
544
545
  # @yield [response, operation] Access the result along with the RPC operation
545
- # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Billing::V1::ProjectBillingInfo>]
546
- # @yieldparam operation [GRPC::ActiveCall::Operation]
546
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Billing::V1::ProjectBillingInfo>]
547
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
547
548
  #
548
- # @return [Gapic::PagedEnumerable<Google::Cloud::Billing::V1::ProjectBillingInfo>]
549
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Billing::V1::ProjectBillingInfo>]
549
550
  #
550
- # @raise [Google::Cloud::Error] if the RPC is aborted.
551
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
551
552
  #
552
553
  def list_project_billing_info request, options = nil
553
- raise ArgumentError, "request must be provided" if request.nil?
554
+ raise ::ArgumentError, "request must be provided" if request.nil?
554
555
 
555
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Billing::V1::ListProjectBillingInfoRequest
556
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Billing::V1::ListProjectBillingInfoRequest
556
557
 
557
558
  # Converts hash and nil to an options object
558
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
559
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
559
560
 
560
561
  # Customize the options with defaults
561
562
  metadata = @config.rpcs.list_project_billing_info.metadata.to_h
562
563
 
563
564
  # Set x-goog-api-client and x-goog-user-project headers
564
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
565
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
565
566
  lib_name: @config.lib_name, lib_version: @config.lib_version,
566
567
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
567
568
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -579,12 +580,12 @@ module Google
579
580
  retry_policy: @config.retry_policy
580
581
 
581
582
  @cloud_billing_stub.call_rpc :list_project_billing_info, request, options: options do |response, operation|
582
- response = Gapic::PagedEnumerable.new @cloud_billing_stub, :list_project_billing_info, request, response, operation, options
583
+ response = ::Gapic::PagedEnumerable.new @cloud_billing_stub, :list_project_billing_info, request, response, operation, options
583
584
  yield response, operation if block_given?
584
585
  return response
585
586
  end
586
- rescue GRPC::BadStatus => e
587
- raise Google::Cloud::Error.from_error(e)
587
+ rescue ::GRPC::BadStatus => e
588
+ raise ::Google::Cloud::Error.from_error(e)
588
589
  end
589
590
 
590
591
  ##
@@ -595,12 +596,12 @@ module Google
595
596
  #
596
597
  # @overload get_project_billing_info(request, options = nil)
597
598
  # Pass arguments to `get_project_billing_info` via a request object, either of type
598
- # {Google::Cloud::Billing::V1::GetProjectBillingInfoRequest} or an equivalent Hash.
599
+ # {::Google::Cloud::Billing::V1::GetProjectBillingInfoRequest} or an equivalent Hash.
599
600
  #
600
- # @param request [Google::Cloud::Billing::V1::GetProjectBillingInfoRequest, Hash]
601
+ # @param request [::Google::Cloud::Billing::V1::GetProjectBillingInfoRequest, ::Hash]
601
602
  # A request object representing the call parameters. Required. To specify no
602
603
  # parameters, or to keep all the default parameter values, pass an empty Hash.
603
- # @param options [Gapic::CallOptions, Hash]
604
+ # @param options [::Gapic::CallOptions, ::Hash]
604
605
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
605
606
  #
606
607
  # @overload get_project_billing_info(name: nil)
@@ -608,31 +609,31 @@ module Google
608
609
  # least one keyword argument is required. To specify no parameters, or to keep all
609
610
  # the default parameter values, pass an empty Hash as a request object (see above).
610
611
  #
611
- # @param name [String]
612
+ # @param name [::String]
612
613
  # Required. The resource name of the project for which billing information is
613
614
  # retrieved. For example, `projects/tokyo-rain-123`.
614
615
  #
615
616
  # @yield [response, operation] Access the result along with the RPC operation
616
- # @yieldparam response [Google::Cloud::Billing::V1::ProjectBillingInfo]
617
- # @yieldparam operation [GRPC::ActiveCall::Operation]
617
+ # @yieldparam response [::Google::Cloud::Billing::V1::ProjectBillingInfo]
618
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
618
619
  #
619
- # @return [Google::Cloud::Billing::V1::ProjectBillingInfo]
620
+ # @return [::Google::Cloud::Billing::V1::ProjectBillingInfo]
620
621
  #
621
- # @raise [Google::Cloud::Error] if the RPC is aborted.
622
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
622
623
  #
623
624
  def get_project_billing_info request, options = nil
624
- raise ArgumentError, "request must be provided" if request.nil?
625
+ raise ::ArgumentError, "request must be provided" if request.nil?
625
626
 
626
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Billing::V1::GetProjectBillingInfoRequest
627
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Billing::V1::GetProjectBillingInfoRequest
627
628
 
628
629
  # Converts hash and nil to an options object
629
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
630
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
630
631
 
631
632
  # Customize the options with defaults
632
633
  metadata = @config.rpcs.get_project_billing_info.metadata.to_h
633
634
 
634
635
  # Set x-goog-api-client and x-goog-user-project headers
635
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
636
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
636
637
  lib_name: @config.lib_name, lib_version: @config.lib_version,
637
638
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
638
639
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -653,8 +654,8 @@ module Google
653
654
  yield response, operation if block_given?
654
655
  return response
655
656
  end
656
- rescue GRPC::BadStatus => e
657
- raise Google::Cloud::Error.from_error(e)
657
+ rescue ::GRPC::BadStatus => e
658
+ raise ::Google::Cloud::Error.from_error(e)
658
659
  end
659
660
 
660
661
  ##
@@ -692,12 +693,12 @@ module Google
692
693
  #
693
694
  # @overload update_project_billing_info(request, options = nil)
694
695
  # Pass arguments to `update_project_billing_info` via a request object, either of type
695
- # {Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest} or an equivalent Hash.
696
+ # {::Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest} or an equivalent Hash.
696
697
  #
697
- # @param request [Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest, Hash]
698
+ # @param request [::Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest, ::Hash]
698
699
  # A request object representing the call parameters. Required. To specify no
699
700
  # parameters, or to keep all the default parameter values, pass an empty Hash.
700
- # @param options [Gapic::CallOptions, Hash]
701
+ # @param options [::Gapic::CallOptions, ::Hash]
701
702
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
702
703
  #
703
704
  # @overload update_project_billing_info(name: nil, project_billing_info: nil)
@@ -705,34 +706,34 @@ module Google
705
706
  # least one keyword argument is required. To specify no parameters, or to keep all
706
707
  # the default parameter values, pass an empty Hash as a request object (see above).
707
708
  #
708
- # @param name [String]
709
+ # @param name [::String]
709
710
  # Required. The resource name of the project associated with the billing information
710
711
  # that you want to update. For example, `projects/tokyo-rain-123`.
711
- # @param project_billing_info [Google::Cloud::Billing::V1::ProjectBillingInfo, Hash]
712
+ # @param project_billing_info [::Google::Cloud::Billing::V1::ProjectBillingInfo, ::Hash]
712
713
  # The new billing information for the project. Read-only fields are ignored;
713
714
  # thus, you can leave empty all fields except `billing_account_name`.
714
715
  #
715
716
  # @yield [response, operation] Access the result along with the RPC operation
716
- # @yieldparam response [Google::Cloud::Billing::V1::ProjectBillingInfo]
717
- # @yieldparam operation [GRPC::ActiveCall::Operation]
717
+ # @yieldparam response [::Google::Cloud::Billing::V1::ProjectBillingInfo]
718
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
718
719
  #
719
- # @return [Google::Cloud::Billing::V1::ProjectBillingInfo]
720
+ # @return [::Google::Cloud::Billing::V1::ProjectBillingInfo]
720
721
  #
721
- # @raise [Google::Cloud::Error] if the RPC is aborted.
722
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
722
723
  #
723
724
  def update_project_billing_info request, options = nil
724
- raise ArgumentError, "request must be provided" if request.nil?
725
+ raise ::ArgumentError, "request must be provided" if request.nil?
725
726
 
726
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest
727
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest
727
728
 
728
729
  # Converts hash and nil to an options object
729
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
730
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
730
731
 
731
732
  # Customize the options with defaults
732
733
  metadata = @config.rpcs.update_project_billing_info.metadata.to_h
733
734
 
734
735
  # Set x-goog-api-client and x-goog-user-project headers
735
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
736
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
736
737
  lib_name: @config.lib_name, lib_version: @config.lib_version,
737
738
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
738
739
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -753,8 +754,8 @@ module Google
753
754
  yield response, operation if block_given?
754
755
  return response
755
756
  end
756
- rescue GRPC::BadStatus => e
757
- raise Google::Cloud::Error.from_error(e)
757
+ rescue ::GRPC::BadStatus => e
758
+ raise ::Google::Cloud::Error.from_error(e)
758
759
  end
759
760
 
760
761
  ##
@@ -765,12 +766,12 @@ module Google
765
766
  #
766
767
  # @overload get_iam_policy(request, options = nil)
767
768
  # Pass arguments to `get_iam_policy` via a request object, either of type
768
- # {Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
769
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
769
770
  #
770
- # @param request [Google::Iam::V1::GetIamPolicyRequest, Hash]
771
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
771
772
  # A request object representing the call parameters. Required. To specify no
772
773
  # parameters, or to keep all the default parameter values, pass an empty Hash.
773
- # @param options [Gapic::CallOptions, Hash]
774
+ # @param options [::Gapic::CallOptions, ::Hash]
774
775
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
775
776
  #
776
777
  # @overload get_iam_policy(resource: nil, options: nil)
@@ -778,34 +779,34 @@ module Google
778
779
  # least one keyword argument is required. To specify no parameters, or to keep all
779
780
  # the default parameter values, pass an empty Hash as a request object (see above).
780
781
  #
781
- # @param resource [String]
782
+ # @param resource [::String]
782
783
  # REQUIRED: The resource for which the policy is being requested.
783
784
  # See the operation documentation for the appropriate value for this field.
784
- # @param options [Google::Iam::V1::GetPolicyOptions, Hash]
785
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
785
786
  # OPTIONAL: A `GetPolicyOptions` object for specifying options to
786
787
  # `GetIamPolicy`. This field is only used by Cloud IAM.
787
788
  #
788
789
  # @yield [response, operation] Access the result along with the RPC operation
789
- # @yieldparam response [Google::Iam::V1::Policy]
790
- # @yieldparam operation [GRPC::ActiveCall::Operation]
790
+ # @yieldparam response [::Google::Iam::V1::Policy]
791
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
791
792
  #
792
- # @return [Google::Iam::V1::Policy]
793
+ # @return [::Google::Iam::V1::Policy]
793
794
  #
794
- # @raise [Google::Cloud::Error] if the RPC is aborted.
795
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
795
796
  #
796
797
  def get_iam_policy request, options = nil
797
- raise ArgumentError, "request must be provided" if request.nil?
798
+ raise ::ArgumentError, "request must be provided" if request.nil?
798
799
 
799
- request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::GetIamPolicyRequest
800
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
800
801
 
801
802
  # Converts hash and nil to an options object
802
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
803
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
803
804
 
804
805
  # Customize the options with defaults
805
806
  metadata = @config.rpcs.get_iam_policy.metadata.to_h
806
807
 
807
808
  # Set x-goog-api-client and x-goog-user-project headers
808
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
809
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
809
810
  lib_name: @config.lib_name, lib_version: @config.lib_version,
810
811
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
811
812
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -826,8 +827,8 @@ module Google
826
827
  yield response, operation if block_given?
827
828
  return response
828
829
  end
829
- rescue GRPC::BadStatus => e
830
- raise Google::Cloud::Error.from_error(e)
830
+ rescue ::GRPC::BadStatus => e
831
+ raise ::Google::Cloud::Error.from_error(e)
831
832
  end
832
833
 
833
834
  ##
@@ -839,12 +840,12 @@ module Google
839
840
  #
840
841
  # @overload set_iam_policy(request, options = nil)
841
842
  # Pass arguments to `set_iam_policy` via a request object, either of type
842
- # {Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
843
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
843
844
  #
844
- # @param request [Google::Iam::V1::SetIamPolicyRequest, Hash]
845
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
845
846
  # A request object representing the call parameters. Required. To specify no
846
847
  # parameters, or to keep all the default parameter values, pass an empty Hash.
847
- # @param options [Gapic::CallOptions, Hash]
848
+ # @param options [::Gapic::CallOptions, ::Hash]
848
849
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
849
850
  #
850
851
  # @overload set_iam_policy(resource: nil, policy: nil)
@@ -852,36 +853,36 @@ module Google
852
853
  # least one keyword argument is required. To specify no parameters, or to keep all
853
854
  # the default parameter values, pass an empty Hash as a request object (see above).
854
855
  #
855
- # @param resource [String]
856
+ # @param resource [::String]
856
857
  # REQUIRED: The resource for which the policy is being specified.
857
858
  # See the operation documentation for the appropriate value for this field.
858
- # @param policy [Google::Iam::V1::Policy, Hash]
859
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
859
860
  # REQUIRED: The complete policy to be applied to the `resource`. The size of
860
861
  # the policy is limited to a few 10s of KB. An empty policy is a
861
862
  # valid policy but certain Cloud Platform services (such as Projects)
862
863
  # might reject them.
863
864
  #
864
865
  # @yield [response, operation] Access the result along with the RPC operation
865
- # @yieldparam response [Google::Iam::V1::Policy]
866
- # @yieldparam operation [GRPC::ActiveCall::Operation]
866
+ # @yieldparam response [::Google::Iam::V1::Policy]
867
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
867
868
  #
868
- # @return [Google::Iam::V1::Policy]
869
+ # @return [::Google::Iam::V1::Policy]
869
870
  #
870
- # @raise [Google::Cloud::Error] if the RPC is aborted.
871
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
871
872
  #
872
873
  def set_iam_policy request, options = nil
873
- raise ArgumentError, "request must be provided" if request.nil?
874
+ raise ::ArgumentError, "request must be provided" if request.nil?
874
875
 
875
- request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::SetIamPolicyRequest
876
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
876
877
 
877
878
  # Converts hash and nil to an options object
878
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
879
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
879
880
 
880
881
  # Customize the options with defaults
881
882
  metadata = @config.rpcs.set_iam_policy.metadata.to_h
882
883
 
883
884
  # Set x-goog-api-client and x-goog-user-project headers
884
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
885
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
885
886
  lib_name: @config.lib_name, lib_version: @config.lib_version,
886
887
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
887
888
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -902,8 +903,8 @@ module Google
902
903
  yield response, operation if block_given?
903
904
  return response
904
905
  end
905
- rescue GRPC::BadStatus => e
906
- raise Google::Cloud::Error.from_error(e)
906
+ rescue ::GRPC::BadStatus => e
907
+ raise ::Google::Cloud::Error.from_error(e)
907
908
  end
908
909
 
909
910
  ##
@@ -913,12 +914,12 @@ module Google
913
914
  #
914
915
  # @overload test_iam_permissions(request, options = nil)
915
916
  # Pass arguments to `test_iam_permissions` via a request object, either of type
916
- # {Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
917
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
917
918
  #
918
- # @param request [Google::Iam::V1::TestIamPermissionsRequest, Hash]
919
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
919
920
  # A request object representing the call parameters. Required. To specify no
920
921
  # parameters, or to keep all the default parameter values, pass an empty Hash.
921
- # @param options [Gapic::CallOptions, Hash]
922
+ # @param options [::Gapic::CallOptions, ::Hash]
922
923
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
923
924
  #
924
925
  # @overload test_iam_permissions(resource: nil, permissions: nil)
@@ -926,36 +927,36 @@ module Google
926
927
  # least one keyword argument is required. To specify no parameters, or to keep all
927
928
  # the default parameter values, pass an empty Hash as a request object (see above).
928
929
  #
929
- # @param resource [String]
930
+ # @param resource [::String]
930
931
  # REQUIRED: The resource for which the policy detail is being requested.
931
932
  # See the operation documentation for the appropriate value for this field.
932
- # @param permissions [Array<String>]
933
+ # @param permissions [::Array<::String>]
933
934
  # The set of permissions to check for the `resource`. Permissions with
934
935
  # wildcards (such as '*' or 'storage.*') are not allowed. For more
935
936
  # information see
936
937
  # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
937
938
  #
938
939
  # @yield [response, operation] Access the result along with the RPC operation
939
- # @yieldparam response [Google::Iam::V1::TestIamPermissionsResponse]
940
- # @yieldparam operation [GRPC::ActiveCall::Operation]
940
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
941
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
941
942
  #
942
- # @return [Google::Iam::V1::TestIamPermissionsResponse]
943
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
943
944
  #
944
- # @raise [Google::Cloud::Error] if the RPC is aborted.
945
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
945
946
  #
946
947
  def test_iam_permissions request, options = nil
947
- raise ArgumentError, "request must be provided" if request.nil?
948
+ raise ::ArgumentError, "request must be provided" if request.nil?
948
949
 
949
- request = Gapic::Protobuf.coerce request, to: Google::Iam::V1::TestIamPermissionsRequest
950
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
950
951
 
951
952
  # Converts hash and nil to an options object
952
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
953
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
953
954
 
954
955
  # Customize the options with defaults
955
956
  metadata = @config.rpcs.test_iam_permissions.metadata.to_h
956
957
 
957
958
  # Set x-goog-api-client and x-goog-user-project headers
958
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
959
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
959
960
  lib_name: @config.lib_name, lib_version: @config.lib_version,
960
961
  gapic_version: ::Google::Cloud::Billing::V1::VERSION
961
962
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -976,8 +977,8 @@ module Google
976
977
  yield response, operation if block_given?
977
978
  return response
978
979
  end
979
- rescue GRPC::BadStatus => e
980
- raise Google::Cloud::Error.from_error(e)
980
+ rescue ::GRPC::BadStatus => e
981
+ raise ::Google::Cloud::Error.from_error(e)
981
982
  end
982
983
 
983
984
  ##
@@ -987,7 +988,7 @@ module Google
987
988
  # providing control over timeouts, retry behavior, logging, transport
988
989
  # parameters, and other low-level controls. Certain parameters can also be
989
990
  # applied individually to specific RPCs. See
990
- # {Google::Cloud::Billing::V1::CloudBilling::Client::Configuration::Rpcs}
991
+ # {::Google::Cloud::Billing::V1::CloudBilling::Client::Configuration::Rpcs}
991
992
  # for a list of RPCs that can be configured independently.
992
993
  #
993
994
  # Configuration can be applied globally to all clients, or to a single client
@@ -998,22 +999,22 @@ module Google
998
999
  # To modify the global config, setting the timeout for get_billing_account
999
1000
  # to 20 seconds, and all remaining timeouts to 10 seconds:
1000
1001
  #
1001
- # Google::Cloud::Billing::V1::CloudBilling::Client.configure do |config|
1002
- # config.timeout = 10_000
1003
- # config.rpcs.get_billing_account.timeout = 20_000
1002
+ # ::Google::Cloud::Billing::V1::CloudBilling::Client.configure do |config|
1003
+ # config.timeout = 10.0
1004
+ # config.rpcs.get_billing_account.timeout = 20.0
1004
1005
  # end
1005
1006
  #
1006
1007
  # To apply the above configuration only to a new client:
1007
1008
  #
1008
- # client = Google::Cloud::Billing::V1::CloudBilling::Client.new do |config|
1009
- # config.timeout = 10_000
1010
- # config.rpcs.get_billing_account.timeout = 20_000
1009
+ # client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config|
1010
+ # config.timeout = 10.0
1011
+ # config.rpcs.get_billing_account.timeout = 20.0
1011
1012
  # end
1012
1013
  #
1013
1014
  # @!attribute [rw] endpoint
1014
1015
  # The hostname or hostname:port of the service endpoint.
1015
1016
  # Defaults to `"cloudbilling.googleapis.com"`.
1016
- # @return [String]
1017
+ # @return [::String]
1017
1018
  # @!attribute [rw] credentials
1018
1019
  # Credentials to send with calls. You may provide any of the following types:
1019
1020
  # * (`String`) The path to a service account key file in JSON format
@@ -1025,29 +1026,29 @@ module Google
1025
1026
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1026
1027
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1027
1028
  # * (`nil`) indicating no credentials
1028
- # @return [Object]
1029
+ # @return [::Object]
1029
1030
  # @!attribute [rw] scope
1030
1031
  # The OAuth scopes
1031
- # @return [Array<String>]
1032
+ # @return [::Array<::String>]
1032
1033
  # @!attribute [rw] lib_name
1033
1034
  # The library name as recorded in instrumentation and logging
1034
- # @return [String]
1035
+ # @return [::String]
1035
1036
  # @!attribute [rw] lib_version
1036
1037
  # The library version as recorded in instrumentation and logging
1037
- # @return [String]
1038
+ # @return [::String]
1038
1039
  # @!attribute [rw] channel_args
1039
1040
  # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1040
1041
  # `GRPC::Core::Channel` object is provided as the credential.
1041
- # @return [Hash]
1042
+ # @return [::Hash]
1042
1043
  # @!attribute [rw] interceptors
1043
1044
  # An array of interceptors that are run before calls are executed.
1044
- # @return [Array<GRPC::ClientInterceptor>]
1045
+ # @return [::Array<::GRPC::ClientInterceptor>]
1045
1046
  # @!attribute [rw] timeout
1046
- # The call timeout in milliseconds.
1047
- # @return [Numeric]
1047
+ # The call timeout in seconds.
1048
+ # @return [::Numeric]
1048
1049
  # @!attribute [rw] metadata
1049
1050
  # Additional gRPC headers to be sent with the call.
1050
- # @return [Hash{Symbol=>String}]
1051
+ # @return [::Hash{::Symbol=>::String}]
1051
1052
  # @!attribute [rw] retry_policy
1052
1053
  # The retry policy. The value is a hash with the following keys:
1053
1054
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
@@ -1055,25 +1056,29 @@ module Google
1055
1056
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1056
1057
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1057
1058
  # trigger a retry.
1058
- # @return [Hash]
1059
+ # @return [::Hash]
1060
+ # @!attribute [rw] quota_project
1061
+ # A separate project against which to charge quota.
1062
+ # @return [::String]
1059
1063
  #
1060
1064
  class Configuration
1061
- extend Gapic::Config
1065
+ extend ::Gapic::Config
1062
1066
 
1063
- config_attr :endpoint, "cloudbilling.googleapis.com", String
1064
- config_attr :credentials, nil do |value|
1067
+ config_attr :endpoint, "cloudbilling.googleapis.com", ::String
1068
+ config_attr :credentials, nil do |value|
1065
1069
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1066
1070
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1067
1071
  allowed.any? { |klass| klass === value }
1068
1072
  end
1069
- config_attr :scope, nil, String, Array, nil
1070
- config_attr :lib_name, nil, String, nil
1071
- config_attr :lib_version, nil, String, nil
1072
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
1073
- config_attr :interceptors, nil, Array, nil
1074
- config_attr :timeout, nil, Numeric, nil
1075
- config_attr :metadata, nil, Hash, nil
1076
- config_attr :retry_policy, nil, Hash, Proc, nil
1073
+ config_attr :scope, nil, ::String, ::Array, nil
1074
+ config_attr :lib_name, nil, ::String, nil
1075
+ config_attr :lib_version, nil, ::String, nil
1076
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1077
+ config_attr :interceptors, nil, ::Array, nil
1078
+ config_attr :timeout, nil, ::Numeric, nil
1079
+ config_attr :metadata, nil, ::Hash, nil
1080
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1081
+ config_attr :quota_project, nil, ::String, nil
1077
1082
 
1078
1083
  # @private
1079
1084
  def initialize parent_config = nil
@@ -1089,7 +1094,7 @@ module Google
1089
1094
  def rpcs
1090
1095
  @rpcs ||= begin
1091
1096
  parent_rpcs = nil
1092
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
1097
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1093
1098
  Rpcs.new parent_rpcs
1094
1099
  end
1095
1100
  end
@@ -1114,77 +1119,77 @@ module Google
1114
1119
  class Rpcs
1115
1120
  ##
1116
1121
  # RPC-specific configuration for `get_billing_account`
1117
- # @return [Gapic::Config::Method]
1122
+ # @return [::Gapic::Config::Method]
1118
1123
  #
1119
1124
  attr_reader :get_billing_account
1120
1125
  ##
1121
1126
  # RPC-specific configuration for `list_billing_accounts`
1122
- # @return [Gapic::Config::Method]
1127
+ # @return [::Gapic::Config::Method]
1123
1128
  #
1124
1129
  attr_reader :list_billing_accounts
1125
1130
  ##
1126
1131
  # RPC-specific configuration for `update_billing_account`
1127
- # @return [Gapic::Config::Method]
1132
+ # @return [::Gapic::Config::Method]
1128
1133
  #
1129
1134
  attr_reader :update_billing_account
1130
1135
  ##
1131
1136
  # RPC-specific configuration for `create_billing_account`
1132
- # @return [Gapic::Config::Method]
1137
+ # @return [::Gapic::Config::Method]
1133
1138
  #
1134
1139
  attr_reader :create_billing_account
1135
1140
  ##
1136
1141
  # RPC-specific configuration for `list_project_billing_info`
1137
- # @return [Gapic::Config::Method]
1142
+ # @return [::Gapic::Config::Method]
1138
1143
  #
1139
1144
  attr_reader :list_project_billing_info
1140
1145
  ##
1141
1146
  # RPC-specific configuration for `get_project_billing_info`
1142
- # @return [Gapic::Config::Method]
1147
+ # @return [::Gapic::Config::Method]
1143
1148
  #
1144
1149
  attr_reader :get_project_billing_info
1145
1150
  ##
1146
1151
  # RPC-specific configuration for `update_project_billing_info`
1147
- # @return [Gapic::Config::Method]
1152
+ # @return [::Gapic::Config::Method]
1148
1153
  #
1149
1154
  attr_reader :update_project_billing_info
1150
1155
  ##
1151
1156
  # RPC-specific configuration for `get_iam_policy`
1152
- # @return [Gapic::Config::Method]
1157
+ # @return [::Gapic::Config::Method]
1153
1158
  #
1154
1159
  attr_reader :get_iam_policy
1155
1160
  ##
1156
1161
  # RPC-specific configuration for `set_iam_policy`
1157
- # @return [Gapic::Config::Method]
1162
+ # @return [::Gapic::Config::Method]
1158
1163
  #
1159
1164
  attr_reader :set_iam_policy
1160
1165
  ##
1161
1166
  # RPC-specific configuration for `test_iam_permissions`
1162
- # @return [Gapic::Config::Method]
1167
+ # @return [::Gapic::Config::Method]
1163
1168
  #
1164
1169
  attr_reader :test_iam_permissions
1165
1170
 
1166
1171
  # @private
1167
1172
  def initialize parent_rpcs = nil
1168
1173
  get_billing_account_config = parent_rpcs&.get_billing_account if parent_rpcs&.respond_to? :get_billing_account
1169
- @get_billing_account = Gapic::Config::Method.new get_billing_account_config
1174
+ @get_billing_account = ::Gapic::Config::Method.new get_billing_account_config
1170
1175
  list_billing_accounts_config = parent_rpcs&.list_billing_accounts if parent_rpcs&.respond_to? :list_billing_accounts
1171
- @list_billing_accounts = Gapic::Config::Method.new list_billing_accounts_config
1176
+ @list_billing_accounts = ::Gapic::Config::Method.new list_billing_accounts_config
1172
1177
  update_billing_account_config = parent_rpcs&.update_billing_account if parent_rpcs&.respond_to? :update_billing_account
1173
- @update_billing_account = Gapic::Config::Method.new update_billing_account_config
1178
+ @update_billing_account = ::Gapic::Config::Method.new update_billing_account_config
1174
1179
  create_billing_account_config = parent_rpcs&.create_billing_account if parent_rpcs&.respond_to? :create_billing_account
1175
- @create_billing_account = Gapic::Config::Method.new create_billing_account_config
1180
+ @create_billing_account = ::Gapic::Config::Method.new create_billing_account_config
1176
1181
  list_project_billing_info_config = parent_rpcs&.list_project_billing_info if parent_rpcs&.respond_to? :list_project_billing_info
1177
- @list_project_billing_info = Gapic::Config::Method.new list_project_billing_info_config
1182
+ @list_project_billing_info = ::Gapic::Config::Method.new list_project_billing_info_config
1178
1183
  get_project_billing_info_config = parent_rpcs&.get_project_billing_info if parent_rpcs&.respond_to? :get_project_billing_info
1179
- @get_project_billing_info = Gapic::Config::Method.new get_project_billing_info_config
1184
+ @get_project_billing_info = ::Gapic::Config::Method.new get_project_billing_info_config
1180
1185
  update_project_billing_info_config = parent_rpcs&.update_project_billing_info if parent_rpcs&.respond_to? :update_project_billing_info
1181
- @update_project_billing_info = Gapic::Config::Method.new update_project_billing_info_config
1186
+ @update_project_billing_info = ::Gapic::Config::Method.new update_project_billing_info_config
1182
1187
  get_iam_policy_config = parent_rpcs&.get_iam_policy if parent_rpcs&.respond_to? :get_iam_policy
1183
- @get_iam_policy = Gapic::Config::Method.new get_iam_policy_config
1188
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1184
1189
  set_iam_policy_config = parent_rpcs&.set_iam_policy if parent_rpcs&.respond_to? :set_iam_policy
1185
- @set_iam_policy = Gapic::Config::Method.new set_iam_policy_config
1190
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1186
1191
  test_iam_permissions_config = parent_rpcs&.test_iam_permissions if parent_rpcs&.respond_to? :test_iam_permissions
1187
- @test_iam_permissions = Gapic::Config::Method.new test_iam_permissions_config
1192
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1188
1193
 
1189
1194
  yield self if block_given?
1190
1195
  end