3.14.0-rc 3.13.0 (latest) 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 2.48.0-rc 2.47.1 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.0 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.0 2.13.0 2.12.0 2.11.0 Retrieves the Google Cloud Console billing accounts and associates them with projects.

###### 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

### CloudBillingClient(CloudBillingClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `CloudBillingClient const &` |

### CloudBillingClient(CloudBillingClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `CloudBillingClient &&` |

### CloudBillingClient(std::shared_ptr\< CloudBillingConnection \>, Options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `connection` | `std::shared_ptr< CloudBillingConnection >` |
| `opts` | `Options` |

## Operators

### operator=(CloudBillingClient const \&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `CloudBillingClient const &` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `CloudBillingClient &` |   |

### operator=(CloudBillingClient \&\&)

Copy and move support

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `CloudBillingClient &&` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `CloudBillingClient &` |   |

## Functions

### GetBillingAccount(std::string const \&, Options)

Gets information about a billing account.
The current authenticated user must be a [viewer of the billing account](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetBillingAccount(google::cloud::billing::v1::GetBillingAccountRequest const \&, Options)

Gets information about a billing account.
The current authenticated user must be a [viewer of the billing account](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::GetBillingAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.GetBillingAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L333). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### ListBillingAccounts(Options)

Lists the billing accounts that the current authenticated user has permission to [view](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::cloud::billing::v1::BillingAccount >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### ListBillingAccounts(std::string const \&, Options)

Lists the billing accounts that the current authenticated user has permission to [view](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `std::string const &` Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF` |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::cloud::billing::v1::BillingAccount >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### ListBillingAccounts(google::cloud::billing::v1::ListBillingAccountsRequest, Options)

Lists the billing accounts that the current authenticated user has permission to [view](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::ListBillingAccountsRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.ListBillingAccountsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L345). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::cloud::billing::v1::BillingAccount >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### UpdateBillingAccount(std::string const \&, google::cloud::billing::v1::BillingAccount const \&, Options)

Updates a billing account's fields.
Currently the only field that can be edited is `display_name`. The current authenticated user must have the `billing.accounts.update` IAM permission, which is typically given to the [administrator](https://cloud.google.com/billing/docs/how-to/billing-access) of the billing account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The name of the billing account resource to be updated. |
| `account` | `google::cloud::billing::v1::BillingAccount const &` Required. The billing account resource to replace the resource on the server. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateBillingAccount(google::cloud::billing::v1::UpdateBillingAccountRequest const \&, Options)

Updates a billing account's fields.
Currently the only field that can be edited is `display_name`. The current authenticated user must have the `billing.accounts.update` IAM permission, which is typically given to the [administrator](https://cloud.google.com/billing/docs/how-to/billing-access) of the billing account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::UpdateBillingAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.UpdateBillingAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L400). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateBillingAccount(google::cloud::billing::v1::BillingAccount const \&, Options)

This method creates [billing subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts).
Google Cloud resellers should use the Channel Services APIs, [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create) and [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).

When creating a subaccount, the current authenticated user must have the `billing.accounts.update` IAM permission on the parent account, which is typically given to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). This method will return an error if the parent account has not been provisioned for subaccounts.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `billing_account` | `google::cloud::billing::v1::BillingAccount const &` Required. The billing account resource to create. Currently CreateBillingAccount only supports subaccount creation, so any created billing accounts must be under a provided parent billing account. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateBillingAccount(google::cloud::billing::v1::BillingAccount const \&, std::string const \&, Options)

This method creates [billing subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts).
Google Cloud resellers should use the Channel Services APIs, [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create) and [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).

When creating a subaccount, the current authenticated user must have the `billing.accounts.update` IAM permission on the parent account, which is typically given to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). This method will return an error if the parent account has not been provisioned for subaccounts.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `billing_account` | `google::cloud::billing::v1::BillingAccount const &` Required. The billing account resource to create. Currently CreateBillingAccount only supports subaccount creation, so any created billing accounts must be under a provided parent billing account. |
| `parent` | `std::string const &` Optional. The parent to create a billing account from. Format: - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF` |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### CreateBillingAccount(google::cloud::billing::v1::CreateBillingAccountRequest const \&, Options)

This method creates [billing subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts).
Google Cloud resellers should use the Channel Services APIs, [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create) and [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).

When creating a subaccount, the current authenticated user must have the `billing.accounts.update` IAM permission on the parent account, which is typically given to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). This method will return an error if the parent account has not been provisioned for subaccounts.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::CreateBillingAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.CreateBillingAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L385). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### ListProjectBillingInfo(std::string const \&, Options)

Lists the projects associated with a billing account.
The current authenticated user must have the `billing.resourceAssociations.list` IAM permission, which is often given to billing account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::cloud::billing::v1::ProjectBillingInfo >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.cloud.billing.v1.ProjectBillingInfo](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L304), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### ListProjectBillingInfo(google::cloud::billing::v1::ListProjectBillingInfoRequest, Options)

