Class CloudBillingClient (2.2.0)

public abstract class CloudBillingClient

CloudBilling client wrapper, for convenient use.

Inheritance

Object > CloudBillingClient

Derived Types

Namespace

Google.Cloud.Billing.V1

Assembly

Google.Cloud.Billing.V1.dll

Remarks

Retrieves GCP Console billing accounts and associates them with projects.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the CloudBilling service, which is a host of "cloudbilling.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudBilling scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default CloudBilling scopes are:

GrpcClient

public virtual CloudBilling.CloudBillingClient GrpcClient { get; }

The underlying gRPC CloudBilling client

Property Value
TypeDescription
CloudBilling.CloudBillingClient

Methods

Create()

public static CloudBillingClient Create()

Synchronously creates a CloudBillingClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudBillingClientBuilder.

Returns
TypeDescription
CloudBillingClient

The created CloudBillingClient.

CreateAsync(CancellationToken)

public static Task<CloudBillingClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a CloudBillingClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudBillingClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<CloudBillingClient>

The task representing the created CloudBillingClient.

CreateBillingAccount(BillingAccount, CallSettings)

public virtual BillingAccount CreateBillingAccount(BillingAccount billingAccount, CallSettings callSettings = null)

Creates a billing account. This method can only be used to create billing subaccounts by GCP resellers. When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the master account, which is typically given to billing account administrators. This method will return an error if the master account has not been provisioned as a reseller account.

Parameters
NameDescription
billingAccountBillingAccount

Required. The billing account resource to create. Currently CreateBillingAccount only supports subaccount creation, so any created billing accounts must be under a provided master billing account.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
BillingAccount billingAccount = new BillingAccount();
// Make the request
BillingAccount response = cloudBillingClient.CreateBillingAccount(billingAccount);

CreateBillingAccount(CreateBillingAccountRequest, CallSettings)

public virtual BillingAccount CreateBillingAccount(CreateBillingAccountRequest request, CallSettings callSettings = null)

Creates a billing account. This method can only be used to create billing subaccounts by GCP resellers. When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the master account, which is typically given to billing account administrators. This method will return an error if the master account has not been provisioned as a reseller account.

Parameters
NameDescription
requestCreateBillingAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
CreateBillingAccountRequest request = new CreateBillingAccountRequest
{
    BillingAccount = new BillingAccount(),
};
// Make the request
BillingAccount response = cloudBillingClient.CreateBillingAccount(request);

CreateBillingAccountAsync(BillingAccount, CallSettings)

public virtual Task<BillingAccount> CreateBillingAccountAsync(BillingAccount billingAccount, CallSettings callSettings = null)

Creates a billing account. This method can only be used to create billing subaccounts by GCP resellers. When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the master account, which is typically given to billing account administrators. This method will return an error if the master account has not been provisioned as a reseller account.

Parameters
NameDescription
billingAccountBillingAccount

Required. The billing account resource to create. Currently CreateBillingAccount only supports subaccount creation, so any created billing accounts must be under a provided master billing account.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
BillingAccount billingAccount = new BillingAccount();
// Make the request
BillingAccount response = await cloudBillingClient.CreateBillingAccountAsync(billingAccount);

CreateBillingAccountAsync(BillingAccount, CancellationToken)

public virtual Task<BillingAccount> CreateBillingAccountAsync(BillingAccount billingAccount, CancellationToken cancellationToken)

Creates a billing account. This method can only be used to create billing subaccounts by GCP resellers. When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the master account, which is typically given to billing account administrators. This method will return an error if the master account has not been provisioned as a reseller account.

Parameters
NameDescription
billingAccountBillingAccount

Required. The billing account resource to create. Currently CreateBillingAccount only supports subaccount creation, so any created billing accounts must be under a provided master billing account.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
BillingAccount billingAccount = new BillingAccount();
// Make the request
BillingAccount response = await cloudBillingClient.CreateBillingAccountAsync(billingAccount);

CreateBillingAccountAsync(CreateBillingAccountRequest, CallSettings)

public virtual Task<BillingAccount> CreateBillingAccountAsync(CreateBillingAccountRequest request, CallSettings callSettings = null)

