Documentation
¶
Overview ¶
Copyright 2026 Google LLC. All Rights Reserved.
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. Package billingbudgets defines functions and types for handling billingbudgets GCP resources.
Copyright 2026 Google LLC. All Rights Reserved.
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.
Copyright 2026 Google LLC. All Rights Reserved.
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.
Copyright 2026 Google LLC. All Rights Reserved.
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.
Copyright 2026 Google LLC. All Rights Reserved.
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.
Copyright 2026 Google LLC. All Rights Reserved.
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. Package beta defines operations in the declarative SDK.
Index ¶
- Constants
- Variables
- func DCLBudgetSchema() *dcl.Schema
- type Budget
- type BudgetAllUpdatesRule
- type BudgetAmount
- type BudgetAmountLastPeriodAmount
- type BudgetAmountSpecifiedAmount
- type BudgetBudgetFilter
- type BudgetBudgetFilterCalendarPeriodEnum
- type BudgetBudgetFilterCreditTypesTreatmentEnum
- type BudgetBudgetFilterCustomPeriod
- type BudgetBudgetFilterCustomPeriodEndDate
- type BudgetBudgetFilterCustomPeriodStartDate
- type BudgetBudgetFilterLabels
- type BudgetList
- type BudgetThresholdRules
- type BudgetThresholdRulesSpendBasisEnum
- type Client
- func (c *Client) ApplyBudget(ctx context.Context, rawDesired *Budget, opts ...dcl.ApplyOption) (*Budget, error)
- func (c *Client) DeleteAllBudget(ctx context.Context, billingAccount string, filter func(*Budget) bool) error
- func (c *Client) DeleteBudget(ctx context.Context, r *Budget) error
- func (c *Client) GetBudget(ctx context.Context, r *Budget) (*Budget, error)
- func (c *Client) ListBudget(ctx context.Context, billingAccount string) (*BudgetList, error)
- func (c *Client) ListBudgetWithMaxResults(ctx context.Context, billingAccount string, pageSize int32) (*BudgetList, error)
Constants ¶
const BudgetMaxPage = -1
Variables ¶
var YAML_budget []byte
Functions ¶
func DCLBudgetSchema ¶ added in v1.10.3
Types ¶
type Budget ¶
type Budget struct {
Name *string `json:"name"`
DisplayName *string `json:"displayName"`
BudgetFilter *BudgetBudgetFilter `json:"budgetFilter"`
Amount *BudgetAmount `json:"amount"`
ThresholdRules []BudgetThresholdRules `json:"thresholdRules"`
Etag *string `json:"etag"`
AllUpdatesRule *BudgetAllUpdatesRule `json:"allUpdatesRule"`
BillingAccount *string `json:"billingAccount"`
}
func (*Budget) Describe ¶
func (r *Budget) Describe() dcl.ServiceTypeVersion
Describe returns a simple description of this resource to ensure that automated tools can identify it.
type BudgetAllUpdatesRule ¶
type BudgetAllUpdatesRule struct {
PubsubTopic *string `json:"pubsubTopic"`
SchemaVersion *string `json:"schemaVersion"`
MonitoringNotificationChannels []string `json:"monitoringNotificationChannels"`
DisableDefaultIamRecipients *bool `json:"disableDefaultIamRecipients"`
// contains filtered or unexported fields
}
var EmptyBudgetAllUpdatesRule *BudgetAllUpdatesRule = &BudgetAllUpdatesRule{empty: true}
This object is used to assert a desired state where this BudgetAllUpdatesRule is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetAllUpdatesRule) Empty ¶
func (r *BudgetAllUpdatesRule) Empty() bool
func (*BudgetAllUpdatesRule) HashCode ¶
func (r *BudgetAllUpdatesRule) HashCode() string
func (*BudgetAllUpdatesRule) String ¶
func (r *BudgetAllUpdatesRule) String() string
func (*BudgetAllUpdatesRule) UnmarshalJSON ¶
func (r *BudgetAllUpdatesRule) UnmarshalJSON(data []byte) error
type BudgetAmount ¶
type BudgetAmount struct {
SpecifiedAmount *BudgetAmountSpecifiedAmount `json:"specifiedAmount"`
LastPeriodAmount *BudgetAmountLastPeriodAmount `json:"lastPeriodAmount"`
// contains filtered or unexported fields
}
var EmptyBudgetAmount *BudgetAmount = &BudgetAmount{empty: true}
This object is used to assert a desired state where this BudgetAmount is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetAmount) Empty ¶
func (r *BudgetAmount) Empty() bool
func (*BudgetAmount) HashCode ¶
func (r *BudgetAmount) HashCode() string
func (*BudgetAmount) String ¶
func (r *BudgetAmount) String() string
func (*BudgetAmount) UnmarshalJSON ¶
func (r *BudgetAmount) UnmarshalJSON(data []byte) error
type BudgetAmountLastPeriodAmount ¶
type BudgetAmountLastPeriodAmount struct {
// contains filtered or unexported fields
}
var EmptyBudgetAmountLastPeriodAmount *BudgetAmountLastPeriodAmount = &BudgetAmountLastPeriodAmount{empty: true}
This object is used to assert a desired state where this BudgetAmountLastPeriodAmount is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetAmountLastPeriodAmount) Empty ¶
func (r *BudgetAmountLastPeriodAmount) Empty() bool
func (*BudgetAmountLastPeriodAmount) HashCode ¶
func (r *BudgetAmountLastPeriodAmount) HashCode() string
func (*BudgetAmountLastPeriodAmount) String ¶
func (r *BudgetAmountLastPeriodAmount) String() string
func (*BudgetAmountLastPeriodAmount) UnmarshalJSON ¶
func (r *BudgetAmountLastPeriodAmount) UnmarshalJSON(data []byte) error
type BudgetAmountSpecifiedAmount ¶
type BudgetAmountSpecifiedAmount struct {
CurrencyCode *string `json:"currencyCode"`
Units *int64 `json:"units"`
Nanos *int64 `json:"nanos"`
// contains filtered or unexported fields
}
var EmptyBudgetAmountSpecifiedAmount *BudgetAmountSpecifiedAmount = &BudgetAmountSpecifiedAmount{empty: true}
This object is used to assert a desired state where this BudgetAmountSpecifiedAmount is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetAmountSpecifiedAmount) Empty ¶
func (r *BudgetAmountSpecifiedAmount) Empty() bool
func (*BudgetAmountSpecifiedAmount) HashCode ¶
func (r *BudgetAmountSpecifiedAmount) HashCode() string
func (*BudgetAmountSpecifiedAmount) String ¶
func (r *BudgetAmountSpecifiedAmount) String() string
func (*BudgetAmountSpecifiedAmount) UnmarshalJSON ¶
func (r *BudgetAmountSpecifiedAmount) UnmarshalJSON(data []byte) error
type BudgetBudgetFilter ¶
type BudgetBudgetFilter struct {
Projects []string `json:"projects"`
CreditTypes []string `json:"creditTypes"`
CreditTypesTreatment *BudgetBudgetFilterCreditTypesTreatmentEnum `json:"creditTypesTreatment"`
Services []string `json:"services"`
Subaccounts []string `json:"subaccounts"`
Labels map[string]BudgetBudgetFilterLabels `json:"labels"`
CalendarPeriod *BudgetBudgetFilterCalendarPeriodEnum `json:"calendarPeriod"`
CustomPeriod *BudgetBudgetFilterCustomPeriod `json:"customPeriod"`
// contains filtered or unexported fields
}
var EmptyBudgetBudgetFilter *BudgetBudgetFilter = &BudgetBudgetFilter{empty: true}
This object is used to assert a desired state where this BudgetBudgetFilter is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetBudgetFilter) Empty ¶
func (r *BudgetBudgetFilter) Empty() bool
func (*BudgetBudgetFilter) HashCode ¶
func (r *BudgetBudgetFilter) HashCode() string
func (*BudgetBudgetFilter) String ¶
func (r *BudgetBudgetFilter) String() string
func (*BudgetBudgetFilter) UnmarshalJSON ¶
func (r *BudgetBudgetFilter) UnmarshalJSON(data []byte) error
type BudgetBudgetFilterCalendarPeriodEnum ¶
type BudgetBudgetFilterCalendarPeriodEnum string
The enum BudgetBudgetFilterCalendarPeriodEnum.
func BudgetBudgetFilterCalendarPeriodEnumRef ¶
func BudgetBudgetFilterCalendarPeriodEnumRef(s string) *BudgetBudgetFilterCalendarPeriodEnum
BudgetBudgetFilterCalendarPeriodEnumRef returns a *BudgetBudgetFilterCalendarPeriodEnum with the value of string s If the empty string is provided, nil is returned.
func (BudgetBudgetFilterCalendarPeriodEnum) Validate ¶
func (v BudgetBudgetFilterCalendarPeriodEnum) Validate() error
type BudgetBudgetFilterCreditTypesTreatmentEnum ¶
type BudgetBudgetFilterCreditTypesTreatmentEnum string
The enum BudgetBudgetFilterCreditTypesTreatmentEnum.
func BudgetBudgetFilterCreditTypesTreatmentEnumRef ¶
func BudgetBudgetFilterCreditTypesTreatmentEnumRef(s string) *BudgetBudgetFilterCreditTypesTreatmentEnum
BudgetBudgetFilterCreditTypesTreatmentEnumRef returns a *BudgetBudgetFilterCreditTypesTreatmentEnum with the value of string s If the empty string is provided, nil is returned.
func (BudgetBudgetFilterCreditTypesTreatmentEnum) Validate ¶
func (v BudgetBudgetFilterCreditTypesTreatmentEnum) Validate() error
type BudgetBudgetFilterCustomPeriod ¶
type BudgetBudgetFilterCustomPeriod struct {
StartDate *BudgetBudgetFilterCustomPeriodStartDate `json:"startDate"`
EndDate *BudgetBudgetFilterCustomPeriodEndDate `json:"endDate"`
// contains filtered or unexported fields
}
var EmptyBudgetBudgetFilterCustomPeriod *BudgetBudgetFilterCustomPeriod = &BudgetBudgetFilterCustomPeriod{empty: true}
This object is used to assert a desired state where this BudgetBudgetFilterCustomPeriod is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetBudgetFilterCustomPeriod) Empty ¶
func (r *BudgetBudgetFilterCustomPeriod) Empty() bool
func (*BudgetBudgetFilterCustomPeriod) HashCode ¶
func (r *BudgetBudgetFilterCustomPeriod) HashCode() string
func (*BudgetBudgetFilterCustomPeriod) String ¶
func (r *BudgetBudgetFilterCustomPeriod) String() string
func (*BudgetBudgetFilterCustomPeriod) UnmarshalJSON ¶
func (r *BudgetBudgetFilterCustomPeriod) UnmarshalJSON(data []byte) error
type BudgetBudgetFilterCustomPeriodEndDate ¶
type BudgetBudgetFilterCustomPeriodEndDate struct {
Year *int64 `json:"year"`
Month *int64 `json:"month"`
Day *int64 `json:"day"`
// contains filtered or unexported fields
}
var EmptyBudgetBudgetFilterCustomPeriodEndDate *BudgetBudgetFilterCustomPeriodEndDate = &BudgetBudgetFilterCustomPeriodEndDate{empty: true}
This object is used to assert a desired state where this BudgetBudgetFilterCustomPeriodEndDate is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetBudgetFilterCustomPeriodEndDate) Empty ¶
func (r *BudgetBudgetFilterCustomPeriodEndDate) Empty() bool
func (*BudgetBudgetFilterCustomPeriodEndDate) HashCode ¶
func (r *BudgetBudgetFilterCustomPeriodEndDate) HashCode() string
func (*BudgetBudgetFilterCustomPeriodEndDate) String ¶
func (r *BudgetBudgetFilterCustomPeriodEndDate) String() string
func (*BudgetBudgetFilterCustomPeriodEndDate) UnmarshalJSON ¶
func (r *BudgetBudgetFilterCustomPeriodEndDate) UnmarshalJSON(data []byte) error
type BudgetBudgetFilterCustomPeriodStartDate ¶
type BudgetBudgetFilterCustomPeriodStartDate struct {
Year *int64 `json:"year"`
Month *int64 `json:"month"`
Day *int64 `json:"day"`
// contains filtered or unexported fields
}
var EmptyBudgetBudgetFilterCustomPeriodStartDate *BudgetBudgetFilterCustomPeriodStartDate = &BudgetBudgetFilterCustomPeriodStartDate{empty: true}
This object is used to assert a desired state where this BudgetBudgetFilterCustomPeriodStartDate is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetBudgetFilterCustomPeriodStartDate) Empty ¶
func (r *BudgetBudgetFilterCustomPeriodStartDate) Empty() bool
func (*BudgetBudgetFilterCustomPeriodStartDate) HashCode ¶
func (r *BudgetBudgetFilterCustomPeriodStartDate) HashCode() string
func (*BudgetBudgetFilterCustomPeriodStartDate) String ¶
func (r *BudgetBudgetFilterCustomPeriodStartDate) String() string
func (*BudgetBudgetFilterCustomPeriodStartDate) UnmarshalJSON ¶
func (r *BudgetBudgetFilterCustomPeriodStartDate) UnmarshalJSON(data []byte) error
type BudgetBudgetFilterLabels ¶
type BudgetBudgetFilterLabels struct {
Values []string `json:"values"`
// contains filtered or unexported fields
}
var EmptyBudgetBudgetFilterLabels *BudgetBudgetFilterLabels = &BudgetBudgetFilterLabels{empty: true}
This object is used to assert a desired state where this BudgetBudgetFilterLabels is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetBudgetFilterLabels) Empty ¶
func (r *BudgetBudgetFilterLabels) Empty() bool
func (*BudgetBudgetFilterLabels) HashCode ¶
func (r *BudgetBudgetFilterLabels) HashCode() string
func (*BudgetBudgetFilterLabels) String ¶
func (r *BudgetBudgetFilterLabels) String() string
func (*BudgetBudgetFilterLabels) UnmarshalJSON ¶
func (r *BudgetBudgetFilterLabels) UnmarshalJSON(data []byte) error
type BudgetList ¶
type BudgetList struct {
Items []*Budget
// contains filtered or unexported fields
}
func (*BudgetList) HasNext ¶
func (l *BudgetList) HasNext() bool
type BudgetThresholdRules ¶
type BudgetThresholdRules struct {
ThresholdPercent *float64 `json:"thresholdPercent"`
SpendBasis *BudgetThresholdRulesSpendBasisEnum `json:"spendBasis"`
// contains filtered or unexported fields
}
var EmptyBudgetThresholdRules *BudgetThresholdRules = &BudgetThresholdRules{empty: true}
This object is used to assert a desired state where this BudgetThresholdRules is empty. Go lacks global const objects, but this object should be treated as one. Modifying this object will have undesirable results.
func (*BudgetThresholdRules) Empty ¶
func (r *BudgetThresholdRules) Empty() bool
func (*BudgetThresholdRules) HashCode ¶
func (r *BudgetThresholdRules) HashCode() string
func (*BudgetThresholdRules) String ¶
func (r *BudgetThresholdRules) String() string
func (*BudgetThresholdRules) UnmarshalJSON ¶
func (r *BudgetThresholdRules) UnmarshalJSON(data []byte) error
type BudgetThresholdRulesSpendBasisEnum ¶
type BudgetThresholdRulesSpendBasisEnum string
The enum BudgetThresholdRulesSpendBasisEnum.
func BudgetThresholdRulesSpendBasisEnumRef ¶
func BudgetThresholdRulesSpendBasisEnumRef(s string) *BudgetThresholdRulesSpendBasisEnum
BudgetThresholdRulesSpendBasisEnumRef returns a *BudgetThresholdRulesSpendBasisEnum with the value of string s If the empty string is provided, nil is returned.
func (BudgetThresholdRulesSpendBasisEnum) Validate ¶
func (v BudgetThresholdRulesSpendBasisEnum) Validate() error
type Client ¶
The Client is the base struct of all operations. This will receive the Get, Delete, List, and Apply operations on all resources.
func (*Client) ApplyBudget ¶
func (*Client) DeleteAllBudget ¶
func (c *Client) DeleteAllBudget(ctx context.Context, billingAccount string, filter func(*Budget) bool) error
DeleteAllBudget deletes all resources that the filter functions returns true on.