# Class CloudBillingClient (2.93.0)

2.93.0 (latest) 2.91.0 2.88.0 2.87.0 2.85.0 2.83.0 2.82.0 2.81.0 2.80.0 2.78.0 2.76.0 2.75.0 2.74.0 2.73.0 2.72.0 2.70.0 2.68.0 2.67.0 2.64.0 2.63.0 2.62.0 2.60.0 2.59.0 2.58.0 2.57.0 2.56.0 2.55.0 2.54.0 2.53.0 2.52.0 2.51.0 2.49.0 2.48.0 2.47.0 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.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.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.5 2.2.1 2.1.12

|---|---|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-billing/google-cloud-billing/src/main/java/com/google/cloud/billing/v1/CloudBillingClient.java) | [Product Reference](https://cloud.google.com/billing/docs) | [REST Documentation](https://cloud.google.com/billing/docs/reference/rest) | [RPC Documentation](https://cloud.google.com/billing/docs/reference/rpc) |

Service Description: Retrieves the Google Cloud Console billing accounts and associates them with
projects.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       BillingAccountName name = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]");
       BillingAccount response = cloudBillingClient.getBillingAccount(name);
     }
     
Note: close() needs to be called on the CloudBillingClient object to clean up resources such
as threads. In the example above, try-with-resources is used, which automatically calls close().