Lists the projects associated with a billing account.
The current authenticated user must have the `billing.resourceAssociations.list` IAM permission, which is often given to billing account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::ListProjectBillingInfoRequest` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.ListProjectBillingInfoRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L419). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StreamRange< google::cloud::billing::v1::ProjectBillingInfo >` | a [StreamRange](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StreamRange.html) to iterate of the results. See the documentation of this type for details. In brief, this class has `begin()` and `end()` member functions returning a iterator class meeting the [input iterator requirements](https://en.cppreference.com/w/cpp/named_req/InputIterator). The value type for this iterator is a [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html)`<T>` contains elements of type [google.cloud.billing.v1.ProjectBillingInfo](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L304), or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |

### GetProjectBillingInfo(std::string const \&, Options)

Gets the billing information for a project.
The current authenticated user must have the `resourcemanager.projects.get` permission for the project, which can be granted by assigning the [Project Viewer](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles) role.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::ProjectBillingInfo >` | the result of the RPC. The response message type ([google.cloud.billing.v1.ProjectBillingInfo](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L304)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetProjectBillingInfo(google::cloud::billing::v1::GetProjectBillingInfoRequest const \&, Options)

Gets the billing information for a project.
The current authenticated user must have the `resourcemanager.projects.get` permission for the project, which can be granted by assigning the [Project Viewer](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles) role.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::GetProjectBillingInfoRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.GetProjectBillingInfoRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L453). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::ProjectBillingInfo >` | the result of the RPC. The response message type ([google.cloud.billing.v1.ProjectBillingInfo](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L304)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateProjectBillingInfo(std::string const \&, google::cloud::billing::v1::ProjectBillingInfo const \&, Options)

Sets or updates the billing account associated with a project.
You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges.

*Note:* Incurred charges that have not yet been reported in the transaction history of the Google Cloud Console might be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project.

The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo) and the [billing account](https://cloud.google.com/billing/docs/how-to/billing-access).

You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project.

Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `std::string const &` Required. The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`. |
| `project_billing_info` | `google::cloud::billing::v1::ProjectBillingInfo const &` The new billing information for the project. Output-only fields are ignored; thus, you can leave empty all fields except `billing_account_name`. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::ProjectBillingInfo >` | the result of the RPC. The response message type ([google.cloud.billing.v1.ProjectBillingInfo](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L304)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### UpdateProjectBillingInfo(google::cloud::billing::v1::UpdateProjectBillingInfoRequest const \&, Options)

Sets or updates the billing account associated with a project.
You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges.

*Note:* Incurred charges that have not yet been reported in the transaction history of the Google Cloud Console might be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project.

The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo) and the [billing account](https://cloud.google.com/billing/docs/how-to/billing-access).

You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project.

Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::UpdateProjectBillingInfoRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.UpdateProjectBillingInfoRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L465). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::ProjectBillingInfo >` | the result of the RPC. The response message type ([google.cloud.billing.v1.ProjectBillingInfo](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L304)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetIamPolicy(std::string const \&, Options)

Gets the access control policy for a billing account.
The caller must have the `billing.accounts.getIamPolicy` permission on the account, which is often given to billing account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### GetIamPolicy(google::iam::v1::GetIamPolicyRequest const \&, Options)

Gets the access control policy for a billing account.
The caller must have the `billing.accounts.getIamPolicy` permission on the account, which is often given to billing account [viewers](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::GetIamPolicyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.GetIamPolicyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L123). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### SetIamPolicy(std::string const \&, google::iam::v1::Policy const \&, Options)

Sets the access control policy for a billing account.
Replaces any existing policy. The caller must have the `billing.accounts.setIamPolicy` permission on the account, which is often given to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `google::iam::v1::Policy const &` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### SetIamPolicy(std::string const \&, IamUpdater const \&, Options)

Updates the IAM policy for `resource` using an optimistic concurrency control loop.
The loop fetches the current policy for `resource`, and passes it to `updater`, which should return the new policy. This new policy should use the current etag so that the read-modify-write cycle can detect races and rerun the update when there is a mismatch. If the new policy does not have an etag, the existing policy will be blindly overwritten. If `updater` does not yield a policy, the control loop is terminated and kCancelled is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` Required. The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `updater` | `IamUpdater const &` Required. Functor to map the current policy to a new one. |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | google::iam::v1::Policy |

### SetIamPolicy(google::iam::v1::SetIamPolicyRequest const \&, Options)

Sets the access control policy for a billing account.
Replaces any existing policy. The caller must have the `billing.accounts.setIamPolicy` permission on the account, which is often given to billing account [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::SetIamPolicyRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.SetIamPolicyRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L100). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` | the result of the RPC. The response message type ([google.iam.v1.Policy](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/policy.proto#L102)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### TestIamPermissions(std::string const \&, std::vector\< std::string \> const \&, Options)

Tests the access control policy for a billing account.
This method takes the resource and a set of permissions as input and returns the subset of the input permissions that the caller is allowed for that resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `std::string const &` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `std::vector< std::string > const &` The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.* ') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::TestIamPermissionsResponse >` | the result of the RPC. The response message type ([google.iam.v1.TestIamPermissionsResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L153)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const \&, Options)

Tests the access control policy for a billing account.
This method takes the resource and a set of permissions as input and returns the subset of the input permissions that the caller is allowed for that resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::iam::v1::TestIamPermissionsRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.iam.v1.TestIamPermissionsRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L137). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::TestIamPermissionsResponse >` | the result of the RPC. The response message type ([google.iam.v1.TestIamPermissionsResponse](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/iam/v1/iam_policy.proto#L153)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |

### MoveBillingAccount(google::cloud::billing::v1::MoveBillingAccountRequest const \&, Options)

Changes which parent organization a billing account belongs to.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `google::cloud::billing::v1::MoveBillingAccountRequest const &` Unary RPCs, such as the one wrapped by this function, receive a single `request` proto message which includes all the inputs for the RPC. In this case, the proto message is a [google.cloud.billing.v1.MoveBillingAccountRequest](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L478). Proto messages are converted to C++ classes by Protobuf, using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). |
| `opts` | `Options` Optional. Override the class-level options, such as retry and backoff policies. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::cloud::billing::v1::BillingAccount >` | the result of the RPC. The response message type ([google.cloud.billing.v1.BillingAccount](https://github.com/googleapis/googleapis/blob/57aa4dbce5d23b2115b2732b10dcb7ddc8e8698d/google/cloud/billing/v1/cloud_billing.proto#L242)) is mapped to a C++ class using the [Protobuf mapping rules](https://protobuf.dev/reference/cpp/cpp-generated/). If the request fails, the [`StatusOr`](https://docs.cloud.google.com/cpp/docs/reference/common/latest/classgoogle_1_1cloud_1_1StatusOr.html) contains the error details. |