google-cloud-billing-v1 0.5.1 → 0.5.6

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: 841c0f97ea8b10e1ac1ca53b5adfad46966f1c8f957f2836c5498ac3791b0aab
4
- data.tar.gz: 6e18e154cd75794bd0ce72327714bdf2d7355c8f5b62d1bf724aeae4179d9c8d
3
+ metadata.gz: bd2f911247446b6a1fa984b9e4bb2e3ea714219d625633c04b075e2268883bc6
4
+ data.tar.gz: b255b2633b6f9ec3632f021551f4737ae1402ed5393a736da15af52c25479d53
5
5
  SHA512:
6
- metadata.gz: 34f2ce0a4bf529cba077a5a152c8c62eee5273918ebad846f1bdfb1861c8a61bf78b9f7d5f7847bfa51c6a0405fbfb58d8db4cb7ff3d4c61a683cf1b2fbe926d
7
- data.tar.gz: 524f46edb597eeac32afb76c75ff5da9dce02d0b11265bd9353827bf347b0a2263d659db81c85159cffed8224dceb1e21c8292ec153f6bc429acafd430635f23
6
+ metadata.gz: 4c410311d8c86f1b529b115911396c8c01ffc67e4425084df6bb6a738784a3f57759c70f5b2d002e432c5cada5f59e930ae629da3e6e62deb413ca588e173919
7
+ data.tar.gz: fa54235eca026308175405e547d18dd5f494e652b5c1200266a91528e3e5bb68218fa03349d40ddb8341190506f2156a64d2744a6bb02e310ee27bf5b7fd69d5
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.
@@ -34,3 +34,6 @@ module Google
34
34
  end
35
35
  end
36
36
  end
37
+
38
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
39
+ require "google/cloud/billing/v1/_helpers" if ::File.file? helper_path
@@ -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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
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: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
139
+ retry_codes: [4, 14]
140
140
  }
141
141
 
142
142
  default_config
@@ -1066,7 +1066,7 @@ module Google
1066
1066
 
1067
1067
  config_attr :endpoint, "cloudbilling.googleapis.com", ::String
1068
1068
  config_attr :credentials, nil do |value|
1069
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1069
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1070
1070
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1071
1071
  allowed.any? { |klass| klass === value }
1072
1072
  end
@@ -1094,7 +1094,7 @@ module Google
1094
1094
  def rpcs
1095
1095
  @rpcs ||= begin
1096
1096
  parent_rpcs = nil
1097
- 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)
1098
1098
  Rpcs.new parent_rpcs
1099
1099
  end
1100
1100
  end
@@ -1106,7 +1106,7 @@ module Google
1106
1106
  # Each configuration object is of type `Gapic::Config::Method` and includes
1107
1107
  # the following configuration fields:
1108
1108
  #
1109
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1109
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1110
1110
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1111
1111
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1112
1112
  # include the following keys:
@@ -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,22 +101,22 @@ 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
108
108
  # [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).
109
- rpc :GetIamPolicy, Google::Iam::V1::GetIamPolicyRequest, Google::Iam::V1::Policy
109
+ rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy
110
110
  # Sets the access control policy for a billing account. Replaces any existing
111
111
  # policy.
112
112
  # The caller must have the `billing.accounts.setIamPolicy` permission on the
113
113
  # account, which is often given to billing account
114
114
  # [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).
115
- rpc :SetIamPolicy, Google::Iam::V1::SetIamPolicyRequest, Google::Iam::V1::Policy
115
+ rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy
116
116
  # Tests the access control policy for a billing account. This method takes
117
117
  # the resource and a set of permissions as input and returns the subset of
118
118
  # the input permissions that the caller is allowed for that resource.
119
- rpc :TestIamPermissions, Google::Iam::V1::TestIamPermissionsRequest, Google::Iam::V1::TestIamPermissionsResponse
119
+ rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse
120
120
  end
121
121
 
122
122
  Stub = Service.rpc_stub_class
@@ -392,7 +392,7 @@ module Google
392
392
 
393
393
  config_attr :endpoint, "cloudbilling.googleapis.com", ::String
394
394
  config_attr :credentials, nil do |value|
395
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
395
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
396
396
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
397
397
  allowed.any? { |klass| klass === value }
398
398
  end
@@ -420,7 +420,7 @@ module Google
420
420
  def rpcs
421
421
  @rpcs ||= begin
422
422
  parent_rpcs = nil
423
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
423
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
424
424
  Rpcs.new parent_rpcs
425
425
  end
426
426
  end
@@ -432,7 +432,7 @@ module Google
432
432
  # Each configuration object is of type `Gapic::Config::Method` and includes
433
433
  # the following configuration fields:
434
434
  #
435
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
435
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
436
436
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
437
437
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
438
438
  # include the following keys:
@@ -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
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Billing
23
23
  module V1
24
- VERSION = "0.5.1"
24
+ VERSION = "0.5.6"
25
25
  end
26
26
  end
27
27
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
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.5.1
4
+ version: 0.5.6
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-05-26 00:00:00.000000000 Z
11
+ date: 2021-01-20 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.2'
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.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-errors
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubygems_version: 3.0.6
230
+ rubygems_version: 3.2.6
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: API Client library for the Billing V1 API