Class CloudBillingGrpc.CloudBillingFutureStub (2.46.0)

public static final class CloudBillingGrpc.CloudBillingFutureStub extends AbstractFutureStub<CloudBillingGrpc.CloudBillingFutureStub>

A stub to allow clients to do ListenableFuture-style rpc calls to service CloudBilling.

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

Inheritance

java.lang.Object > io.grpc.stub.AbstractStub > io.grpc.stub.AbstractFutureStub > CloudBillingGrpc.CloudBillingFutureStub

Methods

build(Channel channel, CallOptions callOptions)

protected CloudBillingGrpc.CloudBillingFutureStub build(Channel channel, CallOptions callOptions)
Parameters
Name Description
channel io.grpc.Channel
callOptions io.grpc.CallOptions
Returns
Type Description
CloudBillingGrpc.CloudBillingFutureStub
Overrides
io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)

createBillingAccount(CreateBillingAccountRequest request)

public ListenableFuture<BillingAccount> createBillingAccount(CreateBillingAccountRequest request)

This method creates billing subaccounts. Google Cloud resellers should use the Channel Services APIs, accounts.customers.create and 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. This method will return an error if the parent account has not been provisioned for subaccounts.

Parameter
Name Description
request CreateBillingAccountRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<BillingAccount>

getBillingAccount(GetBillingAccountRequest request)

public ListenableFuture<BillingAccount> getBillingAccount(GetBillingAccountRequest request)

Gets information about a billing account. The current authenticated user must be a viewer of the billing account.

Parameter
Name Description
request GetBillingAccountRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<BillingAccount>

getIamPolicy(GetIamPolicyRequest request)

public ListenableFuture<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.

Parameter
Name Description
request com.google.iam.v1.GetIamPolicyRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<com.google.iam.v1.Policy>

getProjectBillingInfo(GetProjectBillingInfoRequest request)

public ListenableFuture<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 role.

Parameter
Name Description
request GetProjectBillingInfoRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ProjectBillingInfo>

listBillingAccounts(ListBillingAccountsRequest request)

public ListenableFuture<ListBillingAccountsResponse> listBillingAccounts(ListBillingAccountsRequest request)

Lists the billing accounts that the current authenticated user has permission to view.

Parameter
Name Description
request ListBillingAccountsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListBillingAccountsResponse>

listProjectBillingInfo(ListProjectBillingInfoRequest request)

public ListenableFuture<ListProjectBillingInfoResponse> 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.

Parameter
Name Description
request ListProjectBillingInfoRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListProjectBillingInfoResponse>

moveBillingAccount(MoveBillingAccountRequest request)

public ListenableFuture<BillingAccount> moveBillingAccount(MoveBillingAccountRequest request)

Changes which parent organization a billing account belongs to.

Parameter
Name Description
request MoveBillingAccountRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<BillingAccount>

setIamPolicy(SetIamPolicyRequest request)

public ListenableFuture<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.

Parameter
Name Description
request com.google.iam.v1.SetIamPolicyRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<com.google.iam.v1.Policy>

testIamPermissions(TestIamPermissionsRequest request)

public ListenableFuture<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.

Parameter
Name Description
request com.google.iam.v1.TestIamPermissionsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<com.google.iam.v1.TestIamPermissionsResponse>

updateBillingAccount(UpdateBillingAccountRequest request)

public ListenableFuture<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 of the billing account.

Parameter
Name Description
request UpdateBillingAccountRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<BillingAccount>

updateProjectBillingInfo(UpdateProjectBillingInfoRequest request)

public ListenableFuture<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 and the billing account. 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.

Parameter
Name Description
request UpdateProjectBillingInfoRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ProjectBillingInfo>