/
billingbudgetsbudget_types.go
232 lines (184 loc) · 11 KB
/
billingbudgetsbudget_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
//
// ----------------------------------------------------------------------------
//
// This file is automatically generated by Config Connector and manual
// changes will be clobbered when the file is regenerated.
//
// ----------------------------------------------------------------------------
// *** DISCLAIMER ***
// Config Connector's go-client for CRDs is currently in ALPHA, which means
// that future versions of the go-client may include breaking changes.
// Please try it out and give us feedback!
package v1beta1
import (
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type BudgetAllUpdatesRule struct {
/* Optional. When set to true, disables default notifications sent when a threshold is exceeded. Default notifications are sent to those with Billing Account Administrator and Billing Account User IAM roles for the target account. */
// +optional
DisableDefaultIamRecipients *bool `json:"disableDefaultIamRecipients,omitempty"`
// +optional
MonitoringNotificationChannels []v1alpha1.ResourceRef `json:"monitoringNotificationChannels,omitempty"`
// +optional
PubsubTopicRef *v1alpha1.ResourceRef `json:"pubsubTopicRef,omitempty"`
/* Optional. Required when NotificationsRule.pubsub_topic is set. The schema version of the notification sent to NotificationsRule.pubsub_topic. Only "1.0" is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format. */
// +optional
SchemaVersion *string `json:"schemaVersion,omitempty"`
}
type BudgetAmount struct {
/* Use the last period's actual spend as the budget for the present period. LastPeriodAmount can only be set when the budget's time period is a . */
// +optional
LastPeriodAmount *BudgetLastPeriodAmount `json:"lastPeriodAmount,omitempty"`
/* A specified amount to use as the budget. `currency_code` is optional. If specified when creating a budget, it must match the currency of the billing account. If specified when updating a budget, it must match the currency_code of the existing budget. The `currency_code` is provided on output. */
// +optional
SpecifiedAmount *BudgetSpecifiedAmount `json:"specifiedAmount,omitempty"`
}
type BudgetBudgetFilter struct {
/* Optional. Specifies to track usage for recurring calendar period. For example, assume that CalendarPeriod.QUARTER is set. The budget will track usage from April 1 to June 30, when the current calendar month is April, May, June. After that, it will track usage from July 1 to September 30 when the current calendar month is July, August, September, so on. Possible values: CALENDAR_PERIOD_UNSPECIFIED, MONTH, QUARTER, YEAR */
// +optional
CalendarPeriod *string `json:"calendarPeriod,omitempty"`
/* Optional. If Filter.credit_types_treatment is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be subtracted from gross cost to determine the spend for threshold calculations. See a list of acceptable credit type values. If Filter.credit_types_treatment is not INCLUDE_SPECIFIED_CREDITS, this field must be empty. */
// +optional
CreditTypes []string `json:"creditTypes,omitempty"`
/* Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. */
// +optional
CreditTypesTreatment *string `json:"creditTypesTreatment,omitempty"`
/* Optional. Specifies to track usage from any start date (required) to any end date (optional). This time period is static, it does not recur. */
// +optional
CustomPeriod *BudgetCustomPeriod `json:"customPeriod,omitempty"`
/* Optional. A single label and value pair specifying that usage from only this set of labeled resources should be included in the budget. Currently, multiple entries or multiple values per entry are not allowed. If omitted, the report will include all labeled and unlabeled usage. */
// +optional
Labels map[string]BudgetLabels `json:"labels,omitempty"`
// +optional
Projects []v1alpha1.ResourceRef `json:"projects,omitempty"`
/* Optional. A set of services of the form `services/{service_id}`, specifying that usage from only this set of services should be included in the budget. If omitted, the report will include usage for all the services. The service names are available through the Catalog API: https://cloud.google.com/billing/v1/how-tos/catalog-api. */
// +optional
Services []string `json:"services,omitempty"`
// +optional
Subaccounts []v1alpha1.ResourceRef `json:"subaccounts,omitempty"`
}
type BudgetCustomPeriod struct {
/* Immutable. Optional. The end date of the time period. Budgets with elapsed end date won't be processed. If unset, specifies to track all usage incurred since the start_date. */
// +optional
EndDate *BudgetEndDate `json:"endDate,omitempty"`
/* Immutable. Required. The start date must be after January 1, 2017. */
StartDate BudgetStartDate `json:"startDate"`
}
type BudgetEndDate struct {
/* Immutable. Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */
// +optional
Day *int `json:"day,omitempty"`
/* Immutable. Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */
// +optional
Month *int `json:"month,omitempty"`
/* Immutable. Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */
// +optional
Year *int `json:"year,omitempty"`
}
type BudgetLabels struct {
/* Immutable. The values of the label */
// +optional
Values []string `json:"values,omitempty"`
}
type BudgetLastPeriodAmount struct {
}
type BudgetSpecifiedAmount struct {
/* Immutable. The three-letter currency code defined in ISO 4217. */
// +optional
CurrencyCode *string `json:"currencyCode,omitempty"`
/* Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. */
// +optional
Nanos *int `json:"nanos,omitempty"`
/* The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. */
// +optional
Units *int `json:"units,omitempty"`
}
type BudgetStartDate struct {
/* Immutable. Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */
// +optional
Day *int `json:"day,omitempty"`
/* Immutable. Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */
// +optional
Month *int `json:"month,omitempty"`
/* Immutable. Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */
// +optional
Year *int `json:"year,omitempty"`
}
type BudgetThresholdRules struct {
/* Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set. Possible values: BASIS_UNSPECIFIED, CURRENT_SPEND, FORECASTED_SPEND */
// +optional
SpendBasis *string `json:"spendBasis,omitempty"`
/* Required. Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Validation: non-negative number. */
ThresholdPercent float64 `json:"thresholdPercent"`
}
type BillingBudgetsBudgetSpec struct {
/* Optional. Rules to apply to notifications sent based on budget spend and thresholds. */
// +optional
AllUpdatesRule *BudgetAllUpdatesRule `json:"allUpdatesRule,omitempty"`
/* Required. Budgeted amount. */
Amount BudgetAmount `json:"amount"`
/* Immutable. */
BillingAccountRef v1alpha1.ResourceRef `json:"billingAccountRef"`
/* Optional. Filters that define which resources are used to compute the actual spend against the budget amount, such as projects, services, and the budget's time period, as well as other filters. */
// +optional
BudgetFilter *BudgetBudgetFilter `json:"budgetFilter,omitempty"`
/* User data for display name in UI. The name must be less than or equal to 60 characters. */
// +optional
DisplayName *string `json:"displayName,omitempty"`
/* Immutable. Optional. The service-generated name of the resource. Used for acquisition only. Leave unset to create a new resource. */
// +optional
ResourceID *string `json:"resourceID,omitempty"`
/* Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. */
// +optional
ThresholdRules []BudgetThresholdRules `json:"thresholdRules,omitempty"`
}
type BillingBudgetsBudgetStatus struct {
/* Conditions represent the latest available observations of the
BillingBudgetsBudget's current state. */
Conditions []v1alpha1.Condition `json:"conditions,omitempty"`
/* Optional. Etag to validate that the object is unchanged for a read-modify-write operation. An empty etag will cause an update to overwrite other changes. */
// +optional
Etag *string `json:"etag,omitempty"`
/* ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. */
// +optional
ObservedGeneration *int `json:"observedGeneration,omitempty"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:categories=gcp,shortName=gcpbillingbudgetsbudget;gcpbillingbudgetsbudgets
// +kubebuilder:subresource:status
// BillingBudgetsBudget is the Schema for the billingbudgets API
// +k8s:openapi-gen=true
type BillingBudgetsBudget struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec BillingBudgetsBudgetSpec `json:"spec,omitempty"`
Status BillingBudgetsBudgetStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// BillingBudgetsBudgetList contains a list of BillingBudgetsBudget
type BillingBudgetsBudgetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []BillingBudgetsBudget `json:"items"`
}
func init() {
SchemeBuilder.Register(&BillingBudgetsBudget{}, &BillingBudgetsBudgetList{})
}