google-cloud-billing-v1 0.4.1 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/google/cloud/billing/v1/cloud_billing/client.rb +26 -21
- data/lib/google/cloud/billing/v1/cloud_billing_services_pb.rb +7 -7
- data/lib/google/cloud/billing/v1/cloud_catalog/client.rb +17 -12
- data/lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb +2 -2
- data/lib/google/cloud/billing/v1/version.rb +1 -1
- metadata +35 -8
- data/lib/google/cloud/common_resources_pb.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c1dc473caf327657f054674da1d60df941428009b6b08320151509d5a5d0c0e
|
4
|
+
data.tar.gz: 85a42de8b43579f88ded56e869841b228b5094fc9e7148e9cf349a5278fe13c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4d6a80f8214c1cfc3a5f68325aabb0329583e2e540bcd1defab1e9e6c0647e5822b8c5c12b9030000c65b89f805ad571e7b86ad206e4921c34aaf7cc003d205
|
7
|
+
data.tar.gz: ec7bdb78edcf0c0022012c8118008d9843d2ba62ee58615b42a5b3e6563ca5169631cab06926229655341b3ee184d347b1623265a6694efd335dcce4afd96bcd
|
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
|
@@ -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.
|
@@ -70,7 +70,7 @@ module Google
|
|
70
70
|
initial_delay: 0.1,
|
71
71
|
max_delay: 60.0,
|
72
72
|
multiplier: 1.3,
|
73
|
-
retry_codes: [
|
73
|
+
retry_codes: [4, 14]
|
74
74
|
}
|
75
75
|
|
76
76
|
default_config.rpcs.list_billing_accounts.timeout = 60.0
|
@@ -78,7 +78,7 @@ module Google
|
|
78
78
|
initial_delay: 0.1,
|
79
79
|
max_delay: 60.0,
|
80
80
|
multiplier: 1.3,
|
81
|
-
retry_codes: [
|
81
|
+
retry_codes: [4, 14]
|
82
82
|
}
|
83
83
|
|
84
84
|
default_config.rpcs.update_billing_account.timeout = 60.0
|
@@ -86,7 +86,7 @@ module Google
|
|
86
86
|
initial_delay: 0.1,
|
87
87
|
max_delay: 60.0,
|
88
88
|
multiplier: 1.3,
|
89
|
-
retry_codes: [
|
89
|
+
retry_codes: [4, 14]
|
90
90
|
}
|
91
91
|
|
92
92
|
default_config.rpcs.create_billing_account.timeout = 60.0
|
@@ -96,7 +96,7 @@ module Google
|
|
96
96
|
initial_delay: 0.1,
|
97
97
|
max_delay: 60.0,
|
98
98
|
multiplier: 1.3,
|
99
|
-
retry_codes: [
|
99
|
+
retry_codes: [4, 14]
|
100
100
|
}
|
101
101
|
|
102
102
|
default_config.rpcs.get_project_billing_info.timeout = 60.0
|
@@ -104,7 +104,7 @@ module Google
|
|
104
104
|
initial_delay: 0.1,
|
105
105
|
max_delay: 60.0,
|
106
106
|
multiplier: 1.3,
|
107
|
-
retry_codes: [
|
107
|
+
retry_codes: [4, 14]
|
108
108
|
}
|
109
109
|
|
110
110
|
default_config.rpcs.update_project_billing_info.timeout = 60.0
|
@@ -112,7 +112,7 @@ module Google
|
|
112
112
|
initial_delay: 0.1,
|
113
113
|
max_delay: 60.0,
|
114
114
|
multiplier: 1.3,
|
115
|
-
retry_codes: [
|
115
|
+
retry_codes: [4, 14]
|
116
116
|
}
|
117
117
|
|
118
118
|
default_config.rpcs.get_iam_policy.timeout = 60.0
|
@@ -120,7 +120,7 @@ module Google
|
|
120
120
|
initial_delay: 0.1,
|
121
121
|
max_delay: 60.0,
|
122
122
|
multiplier: 1.3,
|
123
|
-
retry_codes: [
|
123
|
+
retry_codes: [4, 14]
|
124
124
|
}
|
125
125
|
|
126
126
|
default_config.rpcs.set_iam_policy.timeout = 60.0
|
@@ -128,7 +128,7 @@ module Google
|
|
128
128
|
initial_delay: 0.1,
|
129
129
|
max_delay: 60.0,
|
130
130
|
multiplier: 1.3,
|
131
|
-
retry_codes: [
|
131
|
+
retry_codes: [4, 14]
|
132
132
|
}
|
133
133
|
|
134
134
|
default_config.rpcs.test_iam_permissions.timeout = 60.0
|
@@ -136,7 +136,7 @@ module Google
|
|
136
136
|
initial_delay: 0.1,
|
137
137
|
max_delay: 60.0,
|
138
138
|
multiplier: 1.3,
|
139
|
-
retry_codes: [
|
139
|
+
retry_codes: [4, 14]
|
140
140
|
}
|
141
141
|
|
142
142
|
default_config
|
@@ -204,7 +204,8 @@ 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 =
|
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
210
|
@cloud_billing_stub = ::Gapic::ServiceStub.new(
|
210
211
|
::Google::Cloud::Billing::V1::CloudBilling::Stub,
|
@@ -1056,24 +1057,28 @@ module Google
|
|
1056
1057
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1057
1058
|
# trigger a retry.
|
1058
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
1065
|
extend ::Gapic::Config
|
1062
1066
|
|
1063
|
-
config_attr :endpoint,
|
1064
|
-
config_attr :credentials,
|
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,
|
1070
|
-
config_attr :lib_name,
|
1071
|
-
config_attr :lib_version,
|
1072
|
-
config_attr(:channel_args,
|
1073
|
-
config_attr :interceptors,
|
1074
|
-
config_attr :timeout,
|
1075
|
-
config_attr :metadata,
|
1076
|
-
config_attr :retry_policy,
|
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?
|
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
|
@@ -37,18 +37,18 @@ module Google
|
|
37
37
|
# Gets information about a billing account. The current authenticated user
|
38
38
|
# must be a [viewer of the billing
|
39
39
|
# account](https://cloud.google.com/billing/docs/how-to/billing-access).
|
40
|
-
rpc :GetBillingAccount, GetBillingAccountRequest, BillingAccount
|
40
|
+
rpc :GetBillingAccount, Google::Cloud::Billing::V1::GetBillingAccountRequest, Google::Cloud::Billing::V1::BillingAccount
|
41
41
|
# Lists the billing accounts that the current authenticated user has
|
42
42
|
# permission to
|
43
43
|
# [view](https://cloud.google.com/billing/docs/how-to/billing-access).
|
44
|
-
rpc :ListBillingAccounts, ListBillingAccountsRequest, ListBillingAccountsResponse
|
44
|
+
rpc :ListBillingAccounts, Google::Cloud::Billing::V1::ListBillingAccountsRequest, Google::Cloud::Billing::V1::ListBillingAccountsResponse
|
45
45
|
# Updates a billing account's fields.
|
46
46
|
# Currently the only field that can be edited is `display_name`.
|
47
47
|
# The current authenticated user must have the `billing.accounts.update`
|
48
48
|
# IAM permission, which is typically given to the
|
49
49
|
# [administrator](https://cloud.google.com/billing/docs/how-to/billing-access)
|
50
50
|
# of the billing account.
|
51
|
-
rpc :UpdateBillingAccount, UpdateBillingAccountRequest, BillingAccount
|
51
|
+
rpc :UpdateBillingAccount, Google::Cloud::Billing::V1::UpdateBillingAccountRequest, Google::Cloud::Billing::V1::BillingAccount
|
52
52
|
# Creates a billing account.
|
53
53
|
# This method can only be used to create
|
54
54
|
# [billing subaccounts](https://cloud.google.com/billing/docs/concepts)
|
@@ -59,17 +59,17 @@ module Google
|
|
59
59
|
# [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).
|
60
60
|
# This method will return an error if the master account has not been
|
61
61
|
# provisioned as a reseller account.
|
62
|
-
rpc :CreateBillingAccount, CreateBillingAccountRequest, BillingAccount
|
62
|
+
rpc :CreateBillingAccount, Google::Cloud::Billing::V1::CreateBillingAccountRequest, Google::Cloud::Billing::V1::BillingAccount
|
63
63
|
# Lists the projects associated with a billing account. The current
|
64
64
|
# authenticated user must have the `billing.resourceAssociations.list` IAM
|
65
65
|
# permission, which is often given to billing account
|
66
66
|
# [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).
|
67
|
-
rpc :ListProjectBillingInfo, ListProjectBillingInfoRequest, ListProjectBillingInfoResponse
|
67
|
+
rpc :ListProjectBillingInfo, Google::Cloud::Billing::V1::ListProjectBillingInfoRequest, Google::Cloud::Billing::V1::ListProjectBillingInfoResponse
|
68
68
|
# Gets the billing information for a project. The current authenticated user
|
69
69
|
# must have [permission to view the
|
70
70
|
# project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo
|
71
71
|
# ).
|
72
|
-
rpc :GetProjectBillingInfo, GetProjectBillingInfoRequest, ProjectBillingInfo
|
72
|
+
rpc :GetProjectBillingInfo, Google::Cloud::Billing::V1::GetProjectBillingInfoRequest, Google::Cloud::Billing::V1::ProjectBillingInfo
|
73
73
|
# Sets or updates the billing account associated with a project. You specify
|
74
74
|
# the new billing account by setting the `billing_account_name` in the
|
75
75
|
# `ProjectBillingInfo` resource to the resource name of a billing account.
|
@@ -101,7 +101,7 @@ module Google
|
|
101
101
|
# resources used by the project will be shut down. Thus, unless you wish to
|
102
102
|
# disable billing, you should always call this method with the name of an
|
103
103
|
# *open* billing account.
|
104
|
-
rpc :UpdateProjectBillingInfo, UpdateProjectBillingInfoRequest, ProjectBillingInfo
|
104
|
+
rpc :UpdateProjectBillingInfo, Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest, Google::Cloud::Billing::V1::ProjectBillingInfo
|
105
105
|
# Gets the access control policy for a billing account.
|
106
106
|
# The caller must have the `billing.accounts.getIamPolicy` permission on the
|
107
107
|
# account, which is often given to billing account
|
@@ -136,7 +136,8 @@ module Google
|
|
136
136
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
137
137
|
credentials = Credentials.new credentials, scope: @config.scope
|
138
138
|
end
|
139
|
-
@quota_project_id =
|
139
|
+
@quota_project_id = @config.quota_project
|
140
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
140
141
|
|
141
142
|
@cloud_catalog_stub = ::Gapic::ServiceStub.new(
|
142
143
|
::Google::Cloud::Billing::V1::CloudCatalog::Stub,
|
@@ -382,24 +383,28 @@ module Google
|
|
382
383
|
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
383
384
|
# trigger a retry.
|
384
385
|
# @return [::Hash]
|
386
|
+
# @!attribute [rw] quota_project
|
387
|
+
# A separate project against which to charge quota.
|
388
|
+
# @return [::String]
|
385
389
|
#
|
386
390
|
class Configuration
|
387
391
|
extend ::Gapic::Config
|
388
392
|
|
389
|
-
config_attr :endpoint,
|
390
|
-
config_attr :credentials,
|
393
|
+
config_attr :endpoint, "cloudbilling.googleapis.com", ::String
|
394
|
+
config_attr :credentials, nil do |value|
|
391
395
|
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
392
396
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
393
397
|
allowed.any? { |klass| klass === value }
|
394
398
|
end
|
395
|
-
config_attr :scope,
|
396
|
-
config_attr :lib_name,
|
397
|
-
config_attr :lib_version,
|
398
|
-
config_attr(:channel_args,
|
399
|
-
config_attr :interceptors,
|
400
|
-
config_attr :timeout,
|
401
|
-
config_attr :metadata,
|
402
|
-
config_attr :retry_policy,
|
399
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
400
|
+
config_attr :lib_name, nil, ::String, nil
|
401
|
+
config_attr :lib_version, nil, ::String, nil
|
402
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
403
|
+
config_attr :interceptors, nil, ::Array, nil
|
404
|
+
config_attr :timeout, nil, ::Numeric, nil
|
405
|
+
config_attr :metadata, nil, ::Hash, nil
|
406
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
407
|
+
config_attr :quota_project, nil, ::String, nil
|
403
408
|
|
404
409
|
# @private
|
405
410
|
def initialize parent_config = nil
|
@@ -415,7 +420,7 @@ module Google
|
|
415
420
|
def rpcs
|
416
421
|
@rpcs ||= begin
|
417
422
|
parent_rpcs = nil
|
418
|
-
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to?
|
423
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
419
424
|
Rpcs.new parent_rpcs
|
420
425
|
end
|
421
426
|
end
|
@@ -37,9 +37,9 @@ module Google
|
|
37
37
|
self.service_name = 'google.cloud.billing.v1.CloudCatalog'
|
38
38
|
|
39
39
|
# Lists all public cloud services.
|
40
|
-
rpc :ListServices, ListServicesRequest, ListServicesResponse
|
40
|
+
rpc :ListServices, Google::Cloud::Billing::V1::ListServicesRequest, Google::Cloud::Billing::V1::ListServicesResponse
|
41
41
|
# Lists all publicly available SKUs for a given cloud service.
|
42
|
-
rpc :ListSkus, ListSkusRequest, ListSkusResponse
|
42
|
+
rpc :ListSkus, Google::Cloud::Billing::V1::ListSkusRequest, Google::Cloud::Billing::V1::ListSkusResponse
|
43
43
|
end
|
44
44
|
|
45
45
|
Stub = Service.rpc_stub_class
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-billing-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: google-cloud-errors
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,14 +78,42 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '5.
|
81
|
+
version: '5.14'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '5.
|
88
|
+
version: '5.14'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: minitest-focus
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.1'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.1'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: minitest-rg
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '5.2'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '5.2'
|
89
117
|
- !ruby/object:Gem::Dependency
|
90
118
|
name: rake
|
91
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,7 +196,6 @@ files:
|
|
168
196
|
- lib/google/cloud/billing/v1/cloud_catalog_pb.rb
|
169
197
|
- lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb
|
170
198
|
- lib/google/cloud/billing/v1/version.rb
|
171
|
-
- lib/google/cloud/common_resources_pb.rb
|
172
199
|
- proto_docs/README.md
|
173
200
|
- proto_docs/google/api/field_behavior.rb
|
174
201
|
- proto_docs/google/api/resource.rb
|
@@ -200,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
227
|
- !ruby/object:Gem::Version
|
201
228
|
version: '0'
|
202
229
|
requirements: []
|
203
|
-
rubygems_version: 3.
|
230
|
+
rubygems_version: 3.1.3
|
204
231
|
signing_key:
|
205
232
|
specification_version: 4
|
206
233
|
summary: API Client library for the Billing V1 API
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/common_resources.proto
|
3
|
-
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
|
-
require 'google/api/resource_pb'
|
7
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
8
|
-
add_file("google/cloud/common_resources.proto", :syntax => :proto3) do
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
module Google
|
13
|
-
module Cloud
|
14
|
-
end
|
15
|
-
end
|