google-cloud-billing-budgets-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,283 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Api
22
+ # A simple descriptor of a resource type.
23
+ #
24
+ # ResourceDescriptor annotates a resource message (either by means of a
25
+ # protobuf annotation or use in the service config), and associates the
26
+ # resource's schema, the resource type, and the pattern of the resource name.
27
+ #
28
+ # Example:
29
+ #
30
+ # message Topic {
31
+ # // Indicates this message defines a resource schema.
32
+ # // Declares the resource type in the format of {service}/{kind}.
33
+ # // For Kubernetes resources, the format is {api group}/{kind}.
34
+ # option (google.api.resource) = {
35
+ # type: "pubsub.googleapis.com/Topic"
36
+ # name_descriptor: {
37
+ # pattern: "projects/{project}/topics/{topic}"
38
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
+ # parent_name_extractor: "projects/{project}"
40
+ # }
41
+ # };
42
+ # }
43
+ #
44
+ # The ResourceDescriptor Yaml config will look like:
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}"
52
+ #
53
+ # Sometimes, resources have multiple patterns, typically because they can
54
+ # live under multiple parents.
55
+ #
56
+ # Example:
57
+ #
58
+ # message LogEntry {
59
+ # option (google.api.resource) = {
60
+ # type: "logging.googleapis.com/LogEntry"
61
+ # name_descriptor: {
62
+ # pattern: "projects/{project}/logs/{log}"
63
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
+ # parent_name_extractor: "projects/{project}"
65
+ # }
66
+ # name_descriptor: {
67
+ # pattern: "folders/{folder}/logs/{log}"
68
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
+ # parent_name_extractor: "folders/{folder}"
70
+ # }
71
+ # name_descriptor: {
72
+ # pattern: "organizations/{organization}/logs/{log}"
73
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
+ # parent_name_extractor: "organizations/{organization}"
75
+ # }
76
+ # name_descriptor: {
77
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
+ # parent_type: "billing.googleapis.com/BillingAccount"
79
+ # parent_name_extractor: "billingAccounts/{billing_account}"
80
+ # }
81
+ # };
82
+ # }
83
+ #
84
+ # The ResourceDescriptor Yaml config will look like:
85
+ #
86
+ # resources:
87
+ # - type: 'logging.googleapis.com/LogEntry'
88
+ # name_descriptor:
89
+ # - pattern: "projects/{project}/logs/{log}"
90
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
+ # parent_name_extractor: "projects/{project}"
92
+ # - pattern: "folders/{folder}/logs/{log}"
93
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
+ # parent_name_extractor: "folders/{folder}"
95
+ # - pattern: "organizations/{organization}/logs/{log}"
96
+ # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
+ # parent_name_extractor: "organizations/{organization}"
98
+ # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
+ # parent_type: "billing.googleapis.com/BillingAccount"
100
+ # parent_name_extractor: "billingAccounts/{billing_account}"
101
+ #
102
+ # For flexible resources, the resource name doesn't contain parent names, but
103
+ # the resource itself has parents for policy evaluation.
104
+ #
105
+ # Example:
106
+ #
107
+ # message Shelf {
108
+ # option (google.api.resource) = {
109
+ # type: "library.googleapis.com/Shelf"
110
+ # name_descriptor: {
111
+ # pattern: "shelves/{shelf}"
112
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
+ # }
114
+ # name_descriptor: {
115
+ # pattern: "shelves/{shelf}"
116
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
+ # }
118
+ # };
119
+ # }
120
+ #
121
+ # The ResourceDescriptor Yaml config will look like:
122
+ #
123
+ # resources:
124
+ # - type: 'library.googleapis.com/Shelf'
125
+ # name_descriptor:
126
+ # - pattern: "shelves/{shelf}"
127
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
+ # - pattern: "shelves/{shelf}"
129
+ # parent_type: "cloudresourcemanager.googleapis.com/Folder"
130
+ # @!attribute [rw] type
131
+ # @return [::String]
132
+ # The resource type. It must be in the format of
133
+ # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be
134
+ # singular and must not include version numbers.
135
+ #
136
+ # Example: `storage.googleapis.com/Bucket`
137
+ #
138
+ # The value of the resource_type_kind must follow the regular expression
139
+ # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
140
+ # should use PascalCase (UpperCamelCase). The maximum number of
141
+ # characters allowed for the `resource_type_kind` is 100.
142
+ # @!attribute [rw] pattern
143
+ # @return [::Array<::String>]
144
+ # Optional. The relative resource name pattern associated with this resource
145
+ # type. The DNS prefix of the full resource name shouldn't be specified here.
146
+ #
147
+ # The path pattern must follow the syntax, which aligns with HTTP binding
148
+ # syntax:
149
+ #
150
+ # Template = Segment { "/" Segment } ;
151
+ # Segment = LITERAL | Variable ;
152
+ # Variable = "{" LITERAL "}" ;
153
+ #
154
+ # Examples:
155
+ #
156
+ # - "projects/\\{project}/topics/\\{topic}"
157
+ # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}"
158
+ #
159
+ # The components in braces correspond to the IDs for each resource in the
160
+ # hierarchy. It is expected that, if multiple patterns are provided,
161
+ # the same component name (e.g. "project") refers to IDs of the same
162
+ # type of resource.
163
+ # @!attribute [rw] name_field
164
+ # @return [::String]
165
+ # Optional. The field on the resource that designates the resource name
166
+ # field. If omitted, this is assumed to be "name".
167
+ # @!attribute [rw] history
168
+ # @return [::Google::Api::ResourceDescriptor::History]
169
+ # Optional. The historical or future-looking state of the resource pattern.
170
+ #
171
+ # Example:
172
+ #
173
+ # // The InspectTemplate message originally only supported resource
174
+ # // names with organization, and project was added later.
175
+ # message InspectTemplate {
176
+ # option (google.api.resource) = {
177
+ # type: "dlp.googleapis.com/InspectTemplate"
178
+ # pattern:
179
+ # "organizations/{organization}/inspectTemplates/{inspect_template}"
180
+ # pattern: "projects/{project}/inspectTemplates/{inspect_template}"
181
+ # history: ORIGINALLY_SINGLE_PATTERN
182
+ # };
183
+ # }
184
+ # @!attribute [rw] plural
185
+ # @return [::String]
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
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
194
+ # @!attribute [rw] singular
195
+ # @return [::String]
196
+ # The same concept of the `singular` field in k8s CRD spec
197
+ # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
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.
204
+ class ResourceDescriptor
205
+ include ::Google::Protobuf::MessageExts
206
+ extend ::Google::Protobuf::MessageExts::ClassMethods
207
+
208
+ # A description of the historical or future-looking state of the
209
+ # resource pattern.
210
+ module History
211
+ # The "unset" value.
212
+ HISTORY_UNSPECIFIED = 0
213
+
214
+ # The resource originally had one pattern and launched as such, and
215
+ # additional patterns were added later.
216
+ ORIGINALLY_SINGLE_PATTERN = 1
217
+
218
+ # The resource has one pattern, but the API owner expects to add more
219
+ # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents
220
+ # that from being necessary once there are multiple patterns.)
221
+ FUTURE_MULTI_PATTERN = 2
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
239
+ end
240
+
241
+ # Defines a proto annotation that describes a string field that refers to
242
+ # an API resource.
243
+ # @!attribute [rw] type
244
+ # @return [::String]
245
+ # The resource type that the annotated field references.
246
+ #
247
+ # Example:
248
+ #
249
+ # message Subscription {
250
+ # string topic = 2 [(google.api.resource_reference) = {
251
+ # type: "pubsub.googleapis.com/Topic"
252
+ # }];
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
+ # }
265
+ # @!attribute [rw] child_type
266
+ # @return [::String]
267
+ # The resource type of a child collection that the annotated field
268
+ # references. This is useful for annotating the `parent` field that
269
+ # doesn't have a fixed resource type.
270
+ #
271
+ # Example:
272
+ #
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
278
+ class ResourceReference
279
+ include ::Google::Protobuf::MessageExts
280
+ extend ::Google::Protobuf::MessageExts::ClassMethods
281
+ end
282
+ end
283
+ end
@@ -0,0 +1,311 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Billing
23
+ module Budgets
24
+ module V1
25
+ # A budget is a plan that describes what you expect to spend on Cloud
26
+ # projects, plus the rules to execute as spend is tracked against that plan,
27
+ # (for example, send an alert when 90% of the target spend is met).
28
+ # The budget time period is configurable, with options such as month (default),
29
+ # quarter, year, or custom time period.
30
+ # @!attribute [r] name
31
+ # @return [::String]
32
+ # Output only. Resource name of the budget.
33
+ # The resource name implies the scope of a budget. Values are of the form
34
+ # `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
35
+ # @!attribute [rw] display_name
36
+ # @return [::String]
37
+ # User data for display name in UI. The name must be less than or equal to 60
38
+ # characters.
39
+ # @!attribute [rw] budget_filter
40
+ # @return [::Google::Cloud::Billing::Budgets::V1::Filter]
41
+ # Optional. Filters that define which resources are used to compute the
42
+ # actual spend against the budget amount, such as projects, services, and the
43
+ # budget's time period, as well as other filters.
44
+ # @!attribute [rw] amount
45
+ # @return [::Google::Cloud::Billing::Budgets::V1::BudgetAmount]
46
+ # Required. Budgeted amount.
47
+ # @!attribute [rw] threshold_rules
48
+ # @return [::Array<::Google::Cloud::Billing::Budgets::V1::ThresholdRule>]
49
+ # Optional. Rules that trigger alerts (notifications of thresholds
50
+ # being crossed) when spend exceeds the specified percentages of the budget.
51
+ # @!attribute [rw] notifications_rule
52
+ # @return [::Google::Cloud::Billing::Budgets::V1::NotificationsRule]
53
+ # Optional. Rules to apply to notifications sent based on budget spend and
54
+ # thresholds.
55
+ # @!attribute [rw] etag
56
+ # @return [::String]
57
+ # Optional. Etag to validate that the object is unchanged for a
58
+ # read-modify-write operation.
59
+ # An empty etag will cause an update to overwrite other changes.
60
+ class Budget
61
+ include ::Google::Protobuf::MessageExts
62
+ extend ::Google::Protobuf::MessageExts::ClassMethods
63
+ end
64
+
65
+ # The budgeted amount for each usage period.
66
+ # @!attribute [rw] specified_amount
67
+ # @return [::Google::Type::Money]
68
+ # A specified amount to use as the budget.
69
+ # `currency_code` is optional. If specified when creating a budget, it must
70
+ # match the currency of the billing account. If specified when updating a
71
+ # budget, it must match the currency_code of the existing budget.
72
+ # The `currency_code` is provided on output.
73
+ # @!attribute [rw] last_period_amount
74
+ # @return [::Google::Cloud::Billing::Budgets::V1::LastPeriodAmount]
75
+ # Use the last period's actual spend as the budget for the present period.
76
+ # LastPeriodAmount can only be set when the budget's time period is a
77
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#calendar_period Filter.calendar_period}.
78
+ # It cannot be set in combination with
79
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#custom_period Filter.custom_period}.
80
+ class BudgetAmount
81
+ include ::Google::Protobuf::MessageExts
82
+ extend ::Google::Protobuf::MessageExts::ClassMethods
83
+ end
84
+
85
+ # Describes a budget amount targeted to the last
86
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#calendar_period Filter.calendar_period}
87
+ # spend. At this time, the amount is automatically 100% of the last calendar
88
+ # period's spend; that is, there are no other options yet.
89
+ # Future configuration options will be described here (for example, configuring
90
+ # a percentage of last period's spend).
91
+ # LastPeriodAmount cannot be set for a budget configured with
92
+ # a
93
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#custom_period Filter.custom_period}.
94
+ class LastPeriodAmount
95
+ include ::Google::Protobuf::MessageExts
96
+ extend ::Google::Protobuf::MessageExts::ClassMethods
97
+ end
98
+
99
+ # ThresholdRule contains a definition of a threshold which triggers
100
+ # an alert (a notification of a threshold being crossed) to be sent when
101
+ # spend goes above the specified amount.
102
+ # Alerts are automatically e-mailed to users with the Billing Account
103
+ # Administrator role or the Billing Account User role.
104
+ # The thresholds here have no effect on notifications sent to anything
105
+ # configured under `Budget.all_updates_rule`.
106
+ # @!attribute [rw] threshold_percent
107
+ # @return [::Float]
108
+ # Required. Send an alert when this threshold is exceeded.
109
+ # This is a 1.0-based percentage, so 0.5 = 50%.
110
+ # Validation: non-negative number.
111
+ # @!attribute [rw] spend_basis
112
+ # @return [::Google::Cloud::Billing::Budgets::V1::ThresholdRule::Basis]
113
+ # Optional. The type of basis used to determine if spend has passed the
114
+ # threshold. Behavior defaults to CURRENT_SPEND if not set.
115
+ class ThresholdRule
116
+ include ::Google::Protobuf::MessageExts
117
+ extend ::Google::Protobuf::MessageExts::ClassMethods
118
+
119
+ # The type of basis used to determine if spend has passed the threshold.
120
+ module Basis
121
+ # Unspecified threshold basis.
122
+ BASIS_UNSPECIFIED = 0
123
+
124
+ # Use current spend as the basis for comparison against the threshold.
125
+ CURRENT_SPEND = 1
126
+
127
+ # Use forecasted spend for the period as the basis for comparison against
128
+ # the threshold.
129
+ # FORECASTED_SPEND can only be set when the budget's time period is a
130
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#calendar_period Filter.calendar_period}.
131
+ # It cannot be set in combination with
132
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#custom_period Filter.custom_period}.
133
+ FORECASTED_SPEND = 2
134
+ end
135
+ end
136
+
137
+ # NotificationsRule defines notifications that are sent based on budget spend
138
+ # and thresholds.
139
+ # @!attribute [rw] pubsub_topic
140
+ # @return [::String]
141
+ # Optional. The name of the Pub/Sub topic where budget related messages will
142
+ # be published, in the form `projects/{project_id}/topics/{topic_id}`.
143
+ # Updates are sent at regular intervals to the topic. The topic needs to be
144
+ # created before the budget is created; see
145
+ # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
146
+ # for more details.
147
+ # Caller is expected to have
148
+ # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
149
+ # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
150
+ # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
151
+ # for more details on Pub/Sub roles and permissions.
152
+ # @!attribute [rw] schema_version
153
+ # @return [::String]
154
+ # Optional. Required when
155
+ # {::Google::Cloud::Billing::Budgets::V1::NotificationsRule#pubsub_topic NotificationsRule.pubsub_topic}
156
+ # is set. The schema version of the notification sent to
157
+ # {::Google::Cloud::Billing::Budgets::V1::NotificationsRule#pubsub_topic NotificationsRule.pubsub_topic}.
158
+ # Only "1.0" is accepted. It represents the JSON schema as defined in
159
+ # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
160
+ # @!attribute [rw] monitoring_notification_channels
161
+ # @return [::Array<::String>]
162
+ # Optional. Targets to send notifications to when a threshold is exceeded.
163
+ # This is in addition to default recipients who have billing account IAM
164
+ # roles. The value is the full REST resource name of a monitoring
165
+ # notification channel with the form
166
+ # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
167
+ # channels are allowed. See
168
+ # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
169
+ # for more details.
170
+ # @!attribute [rw] disable_default_iam_recipients
171
+ # @return [::Boolean]
172
+ # Optional. When set to true, disables default notifications sent when a
173
+ # threshold is exceeded. Default notifications are sent to those with Billing
174
+ # Account Administrator and Billing Account User IAM roles for the target
175
+ # account.
176
+ class NotificationsRule
177
+ include ::Google::Protobuf::MessageExts
178
+ extend ::Google::Protobuf::MessageExts::ClassMethods
179
+ end
180
+
181
+ # A filter for a budget, limiting the scope of the cost to calculate.
182
+ # @!attribute [rw] projects
183
+ # @return [::Array<::String>]
184
+ # Optional. A set of projects of the form `projects/{project}`,
185
+ # specifying that usage from only this set of projects should be
186
+ # included in the budget. If omitted, the report will include all usage for
187
+ # the billing account, regardless of which project the usage occurred on.
188
+ # Only zero or one project can be specified currently.
189
+ # @!attribute [rw] credit_types
190
+ # @return [::Array<::String>]
191
+ # Optional. If
192
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#credit_types_treatment Filter.credit_types_treatment}
193
+ # is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be
194
+ # subtracted from gross cost to determine the spend for threshold
195
+ # calculations. See [a list of acceptable credit type
196
+ # values](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
197
+ #
198
+ # If
199
+ # {::Google::Cloud::Billing::Budgets::V1::Filter#credit_types_treatment Filter.credit_types_treatment}
200
+ # is **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty.
201
+ # @!attribute [rw] credit_types_treatment
202
+ # @return [::Google::Cloud::Billing::Budgets::V1::Filter::CreditTypesTreatment]
203
+ # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
204
+ # @!attribute [rw] services
205
+ # @return [::Array<::String>]
206
+ # Optional. A set of services of the form `services/{service_id}`,
207
+ # specifying that usage from only this set of services should be
208
+ # included in the budget. If omitted, the report will include usage for
209
+ # all the services.
210
+ # The service names are available through the Catalog API:
211
+ # https://cloud.google.com/billing/v1/how-tos/catalog-api.
212
+ # @!attribute [rw] subaccounts
213
+ # @return [::Array<::String>]
214
+ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`,
215
+ # specifying that usage from only this set of subaccounts should be included
216
+ # in the budget. If a subaccount is set to the name of the parent account,
217
+ # usage from the parent account will be included. If the field is omitted,
218
+ # the report will include usage from the parent account and all subaccounts,
219
+ # if they exist.
220
+ # @!attribute [rw] labels
221
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::ListValue}]
222
+ # Optional. A single label and value pair specifying that usage from only
223
+ # this set of labeled resources should be included in the budget. Currently,
224
+ # multiple entries or multiple values per entry are not allowed. If omitted,
225
+ # the report will include all labeled and unlabeled usage.
226
+ # @!attribute [rw] calendar_period
227
+ # @return [::Google::Cloud::Billing::Budgets::V1::CalendarPeriod]
228
+ # Optional. Specifies to track usage for recurring calendar period.
229
+ # For example, assume that CalendarPeriod.QUARTER is set. The budget will
230
+ # track usage from April 1 to June 30, when the current calendar month is
231
+ # April, May, June. After that, it will track usage from July 1 to
232
+ # September 30 when the current calendar month is July, August, September,
233
+ # so on.
234
+ # @!attribute [rw] custom_period
235
+ # @return [::Google::Cloud::Billing::Budgets::V1::CustomPeriod]
236
+ # Optional. Specifies to track usage from any start date (required) to any
237
+ # end date (optional). This time period is static, it does not recur.
238
+ class Filter
239
+ include ::Google::Protobuf::MessageExts
240
+ extend ::Google::Protobuf::MessageExts::ClassMethods
241
+
242
+ # @!attribute [rw] key
243
+ # @return [::String]
244
+ # @!attribute [rw] value
245
+ # @return [::Google::Protobuf::ListValue]
246
+ class LabelsEntry
247
+ include ::Google::Protobuf::MessageExts
248
+ extend ::Google::Protobuf::MessageExts::ClassMethods
249
+ end
250
+
251
+ # Specifies how credits are applied when determining the spend for
252
+ # threshold calculations. Budgets track the total cost minus any applicable
253
+ # selected credits.
254
+ # [See the documentation for a list of credit
255
+ # types](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
256
+ module CreditTypesTreatment
257
+ CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0
258
+
259
+ # All types of credit are subtracted from the gross cost to determine the
260
+ # spend for threshold calculations.
261
+ INCLUDE_ALL_CREDITS = 1
262
+
263
+ # All types of credit are added to the net cost to determine the spend for
264
+ # threshold calculations.
265
+ EXCLUDE_ALL_CREDITS = 2
266
+
267
+ # [Credit
268
+ # types](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type)
269
+ # specified in the credit_types field are subtracted from the
270
+ # gross cost to determine the spend for threshold calculations.
271
+ INCLUDE_SPECIFIED_CREDITS = 3
272
+ end
273
+ end
274
+
275
+ # All date times begin at 12 AM US and Canadian Pacific Time (UTC-8).
276
+ # @!attribute [rw] start_date
277
+ # @return [::Google::Type::Date]
278
+ # Required. The start date must be after January 1, 2017.
279
+ # @!attribute [rw] end_date
280
+ # @return [::Google::Type::Date]
281
+ # Optional. The end date of the time period. Budgets with elapsed end date
282
+ # won't be processed. If unset, specifies to track all usage incurred since
283
+ # the start_date.
284
+ class CustomPeriod
285
+ include ::Google::Protobuf::MessageExts
286
+ extend ::Google::Protobuf::MessageExts::ClassMethods
287
+ end
288
+
289
+ # A `CalendarPeriod` represents the abstract concept of a time period that
290
+ # has a canonical start. Grammatically, "the start of the current
291
+ # `CalendarPeriod`". All calendar times begin at 12 AM US and Canadian
292
+ # Pacific Time (UTC-8).
293
+ module CalendarPeriod
294
+ CALENDAR_PERIOD_UNSPECIFIED = 0
295
+
296
+ # A month. Month starts on the first day of each month, such as January 1,
297
+ # February 1, March 1, and so on.
298
+ MONTH = 1
299
+
300
+ # A quarter. Quarters start on dates January 1, April 1, July 1, and October
301
+ # 1 of each year.
302
+ QUARTER = 2
303
+
304
+ # A year. Year starts on January 1.
305
+ YEAR = 3
306
+ end
307
+ end
308
+ end
309
+ end
310
+ end
311
+ end