Documentation ¶
Index ¶
- Variables
- func RegisterBudgetServiceServer(s *grpc.Server, srv BudgetServiceServer)
- type AllUpdatesRule
- func (*AllUpdatesRule) Descriptor() ([]byte, []int)deprecated
- func (x *AllUpdatesRule) GetDisableDefaultIamRecipients() bool
- func (x *AllUpdatesRule) GetEnableProjectLevelRecipients() bool
- func (x *AllUpdatesRule) GetMonitoringNotificationChannels() []string
- func (x *AllUpdatesRule) GetPubsubTopic() string
- func (x *AllUpdatesRule) GetSchemaVersion() string
- func (*AllUpdatesRule) ProtoMessage()
- func (x *AllUpdatesRule) ProtoReflect() protoreflect.Message
- func (x *AllUpdatesRule) Reset()
- func (x *AllUpdatesRule) String() string
- type Budget
- func (*Budget) Descriptor() ([]byte, []int)deprecated
- func (x *Budget) GetAllUpdatesRule() *AllUpdatesRule
- func (x *Budget) GetAmount() *BudgetAmount
- func (x *Budget) GetBudgetFilter() *Filter
- func (x *Budget) GetDisplayName() string
- func (x *Budget) GetEtag() string
- func (x *Budget) GetName() string
- func (x *Budget) GetThresholdRules() []*ThresholdRule
- func (*Budget) ProtoMessage()
- func (x *Budget) ProtoReflect() protoreflect.Message
- func (x *Budget) Reset()
- func (x *Budget) String() string
- type BudgetAmount
- func (*BudgetAmount) Descriptor() ([]byte, []int)deprecated
- func (m *BudgetAmount) GetBudgetAmount() isBudgetAmount_BudgetAmount
- func (x *BudgetAmount) GetLastPeriodAmount() *LastPeriodAmount
- func (x *BudgetAmount) GetSpecifiedAmount() *money.Money
- func (*BudgetAmount) ProtoMessage()
- func (x *BudgetAmount) ProtoReflect() protoreflect.Message
- func (x *BudgetAmount) Reset()
- func (x *BudgetAmount) String() string
- type BudgetAmount_LastPeriodAmount
- type BudgetAmount_SpecifiedAmount
- type BudgetServiceClient
- type BudgetServiceServer
- type CalendarPeriod
- func (CalendarPeriod) Descriptor() protoreflect.EnumDescriptor
- func (x CalendarPeriod) Enum() *CalendarPeriod
- func (CalendarPeriod) EnumDescriptor() ([]byte, []int)deprecated
- func (x CalendarPeriod) Number() protoreflect.EnumNumber
- func (x CalendarPeriod) String() string
- func (CalendarPeriod) Type() protoreflect.EnumType
- type CreateBudgetRequest
- func (*CreateBudgetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateBudgetRequest) GetBudget() *Budget
- func (x *CreateBudgetRequest) GetParent() string
- func (*CreateBudgetRequest) ProtoMessage()
- func (x *CreateBudgetRequest) ProtoReflect() protoreflect.Message
- func (x *CreateBudgetRequest) Reset()
- func (x *CreateBudgetRequest) String() string
- type CustomPeriod
- func (*CustomPeriod) Descriptor() ([]byte, []int)deprecated
- func (x *CustomPeriod) GetEndDate() *date.Date
- func (x *CustomPeriod) GetStartDate() *date.Date
- func (*CustomPeriod) ProtoMessage()
- func (x *CustomPeriod) ProtoReflect() protoreflect.Message
- func (x *CustomPeriod) Reset()
- func (x *CustomPeriod) String() string
- type DeleteBudgetRequest
- func (*DeleteBudgetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteBudgetRequest) GetName() string
- func (*DeleteBudgetRequest) ProtoMessage()
- func (x *DeleteBudgetRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteBudgetRequest) Reset()
- func (x *DeleteBudgetRequest) String() string
- type Filter
- func (*Filter) Descriptor() ([]byte, []int)deprecated
- func (x *Filter) GetCalendarPeriod() CalendarPeriod
- func (x *Filter) GetCreditTypes() []string
- func (x *Filter) GetCreditTypesTreatment() Filter_CreditTypesTreatment
- func (x *Filter) GetCustomPeriod() *CustomPeriod
- func (x *Filter) GetLabels() map[string]*structpb.ListValue
- func (x *Filter) GetProjects() []string
- func (x *Filter) GetResourceAncestors() []string
- func (x *Filter) GetServices() []string
- func (x *Filter) GetSubaccounts() []string
- func (m *Filter) GetUsagePeriod() isFilter_UsagePeriod
- func (*Filter) ProtoMessage()
- func (x *Filter) ProtoReflect() protoreflect.Message
- func (x *Filter) Reset()
- func (x *Filter) String() string
- type Filter_CalendarPeriod
- type Filter_CreditTypesTreatment
- func (Filter_CreditTypesTreatment) Descriptor() protoreflect.EnumDescriptor
- func (x Filter_CreditTypesTreatment) Enum() *Filter_CreditTypesTreatment
- func (Filter_CreditTypesTreatment) EnumDescriptor() ([]byte, []int)deprecated
- func (x Filter_CreditTypesTreatment) Number() protoreflect.EnumNumber
- func (x Filter_CreditTypesTreatment) String() string
- func (Filter_CreditTypesTreatment) Type() protoreflect.EnumType
- type Filter_CustomPeriod
- type GetBudgetRequest
- type LastPeriodAmount
- type ListBudgetsRequest
- func (*ListBudgetsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListBudgetsRequest) GetPageSize() int32
- func (x *ListBudgetsRequest) GetPageToken() string
- func (x *ListBudgetsRequest) GetParent() string
- func (x *ListBudgetsRequest) GetScope() string
- func (*ListBudgetsRequest) ProtoMessage()
- func (x *ListBudgetsRequest) ProtoReflect() protoreflect.Message
- func (x *ListBudgetsRequest) Reset()
- func (x *ListBudgetsRequest) String() string
- type ListBudgetsResponse
- func (*ListBudgetsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListBudgetsResponse) GetBudgets() []*Budget
- func (x *ListBudgetsResponse) GetNextPageToken() string
- func (*ListBudgetsResponse) ProtoMessage()
- func (x *ListBudgetsResponse) ProtoReflect() protoreflect.Message
- func (x *ListBudgetsResponse) Reset()
- func (x *ListBudgetsResponse) String() string
- type ThresholdRule
- func (*ThresholdRule) Descriptor() ([]byte, []int)deprecated
- func (x *ThresholdRule) GetSpendBasis() ThresholdRule_Basis
- func (x *ThresholdRule) GetThresholdPercent() float64
- func (*ThresholdRule) ProtoMessage()
- func (x *ThresholdRule) ProtoReflect() protoreflect.Message
- func (x *ThresholdRule) Reset()
- func (x *ThresholdRule) String() string
- type ThresholdRule_Basis
- func (ThresholdRule_Basis) Descriptor() protoreflect.EnumDescriptor
- func (x ThresholdRule_Basis) Enum() *ThresholdRule_Basis
- func (ThresholdRule_Basis) EnumDescriptor() ([]byte, []int)deprecated
- func (x ThresholdRule_Basis) Number() protoreflect.EnumNumber
- func (x ThresholdRule_Basis) String() string
- func (ThresholdRule_Basis) Type() protoreflect.EnumType
- type UnimplementedBudgetServiceServer
- func (*UnimplementedBudgetServiceServer) CreateBudget(context.Context, *CreateBudgetRequest) (*Budget, error)
- func (*UnimplementedBudgetServiceServer) DeleteBudget(context.Context, *DeleteBudgetRequest) (*emptypb.Empty, error)
- func (*UnimplementedBudgetServiceServer) GetBudget(context.Context, *GetBudgetRequest) (*Budget, error)
- func (*UnimplementedBudgetServiceServer) ListBudgets(context.Context, *ListBudgetsRequest) (*ListBudgetsResponse, error)
- func (*UnimplementedBudgetServiceServer) UpdateBudget(context.Context, *UpdateBudgetRequest) (*Budget, error)
- type UpdateBudgetRequest
- func (*UpdateBudgetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateBudgetRequest) GetBudget() *Budget
- func (x *UpdateBudgetRequest) GetUpdateMask() *fieldmaskpb.FieldMask
- func (*UpdateBudgetRequest) ProtoMessage()
- func (x *UpdateBudgetRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateBudgetRequest) Reset()
- func (x *UpdateBudgetRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var ( CalendarPeriod_name = map[int32]string{ 0: "CALENDAR_PERIOD_UNSPECIFIED", 1: "MONTH", 2: "QUARTER", 3: "YEAR", } CalendarPeriod_value = map[string]int32{ "CALENDAR_PERIOD_UNSPECIFIED": 0, "MONTH": 1, "QUARTER": 2, "YEAR": 3, } )
Enum value maps for CalendarPeriod.
var ( ThresholdRule_Basis_name = map[int32]string{ 0: "BASIS_UNSPECIFIED", 1: "CURRENT_SPEND", 2: "FORECASTED_SPEND", } ThresholdRule_Basis_value = map[string]int32{ "BASIS_UNSPECIFIED": 0, "CURRENT_SPEND": 1, "FORECASTED_SPEND": 2, } )
Enum value maps for ThresholdRule_Basis.
var ( Filter_CreditTypesTreatment_name = map[int32]string{ 0: "CREDIT_TYPES_TREATMENT_UNSPECIFIED", 1: "INCLUDE_ALL_CREDITS", 2: "EXCLUDE_ALL_CREDITS", 3: "INCLUDE_SPECIFIED_CREDITS", } Filter_CreditTypesTreatment_value = map[string]int32{ "CREDIT_TYPES_TREATMENT_UNSPECIFIED": 0, "INCLUDE_ALL_CREDITS": 1, "EXCLUDE_ALL_CREDITS": 2, "INCLUDE_SPECIFIED_CREDITS": 3, } )
Enum value maps for Filter_CreditTypesTreatment.
var File_google_cloud_billing_budgets_v1beta1_budget_model_proto protoreflect.FileDescriptor
var File_google_cloud_billing_budgets_v1beta1_budget_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBudgetServiceServer ¶
func RegisterBudgetServiceServer(s *grpc.Server, srv BudgetServiceServer)
Types ¶
type AllUpdatesRule ¶
type AllUpdatesRule struct { // Optional. The name of the Pub/Sub topic where budget related messages will // be published, in the form `projects/{project_id}/topics/{topic_id}`. // Updates are sent at regular intervals to the topic. The topic needs to be // created before the budget is created; see // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications // for more details. // Caller is expected to have // `pubsub.topics.setIamPolicy` permission on the topic when it's set for a // budget, otherwise, the API call will fail with PERMISSION_DENIED. See // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#permissions_required_for_this_task // for more details on Pub/Sub roles and permissions. PubsubTopic string `protobuf:"bytes,1,opt,name=pubsub_topic,json=pubsubTopic,proto3" json:"pubsub_topic,omitempty"` // Optional. Required when // [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic] // is set. The schema version of the notification sent to // [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.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. SchemaVersion string `protobuf:"bytes,2,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"` // Optional. Targets to send notifications to when a threshold is exceeded. // This is in addition to default recipients who have billing account IAM // roles. The value is the full REST resource name of a monitoring // notification channel with the form // `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 // channels are allowed. See // https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients // for more details. MonitoringNotificationChannels []string `` /* 153-byte string literal not displayed */ // 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. DisableDefaultIamRecipients bool `` /* 147-byte string literal not displayed */ // Optional. When set to true, and when the budget has a single project // configured, notifications will be sent to project level recipients of that // project. This field will be ignored if the budget has multiple or no // project configured. // // Currently, project level recipients are the users with `Owner` role on a // cloud project. EnableProjectLevelRecipients bool `` /* 150-byte string literal not displayed */ // contains filtered or unexported fields }
AllUpdatesRule defines notifications that are sent based on budget spend and thresholds.
func (*AllUpdatesRule) Descriptor
deprecated
func (*AllUpdatesRule) Descriptor() ([]byte, []int)
Deprecated: Use AllUpdatesRule.ProtoReflect.Descriptor instead.
func (*AllUpdatesRule) GetDisableDefaultIamRecipients ¶
func (x *AllUpdatesRule) GetDisableDefaultIamRecipients() bool
func (*AllUpdatesRule) GetEnableProjectLevelRecipients ¶ added in v1.17.0
func (x *AllUpdatesRule) GetEnableProjectLevelRecipients() bool
func (*AllUpdatesRule) GetMonitoringNotificationChannels ¶
func (x *AllUpdatesRule) GetMonitoringNotificationChannels() []string
func (*AllUpdatesRule) GetPubsubTopic ¶
func (x *AllUpdatesRule) GetPubsubTopic() string
func (*AllUpdatesRule) GetSchemaVersion ¶
func (x *AllUpdatesRule) GetSchemaVersion() string
func (*AllUpdatesRule) ProtoMessage ¶
func (*AllUpdatesRule) ProtoMessage()
func (*AllUpdatesRule) ProtoReflect ¶
func (x *AllUpdatesRule) ProtoReflect() protoreflect.Message
func (*AllUpdatesRule) Reset ¶
func (x *AllUpdatesRule) Reset()
func (*AllUpdatesRule) String ¶
func (x *AllUpdatesRule) String() string
type Budget ¶
type Budget struct { // Output only. Resource name of the budget. // The resource name implies the scope of a budget. Values are of the form // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // User data for display name in UI. // Validation: <= 60 chars. DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // 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. BudgetFilter *Filter `protobuf:"bytes,3,opt,name=budget_filter,json=budgetFilter,proto3" json:"budget_filter,omitempty"` // Required. Budgeted amount. Amount *BudgetAmount `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` // Optional. Rules that trigger alerts (notifications of thresholds // being crossed) when spend exceeds the specified percentages of the budget. // // Optional for `pubsubTopic` notifications. // // Required if using email notifications. ThresholdRules []*ThresholdRule `protobuf:"bytes,5,rep,name=threshold_rules,json=thresholdRules,proto3" json:"threshold_rules,omitempty"` // Optional. Rules to apply to notifications sent based on budget spend and // thresholds. AllUpdatesRule *AllUpdatesRule `protobuf:"bytes,6,opt,name=all_updates_rule,json=allUpdatesRule,proto3" json:"all_updates_rule,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. Etag string `protobuf:"bytes,7,opt,name=etag,proto3" json:"etag,omitempty"` // contains filtered or unexported fields }
A budget is a plan that describes what you expect to spend on Cloud projects, plus the rules to execute as spend is tracked against that plan, (for example, send an alert when 90% of the target spend is met). The budget time period is configurable, with options such as month (default), quarter, year, or custom time period.
func (*Budget) Descriptor
deprecated
func (*Budget) GetAllUpdatesRule ¶
func (x *Budget) GetAllUpdatesRule() *AllUpdatesRule
func (*Budget) GetAmount ¶
func (x *Budget) GetAmount() *BudgetAmount
func (*Budget) GetBudgetFilter ¶
func (*Budget) GetDisplayName ¶
func (*Budget) GetThresholdRules ¶
func (x *Budget) GetThresholdRules() []*ThresholdRule
func (*Budget) ProtoMessage ¶
func (*Budget) ProtoMessage()
func (*Budget) ProtoReflect ¶
func (x *Budget) ProtoReflect() protoreflect.Message
type BudgetAmount ¶
type BudgetAmount struct { // Specification for what amount to use as the budget. // // Types that are assignable to BudgetAmount: // // *BudgetAmount_SpecifiedAmount // *BudgetAmount_LastPeriodAmount BudgetAmount isBudgetAmount_BudgetAmount `protobuf_oneof:"budget_amount"` // contains filtered or unexported fields }
The budgeted amount for each usage period.
func (*BudgetAmount) Descriptor
deprecated
func (*BudgetAmount) Descriptor() ([]byte, []int)
Deprecated: Use BudgetAmount.ProtoReflect.Descriptor instead.
func (*BudgetAmount) GetBudgetAmount ¶
func (m *BudgetAmount) GetBudgetAmount() isBudgetAmount_BudgetAmount
func (*BudgetAmount) GetLastPeriodAmount ¶
func (x *BudgetAmount) GetLastPeriodAmount() *LastPeriodAmount
func (*BudgetAmount) GetSpecifiedAmount ¶
func (x *BudgetAmount) GetSpecifiedAmount() *money.Money
func (*BudgetAmount) ProtoMessage ¶
func (*BudgetAmount) ProtoMessage()
func (*BudgetAmount) ProtoReflect ¶
func (x *BudgetAmount) ProtoReflect() protoreflect.Message
func (*BudgetAmount) Reset ¶
func (x *BudgetAmount) Reset()
func (*BudgetAmount) String ¶
func (x *BudgetAmount) String() string
type BudgetAmount_LastPeriodAmount ¶
type BudgetAmount_LastPeriodAmount 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 // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. // It cannot be set in combination with // [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period]. LastPeriodAmount *LastPeriodAmount `protobuf:"bytes,2,opt,name=last_period_amount,json=lastPeriodAmount,proto3,oneof"` }
type BudgetAmount_SpecifiedAmount ¶
type BudgetAmount_SpecifiedAmount struct { // 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. SpecifiedAmount *money.Money `protobuf:"bytes,1,opt,name=specified_amount,json=specifiedAmount,proto3,oneof"` }
type BudgetServiceClient ¶
type BudgetServiceClient interface { // Creates a new budget. See // [Quotas and limits](https://cloud.google.com/billing/quotas) // for more information on the limits of the number of budgets you can create. CreateBudget(ctx context.Context, in *CreateBudgetRequest, opts ...grpc.CallOption) (*Budget, error) // Updates a budget and returns the updated budget. // // WARNING: There are some fields exposed on the Google Cloud Console that // aren't available on this API. Budget fields that are not exposed in // this API will not be changed by this method. UpdateBudget(ctx context.Context, in *UpdateBudgetRequest, opts ...grpc.CallOption) (*Budget, error) // Returns a budget. // // WARNING: There are some fields exposed on the Google Cloud Console that // aren't available on this API. When reading from the API, you will not // see these fields in the return value, though they may have been set // in the Cloud Console. GetBudget(ctx context.Context, in *GetBudgetRequest, opts ...grpc.CallOption) (*Budget, error) // Returns a list of budgets for a billing account. // // WARNING: There are some fields exposed on the Google Cloud Console that // aren't available on this API. When reading from the API, you will not // see these fields in the return value, though they may have been set // in the Cloud Console. ListBudgets(ctx context.Context, in *ListBudgetsRequest, opts ...grpc.CallOption) (*ListBudgetsResponse, error) // Deletes a budget. Returns successfully if already deleted. DeleteBudget(ctx context.Context, in *DeleteBudgetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
BudgetServiceClient is the client API for BudgetService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBudgetServiceClient ¶
func NewBudgetServiceClient(cc grpc.ClientConnInterface) BudgetServiceClient
type BudgetServiceServer ¶
type BudgetServiceServer interface { // Creates a new budget. See // [Quotas and limits](https://cloud.google.com/billing/quotas) // for more information on the limits of the number of budgets you can create. CreateBudget(context.Context, *CreateBudgetRequest) (*Budget, error) // Updates a budget and returns the updated budget. // // WARNING: There are some fields exposed on the Google Cloud Console that // aren't available on this API. Budget fields that are not exposed in // this API will not be changed by this method. UpdateBudget(context.Context, *UpdateBudgetRequest) (*Budget, error) // Returns a budget. // // WARNING: There are some fields exposed on the Google Cloud Console that // aren't available on this API. When reading from the API, you will not // see these fields in the return value, though they may have been set // in the Cloud Console. GetBudget(context.Context, *GetBudgetRequest) (*Budget, error) // Returns a list of budgets for a billing account. // // WARNING: There are some fields exposed on the Google Cloud Console that // aren't available on this API. When reading from the API, you will not // see these fields in the return value, though they may have been set // in the Cloud Console. ListBudgets(context.Context, *ListBudgetsRequest) (*ListBudgetsResponse, error) // Deletes a budget. Returns successfully if already deleted. DeleteBudget(context.Context, *DeleteBudgetRequest) (*emptypb.Empty, error) }
BudgetServiceServer is the server API for BudgetService service.
type CalendarPeriod ¶
type CalendarPeriod int32
A `CalendarPeriod` represents the abstract concept of a time period that has a canonical start. Grammatically, "the start of the current `CalendarPeriod`". All calendar times begin at 12 AM US and Canadian Pacific Time (UTC-8).
const ( // Calendar period is unset. This is the default if the budget is for a // custom time period (CustomPeriod). CalendarPeriod_CALENDAR_PERIOD_UNSPECIFIED CalendarPeriod = 0 // A month. Month starts on the first day of each month, such as January 1, // February 1, March 1, and so on. CalendarPeriod_MONTH CalendarPeriod = 1 // A quarter. Quarters start on dates January 1, April 1, July 1, and October // 1 of each year. CalendarPeriod_QUARTER CalendarPeriod = 2 // A year. Year starts on January 1. CalendarPeriod_YEAR CalendarPeriod = 3 )
func (CalendarPeriod) Descriptor ¶
func (CalendarPeriod) Descriptor() protoreflect.EnumDescriptor
func (CalendarPeriod) Enum ¶
func (x CalendarPeriod) Enum() *CalendarPeriod
func (CalendarPeriod) EnumDescriptor
deprecated
func (CalendarPeriod) EnumDescriptor() ([]byte, []int)
Deprecated: Use CalendarPeriod.Descriptor instead.
func (CalendarPeriod) Number ¶
func (x CalendarPeriod) Number() protoreflect.EnumNumber
func (CalendarPeriod) String ¶
func (x CalendarPeriod) String() string
func (CalendarPeriod) Type ¶
func (CalendarPeriod) Type() protoreflect.EnumType
type CreateBudgetRequest ¶
type CreateBudgetRequest struct { // Required. The name of the billing account to create the budget in. Values // are of the form `billingAccounts/{billingAccountId}`. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Required. Budget to create. Budget *Budget `protobuf:"bytes,2,opt,name=budget,proto3" json:"budget,omitempty"` // contains filtered or unexported fields }
Request for CreateBudget
func (*CreateBudgetRequest) Descriptor
deprecated
func (*CreateBudgetRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateBudgetRequest.ProtoReflect.Descriptor instead.
func (*CreateBudgetRequest) GetBudget ¶
func (x *CreateBudgetRequest) GetBudget() *Budget
func (*CreateBudgetRequest) GetParent ¶
func (x *CreateBudgetRequest) GetParent() string
func (*CreateBudgetRequest) ProtoMessage ¶
func (*CreateBudgetRequest) ProtoMessage()
func (*CreateBudgetRequest) ProtoReflect ¶
func (x *CreateBudgetRequest) ProtoReflect() protoreflect.Message
func (*CreateBudgetRequest) Reset ¶
func (x *CreateBudgetRequest) Reset()
func (*CreateBudgetRequest) String ¶
func (x *CreateBudgetRequest) String() string
type CustomPeriod ¶
type CustomPeriod struct { // Required. The start date must be after January 1, 2017. StartDate *date.Date `protobuf:"bytes,1,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` // 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. EndDate *date.Date `protobuf:"bytes,2,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // contains filtered or unexported fields }
All date times begin at 12 AM US and Canadian Pacific Time (UTC-8).
func (*CustomPeriod) Descriptor
deprecated
func (*CustomPeriod) Descriptor() ([]byte, []int)
Deprecated: Use CustomPeriod.ProtoReflect.Descriptor instead.
func (*CustomPeriod) GetEndDate ¶
func (x *CustomPeriod) GetEndDate() *date.Date
func (*CustomPeriod) GetStartDate ¶
func (x *CustomPeriod) GetStartDate() *date.Date
func (*CustomPeriod) ProtoMessage ¶
func (*CustomPeriod) ProtoMessage()
func (*CustomPeriod) ProtoReflect ¶
func (x *CustomPeriod) ProtoReflect() protoreflect.Message
func (*CustomPeriod) Reset ¶
func (x *CustomPeriod) Reset()
func (*CustomPeriod) String ¶
func (x *CustomPeriod) String() string
type DeleteBudgetRequest ¶
type DeleteBudgetRequest struct { // Required. Name of the budget to delete. Values are of the form // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
Request for DeleteBudget
func (*DeleteBudgetRequest) Descriptor
deprecated
func (*DeleteBudgetRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteBudgetRequest.ProtoReflect.Descriptor instead.
func (*DeleteBudgetRequest) GetName ¶
func (x *DeleteBudgetRequest) GetName() string
func (*DeleteBudgetRequest) ProtoMessage ¶
func (*DeleteBudgetRequest) ProtoMessage()
func (*DeleteBudgetRequest) ProtoReflect ¶
func (x *DeleteBudgetRequest) ProtoReflect() protoreflect.Message
func (*DeleteBudgetRequest) Reset ¶
func (x *DeleteBudgetRequest) Reset()
func (*DeleteBudgetRequest) String ¶
func (x *DeleteBudgetRequest) String() string
type Filter ¶
type Filter struct { // Optional. A set of projects of the form `projects/{project}`, // specifying that usage from only this set of projects should be // included in the budget. If omitted, the report will include all usage for // the billing account, regardless of which project the usage occurred on. Projects []string `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` // Optional. A set of folder and organization names of the form // `folders/{folderId}` or `organizations/{organizationId}`, specifying that // usage from only this set of folders and organizations should be included in // the budget. If omitted, the budget includes all usage that the billing // account pays for. If the folder or organization contains projects that are // paid for by a different Cloud Billing account, the budget *doesn't* apply // to those projects. ResourceAncestors []string `protobuf:"bytes,2,rep,name=resource_ancestors,json=resourceAncestors,proto3" json:"resource_ancestors,omitempty"` // Optional. If // [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.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](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type). // // If // [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] // is **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty. CreditTypes []string `protobuf:"bytes,7,rep,name=credit_types,json=creditTypes,proto3" json:"credit_types,omitempty"` // Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. CreditTypesTreatment Filter_CreditTypesTreatment `` /* 194-byte string literal not displayed */ // 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. Services []string `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, // specifying that usage from only this set of subaccounts should be included // in the budget. If a subaccount is set to the name of the parent account, // usage from the parent account will be included. If omitted, the // report will include usage from the parent account and all // subaccounts, if they exist. Subaccounts []string `protobuf:"bytes,5,rep,name=subaccounts,proto3" json:"subaccounts,omitempty"` // Optional. A single label and value pair specifying that usage from only // this set of labeled resources should be included in the budget. If omitted, // the report will include all labeled and unlabeled usage. // // An object containing a single `"key": value` pair. Example: `{ "name": // "wrench" }`. // // _Currently, multiple entries or multiple values per entry are not // allowed._ Labels map[string]*structpb.ListValue `` /* 153-byte string literal not displayed */ // Multiple options to choose the budget's time period, specifying that only // usage that occurs during this time period should be included in the budget. // If not set, the <code>usage_period</code> defaults to CalendarPeriod.MONTH. // // Types that are assignable to UsagePeriod: // // *Filter_CalendarPeriod // *Filter_CustomPeriod UsagePeriod isFilter_UsagePeriod `protobuf_oneof:"usage_period"` // contains filtered or unexported fields }
A filter for a budget, limiting the scope of the cost to calculate.
func (*Filter) Descriptor
deprecated
func (*Filter) GetCalendarPeriod ¶
func (x *Filter) GetCalendarPeriod() CalendarPeriod
func (*Filter) GetCreditTypes ¶
func (*Filter) GetCreditTypesTreatment ¶
func (x *Filter) GetCreditTypesTreatment() Filter_CreditTypesTreatment
func (*Filter) GetCustomPeriod ¶
func (x *Filter) GetCustomPeriod() *CustomPeriod
func (*Filter) GetProjects ¶
func (*Filter) GetResourceAncestors ¶ added in v1.15.0
func (*Filter) GetServices ¶
func (*Filter) GetSubaccounts ¶
func (*Filter) GetUsagePeriod ¶
func (m *Filter) GetUsagePeriod() isFilter_UsagePeriod
func (*Filter) ProtoMessage ¶
func (*Filter) ProtoMessage()
func (*Filter) ProtoReflect ¶
func (x *Filter) ProtoReflect() protoreflect.Message
type Filter_CalendarPeriod ¶
type Filter_CalendarPeriod 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. CalendarPeriod CalendarPeriod `` /* 134-byte string literal not displayed */ }
type Filter_CreditTypesTreatment ¶
type Filter_CreditTypesTreatment int32
Specifies how credits are applied when determining the spend for threshold calculations. Budgets track the total cost minus any applicable selected credits. [See the documentation for a list of credit types](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
const ( Filter_CREDIT_TYPES_TREATMENT_UNSPECIFIED Filter_CreditTypesTreatment = 0 // All types of credit are subtracted from the gross cost to determine the // spend for threshold calculations. Filter_INCLUDE_ALL_CREDITS Filter_CreditTypesTreatment = 1 // All types of credit are added to the net cost to determine the spend for // threshold calculations. Filter_EXCLUDE_ALL_CREDITS Filter_CreditTypesTreatment = 2 // [Credit // types](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type) // specified in the credit_types field are subtracted from the // gross cost to determine the spend for threshold calculations. Filter_INCLUDE_SPECIFIED_CREDITS Filter_CreditTypesTreatment = 3 )
func (Filter_CreditTypesTreatment) Descriptor ¶
func (Filter_CreditTypesTreatment) Descriptor() protoreflect.EnumDescriptor
func (Filter_CreditTypesTreatment) Enum ¶
func (x Filter_CreditTypesTreatment) Enum() *Filter_CreditTypesTreatment
func (Filter_CreditTypesTreatment) EnumDescriptor
deprecated
func (Filter_CreditTypesTreatment) EnumDescriptor() ([]byte, []int)
Deprecated: Use Filter_CreditTypesTreatment.Descriptor instead.
func (Filter_CreditTypesTreatment) Number ¶
func (x Filter_CreditTypesTreatment) Number() protoreflect.EnumNumber
func (Filter_CreditTypesTreatment) String ¶
func (x Filter_CreditTypesTreatment) String() string
func (Filter_CreditTypesTreatment) Type ¶
func (Filter_CreditTypesTreatment) Type() protoreflect.EnumType
type Filter_CustomPeriod ¶
type Filter_CustomPeriod struct { // Optional. Specifies to track usage from any start date (required) to any // end date (optional). This time period is static, it does not recur. CustomPeriod *CustomPeriod `protobuf:"bytes,9,opt,name=custom_period,json=customPeriod,proto3,oneof"` }
type GetBudgetRequest ¶
type GetBudgetRequest struct { // Required. Name of budget to get. Values are of the form // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
Request for GetBudget
func (*GetBudgetRequest) Descriptor
deprecated
func (*GetBudgetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBudgetRequest.ProtoReflect.Descriptor instead.
func (*GetBudgetRequest) GetName ¶
func (x *GetBudgetRequest) GetName() string
func (*GetBudgetRequest) ProtoMessage ¶
func (*GetBudgetRequest) ProtoMessage()
func (*GetBudgetRequest) ProtoReflect ¶
func (x *GetBudgetRequest) ProtoReflect() protoreflect.Message
func (*GetBudgetRequest) Reset ¶
func (x *GetBudgetRequest) Reset()
func (*GetBudgetRequest) String ¶
func (x *GetBudgetRequest) String() string
type LastPeriodAmount ¶
type LastPeriodAmount struct {
// contains filtered or unexported fields
}
Describes a budget amount targeted to the last [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period] spend. At this time, the amount is automatically 100% of the last calendar period's spend; that is, there are no other options yet. Future configuration options will be described here (for example, configuring a percentage of last period's spend). LastPeriodAmount cannot be set for a budget configured with a [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period].
func (*LastPeriodAmount) Descriptor
deprecated
func (*LastPeriodAmount) Descriptor() ([]byte, []int)
Deprecated: Use LastPeriodAmount.ProtoReflect.Descriptor instead.
func (*LastPeriodAmount) ProtoMessage ¶
func (*LastPeriodAmount) ProtoMessage()
func (*LastPeriodAmount) ProtoReflect ¶
func (x *LastPeriodAmount) ProtoReflect() protoreflect.Message
func (*LastPeriodAmount) Reset ¶
func (x *LastPeriodAmount) Reset()
func (*LastPeriodAmount) String ¶
func (x *LastPeriodAmount) String() string
type ListBudgetsRequest ¶
type ListBudgetsRequest struct { // Required. Name of billing account to list budgets under. Values // are of the form `billingAccounts/{billingAccountId}`. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Optional. Set the scope of the budgets to be returned, in the format of the // resource name. The scope of a budget is the cost that it tracks, such as // costs for a single project, or the costs for all projects in a folder. Only // project scope (in the format of "projects/project-id" or "projects/123") is // supported in this field. When this field is set to a project's resource // name, the budgets returned are tracking the costs for that project. Scope string `protobuf:"bytes,4,opt,name=scope,proto3" json:"scope,omitempty"` // Optional. The maximum number of budgets to return per page. // The default and maximum value are 100. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Optional. The value returned by the last `ListBudgetsResponse` which // indicates that this is a continuation of a prior `ListBudgets` call, // and that the system should return the next page of data. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // contains filtered or unexported fields }
Request for ListBudgets
func (*ListBudgetsRequest) Descriptor
deprecated
func (*ListBudgetsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListBudgetsRequest.ProtoReflect.Descriptor instead.
func (*ListBudgetsRequest) GetPageSize ¶
func (x *ListBudgetsRequest) GetPageSize() int32
func (*ListBudgetsRequest) GetPageToken ¶
func (x *ListBudgetsRequest) GetPageToken() string
func (*ListBudgetsRequest) GetParent ¶
func (x *ListBudgetsRequest) GetParent() string
func (*ListBudgetsRequest) GetScope ¶ added in v1.17.0
func (x *ListBudgetsRequest) GetScope() string
func (*ListBudgetsRequest) ProtoMessage ¶
func (*ListBudgetsRequest) ProtoMessage()
func (*ListBudgetsRequest) ProtoReflect ¶
func (x *ListBudgetsRequest) ProtoReflect() protoreflect.Message
func (*ListBudgetsRequest) Reset ¶
func (x *ListBudgetsRequest) Reset()
func (*ListBudgetsRequest) String ¶
func (x *ListBudgetsRequest) String() string
type ListBudgetsResponse ¶
type ListBudgetsResponse struct { // List of the budgets owned by the requested billing account. Budgets []*Budget `protobuf:"bytes,1,rep,name=budgets,proto3" json:"budgets,omitempty"` // If not empty, indicates that there may be more budgets that match the // request; this value should be passed in a new `ListBudgetsRequest`. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
Response for ListBudgets
func (*ListBudgetsResponse) Descriptor
deprecated
func (*ListBudgetsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListBudgetsResponse.ProtoReflect.Descriptor instead.
func (*ListBudgetsResponse) GetBudgets ¶
func (x *ListBudgetsResponse) GetBudgets() []*Budget
func (*ListBudgetsResponse) GetNextPageToken ¶
func (x *ListBudgetsResponse) GetNextPageToken() string
func (*ListBudgetsResponse) ProtoMessage ¶
func (*ListBudgetsResponse) ProtoMessage()
func (*ListBudgetsResponse) ProtoReflect ¶
func (x *ListBudgetsResponse) ProtoReflect() protoreflect.Message
func (*ListBudgetsResponse) Reset ¶
func (x *ListBudgetsResponse) Reset()
func (*ListBudgetsResponse) String ¶
func (x *ListBudgetsResponse) String() string
type ThresholdRule ¶
type ThresholdRule struct { // 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 `protobuf:"fixed64,1,opt,name=threshold_percent,json=thresholdPercent,proto3" json:"threshold_percent,omitempty"` // Optional. The type of basis used to determine if spend has passed the // threshold. Behavior defaults to CURRENT_SPEND if not set. SpendBasis ThresholdRule_Basis `` /* 154-byte string literal not displayed */ // contains filtered or unexported fields }
ThresholdRule contains the definition of a threshold. Threshold rules define the triggering events used to generate a budget notification email. When a threshold is crossed (spend exceeds the specified percentages of the budget), budget alert emails are sent to the email recipients you specify in the [NotificationsRule](#notificationsrule).
Threshold rules also affect the fields included in the [JSON data object](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format) sent to a Pub/Sub topic.
Threshold rules are _required_ if using email notifications.
Threshold rules are _optional_ if only setting a [`pubsubTopic` NotificationsRule](#NotificationsRule), unless you want your JSON data object to include data about the thresholds you set.
For more information, see [set budget threshold rules and actions](https://cloud.google.com/billing/docs/how-to/budgets#budget-actions).
func (*ThresholdRule) Descriptor
deprecated
func (*ThresholdRule) Descriptor() ([]byte, []int)
Deprecated: Use ThresholdRule.ProtoReflect.Descriptor instead.
func (*ThresholdRule) GetSpendBasis ¶
func (x *ThresholdRule) GetSpendBasis() ThresholdRule_Basis
func (*ThresholdRule) GetThresholdPercent ¶
func (x *ThresholdRule) GetThresholdPercent() float64
func (*ThresholdRule) ProtoMessage ¶
func (*ThresholdRule) ProtoMessage()
func (*ThresholdRule) ProtoReflect ¶
func (x *ThresholdRule) ProtoReflect() protoreflect.Message
func (*ThresholdRule) Reset ¶
func (x *ThresholdRule) Reset()
func (*ThresholdRule) String ¶
func (x *ThresholdRule) String() string
type ThresholdRule_Basis ¶
type ThresholdRule_Basis int32
The type of basis used to determine if spend has passed the threshold.
const ( // Unspecified threshold basis. ThresholdRule_BASIS_UNSPECIFIED ThresholdRule_Basis = 0 // Use current spend as the basis for comparison against the threshold. ThresholdRule_CURRENT_SPEND ThresholdRule_Basis = 1 // Use forecasted spend for the period as the basis for comparison against // the threshold. // FORECASTED_SPEND can only be set when the budget's time period is a // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. // It cannot be set in combination with // [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period]. ThresholdRule_FORECASTED_SPEND ThresholdRule_Basis = 2 )
func (ThresholdRule_Basis) Descriptor ¶
func (ThresholdRule_Basis) Descriptor() protoreflect.EnumDescriptor
func (ThresholdRule_Basis) Enum ¶
func (x ThresholdRule_Basis) Enum() *ThresholdRule_Basis
func (ThresholdRule_Basis) EnumDescriptor
deprecated
func (ThresholdRule_Basis) EnumDescriptor() ([]byte, []int)
Deprecated: Use ThresholdRule_Basis.Descriptor instead.
func (ThresholdRule_Basis) Number ¶
func (x ThresholdRule_Basis) Number() protoreflect.EnumNumber
func (ThresholdRule_Basis) String ¶
func (x ThresholdRule_Basis) String() string
func (ThresholdRule_Basis) Type ¶
func (ThresholdRule_Basis) Type() protoreflect.EnumType
type UnimplementedBudgetServiceServer ¶
type UnimplementedBudgetServiceServer struct { }
UnimplementedBudgetServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedBudgetServiceServer) CreateBudget ¶
func (*UnimplementedBudgetServiceServer) CreateBudget(context.Context, *CreateBudgetRequest) (*Budget, error)
func (*UnimplementedBudgetServiceServer) DeleteBudget ¶
func (*UnimplementedBudgetServiceServer) DeleteBudget(context.Context, *DeleteBudgetRequest) (*emptypb.Empty, error)
func (*UnimplementedBudgetServiceServer) GetBudget ¶
func (*UnimplementedBudgetServiceServer) GetBudget(context.Context, *GetBudgetRequest) (*Budget, error)
func (*UnimplementedBudgetServiceServer) ListBudgets ¶
func (*UnimplementedBudgetServiceServer) ListBudgets(context.Context, *ListBudgetsRequest) (*ListBudgetsResponse, error)
func (*UnimplementedBudgetServiceServer) UpdateBudget ¶
func (*UnimplementedBudgetServiceServer) UpdateBudget(context.Context, *UpdateBudgetRequest) (*Budget, error)
type UpdateBudgetRequest ¶
type UpdateBudgetRequest struct { // Required. The updated budget object. // The budget to update is specified by the budget name in the budget. Budget *Budget `protobuf:"bytes,1,opt,name=budget,proto3" json:"budget,omitempty"` // Optional. Indicates which fields in the provided budget to update. // Read-only fields (such as `name`) cannot be changed. If this is not // provided, then only fields with non-default values from the request are // updated. See // https://developers.google.com/protocol-buffers/docs/proto3#default for more // details about default values. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
Request for UpdateBudget
func (*UpdateBudgetRequest) Descriptor
deprecated
func (*UpdateBudgetRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateBudgetRequest.ProtoReflect.Descriptor instead.
func (*UpdateBudgetRequest) GetBudget ¶
func (x *UpdateBudgetRequest) GetBudget() *Budget
func (*UpdateBudgetRequest) GetUpdateMask ¶
func (x *UpdateBudgetRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (*UpdateBudgetRequest) ProtoMessage ¶
func (*UpdateBudgetRequest) ProtoMessage()
func (*UpdateBudgetRequest) ProtoReflect ¶
func (x *UpdateBudgetRequest) ProtoReflect() protoreflect.Message
func (*UpdateBudgetRequest) Reset ¶
func (x *UpdateBudgetRequest) Reset()
func (*UpdateBudgetRequest) String ¶
func (x *UpdateBudgetRequest) String() string