google-cloud-billing-v1 0.9.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +2 -2
- data/lib/google/cloud/billing/v1/cloud_billing/client.rb +37 -31
- data/lib/google/cloud/billing/v1/cloud_billing/credentials.rb +2 -0
- data/lib/google/cloud/billing/v1/cloud_billing/rest/client.rb +1143 -0
- data/lib/google/cloud/billing/v1/cloud_billing/rest/service_stub.rb +639 -0
- data/lib/google/cloud/billing/v1/cloud_billing/rest.rb +53 -0
- data/lib/google/cloud/billing/v1/cloud_billing.rb +9 -2
- data/lib/google/cloud/billing/v1/cloud_billing_services_pb.rb +19 -13
- data/lib/google/cloud/billing/v1/cloud_catalog/client.rb +8 -12
- data/lib/google/cloud/billing/v1/cloud_catalog/credentials.rb +2 -0
- data/lib/google/cloud/billing/v1/cloud_catalog/rest/client.rb +450 -0
- data/lib/google/cloud/billing/v1/cloud_catalog/rest/service_stub.rb +164 -0
- data/lib/google/cloud/billing/v1/cloud_catalog/rest.rb +54 -0
- data/lib/google/cloud/billing/v1/cloud_catalog.rb +7 -1
- data/lib/google/cloud/billing/v1/cloud_catalog_pb.rb +15 -2
- data/lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb +1 -2
- data/lib/google/cloud/billing/v1/rest.rb +38 -0
- data/lib/google/cloud/billing/v1/version.rb +1 -1
- data/lib/google/cloud/billing/v1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/billing/v1/cloud_billing.rb +26 -21
- data/proto_docs/google/cloud/billing/v1/cloud_catalog.rb +48 -15
- data/proto_docs/google/protobuf/duration.rb +98 -0
- metadata +19 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8af908c3f6293aa7458e5ffaff9cf50e53d60397c67179946cd57ed54df9d7d8
|
4
|
+
data.tar.gz: bab2cf3bf6aec0c15bab4204d020f359a659a1b4b19e12cca07c0a8fefb1f646
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 772e1df0b42de029c3a04e36d5c45badf62f88379c0781938b482891b78c1fab678e056e70e93c9d46ebf97155e64192c048c6a62a70673ba1d11a4556e476c1
|
7
|
+
data.tar.gz: 9958ebb1b3676ffaac5a5411c33ea060230238cb804e1102a9e876f8b8abe3a9ae9da3d2545e3f11c941f27cc9abf51512d3c0c5c102966083f69ea8b2ae845e
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ruby Client for the Billing V1 API
|
2
2
|
|
3
|
-
|
3
|
+
Allows developers to manage billing for their Google Cloud Platform projects programmatically.
|
4
4
|
|
5
5
|
Allows developers to manage billing for their Google Cloud Platform projects programmatically.
|
6
6
|
|
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
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)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -27,7 +27,8 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Client for the CloudBilling service.
|
29
29
|
#
|
30
|
-
# Retrieves
|
30
|
+
# Retrieves the Google Cloud Console billing accounts and associates them with
|
31
|
+
# projects.
|
31
32
|
#
|
32
33
|
class Client
|
33
34
|
include Paths
|
@@ -212,8 +213,8 @@ module Google
|
|
212
213
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
213
214
|
#
|
214
215
|
# @param name [::String]
|
215
|
-
# Required. The resource name of the billing account to retrieve. For
|
216
|
-
# `billingAccounts/012345-567890-ABCDEF`.
|
216
|
+
# Required. The resource name of the billing account to retrieve. For
|
217
|
+
# example, `billingAccounts/012345-567890-ABCDEF`.
|
217
218
|
#
|
218
219
|
# @yield [response, operation] Access the result along with the RPC operation
|
219
220
|
# @yieldparam response [::Google::Cloud::Billing::V1::BillingAccount]
|
@@ -334,13 +335,11 @@ module Google
|
|
334
335
|
# # Call the list_billing_accounts method.
|
335
336
|
# result = client.list_billing_accounts request
|
336
337
|
#
|
337
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
338
|
-
# #
|
339
|
-
#
|
340
|
-
# # methods are also available for managing paging directly.
|
341
|
-
# result.each do |response|
|
338
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
339
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
340
|
+
# result.each do |item|
|
342
341
|
# # Each element is of type ::Google::Cloud::Billing::V1::BillingAccount.
|
343
|
-
# p
|
342
|
+
# p item
|
344
343
|
# end
|
345
344
|
#
|
346
345
|
def list_billing_accounts request, options = nil
|
@@ -403,7 +402,8 @@ module Google
|
|
403
402
|
# @param name [::String]
|
404
403
|
# Required. The name of the billing account resource to be updated.
|
405
404
|
# @param account [::Google::Cloud::Billing::V1::BillingAccount, ::Hash]
|
406
|
-
# Required. The billing account resource to replace the resource on the
|
405
|
+
# Required. The billing account resource to replace the resource on the
|
406
|
+
# server.
|
407
407
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
408
408
|
# The update mask applied to the resource.
|
409
409
|
# Only "display_name" is currently supported.
|
@@ -473,15 +473,20 @@ module Google
|
|
473
473
|
end
|
474
474
|
|
475
475
|
##
|
476
|
-
#
|
477
|
-
#
|
478
|
-
#
|
479
|
-
#
|
476
|
+
# This method creates [billing
|
477
|
+
# subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts).
|
478
|
+
#
|
479
|
+
# Google Cloud resellers should use the
|
480
|
+
# Channel Services APIs,
|
481
|
+
# [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create)
|
482
|
+
# and
|
483
|
+
# [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).
|
484
|
+
#
|
480
485
|
# When creating a subaccount, the current authenticated user must have the
|
481
|
-
# `billing.accounts.update` IAM permission on the
|
486
|
+
# `billing.accounts.update` IAM permission on the parent account, which is
|
482
487
|
# typically given to billing account
|
483
488
|
# [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).
|
484
|
-
# This method will return an error if the
|
489
|
+
# This method will return an error if the parent account has not been
|
485
490
|
# provisioned as a reseller account.
|
486
491
|
#
|
487
492
|
# @overload create_billing_account(request, options = nil)
|
@@ -502,7 +507,7 @@ module Google
|
|
502
507
|
# @param billing_account [::Google::Cloud::Billing::V1::BillingAccount, ::Hash]
|
503
508
|
# Required. The billing account resource to create.
|
504
509
|
# Currently CreateBillingAccount only supports subaccount creation, so
|
505
|
-
# any created billing accounts must be under a provided
|
510
|
+
# any created billing accounts must be under a provided parent billing
|
506
511
|
# account.
|
507
512
|
#
|
508
513
|
# @yield [response, operation] Access the result along with the RPC operation
|
@@ -583,8 +588,9 @@ module Google
|
|
583
588
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
584
589
|
#
|
585
590
|
# @param name [::String]
|
586
|
-
# Required. The resource name of the billing account associated with the
|
587
|
-
# you want to list. For example,
|
591
|
+
# Required. The resource name of the billing account associated with the
|
592
|
+
# projects that you want to list. For example,
|
593
|
+
# `billingAccounts/012345-567890-ABCDEF`.
|
588
594
|
# @param page_size [::Integer]
|
589
595
|
# Requested page size. The maximum page size is 100; this is also the
|
590
596
|
# default.
|
@@ -613,13 +619,11 @@ module Google
|
|
613
619
|
# # Call the list_project_billing_info method.
|
614
620
|
# result = client.list_project_billing_info request
|
615
621
|
#
|
616
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
617
|
-
# #
|
618
|
-
#
|
619
|
-
# # methods are also available for managing paging directly.
|
620
|
-
# result.each do |response|
|
622
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
623
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
624
|
+
# result.each do |item|
|
621
625
|
# # Each element is of type ::Google::Cloud::Billing::V1::ProjectBillingInfo.
|
622
|
-
# p
|
626
|
+
# p item
|
623
627
|
# end
|
624
628
|
#
|
625
629
|
def list_project_billing_info request, options = nil
|
@@ -666,9 +670,10 @@ module Google
|
|
666
670
|
|
667
671
|
##
|
668
672
|
# Gets the billing information for a project. The current authenticated user
|
669
|
-
# must have
|
670
|
-
#
|
671
|
-
# )
|
673
|
+
# must have the `resourcemanager.projects.get` permission for the project,
|
674
|
+
# which can be granted by assigning the [Project
|
675
|
+
# Viewer](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles)
|
676
|
+
# role.
|
672
677
|
#
|
673
678
|
# @overload get_project_billing_info(request, options = nil)
|
674
679
|
# Pass arguments to `get_project_billing_info` via a request object, either of type
|
@@ -763,7 +768,7 @@ module Google
|
|
763
768
|
# usage charges.
|
764
769
|
#
|
765
770
|
# *Note:* Incurred charges that have not yet been reported in the transaction
|
766
|
-
# history of the
|
771
|
+
# history of the Google Cloud Console might be billed to the new billing
|
767
772
|
# account, even if the charge occurred before the new billing account was
|
768
773
|
# assigned to the project.
|
769
774
|
#
|
@@ -802,8 +807,9 @@ module Google
|
|
802
807
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
803
808
|
#
|
804
809
|
# @param name [::String]
|
805
|
-
# Required. The resource name of the project associated with the billing
|
806
|
-
# that you want to update. For example,
|
810
|
+
# Required. The resource name of the project associated with the billing
|
811
|
+
# information that you want to update. For example,
|
812
|
+
# `projects/tokyo-rain-123`.
|
807
813
|
# @param project_billing_info [::Google::Cloud::Billing::V1::ProjectBillingInfo, ::Hash]
|
808
814
|
# The new billing information for the project. Read-only fields are ignored;
|
809
815
|
# thus, you can leave empty all fields except `billing_account_name`.
|
@@ -26,6 +26,8 @@ module Google
|
|
26
26
|
# Credentials for the CloudBilling API.
|
27
27
|
class Credentials < ::Google::Auth::Credentials
|
28
28
|
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-billing",
|
30
|
+
"https://www.googleapis.com/auth/cloud-billing.readonly",
|
29
31
|
"https://www.googleapis.com/auth/cloud-platform"
|
30
32
|
]
|
31
33
|
self.env_vars = [
|