google-cloud-billing-budgets-v1beta1 0.1.0 → 0.4.0

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: 63eeef2e2f9b198587ca684920224fed03884db141982a3ab9932bd4b7e7626e
4
- data.tar.gz: 9aabe5a29e721716365cc55ee829fb616624cacb37c6210a28b426c1099d7342
3
+ metadata.gz: 2bbcf0fb6f62df8d75c567613fdd00c5df295e5c1675acdaf27f76b377ad7f1d
4
+ data.tar.gz: 8e103ff7a2eb0b8004708ded08b02347665e5fac3f8b29574a2ddeecfd3c6a7e
5
5
  SHA512:
6
- metadata.gz: b2ff224ead15d6845ea67a86933c1497266e2df9620ec9e466b194474a7486b7d3d27de5decd72e958f2a1f040ec2127b888770d98d9ee21f12f0b6f94d469a9
7
- data.tar.gz: e9301e9246b48678b6319892ba3305cd015d5e8a0bddc8bd16d39016232c0c9328d78053bef2e81b12668c05a0879c74d90ff35d2969c965a8aa4d119d4cdf44
6
+ metadata.gz: '09af4c44f6d749829bbccaf6fa9fefc601b83911eb4835159f700fe89b697727bb73a119d0c164799fec70fc0348dac742728e3b75550290ac23acb6ea02a0f4'
7
+ data.tar.gz: 30c610dc43850418a078a8fb9600041dc18e368de0ffea1a7f38c42d0ed8393b0c96e6f733dad7242750fc6ce91968b2b1fb6b514674a3efd3daf21f65dd65bb
data/README.md CHANGED
@@ -6,6 +6,12 @@ Provides methods to view, create, and manage Cloud Billing budgets programmatica
6
6
 
7
7
  https://github.com/googleapis/google-cloud-ruby
8
8
 