| Method | Description | Method Variants |
|---|---|---|
| GetBillingAccount | 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). | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getBillingAccount(GetBillingAccountRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getBillingAccount(BillingAccountName name) - getBillingAccount(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getBillingAccountCallable() |
| ListBillingAccounts | Lists the billing accounts that the current authenticated user has permission to [view](https://cloud.google.com/billing/docs/how-to/billing-access). | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listBillingAccounts(ListBillingAccountsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listBillingAccounts() - listBillingAccounts(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listBillingAccountsPagedCallable() - listBillingAccountsCallable() |
| UpdateBillingAccount | 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateBillingAccount(UpdateBillingAccountRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateBillingAccount(BillingAccountName name, BillingAccount account) - updateBillingAccount(String name, BillingAccount account) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateBillingAccountCallable() |
| CreateBillingAccount | 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createBillingAccount(CreateBillingAccountRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - createBillingAccount(BillingAccount billingAccount) - createBillingAccount(BillingAccount billingAccount, String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createBillingAccountCallable() |
| ListProjectBillingInfo | 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). | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listProjectBillingInfo(ListProjectBillingInfoRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listProjectBillingInfo(BillingAccountName name) - listProjectBillingInfo(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listProjectBillingInfoPagedCallable() - listProjectBillingInfoCallable() |
| GetProjectBillingInfo | 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getProjectBillingInfo(GetProjectBillingInfoRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getProjectBillingInfo(ProjectName name) - getProjectBillingInfo(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getProjectBillingInfoCallable() |
| UpdateProjectBillingInfo | 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateProjectBillingInfo(UpdateProjectBillingInfoRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - updateProjectBillingInfo(String name, ProjectBillingInfo projectBillingInfo) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateProjectBillingInfoCallable() |
| GetIamPolicy | 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). | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getIamPolicy(GetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getIamPolicy(ResourceName resource) - getIamPolicy(String resource) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getIamPolicyCallable() |
| SetIamPolicy | 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). | Request object method variants only take one parameter, a request object, which must be constructed before the call. - setIamPolicy(SetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - setIamPolicy(ResourceName resource, Policy policy) - setIamPolicy(String resource, Policy policy) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - setIamPolicyCallable() |
| TestIamPermissions | 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. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - testIamPermissions(TestIamPermissionsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - testIamPermissions(ResourceName resource, List\<String\> permissions) - testIamPermissions(String resource, List\<String\> permissions) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - testIamPermissionsCallable() |
| MoveBillingAccount | Changes which parent organization a billing account belongs to. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - moveBillingAccount(MoveBillingAccountRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - moveBillingAccountCallable() |
[Methods]

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with
these names, this class includes a format method for each type of name, and additionally a parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of CloudBillingSettings to
create(). For example:

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     CloudBillingSettings cloudBillingSettings =
         CloudBillingSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     CloudBillingClient cloudBillingClient = CloudBillingClient.create(cloudBillingSettings);
     
To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     CloudBillingSettings cloudBillingSettings =
         CloudBillingSettings.newBuilder().setEndpoint(myEndpoint).build();
     CloudBillingClient cloudBillingClient = CloudBillingClient.create(cloudBillingSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     CloudBillingSettings cloudBillingSettings = CloudBillingSettings.newHttpJsonBuilder().build();
     CloudBillingClient cloudBillingClient = CloudBillingClient.create(cloudBillingSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> CloudBillingClient

## Static Methods

### create()

    public static final CloudBillingClient create()

Constructs an instance of CloudBillingClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(CloudBillingSettings settings)

    public static final CloudBillingClient create(CloudBillingSettings settings)

Constructs an instance of CloudBillingClient, using the given settings. The channels are
created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(CloudBillingStub stub)

    public static final CloudBillingClient create(CloudBillingStub stub)

Constructs an instance of CloudBillingClient, using the given stub for making calls. This is
for advanced usage - prefer using create(CloudBillingSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.stub.CloudBillingStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient` |   |

## Constructors

### CloudBillingClient(CloudBillingSettings settings)

    protected CloudBillingClient(CloudBillingSettings settings)

Constructs an instance of CloudBillingClient, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingSettings` |

### CloudBillingClient(CloudBillingStub stub)

    protected CloudBillingClient(CloudBillingStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.stub.CloudBillingStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createBillingAccount(BillingAccount billingAccount)

    public final BillingAccount createBillingAccount(BillingAccount billingAccount)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       BillingAccount billingAccount = BillingAccount.newBuilder().build();
       BillingAccount response = cloudBillingClient.createBillingAccount(billingAccount);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `billingAccount` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` 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. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### createBillingAccount(BillingAccount billingAccount, String parent)

    public final BillingAccount createBillingAccount(BillingAccount billingAccount, String parent)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       BillingAccount billingAccount = BillingAccount.newBuilder().build();
       String parent = "parent-995424086";
       BillingAccount response = cloudBillingClient.createBillingAccount(billingAccount, parent);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `billingAccount` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` 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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Optional. The parent to create a billing account from. Format: - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### createBillingAccount(CreateBillingAccountRequest request)

    public final BillingAccount createBillingAccount(CreateBillingAccountRequest request)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       CreateBillingAccountRequest request =
           CreateBillingAccountRequest.newBuilder()
               .setBillingAccount(BillingAccount.newBuilder().build())
               .setParent("parent-995424086")
               .build();
       BillingAccount response = cloudBillingClient.createBillingAccount(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CreateBillingAccountRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### createBillingAccountCallable()

    public final UnaryCallable<CreateBillingAccountRequest,BillingAccount> createBillingAccountCallable()

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       CreateBillingAccountRequest request =
           CreateBillingAccountRequest.newBuilder()
               .setBillingAccount(BillingAccount.newBuilder().build())
               .setParent("parent-995424086")
               .build();
       ApiFuture<BillingAccount> future =
           cloudBillingClient.createBillingAccountCallable().futureCall(request);
       // Do something.
       BillingAccount response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CreateBillingAccountRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount>` |   |

### getBillingAccount(BillingAccountName name)

    public final BillingAccount getBillingAccount(BillingAccountName name)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       BillingAccountName name = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]");
       BillingAccount response = cloudBillingClient.getBillingAccount(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccountName` Required. The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### getBillingAccount(GetBillingAccountRequest request)

    public final BillingAccount getBillingAccount(GetBillingAccountRequest request)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       GetBillingAccountRequest request =
           GetBillingAccountRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .build();
       BillingAccount response = cloudBillingClient.getBillingAccount(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.GetBillingAccountRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### getBillingAccount(String name)

    public final BillingAccount getBillingAccount(String name)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String name = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString();
       BillingAccount response = cloudBillingClient.getBillingAccount(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### getBillingAccountCallable()

    public final UnaryCallable<GetBillingAccountRequest,BillingAccount> getBillingAccountCallable()

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       GetBillingAccountRequest request =
           GetBillingAccountRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .build();
       ApiFuture<BillingAccount> future =
           cloudBillingClient.getBillingAccountCallable().futureCall(request);
       // Do something.
       BillingAccount response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.GetBillingAccountRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount>` |   |

### getIamPolicy(ResourceName resource)

    public final Policy getIamPolicy(ResourceName resource)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ResourceName resource = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]");
       Policy response = cloudBillingClient.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(GetIamPolicyRequest request)

    public final Policy getIamPolicy(GetIamPolicyRequest request)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       Policy response = cloudBillingClient.getIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.GetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(String resource)

    public final Policy getIamPolicy(String resource)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String resource = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString();
       Policy response = cloudBillingClient.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicyCallable()

    public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       ApiFuture<Policy> future = cloudBillingClient.getIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### getProjectBillingInfo(GetProjectBillingInfoRequest request)

    public final ProjectBillingInfo getProjectBillingInfo(GetProjectBillingInfoRequest request)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       GetProjectBillingInfoRequest request =
           GetProjectBillingInfoRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .build();
       ProjectBillingInfo response = cloudBillingClient.getProjectBillingInfo(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.GetProjectBillingInfoRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo` |   |

### getProjectBillingInfo(ProjectName name)

    public final ProjectBillingInfo getProjectBillingInfo(ProjectName name)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ProjectName name = ProjectName.of("[PROJECT]");
       ProjectBillingInfo response = cloudBillingClient.getProjectBillingInfo(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectName` Required. The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo` |   |

### getProjectBillingInfo(String name)

    public final ProjectBillingInfo getProjectBillingInfo(String name)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String name = ProjectName.of("[PROJECT]").toString();
       ProjectBillingInfo response = cloudBillingClient.getProjectBillingInfo(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo` |   |

### getProjectBillingInfoCallable()

    public final UnaryCallable<GetProjectBillingInfoRequest,ProjectBillingInfo> getProjectBillingInfoCallable()

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       GetProjectBillingInfoRequest request =
           GetProjectBillingInfoRequest.newBuilder()
               .setName(ProjectName.of("[PROJECT]").toString())
               .build();
       ApiFuture<ProjectBillingInfo> future =
           cloudBillingClient.getProjectBillingInfoCallable().futureCall(request);
       // Do something.
       ProjectBillingInfo response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.GetProjectBillingInfoRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo>` |   |

### getSettings()

    public final CloudBillingSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingSettings` |   |

### getStub()

    public CloudBillingStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.stub.CloudBillingStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listBillingAccounts()

    public final CloudBillingClient.ListBillingAccountsPagedResponse listBillingAccounts()

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       for (BillingAccount element : cloudBillingClient.listBillingAccounts().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListBillingAccountsPagedResponse` |   |

### listBillingAccounts(ListBillingAccountsRequest request)

    public final CloudBillingClient.ListBillingAccountsPagedResponse listBillingAccounts(ListBillingAccountsRequest request)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ListBillingAccountsRequest request =
           ListBillingAccountsRequest.newBuilder()
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setParent("parent-995424086")
               .build();
       for (BillingAccount element : cloudBillingClient.listBillingAccounts(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListBillingAccountsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListBillingAccountsPagedResponse` |   |

### listBillingAccounts(String parent)

    public final CloudBillingClient.ListBillingAccountsPagedResponse listBillingAccounts(String parent)

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String parent = "parent-995424086";
       for (BillingAccount element : cloudBillingClient.listBillingAccounts(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` 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` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListBillingAccountsPagedResponse` |   |

### listBillingAccountsCallable()

    public final UnaryCallable<ListBillingAccountsRequest,ListBillingAccountsResponse> listBillingAccountsCallable()

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ListBillingAccountsRequest request =
           ListBillingAccountsRequest.newBuilder()
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setParent("parent-995424086")
               .build();
       while (true) {
         ListBillingAccountsResponse response =
             cloudBillingClient.listBillingAccountsCallable().call(request);
         for (BillingAccount element : response.getBillingAccountsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListBillingAccountsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListBillingAccountsResponse>` |   |

### listBillingAccountsPagedCallable()

    public final UnaryCallable<ListBillingAccountsRequest,CloudBillingClient.ListBillingAccountsPagedResponse> listBillingAccountsPagedCallable()

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

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ListBillingAccountsRequest request =
           ListBillingAccountsRequest.newBuilder()
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setParent("parent-995424086")
               .build();
       ApiFuture<BillingAccount> future =
           cloudBillingClient.listBillingAccountsPagedCallable().futureCall(request);
       // Do something.
       for (BillingAccount element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListBillingAccountsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListBillingAccountsPagedResponse>` |   |

### listProjectBillingInfo(BillingAccountName name)

    public final CloudBillingClient.ListProjectBillingInfoPagedResponse listProjectBillingInfo(BillingAccountName name)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       BillingAccountName name = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]");
       for (ProjectBillingInfo element :
           cloudBillingClient.listProjectBillingInfo(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccountName` Required. The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListProjectBillingInfoPagedResponse` |   |

### listProjectBillingInfo(ListProjectBillingInfoRequest request)

    public final CloudBillingClient.ListProjectBillingInfoPagedResponse listProjectBillingInfo(ListProjectBillingInfoRequest request)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ListProjectBillingInfoRequest request =
           ListProjectBillingInfoRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (ProjectBillingInfo element :
           cloudBillingClient.listProjectBillingInfo(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListProjectBillingInfoRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListProjectBillingInfoPagedResponse` |   |

### listProjectBillingInfo(String name)

    public final CloudBillingClient.ListProjectBillingInfoPagedResponse listProjectBillingInfo(String name)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String name = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString();
       for (ProjectBillingInfo element :
           cloudBillingClient.listProjectBillingInfo(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListProjectBillingInfoPagedResponse` |   |

### listProjectBillingInfoCallable()

    public final UnaryCallable<ListProjectBillingInfoRequest,ListProjectBillingInfoResponse> listProjectBillingInfoCallable()

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ListProjectBillingInfoRequest request =
           ListProjectBillingInfoRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListProjectBillingInfoResponse response =
             cloudBillingClient.listProjectBillingInfoCallable().call(request);
         for (ProjectBillingInfo element : response.getProjectBillingInfoList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListProjectBillingInfoRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListProjectBillingInfoResponse>` |   |

### listProjectBillingInfoPagedCallable()

    public final UnaryCallable<ListProjectBillingInfoRequest,CloudBillingClient.ListProjectBillingInfoPagedResponse> listProjectBillingInfoPagedCallable()

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ListProjectBillingInfoRequest request =
           ListProjectBillingInfoRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<ProjectBillingInfo> future =
           cloudBillingClient.listProjectBillingInfoPagedCallable().futureCall(request);
       // Do something.
       for (ProjectBillingInfo element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ListProjectBillingInfoRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.CloudBillingClient.ListProjectBillingInfoPagedResponse>` |   |

### moveBillingAccount(MoveBillingAccountRequest request)

    public final BillingAccount moveBillingAccount(MoveBillingAccountRequest request)

Changes which parent organization a billing account belongs to.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       MoveBillingAccountRequest request =
           MoveBillingAccountRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setDestinationParent(OrganizationName.of("[ORGANIZATION]").toString())
               .build();
       BillingAccount response = cloudBillingClient.moveBillingAccount(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.MoveBillingAccountRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### moveBillingAccountCallable()

    public final UnaryCallable<MoveBillingAccountRequest,BillingAccount> moveBillingAccountCallable()

Changes which parent organization a billing account belongs to.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       MoveBillingAccountRequest request =
           MoveBillingAccountRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setDestinationParent(OrganizationName.of("[ORGANIZATION]").toString())
               .build();
       ApiFuture<BillingAccount> future =
           cloudBillingClient.moveBillingAccountCallable().futureCall(request);
       // Do something.
       BillingAccount response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.MoveBillingAccountRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount>` |   |

### setIamPolicy(ResourceName resource, Policy policy)

    public final Policy setIamPolicy(ResourceName resource, Policy policy)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ResourceName resource = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]");
       Policy policy = Policy.newBuilder().build();
       Policy response = cloudBillingClient.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` 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. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(SetIamPolicyRequest request)

    public final Policy setIamPolicy(SetIamPolicyRequest request)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Policy response = cloudBillingClient.setIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.SetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(String resource, Policy policy)

    public final Policy setIamPolicy(String resource, Policy policy)

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String resource = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString();
       Policy policy = Policy.newBuilder().build();
       Policy response = cloudBillingClient.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` 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. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicyCallable()

    public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

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).

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Policy> future = cloudBillingClient.setIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### testIamPermissions(ResourceName resource, List\<String\> permissions)

    public final TestIamPermissionsResponse testIamPermissions(ResourceName resource, List<String> permissions)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       ResourceName resource = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]");
       List<String> permissions = new ArrayList<>();
       TestIamPermissionsResponse response =
           cloudBillingClient.testIamPermissions(resource, permissions);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` 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). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissions(TestIamPermissionsRequest request)

    public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       TestIamPermissionsResponse response = cloudBillingClient.testIamPermissions(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.TestIamPermissionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissions(String resource, List\<String\> permissions)

    public final TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String resource = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString();
       List<String> permissions = new ArrayList<>();
       TestIamPermissionsResponse response =
           cloudBillingClient.testIamPermissions(resource, permissions);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` 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). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissionsCallable()

    public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       ApiFuture<TestIamPermissionsResponse> future =
           cloudBillingClient.testIamPermissionsCallable().futureCall(request);
       // Do something.
       TestIamPermissionsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>` |   |

### updateBillingAccount(BillingAccountName name, BillingAccount account)

    public final BillingAccount updateBillingAccount(BillingAccountName name, BillingAccount account)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       BillingAccountName name = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]");
       BillingAccount account = BillingAccount.newBuilder().build();
       BillingAccount response = cloudBillingClient.updateBillingAccount(name, account);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccountName` Required. The name of the billing account resource to be updated. |
| `account` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` Required. The billing account resource to replace the resource on the server. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### updateBillingAccount(UpdateBillingAccountRequest request)

    public final BillingAccount updateBillingAccount(UpdateBillingAccountRequest request)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       UpdateBillingAccountRequest request =
           UpdateBillingAccountRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setAccount(BillingAccount.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       BillingAccount response = cloudBillingClient.updateBillingAccount(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.UpdateBillingAccountRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### updateBillingAccount(String name, BillingAccount account)

    public final BillingAccount updateBillingAccount(String name, BillingAccount account)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String name = BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString();
       BillingAccount account = BillingAccount.newBuilder().build();
       BillingAccount response = cloudBillingClient.updateBillingAccount(name, account);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the billing account resource to be updated. |
| `account` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` Required. The billing account resource to replace the resource on the server. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount` |   |

### updateBillingAccountCallable()

    public final UnaryCallable<UpdateBillingAccountRequest,BillingAccount> updateBillingAccountCallable()

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       UpdateBillingAccountRequest request =
           UpdateBillingAccountRequest.newBuilder()
               .setName(BillingAccountName.ofBillingAccountName("[BILLING_ACCOUNT]").toString())
               .setAccount(BillingAccount.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<BillingAccount> future =
           cloudBillingClient.updateBillingAccountCallable().futureCall(request);
       // Do something.
       BillingAccount response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.UpdateBillingAccountRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.BillingAccount>` |   |

### updateProjectBillingInfo(UpdateProjectBillingInfoRequest request)

    public final ProjectBillingInfo updateProjectBillingInfo(UpdateProjectBillingInfoRequest request)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       UpdateProjectBillingInfoRequest request =
           UpdateProjectBillingInfoRequest.newBuilder()
               .setName("name3373707")
               .setProjectBillingInfo(ProjectBillingInfo.newBuilder().build())
               .build();
       ProjectBillingInfo response = cloudBillingClient.updateProjectBillingInfo(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.UpdateProjectBillingInfoRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo` |   |

### updateProjectBillingInfo(String name, ProjectBillingInfo projectBillingInfo)

    public final ProjectBillingInfo updateProjectBillingInfo(String name, ProjectBillingInfo projectBillingInfo)

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       String name = "name3373707";
       ProjectBillingInfo projectBillingInfo = ProjectBillingInfo.newBuilder().build();
       ProjectBillingInfo response =
           cloudBillingClient.updateProjectBillingInfo(name, projectBillingInfo);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`. |
| `projectBillingInfo` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo` The new billing information for the project. Output-only fields are ignored; thus, you can leave empty all fields except `billing_account_name`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo` |   |

### updateProjectBillingInfoCallable()

    public final UnaryCallable<UpdateProjectBillingInfoRequest,ProjectBillingInfo> updateProjectBillingInfoCallable()

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.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
       UpdateProjectBillingInfoRequest request =
           UpdateProjectBillingInfoRequest.newBuilder()
               .setName("name3373707")
               .setProjectBillingInfo(ProjectBillingInfo.newBuilder().build())
               .build();
       ApiFuture<ProjectBillingInfo> future =
           cloudBillingClient.updateProjectBillingInfoCallable().futureCall(request);
       // Do something.
       ProjectBillingInfo response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.UpdateProjectBillingInfoRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-billing/latest/com.google.cloud.billing.v1.ProjectBillingInfo>` |   |