Creates a billing account. This method can only be used to create billing subaccounts by GCP resellers. When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the master account, which is typically given to billing account administrators. This method will return an error if the master account has not been provisioned as a reseller account.

Parameters
NameDescription
requestCreateBillingAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
CreateBillingAccountRequest request = new CreateBillingAccountRequest
{
    BillingAccount = new BillingAccount(),
};
// Make the request
BillingAccount response = await cloudBillingClient.CreateBillingAccountAsync(request);

CreateBillingAccountAsync(CreateBillingAccountRequest, CancellationToken)

public virtual Task<BillingAccount> CreateBillingAccountAsync(CreateBillingAccountRequest request, CancellationToken cancellationToken)

Creates a billing account. This method can only be used to create billing subaccounts by GCP resellers. When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the master account, which is typically given to billing account administrators. This method will return an error if the master account has not been provisioned as a reseller account.

Parameters
NameDescription
requestCreateBillingAccountRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
CreateBillingAccountRequest request = new CreateBillingAccountRequest
{
    BillingAccount = new BillingAccount(),
};
// Make the request
BillingAccount response = await cloudBillingClient.CreateBillingAccountAsync(request);

GetBillingAccount(BillingAccountName, CallSettings)

public virtual BillingAccount GetBillingAccount(BillingAccountName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameBillingAccountName

Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
// Make the request
BillingAccount response = cloudBillingClient.GetBillingAccount(name);

GetBillingAccount(GetBillingAccountRequest, CallSettings)

public virtual BillingAccount GetBillingAccount(GetBillingAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetBillingAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
GetBillingAccountRequest request = new GetBillingAccountRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
};
// Make the request
BillingAccount response = cloudBillingClient.GetBillingAccount(request);

GetBillingAccount(String, CallSettings)

public virtual BillingAccount GetBillingAccount(string name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameString

Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
// Make the request
BillingAccount response = cloudBillingClient.GetBillingAccount(name);

GetBillingAccountAsync(BillingAccountName, CallSettings)

public virtual Task<BillingAccount> GetBillingAccountAsync(BillingAccountName name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameBillingAccountName

Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
// Make the request
BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(name);

GetBillingAccountAsync(BillingAccountName, CancellationToken)

public virtual Task<BillingAccount> GetBillingAccountAsync(BillingAccountName name, CancellationToken cancellationToken)

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

Parameters
NameDescription
nameBillingAccountName

Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
// Make the request
BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(name);

GetBillingAccountAsync(GetBillingAccountRequest, CallSettings)

public virtual Task<BillingAccount> GetBillingAccountAsync(GetBillingAccountRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetBillingAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
GetBillingAccountRequest request = new GetBillingAccountRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
};
// Make the request
BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(request);

GetBillingAccountAsync(GetBillingAccountRequest, CancellationToken)

public virtual Task<BillingAccount> GetBillingAccountAsync(GetBillingAccountRequest request, CancellationToken cancellationToken)

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

Parameters
NameDescription
requestGetBillingAccountRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
GetBillingAccountRequest request = new GetBillingAccountRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
};
// Make the request
BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(request);

GetBillingAccountAsync(String, CallSettings)

public virtual Task<BillingAccount> GetBillingAccountAsync(string name, CallSettings callSettings = null)

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

Parameters
NameDescription
nameString

Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
// Make the request
BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(name);

GetBillingAccountAsync(String, CancellationToken)

public virtual Task<BillingAccount> GetBillingAccountAsync(string name, CancellationToken cancellationToken)

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

Parameters
NameDescription
nameString

Required. The resource name of the billing account to retrieve. For example, billingAccounts/012345-567890-ABCDEF.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
// Make the request
BillingAccount response = await cloudBillingClient.GetBillingAccountAsync(name);

GetIamPolicy(IResourceName, CallSettings)

public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = cloudBillingClient.GetIamPolicy(resource);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = cloudBillingClient.GetIamPolicy(request);

GetIamPolicy(String, CallSettings)

public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = cloudBillingClient.GetIamPolicy(resource);

GetIamPolicyAsync(IResourceName, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await cloudBillingClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(IResourceName, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)

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.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await cloudBillingClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await cloudBillingClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await cloudBillingClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(String, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await cloudBillingClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(String, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)

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.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await cloudBillingClient.GetIamPolicyAsync(resource);

GetProjectBillingInfo(GetProjectBillingInfoRequest, CallSettings)

public virtual ProjectBillingInfo GetProjectBillingInfo(GetProjectBillingInfoRequest request, CallSettings callSettings = null)

Gets the billing information for a project. The current authenticated user must have permission to view the project.

Parameters
NameDescription
requestGetProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProjectBillingInfo

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
GetProjectBillingInfoRequest request = new GetProjectBillingInfoRequest { Name = "", };
// Make the request
ProjectBillingInfo response = cloudBillingClient.GetProjectBillingInfo(request);

GetProjectBillingInfo(String, CallSettings)

public virtual ProjectBillingInfo GetProjectBillingInfo(string name, CallSettings callSettings = null)

Gets the billing information for a project. The current authenticated user must have permission to view the project.

Parameters
NameDescription
nameString

Required. The resource name of the project for which billing information is retrieved. For example, projects/tokyo-rain-123.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProjectBillingInfo

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
ProjectBillingInfo response = cloudBillingClient.GetProjectBillingInfo(name);

GetProjectBillingInfoAsync(GetProjectBillingInfoRequest, CallSettings)

public virtual Task<ProjectBillingInfo> GetProjectBillingInfoAsync(GetProjectBillingInfoRequest request, CallSettings callSettings = null)

Gets the billing information for a project. The current authenticated user must have permission to view the project.

Parameters
NameDescription
requestGetProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
GetProjectBillingInfoRequest request = new GetProjectBillingInfoRequest { Name = "", };
// Make the request
ProjectBillingInfo response = await cloudBillingClient.GetProjectBillingInfoAsync(request);

GetProjectBillingInfoAsync(GetProjectBillingInfoRequest, CancellationToken)

public virtual Task<ProjectBillingInfo> GetProjectBillingInfoAsync(GetProjectBillingInfoRequest request, CancellationToken cancellationToken)

Gets the billing information for a project. The current authenticated user must have permission to view the project.

Parameters
NameDescription
requestGetProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
GetProjectBillingInfoRequest request = new GetProjectBillingInfoRequest { Name = "", };
// Make the request
ProjectBillingInfo response = await cloudBillingClient.GetProjectBillingInfoAsync(request);

GetProjectBillingInfoAsync(String, CallSettings)

public virtual Task<ProjectBillingInfo> GetProjectBillingInfoAsync(string name, CallSettings callSettings = null)

Gets the billing information for a project. The current authenticated user must have permission to view the project.

Parameters
NameDescription
nameString

Required. The resource name of the project for which billing information is retrieved. For example, projects/tokyo-rain-123.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
ProjectBillingInfo response = await cloudBillingClient.GetProjectBillingInfoAsync(name);

GetProjectBillingInfoAsync(String, CancellationToken)

public virtual Task<ProjectBillingInfo> GetProjectBillingInfoAsync(string name, CancellationToken cancellationToken)

Gets the billing information for a project. The current authenticated user must have permission to view the project.

Parameters
NameDescription
nameString

Required. The resource name of the project for which billing information is retrieved. For example, projects/tokyo-rain-123.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
ProjectBillingInfo response = await cloudBillingClient.GetProjectBillingInfoAsync(name);

ListBillingAccounts(ListBillingAccountsRequest, CallSettings)

public virtual PagedEnumerable<ListBillingAccountsResponse, BillingAccount> ListBillingAccounts(ListBillingAccountsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListBillingAccountsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListBillingAccountsResponse, BillingAccount>

A pageable sequence of BillingAccount resources.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
ListBillingAccountsRequest request = new ListBillingAccountsRequest { Filter = "", };
// Make the request
PagedEnumerable<ListBillingAccountsResponse, BillingAccount> response = cloudBillingClient.ListBillingAccounts(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (BillingAccount item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBillingAccountsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BillingAccount item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BillingAccount> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BillingAccount item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBillingAccounts(String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListBillingAccountsResponse, BillingAccount> ListBillingAccounts(string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

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

Parameters
NameDescription
pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListBillingAccountsResponse, BillingAccount>

A pageable sequence of BillingAccount resources.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Make the request
PagedEnumerable<ListBillingAccountsResponse, BillingAccount> response = cloudBillingClient.ListBillingAccounts();

// Iterate over all response items, lazily performing RPCs as required
foreach (BillingAccount item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBillingAccountsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BillingAccount item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BillingAccount> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BillingAccount item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBillingAccountsAsync(ListBillingAccountsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListBillingAccountsResponse, BillingAccount> ListBillingAccountsAsync(ListBillingAccountsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListBillingAccountsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListBillingAccountsResponse, BillingAccount>

A pageable asynchronous sequence of BillingAccount resources.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
ListBillingAccountsRequest request = new ListBillingAccountsRequest { Filter = "", };
// Make the request
PagedAsyncEnumerable<ListBillingAccountsResponse, BillingAccount> response = cloudBillingClient.ListBillingAccountsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((BillingAccount item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBillingAccountsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BillingAccount item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BillingAccount> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BillingAccount item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListBillingAccountsAsync(String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListBillingAccountsResponse, BillingAccount> ListBillingAccountsAsync(string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

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

Parameters
NameDescription
pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListBillingAccountsResponse, BillingAccount>

A pageable asynchronous sequence of BillingAccount resources.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Make the request
PagedAsyncEnumerable<ListBillingAccountsResponse, BillingAccount> response = cloudBillingClient.ListBillingAccountsAsync();

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((BillingAccount item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBillingAccountsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (BillingAccount item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<BillingAccount> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (BillingAccount item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectBillingInfo(BillingAccountName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> ListProjectBillingInfo(BillingAccountName name, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

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.

Parameters
NameDescription
nameBillingAccountName

Required. The resource name of the billing account associated with the projects that you want to list. For example, billingAccounts/012345-567890-ABCDEF.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo>

A pageable sequence of ProjectBillingInfo resources.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
// Make the request
PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> response = cloudBillingClient.ListProjectBillingInfo(name);

// Iterate over all response items, lazily performing RPCs as required
foreach (ProjectBillingInfo item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProjectBillingInfoResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ProjectBillingInfo item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ProjectBillingInfo> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ProjectBillingInfo item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectBillingInfo(ListProjectBillingInfoRequest, CallSettings)

public virtual PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> ListProjectBillingInfo(ListProjectBillingInfoRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestListProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo>

A pageable sequence of ProjectBillingInfo resources.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
ListProjectBillingInfoRequest request = new ListProjectBillingInfoRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> response = cloudBillingClient.ListProjectBillingInfo(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (ProjectBillingInfo item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProjectBillingInfoResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ProjectBillingInfo item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ProjectBillingInfo> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ProjectBillingInfo item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectBillingInfo(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> ListProjectBillingInfo(string name, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

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.

Parameters
NameDescription
nameString

Required. The resource name of the billing account associated with the projects that you want to list. For example, billingAccounts/012345-567890-ABCDEF.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo>

A pageable sequence of ProjectBillingInfo resources.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
// Make the request
PagedEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> response = cloudBillingClient.ListProjectBillingInfo(name);

// Iterate over all response items, lazily performing RPCs as required
foreach (ProjectBillingInfo item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProjectBillingInfoResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ProjectBillingInfo item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ProjectBillingInfo> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ProjectBillingInfo item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectBillingInfoAsync(BillingAccountName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> ListProjectBillingInfoAsync(BillingAccountName name, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

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.

Parameters
NameDescription
nameBillingAccountName

Required. The resource name of the billing account associated with the projects that you want to list. For example, billingAccounts/012345-567890-ABCDEF.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo>

A pageable asynchronous sequence of ProjectBillingInfo resources.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> response = cloudBillingClient.ListProjectBillingInfoAsync(name);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ProjectBillingInfo item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProjectBillingInfoResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ProjectBillingInfo item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ProjectBillingInfo> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ProjectBillingInfo item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectBillingInfoAsync(ListProjectBillingInfoRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> ListProjectBillingInfoAsync(ListProjectBillingInfoRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestListProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo>

A pageable asynchronous sequence of ProjectBillingInfo resources.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
ListProjectBillingInfoRequest request = new ListProjectBillingInfoRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> response = cloudBillingClient.ListProjectBillingInfoAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ProjectBillingInfo item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProjectBillingInfoResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ProjectBillingInfo item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ProjectBillingInfo> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ProjectBillingInfo item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectBillingInfoAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> ListProjectBillingInfoAsync(string name, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

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.

Parameters
NameDescription
nameString

Required. The resource name of the billing account associated with the projects that you want to list. For example, billingAccounts/012345-567890-ABCDEF.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo>

A pageable asynchronous sequence of ProjectBillingInfo resources.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListProjectBillingInfoResponse, ProjectBillingInfo> response = cloudBillingClient.ListProjectBillingInfoAsync(name);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ProjectBillingInfo item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProjectBillingInfoResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ProjectBillingInfo item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<ProjectBillingInfo> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ProjectBillingInfo item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SetIamPolicy(IResourceName, Policy, CallSettings)

public virtual Policy SetIamPolicy(IResourceName resource, Policy policy, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyGoogle.Cloud.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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = cloudBillingClient.SetIamPolicy(resource, policy);

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = cloudBillingClient.SetIamPolicy(request);

SetIamPolicy(String, Policy, CallSettings)

public virtual Policy SetIamPolicy(string resource, Policy policy, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyGoogle.Cloud.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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.Policy

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = cloudBillingClient.SetIamPolicy(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyGoogle.Cloud.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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await cloudBillingClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CancellationToken cancellationToken)

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.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyGoogle.Cloud.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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await cloudBillingClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await cloudBillingClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestGoogle.Cloud.Iam.V1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
};
// Make the request
Policy response = await cloudBillingClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(String, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CallSettings callSettings = null)

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.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyGoogle.Cloud.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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await cloudBillingClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(String, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CancellationToken cancellationToken)

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.

Parameters
NameDescription
resourceString

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyGoogle.Cloud.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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.Policy>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await cloudBillingClient.SetIamPolicyAsync(resource, policy);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

TestIamPermissions(IResourceName, IEnumerable<String>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

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
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.TestIamPermissionsResponse

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = cloudBillingClient.TestIamPermissions(resource, permissions);

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

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
NameDescription
requestGoogle.Cloud.Iam.V1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.TestIamPermissionsResponse

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = cloudBillingClient.TestIamPermissions(request);

TestIamPermissions(String, IEnumerable<String>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

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
NameDescription
resourceString

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Google.Cloud.Iam.V1.TestIamPermissionsResponse

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = cloudBillingClient.TestIamPermissions(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

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
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<String>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

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
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

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
NameDescription
requestGoogle.Cloud.Iam.V1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

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
NameDescription
requestGoogle.Cloud.Iam.V1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(String, IEnumerable<String>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

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
NameDescription
resourceString

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(String, IEnumerable<String>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

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
NameDescription
resourceString

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerable<String>

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Google.Cloud.Iam.V1.TestIamPermissionsResponse>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await cloudBillingClient.TestIamPermissionsAsync(resource, permissions);

UpdateBillingAccount(BillingAccountName, BillingAccount, CallSettings)

public virtual BillingAccount UpdateBillingAccount(BillingAccountName name, BillingAccount account, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameBillingAccountName

Required. The name of the billing account resource to be updated.

accountBillingAccount

Required. The billing account resource to replace the resource on the server.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
BillingAccount account = new BillingAccount();
// Make the request
BillingAccount response = cloudBillingClient.UpdateBillingAccount(name, account);

UpdateBillingAccount(UpdateBillingAccountRequest, CallSettings)

public virtual BillingAccount UpdateBillingAccount(UpdateBillingAccountRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestUpdateBillingAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
UpdateBillingAccountRequest request = new UpdateBillingAccountRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
    Account = new BillingAccount(),
    UpdateMask = new FieldMask(),
};
// Make the request
BillingAccount response = cloudBillingClient.UpdateBillingAccount(request);

UpdateBillingAccount(String, BillingAccount, CallSettings)

public virtual BillingAccount UpdateBillingAccount(string name, BillingAccount account, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameString

Required. The name of the billing account resource to be updated.

accountBillingAccount

Required. The billing account resource to replace the resource on the server.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
BillingAccount

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
BillingAccount account = new BillingAccount();
// Make the request
BillingAccount response = cloudBillingClient.UpdateBillingAccount(name, account);

UpdateBillingAccountAsync(BillingAccountName, BillingAccount, CallSettings)

public virtual Task<BillingAccount> UpdateBillingAccountAsync(BillingAccountName name, BillingAccount account, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameBillingAccountName

Required. The name of the billing account resource to be updated.

accountBillingAccount

Required. The billing account resource to replace the resource on the server.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
BillingAccount account = new BillingAccount();
// Make the request
BillingAccount response = await cloudBillingClient.UpdateBillingAccountAsync(name, account);

UpdateBillingAccountAsync(BillingAccountName, BillingAccount, CancellationToken)

public virtual Task<BillingAccount> UpdateBillingAccountAsync(BillingAccountName name, BillingAccount account, CancellationToken cancellationToken)

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.

Parameters
NameDescription
nameBillingAccountName

Required. The name of the billing account resource to be updated.

accountBillingAccount

Required. The billing account resource to replace the resource on the server.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName name = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
BillingAccount account = new BillingAccount();
// Make the request
BillingAccount response = await cloudBillingClient.UpdateBillingAccountAsync(name, account);

UpdateBillingAccountAsync(UpdateBillingAccountRequest, CallSettings)

public virtual Task<BillingAccount> UpdateBillingAccountAsync(UpdateBillingAccountRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestUpdateBillingAccountRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
UpdateBillingAccountRequest request = new UpdateBillingAccountRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
    Account = new BillingAccount(),
    UpdateMask = new FieldMask(),
};
// Make the request
BillingAccount response = await cloudBillingClient.UpdateBillingAccountAsync(request);

UpdateBillingAccountAsync(UpdateBillingAccountRequest, CancellationToken)

public virtual Task<BillingAccount> UpdateBillingAccountAsync(UpdateBillingAccountRequest request, CancellationToken cancellationToken)

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.

Parameters
NameDescription
requestUpdateBillingAccountRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
UpdateBillingAccountRequest request = new UpdateBillingAccountRequest
{
    BillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
    Account = new BillingAccount(),
    UpdateMask = new FieldMask(),
};
// Make the request
BillingAccount response = await cloudBillingClient.UpdateBillingAccountAsync(request);

UpdateBillingAccountAsync(String, BillingAccount, CallSettings)

public virtual Task<BillingAccount> UpdateBillingAccountAsync(string name, BillingAccount account, CallSettings callSettings = null)

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.

Parameters
NameDescription
nameString

Required. The name of the billing account resource to be updated.

accountBillingAccount

Required. The billing account resource to replace the resource on the server.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
BillingAccount account = new BillingAccount();
// Make the request
BillingAccount response = await cloudBillingClient.UpdateBillingAccountAsync(name, account);

UpdateBillingAccountAsync(String, BillingAccount, CancellationToken)

public virtual Task<BillingAccount> UpdateBillingAccountAsync(string name, BillingAccount account, CancellationToken cancellationToken)

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.

Parameters
NameDescription
nameString

Required. The name of the billing account resource to be updated.

accountBillingAccount

Required. The billing account resource to replace the resource on the server.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<BillingAccount>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]";
BillingAccount account = new BillingAccount();
// Make the request
BillingAccount response = await cloudBillingClient.UpdateBillingAccountAsync(name, account);

UpdateProjectBillingInfo(UpdateProjectBillingInfoRequest, CallSettings)

public virtual ProjectBillingInfo UpdateProjectBillingInfo(UpdateProjectBillingInfoRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestUpdateProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProjectBillingInfo

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
UpdateProjectBillingInfoRequest request = new UpdateProjectBillingInfoRequest
{
    Name = "",
    ProjectBillingInfo = new ProjectBillingInfo(),
};
// Make the request
ProjectBillingInfo response = cloudBillingClient.UpdateProjectBillingInfo(request);

UpdateProjectBillingInfo(String, ProjectBillingInfo, CallSettings)

public virtual ProjectBillingInfo UpdateProjectBillingInfo(string name, ProjectBillingInfo projectBillingInfo, CallSettings callSettings = null)

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

Parameters
NameDescription
nameString

Required. The resource name of the project associated with the billing information that you want to update. For example, projects/tokyo-rain-123.

projectBillingInfoProjectBillingInfo

The new billing information for the project. Read-only fields are ignored; thus, you can leave empty all fields except billing_account_name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProjectBillingInfo

The RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = CloudBillingClient.Create();
// Initialize request argument(s)
string name = "";
ProjectBillingInfo projectBillingInfo = new ProjectBillingInfo();
// Make the request
ProjectBillingInfo response = cloudBillingClient.UpdateProjectBillingInfo(name, projectBillingInfo);

UpdateProjectBillingInfoAsync(UpdateProjectBillingInfoRequest, CallSettings)

public virtual Task<ProjectBillingInfo> UpdateProjectBillingInfoAsync(UpdateProjectBillingInfoRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestUpdateProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
UpdateProjectBillingInfoRequest request = new UpdateProjectBillingInfoRequest
{
    Name = "",
    ProjectBillingInfo = new ProjectBillingInfo(),
};
// Make the request
ProjectBillingInfo response = await cloudBillingClient.UpdateProjectBillingInfoAsync(request);

UpdateProjectBillingInfoAsync(UpdateProjectBillingInfoRequest, CancellationToken)

public virtual Task<ProjectBillingInfo> UpdateProjectBillingInfoAsync(UpdateProjectBillingInfoRequest request, CancellationToken cancellationToken)

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

Parameters
NameDescription
requestUpdateProjectBillingInfoRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
UpdateProjectBillingInfoRequest request = new UpdateProjectBillingInfoRequest
{
    Name = "",
    ProjectBillingInfo = new ProjectBillingInfo(),
};
// Make the request
ProjectBillingInfo response = await cloudBillingClient.UpdateProjectBillingInfoAsync(request);

UpdateProjectBillingInfoAsync(String, ProjectBillingInfo, CallSettings)

public virtual Task<ProjectBillingInfo> UpdateProjectBillingInfoAsync(string name, ProjectBillingInfo projectBillingInfo, CallSettings callSettings = null)

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

Parameters
NameDescription
nameString

Required. The resource name of the project associated with the billing information that you want to update. For example, projects/tokyo-rain-123.

projectBillingInfoProjectBillingInfo

The new billing information for the project. Read-only fields are ignored; thus, you can leave empty all fields except billing_account_name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "";
ProjectBillingInfo projectBillingInfo = new ProjectBillingInfo();
// Make the request
ProjectBillingInfo response = await cloudBillingClient.UpdateProjectBillingInfoAsync(name, projectBillingInfo);

UpdateProjectBillingInfoAsync(String, ProjectBillingInfo, CancellationToken)

public virtual Task<ProjectBillingInfo> UpdateProjectBillingInfoAsync(string name, ProjectBillingInfo projectBillingInfo, CancellationToken cancellationToken)

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

Parameters
NameDescription
nameString

Required. The resource name of the project associated with the billing information that you want to update. For example, projects/tokyo-rain-123.

projectBillingInfoProjectBillingInfo

The new billing information for the project. Read-only fields are ignored; thus, you can leave empty all fields except billing_account_name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProjectBillingInfo>

A Task containing the RPC response.

Example
// Create client
CloudBillingClient cloudBillingClient = await CloudBillingClient.CreateAsync();
// Initialize request argument(s)
string name = "";
ProjectBillingInfo projectBillingInfo = new ProjectBillingInfo();
// Make the request
ProjectBillingInfo response = await cloudBillingClient.UpdateProjectBillingInfoAsync(name, projectBillingInfo);