# Google Cloud Billing v1 API - Class CloudBilling.CloudBillingBase (3.10.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.10.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.9.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.9.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.8.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.7.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.6.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.5.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.4.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.3.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.2.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.1.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [3.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/3.0.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/2.3.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/2.2.0/Google.Cloud.Billing.V1.CloudBilling.CloudBillingBase)

    [BindServiceMethod(typeof(CloudBilling), "BindService")]
    public abstract class CloudBilling.CloudBillingBase

Reference documentation and code samples for the Google Cloud Billing v1 API class CloudBilling.CloudBillingBase.

Base class for server-side implementations of CloudBilling

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> CloudBilling.CloudBillingBase

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Billing.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1)

## Assembly

Google.Cloud.Billing.V1.dll

## Methods

### CreateBillingAccount(CreateBillingAccountRequest, ServerCallContext)

    public virtual Task<BillingAccount> CreateBillingAccount(CreateBillingAccountRequest request, ServerCallContext context)

This method creates [billing
subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts).

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

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.CreateBillingAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.BillingAccount` | The response to send back to the client (wrapped by a task). |

### GetBillingAccount(GetBillingAccountRequest, ServerCallContext)

    public virtual Task<BillingAccount> GetBillingAccount(GetBillingAccountRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.GetBillingAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.BillingAccount` | The response to send back to the client (wrapped by a task). |

### GetIamPolicy(GetIamPolicyRequest, ServerCallContext)

    public virtual Task<Policy> GetIamPolicy(GetIamPolicyRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.GetIamPolicyRequest.html` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.Policy.html` | The response to send back to the client (wrapped by a task). |

### GetProjectBillingInfo(GetProjectBillingInfoRequest, ServerCallContext)

    public virtual Task<ProjectBillingInfo> GetProjectBillingInfo(GetProjectBillingInfoRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.GetProjectBillingInfoRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.ProjectBillingInfo` | The response to send back to the client (wrapped by a task). |

### ListBillingAccounts(ListBillingAccountsRequest, ServerCallContext)

    public virtual Task<ListBillingAccountsResponse> ListBillingAccounts(ListBillingAccountsRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.ListBillingAccountsRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.ListBillingAccountsResponse` | The response to send back to the client (wrapped by a task). |

### ListProjectBillingInfo(ListProjectBillingInfoRequest, ServerCallContext)

    public virtual Task<ListProjectBillingInfoResponse> ListProjectBillingInfo(ListProjectBillingInfoRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.ListProjectBillingInfoRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.ListProjectBillingInfoResponse` | The response to send back to the client (wrapped by a task). |

### MoveBillingAccount(MoveBillingAccountRequest, ServerCallContext)

    public virtual Task<BillingAccount> MoveBillingAccount(MoveBillingAccountRequest request, ServerCallContext context)

Changes which parent organization a billing account belongs to.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.MoveBillingAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.BillingAccount` | The response to send back to the client (wrapped by a task). |

### SetIamPolicy(SetIamPolicyRequest, ServerCallContext)

    public virtual Task<Policy> SetIamPolicy(SetIamPolicyRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.SetIamPolicyRequest.html` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.Policy.html` | The response to send back to the client (wrapped by a task). |

### TestIamPermissions(TestIamPermissionsRequest, ServerCallContext)

    public virtual Task<TestIamPermissionsResponse> TestIamPermissions(TestIamPermissionsRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.TestIamPermissionsRequest.html` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.TestIamPermissionsResponse.html` | The response to send back to the client (wrapped by a task). |

### UpdateBillingAccount(UpdateBillingAccountRequest, ServerCallContext)

    public virtual Task<BillingAccount> UpdateBillingAccount(UpdateBillingAccountRequest request, ServerCallContext context)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.UpdateBillingAccountRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.BillingAccount` | The response to send back to the client (wrapped by a task). |

### UpdateProjectBillingInfo(UpdateProjectBillingInfoRequest, ServerCallContext)

    public virtual Task<ProjectBillingInfo> UpdateProjectBillingInfo(UpdateProjectBillingInfoRequest request, ServerCallContext context)

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

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

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

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

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.UpdateProjectBillingInfoRequest` The request received from the client. |
| `context` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext.html` The context of the server-side call handler being invoked. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Billing.V1/latest/Google.Cloud.Billing.V1.ProjectBillingInfo` | The response to send back to the client (wrapped by a task). |