9
+ This gem is a _versioned_ client. It provides basic client classes for a
10
+ specific version of the Billing Budgets V1beta1 API. Most users should consider using
11
+ the main client gem,
12
+ [google-cloud-billing-budgets](https://rubygems.org/gems/google-cloud-billing-budgets).
13
+ See the section below titled *Which client should I use?* for more information.
14
+
9
15
  ## Installation
10
16
 
11
17
  ```
@@ -73,3 +79,61 @@ in security maintenance, and not end of life. Currently, this means Ruby 2.4
73
79
  and later. Older versions of Ruby _may_ still work, but are unsupported and not
74
80
  recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
75
81
  about the Ruby support schedule.
82
+
83
+ ## Which client should I use?
84
+
85
+ Most modern Ruby client libraries for Google APIs come in two flavors: the main
86
+ client library with a name such as `google-cloud-billing-budgets`,
87
+ and lower-level _versioned_ client libraries with names such as
88
+ `google-cloud-billing-budgets-v1beta1`.
89
+ _In most cases, you should install the main client._
90
+
91
+ ### What's the difference between the main client and a versioned client?
92
+
93
+ A _versioned client_ provides a basic set of data types and client classes for
94
+ a _single version_ of a specific service. (That is, for a service with multiple
95
+ versions, there might be a separate versioned client for each service version.)
96
+ Most versioned clients are written and maintained by a code generator.
97
+
98
+ The _main client_ is designed to provide you with the _recommended_ client
99
+ interfaces for the service. There will be only one main client for any given
100
+ service, even a service with multiple versions. The main client includes
101
+ factory methods for constructing the client objects we recommend for most
102
+ users. In some cases, those will be classes provided by an underlying versioned
103
+ client; in other cases, they will be handwritten higher-level client objects
104
+ with additional capabilities, convenience methods, or best practices built in.
105
+ Generally, the main client will default to a recommended service version,
106
+ although in some cases you can override this if you need to talk to a specific
107
+ service version.
108
+
109
+ ### Why would I want to use the main client?
110
+
111
+ We recommend that most users install the main client gem for a service. You can
112
+ identify this gem as the one _without_ a version in its name, e.g.
113
+ `google-cloud-billing-budgets`.
114
+ The main client is recommended because it will embody the best practices for
115
+ accessing the service, and may also provide more convenient interfaces or
116
+ tighter integration into frameworks and third-party libraries. In addition, the
117
+ documentation and samples published by Google will generally demonstrate use of
118
+ the main client.
119
+
120
+ ### Why would I want to use a versioned client?
121
+
122
+ You can use a versioned client if you are content with a possibly lower-level
123
+ class interface, you explicitly want to avoid features provided by the main
124
+ client, or you want to access a specific service version not be covered by the
125
+ main client. You can identify versioned client gems because the service version
126
+ is part of the name, e.g. `google-cloud-billing-budgets-v1beta1`.
127
+
128
+ ### What about the google-apis-<name> clients?
129
+
130
+ Client library gems with names that begin with `google-apis-` are based on an
131
+ older code generation technology. They talk to a REST/JSON backend (whereas
132
+ most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
133
+ not offer the same performance, features, and ease of use provided by more
134
+ modern clients.
135
+
136
+ The `google-apis-` clients have wide coverage across Google services, so you
137
+ might need to use one if there is no modern client available for the service.
138
+ However, if a modern client is available, we generally recommend it over the
139
+ older `google-apis-` clients.
@@ -35,3 +35,6 @@ module Google
35
35
  end
36
36
  end
37
37
  end
38
+
39
+ helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb"
40
+ require "google/cloud/billing/budgets/v1beta1/_helpers" if ::File.file? helper_path
@@ -39,9 +39,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
39
39
  optional :pubsub_topic, :string, 1
40
40
  optional :schema_version, :string, 2
41
41
  repeated :monitoring_notification_channels, :string, 3
42
+ optional :disable_default_iam_recipients, :bool, 4
42
43
  end
43
44
  add_message "google.cloud.billing.budgets.v1beta1.Filter" do
44
45
  repeated :projects, :string, 1
46
+ repeated :credit_types, :string, 7
45
47
  optional :credit_types_treatment, :enum, 4, "google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatment"
46
48
  repeated :services, :string, 3
47
49
  repeated :subaccounts, :string, 5
@@ -51,6 +53,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
51
53
  value :CREDIT_TYPES_TREATMENT_UNSPECIFIED, 0
52
54
  value :INCLUDE_ALL_CREDITS, 1
53
55
  value :EXCLUDE_ALL_CREDITS, 2
56
+ value :INCLUDE_SPECIFIED_CREDITS, 3
54
57
  end
55
58
  end
56
59
  end
@@ -162,7 +162,13 @@ module Google
162
162
 
163
163
  # Create credentials
164
164
  credentials = @config.credentials
165
- credentials ||= Credentials.default scope: @config.scope
165
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
166
+ # but only if the default endpoint does not have a region prefix.
167
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
168
+ @config.endpoint == Client.configure.endpoint &&
169
+ !@config.endpoint.split(".").first.include?("-")
170
+ credentials ||= Credentials.default scope: @config.scope,
171
+ enable_self_signed_jwt: enable_self_signed_jwt
166
172
  if credentials.is_a?(String) || credentials.is_a?(Hash)
167
173
  credentials = Credentials.new credentials, scope: @config.scope
168
174
  end
@@ -673,7 +679,7 @@ module Google
673
679
  # Each configuration object is of type `Gapic::Config::Method` and includes
674
680
  # the following configuration fields:
675
681
  #
676
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
682
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
677
683
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
678
684
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
679
685
  # include the following keys:
@@ -27,6 +27,7 @@ module Google
27
27
  # Credentials for the BudgetService API.
28
28
  class Credentials < ::Google::Auth::Credentials
29
29
  self.scope = [
30
+ "https://www.googleapis.com/auth/cloud-billing",
30
31
  "https://www.googleapis.com/auth/cloud-platform"
31
32
  ]
32
33
  self.env_vars = [
@@ -38,29 +38,29 @@ module Google
38
38
  # Creates a new budget. See
39
39
  # <a href="https://cloud.google.com/billing/quotas">Quotas and limits</a>
40
40
  # for more information on the limits of the number of budgets you can create.
41
- rpc :CreateBudget, Google::Cloud::Billing::Budgets::V1beta1::CreateBudgetRequest, Google::Cloud::Billing::Budgets::V1beta1::Budget
41
+ rpc :CreateBudget, ::Google::Cloud::Billing::Budgets::V1beta1::CreateBudgetRequest, ::Google::Cloud::Billing::Budgets::V1beta1::Budget
42
42
  # Updates a budget and returns the updated budget.
43
43
  #
44
44
  # WARNING: There are some fields exposed on the Google Cloud Console that
45
45
  # aren't available on this API. Budget fields that are not exposed in
46
46
  # this API will not be changed by this method.
47
- rpc :UpdateBudget, Google::Cloud::Billing::Budgets::V1beta1::UpdateBudgetRequest, Google::Cloud::Billing::Budgets::V1beta1::Budget
47
+ rpc :UpdateBudget, ::Google::Cloud::Billing::Budgets::V1beta1::UpdateBudgetRequest, ::Google::Cloud::Billing::Budgets::V1beta1::Budget
48
48
  # Returns a budget.
49
49
  #
50
50
  # WARNING: There are some fields exposed on the Google Cloud Console that
51
51
  # aren't available on this API. When reading from the API, you will not
52
52
  # see these fields in the return value, though they may have been set
53
53
  # in the Cloud Console.
54
- rpc :GetBudget, Google::Cloud::Billing::Budgets::V1beta1::GetBudgetRequest, Google::Cloud::Billing::Budgets::V1beta1::Budget
54
+ rpc :GetBudget, ::Google::Cloud::Billing::Budgets::V1beta1::GetBudgetRequest, ::Google::Cloud::Billing::Budgets::V1beta1::Budget
55
55
  # Returns a list of budgets for a billing account.
56
56
  #
57
57
  # WARNING: There are some fields exposed on the Google Cloud Console that
58
58
  # aren't available on this API. When reading from the API, you will not
59
59
  # see these fields in the return value, though they may have been set
60
60
  # in the Cloud Console.
61
- rpc :ListBudgets, Google::Cloud::Billing::Budgets::V1beta1::ListBudgetsRequest, Google::Cloud::Billing::Budgets::V1beta1::ListBudgetsResponse
61
+ rpc :ListBudgets, ::Google::Cloud::Billing::Budgets::V1beta1::ListBudgetsRequest, ::Google::Cloud::Billing::Budgets::V1beta1::ListBudgetsResponse
62
62
  # Deletes a budget. Returns successfully if already deleted.
63
- rpc :DeleteBudget, Google::Cloud::Billing::Budgets::V1beta1::DeleteBudgetRequest, Google::Protobuf::Empty
63
+ rpc :DeleteBudget, ::Google::Cloud::Billing::Budgets::V1beta1::DeleteBudgetRequest, ::Google::Protobuf::Empty
64
64
  end
65
65
 
66
66
  Stub = Service.rpc_stub_class
@@ -22,7 +22,7 @@ module Google
22
22
  module Billing
23
23
  module Budgets
24
24
  module V1beta1
25
- VERSION = "0.1.0"
25
+ VERSION = "0.4.0"
26
26
  end
27
27
  end
28
28
  end
@@ -54,6 +54,12 @@ module Google
54
54
  # This indicates that the field may be set once in a request to create a
55
55
  # resource, but may not be changed thereafter.
56
56
  IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
57
63
  end
58
64
  end
59
65
  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
@@ -124,8 +124,8 @@ module Google
124
124
  # and thresholds.
125
125
  # @!attribute [rw] pubsub_topic
126
126
  # @return [::String]
127
- # Required. The name of the Cloud Pub/Sub topic where budget related messages
128
- # will be published, in the form `projects/{project_id}/topics/{topic_id}`.
127
+ # Optional. The name of the Pub/Sub topic where budget related messages will
128
+ # be published, in the form `projects/{project_id}/topics/{topic_id}`.
129
129
  # Updates are sent at regular intervals to the topic. The topic needs to be
130
130
  # created before the budget is created; see
131
131
  # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
@@ -133,21 +133,29 @@ module Google
133
133
  # Caller is expected to have
134
134
  # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
135
135
  # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
136
- # https://cloud.google.com/pubsub/docs/access-control for more details on
137
- # Pub/Sub roles and permissions.
136
+ # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
137
+ # for more details on Pub/Sub roles and permissions.
138
138
  # @!attribute [rw] schema_version
139
139
  # @return [::String]
140
- # Required. The schema version of the notification sent to `pubsub_topic`.
140
+ # Optional. The schema version of the notification sent to `pubsub_topic`.
141
141
  # Only "1.0" is accepted. It represents the JSON schema as defined in
142
- # https://cloud.google.com/billing/docs/how-to/budgets#notification_format
142
+ # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
143
143
  # @!attribute [rw] monitoring_notification_channels
144
144
  # @return [::Array<::String>]
145
145
  # Optional. Targets to send notifications to when a threshold is exceeded.
146
- # This is in addition to default recipients who have billing account roles.
147
- # The value is the full REST resource name of a monitoring notification
148
- # channel with the form
146
+ # This is in addition to default recipients who have billing account IAM
147
+ # roles. The value is the full REST resource name of a monitoring
148
+ # notification channel with the form
149
149
  # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
150
- # channels are allowed.
150
+ # channels are allowed. See
151
+ # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
152
+ # for more details.
153
+ # @!attribute [rw] disable_default_iam_recipients
154
+ # @return [::Boolean]
155
+ # Optional. When set to true, disables default notifications sent when a
156
+ # threshold is exceeded. Default notifications are sent to those with Billing
157
+ # Account Administrator and Billing Account User IAM roles for the target
158
+ # account.
151
159
  class AllUpdatesRule
152
160
  include ::Google::Protobuf::MessageExts
153
161
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -161,6 +169,19 @@ module Google
161
169
  # included in the budget. If omitted, the report will include all usage for
162
170
  # the billing account, regardless of which project the usage occurred on.
163
171
  # Only zero or one project can be specified currently.
172
+ # @!attribute [rw] credit_types
173
+ # @return [::Array<::String>]
174
+ # Optional. If
175
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#credit_types_treatment Filter.credit_types_treatment}
176
+ # is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be
177
+ # subtracted from gross cost to determine the spend for threshold
178
+ # calculations.
179
+ #
180
+ # If
181
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#credit_types_treatment Filter.credit_types_treatment}
182
+ # is **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty. See [a list
183
+ # of acceptable credit type
184
+ # values](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
164
185
  # @!attribute [rw] credit_types_treatment
165
186
  # @return [::Google::Cloud::Billing::Budgets::V1beta1::Filter::CreditTypesTreatment]
166
187
  # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
@@ -176,10 +197,10 @@ module Google
176
197
  # @return [::Array<::String>]
177
198
  # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`,
178
199
  # specifying that usage from only this set of subaccounts should be included
179
- # in the budget. If a subaccount is set to the name of the reseller account,
180
- # usage from the reseller account will be included. If omitted, the report
181
- # will include usage from the reseller account and all subaccounts, if they
182
- # exist.
200
+ # in the budget. If a subaccount is set to the name of the parent account,
201
+ # usage from the parent account will be included. If omitted, the
202
+ # report will include usage from the parent account and all
203
+ # subaccounts, if they exist.
183
204
  # @!attribute [rw] labels
184
205
  # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::ListValue}]
185
206
  # Optional. A single label and value pair specifying that usage from only
@@ -211,6 +232,10 @@ module Google
211
232
  # All types of credit are added to the net cost to determine the spend for
212
233
  # threshold calculations.
213
234
  EXCLUDE_ALL_CREDITS = 2
235
+
236
+ # Credit types specified in the credit_types field are subtracted from the
237
+ # gross cost to determine the spend for threshold calculations.
238
+ INCLUDE_SPECIFIED_CREDITS = 3
214
239
  end
215
240
  end
216
241
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-billing-budgets-v1beta1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.4.0
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-09-10 00:00:00.000000000 Z
11
+ date: 2021-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -151,7 +151,9 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.9'
153
153
  description: Provides methods to view, create, and manage Cloud Billing budgets programmatically
154
- at scale.
154
+ at scale. Note that google-cloud-billing-budgets-v1beta1 is a version-specific client
155
+ library. For most uses, we recommend installing the main client library google-cloud-billing-budgets
156
+ instead. See the readme for more details.
155
157
  email: googleapis-packages@google.com
156
158
  executables: []
157
159
  extensions: []
@@ -199,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
201
  - !ruby/object:Gem::Version
200
202
  version: '0'
201
203
  requirements: []
202
- rubygems_version: 3.1.3
204
+ rubygems_version: 3.2.6
203
205
  signing_key:
204
206
  specification_version: 4
205
207
  summary: API Client library for the Billing Budgets V1beta1 API