BudgetService stores Cloud Billing budgets, which define a budget plan and rules to execute as we track spend against that plan.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
BudgetServiceClient(BudgetServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
BudgetServiceClient const &
|
BudgetServiceClient(BudgetServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
BudgetServiceClient &&
|
BudgetServiceClient(std::shared_ptr< BudgetServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< BudgetServiceConnection >
|
opts |
Options
|
Operators
operator=(BudgetServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
BudgetServiceClient const &
|
Returns | |
---|---|
Type | Description |
BudgetServiceClient & |
operator=(BudgetServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
BudgetServiceClient &&
|
Returns | |
---|---|
Type | Description |
BudgetServiceClient & |
Functions
CreateBudget(std::string const &, google::cloud::billing::budgets::v1::Budget const &, Options)
Creates a new budget.
See Quotas and limits for more information on the limits of the number of budgets you can create.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The name of the billing account to create the budget in. Values are of the form |
budget |
google::cloud::billing::budgets::v1::Budget const &
Required. Budget to create. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::billing::budgets::v1::Budget > | the result of the RPC. The response message type (google.cloud.billing.budgets.v1.Budget) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateBudget(google::cloud::billing::budgets::v1::CreateBudgetRequest const &, Options)
Creates a new budget.
See Quotas and limits for more information on the limits of the number of budgets you can create.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::billing::budgets::v1::CreateBudgetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::billing::budgets::v1::Budget > | the result of the RPC. The response message type (google.cloud.billing.budgets.v1.Budget) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateBudget(google::cloud::billing::budgets::v1::Budget const &, google::protobuf::FieldMask const &, Options)
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.
Parameters | |
---|---|
Name | Description |
budget |
google::cloud::billing::budgets::v1::Budget const &
Required. The updated budget object. The budget to update is specified by the budget name in the budget. |
update_mask |
google::protobuf::FieldMask const &
Optional. Indicates which fields in the provided budget to update. Read-only fields (such as |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::billing::budgets::v1::Budget > | the result of the RPC. The response message type (google.cloud.billing.budgets.v1.Budget) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateBudget(google::cloud::billing::budgets::v1::UpdateBudgetRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::billing::budgets::v1::UpdateBudgetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::billing::budgets::v1::Budget > | the result of the RPC. The response message type (google.cloud.billing.budgets.v1.Budget) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetBudget(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Name of budget to get. Values are of the form |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::billing::budgets::v1::Budget > | the result of the RPC. The response message type (google.cloud.billing.budgets.v1.Budget) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetBudget(google::cloud::billing::budgets::v1::GetBudgetRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::billing::budgets::v1::GetBudgetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::billing::budgets::v1::Budget > | the result of the RPC. The response message type (google.cloud.billing.budgets.v1.Budget) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListBudgets(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. Name of billing account to list budgets under. Values are of the form |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::billing::budgets::v1::Budget > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListBudgets(google::cloud::billing::budgets::v1::ListBudgetsRequest, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::billing::budgets::v1::ListBudgetsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::billing::budgets::v1::Budget > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
DeleteBudget(std::string const &, Options)
Deletes a budget.
Returns successfully if already deleted.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Name of the budget to delete. Values are of the form |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
DeleteBudget(google::cloud::billing::budgets::v1::DeleteBudgetRequest const &, Options)
Deletes a budget.
Returns successfully if already deleted.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::billing::budgets::v1::DeleteBudgetRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |