Cloud Billing Budget v1 API - Class BudgetServiceClient (2.1.0)

public abstract class BudgetServiceClient

Reference documentation and code samples for the Cloud Billing Budget v1 API class BudgetServiceClient.

BudgetService client wrapper, for convenient use.

Inheritance

Object > BudgetServiceClient

Derived Types

Namespace

Google.Cloud.Billing.Budgets.V1

Assembly

Google.Cloud.Billing.Budgets.V1.dll

Remarks

BudgetService stores Cloud Billing budgets, which define a budget plan and rules to execute as we track spend against that plan.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default BudgetService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual BudgetService.BudgetServiceClient GrpcClient { get; }

The underlying gRPC BudgetService client

Property Value
TypeDescription
BudgetService.BudgetServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static BudgetServiceClient Create()

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

Returns
TypeDescription
BudgetServiceClient

The created BudgetServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<BudgetServiceClient>

The task representing the created BudgetServiceClient.

CreateBudget(BillingAccountName, Budget, CallSettings)

public virtual Budget CreateBudget(BillingAccountName parent, Budget budget, CallSettings callSettings = null)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
parentBillingAccountName

Required. The name of the billing account to create the budget in. Values are of the form billingAccounts/{billingAccountId}.

budgetBudget

Required. Budget to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
BillingAccountName parent = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
Budget budget = new Budget();
// Make the request
Budget response = budgetServiceClient.CreateBudget(parent, budget);

CreateBudget(CreateBudgetRequest, CallSettings)

public virtual Budget CreateBudget(CreateBudgetRequest request, CallSettings callSettings = null)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
requestCreateBudgetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
CreateBudgetRequest request = new CreateBudgetRequest
{
    ParentAsBillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
    Budget = new Budget(),
};
// Make the request
Budget response = budgetServiceClient.CreateBudget(request);

CreateBudget(String, Budget, CallSettings)

public virtual Budget CreateBudget(string parent, Budget budget, CallSettings callSettings = null)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
parentString

Required. The name of the billing account to create the budget in. Values are of the form billingAccounts/{billingAccountId}.

budgetBudget

Required. Budget to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
string parent = "billingAccounts/[BILLING_ACCOUNT]";
Budget budget = new Budget();
// Make the request
Budget response = budgetServiceClient.CreateBudget(parent, budget);

CreateBudgetAsync(BillingAccountName, Budget, CallSettings)

public virtual Task<Budget> CreateBudgetAsync(BillingAccountName parent, Budget budget, CallSettings callSettings = null)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
parentBillingAccountName

Required. The name of the billing account to create the budget in. Values are of the form billingAccounts/{billingAccountId}.

budgetBudget

Required. Budget to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName parent = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
Budget budget = new Budget();
// Make the request
Budget response = await budgetServiceClient.CreateBudgetAsync(parent, budget);

CreateBudgetAsync(BillingAccountName, Budget, CancellationToken)

public virtual Task<Budget> CreateBudgetAsync(BillingAccountName parent, Budget budget, CancellationToken cancellationToken)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
parentBillingAccountName

Required. The name of the billing account to create the budget in. Values are of the form billingAccounts/{billingAccountId}.

budgetBudget

Required. Budget to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName parent = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
Budget budget = new Budget();
// Make the request
Budget response = await budgetServiceClient.CreateBudgetAsync(parent, budget);

CreateBudgetAsync(CreateBudgetRequest, CallSettings)

public virtual Task<Budget> CreateBudgetAsync(CreateBudgetRequest request, CallSettings callSettings = null)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
requestCreateBudgetRequest

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

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
CreateBudgetRequest request = new CreateBudgetRequest
{
    ParentAsBillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
    Budget = new Budget(),
};
// Make the request
Budget response = await budgetServiceClient.CreateBudgetAsync(request);

CreateBudgetAsync(CreateBudgetRequest, CancellationToken)

public virtual Task<Budget> CreateBudgetAsync(CreateBudgetRequest request, CancellationToken cancellationToken)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
requestCreateBudgetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
CreateBudgetRequest request = new CreateBudgetRequest
{
    ParentAsBillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
    Budget = new Budget(),
};
// Make the request
Budget response = await budgetServiceClient.CreateBudgetAsync(request);

CreateBudgetAsync(String, Budget, CallSettings)

public virtual Task<Budget> CreateBudgetAsync(string parent, Budget budget, CallSettings callSettings = null)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
parentString

Required. The name of the billing account to create the budget in. Values are of the form billingAccounts/{billingAccountId}.

budgetBudget

Required. Budget to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "billingAccounts/[BILLING_ACCOUNT]";
Budget budget = new Budget();
// Make the request
Budget response = await budgetServiceClient.CreateBudgetAsync(parent, budget);

CreateBudgetAsync(String, Budget, CancellationToken)

public virtual Task<Budget> CreateBudgetAsync(string parent, Budget budget, CancellationToken cancellationToken)

Creates a new budget. See Quotas and limits for more information on the limits of the number of budgets you can create.

Parameters
NameDescription
parentString

Required. The name of the billing account to create the budget in. Values are of the form billingAccounts/{billingAccountId}.

budgetBudget

Required. Budget to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "billingAccounts/[BILLING_ACCOUNT]";
Budget budget = new Budget();
// Make the request
Budget response = await budgetServiceClient.CreateBudgetAsync(parent, budget);

DeleteBudget(BudgetName, CallSettings)

public virtual void DeleteBudget(BudgetName name, CallSettings callSettings = null)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
nameBudgetName

Required. Name of the budget to delete. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]");
// Make the request
budgetServiceClient.DeleteBudget(name);

DeleteBudget(DeleteBudgetRequest, CallSettings)

public virtual void DeleteBudget(DeleteBudgetRequest request, CallSettings callSettings = null)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
requestDeleteBudgetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
DeleteBudgetRequest request = new DeleteBudgetRequest
{
    BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"),
};
// Make the request
budgetServiceClient.DeleteBudget(request);

DeleteBudget(String, CallSettings)

public virtual void DeleteBudget(string name, CallSettings callSettings = null)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
nameString

Required. Name of the budget to delete. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]";
// Make the request
budgetServiceClient.DeleteBudget(name);

DeleteBudgetAsync(BudgetName, CallSettings)

public virtual Task DeleteBudgetAsync(BudgetName name, CallSettings callSettings = null)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
nameBudgetName

Required. Name of the budget to delete. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]");
// Make the request
await budgetServiceClient.DeleteBudgetAsync(name);

DeleteBudgetAsync(BudgetName, CancellationToken)

public virtual Task DeleteBudgetAsync(BudgetName name, CancellationToken cancellationToken)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
nameBudgetName

Required. Name of the budget to delete. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]");
// Make the request
await budgetServiceClient.DeleteBudgetAsync(name);

DeleteBudgetAsync(DeleteBudgetRequest, CallSettings)

public virtual Task DeleteBudgetAsync(DeleteBudgetRequest request, CallSettings callSettings = null)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
requestDeleteBudgetRequest

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

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteBudgetRequest request = new DeleteBudgetRequest
{
    BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"),
};
// Make the request
await budgetServiceClient.DeleteBudgetAsync(request);

DeleteBudgetAsync(DeleteBudgetRequest, CancellationToken)

public virtual Task DeleteBudgetAsync(DeleteBudgetRequest request, CancellationToken cancellationToken)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
requestDeleteBudgetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteBudgetRequest request = new DeleteBudgetRequest
{
    BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"),
};
// Make the request
await budgetServiceClient.DeleteBudgetAsync(request);

DeleteBudgetAsync(String, CallSettings)

public virtual Task DeleteBudgetAsync(string name, CallSettings callSettings = null)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
nameString

Required. Name of the budget to delete. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]";
// Make the request
await budgetServiceClient.DeleteBudgetAsync(name);

DeleteBudgetAsync(String, CancellationToken)

public virtual Task DeleteBudgetAsync(string name, CancellationToken cancellationToken)

Deletes a budget. Returns successfully if already deleted.

Parameters
NameDescription
nameString

Required. Name of the budget to delete. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]";
// Make the request
await budgetServiceClient.DeleteBudgetAsync(name);

GetBudget(BudgetName, CallSettings)

public virtual Budget GetBudget(BudgetName name, CallSettings callSettings = null)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
nameBudgetName

Required. Name of budget to get. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]");
// Make the request
Budget response = budgetServiceClient.GetBudget(name);

GetBudget(GetBudgetRequest, CallSettings)

public virtual Budget GetBudget(GetBudgetRequest request, CallSettings callSettings = null)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
requestGetBudgetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
GetBudgetRequest request = new GetBudgetRequest
{
    BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"),
};
// Make the request
Budget response = budgetServiceClient.GetBudget(request);

GetBudget(String, CallSettings)

public virtual Budget GetBudget(string name, CallSettings callSettings = null)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
nameString

Required. Name of budget to get. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]";
// Make the request
Budget response = budgetServiceClient.GetBudget(name);

GetBudgetAsync(BudgetName, CallSettings)

public virtual Task<Budget> GetBudgetAsync(BudgetName name, CallSettings callSettings = null)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
nameBudgetName

Required. Name of budget to get. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]");
// Make the request
Budget response = await budgetServiceClient.GetBudgetAsync(name);

GetBudgetAsync(BudgetName, CancellationToken)

public virtual Task<Budget> GetBudgetAsync(BudgetName name, CancellationToken cancellationToken)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
nameBudgetName

Required. Name of budget to get. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
BudgetName name = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]");
// Make the request
Budget response = await budgetServiceClient.GetBudgetAsync(name);

GetBudgetAsync(GetBudgetRequest, CallSettings)

public virtual Task<Budget> GetBudgetAsync(GetBudgetRequest request, CallSettings callSettings = null)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
requestGetBudgetRequest

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

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
GetBudgetRequest request = new GetBudgetRequest
{
    BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"),
};
// Make the request
Budget response = await budgetServiceClient.GetBudgetAsync(request);

GetBudgetAsync(GetBudgetRequest, CancellationToken)

public virtual Task<Budget> GetBudgetAsync(GetBudgetRequest request, CancellationToken cancellationToken)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
requestGetBudgetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
GetBudgetRequest request = new GetBudgetRequest
{
    BudgetName = BudgetName.FromBillingAccountBudget("[BILLING_ACCOUNT]", "[BUDGET]"),
};
// Make the request
Budget response = await budgetServiceClient.GetBudgetAsync(request);

GetBudgetAsync(String, CallSettings)

public virtual Task<Budget> GetBudgetAsync(string name, CallSettings callSettings = null)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
nameString

Required. Name of budget to get. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]";
// Make the request
Budget response = await budgetServiceClient.GetBudgetAsync(name);

GetBudgetAsync(String, CancellationToken)

public virtual Task<Budget> GetBudgetAsync(string name, CancellationToken cancellationToken)

Returns a budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
nameString

Required. Name of budget to get. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "billingAccounts/[BILLING_ACCOUNT]/budgets/[BUDGET]";
// Make the request
Budget response = await budgetServiceClient.GetBudgetAsync(name);

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

public virtual PagedEnumerable<ListBudgetsResponse, Budget> ListBudgets(BillingAccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of budgets for a billing account.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
parentBillingAccountName

Required. Name of billing account to list budgets under. Values are of the form billingAccounts/{billingAccountId}.

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<ListBudgetsResponse, Budget>

A pageable sequence of Budget resources.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
BillingAccountName parent = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
// Make the request
PagedEnumerable<ListBudgetsResponse, Budget> response = budgetServiceClient.ListBudgets(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Budget 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 (ListBudgetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Budget 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<Budget> 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 (Budget 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;

ListBudgets(ListBudgetsRequest, CallSettings)

public virtual PagedEnumerable<ListBudgetsResponse, Budget> ListBudgets(ListBudgetsRequest request, CallSettings callSettings = null)

Returns a list of budgets for a billing account.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
requestListBudgetsRequest

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<ListBudgetsResponse, Budget>

A pageable sequence of Budget resources.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
ListBudgetsRequest request = new ListBudgetsRequest
{
    ParentAsBillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListBudgetsResponse, Budget> response = budgetServiceClient.ListBudgets(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Budget 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 (ListBudgetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Budget 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<Budget> 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 (Budget 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;

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

public virtual PagedEnumerable<ListBudgetsResponse, Budget> ListBudgets(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of budgets for a billing account.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
parentString

Required. Name of billing account to list budgets under. Values are of the form billingAccounts/{billingAccountId}.

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<ListBudgetsResponse, Budget>

A pageable sequence of Budget resources.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
string parent = "billingAccounts/[BILLING_ACCOUNT]";
// Make the request
PagedEnumerable<ListBudgetsResponse, Budget> response = budgetServiceClient.ListBudgets(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Budget 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 (ListBudgetsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Budget 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<Budget> 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 (Budget 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;

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

public virtual PagedAsyncEnumerable<ListBudgetsResponse, Budget> ListBudgetsAsync(BillingAccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of budgets for a billing account.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
parentBillingAccountName

Required. Name of billing account to list budgets under. Values are of the form billingAccounts/{billingAccountId}.

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<ListBudgetsResponse, Budget>

A pageable asynchronous sequence of Budget resources.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
BillingAccountName parent = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListBudgetsResponse, Budget> response = budgetServiceClient.ListBudgetsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Budget 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((ListBudgetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Budget 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<Budget> 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 (Budget 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;

ListBudgetsAsync(ListBudgetsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListBudgetsResponse, Budget> ListBudgetsAsync(ListBudgetsRequest request, CallSettings callSettings = null)

Returns a list of budgets for a billing account.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
requestListBudgetsRequest

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<ListBudgetsResponse, Budget>

A pageable asynchronous sequence of Budget resources.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
ListBudgetsRequest request = new ListBudgetsRequest
{
    ParentAsBillingAccountName = BillingAccountName.FromBillingAccount("[BILLING_ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListBudgetsResponse, Budget> response = budgetServiceClient.ListBudgetsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Budget 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((ListBudgetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Budget 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<Budget> 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 (Budget 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;

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

public virtual PagedAsyncEnumerable<ListBudgetsResponse, Budget> ListBudgetsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns a list of budgets for a billing account.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Parameters
NameDescription
parentString

Required. Name of billing account to list budgets under. Values are of the form billingAccounts/{billingAccountId}.

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<ListBudgetsResponse, Budget>

A pageable asynchronous sequence of Budget resources.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "billingAccounts/[BILLING_ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListBudgetsResponse, Budget> response = budgetServiceClient.ListBudgetsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Budget 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((ListBudgetsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Budget 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<Budget> 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 (Budget 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;

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.

UpdateBudget(Budget, FieldMask, CallSettings)

public virtual Budget UpdateBudget(Budget budget, FieldMask updateMask, CallSettings callSettings = null)

Updates a budget and returns the updated budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method.

Parameters
NameDescription
budgetBudget

Required. The updated budget object. The budget to update is specified by the budget name in the budget.

updateMaskFieldMask

Optional. Indicates which fields in the provided budget to update. Read-only fields (such as name) cannot be changed. If this is not provided, then only fields with non-default values from the request are updated. See https://developers.google.com/protocol-buffers/docs/proto3#default for more details about default values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
Budget budget = new Budget();
FieldMask updateMask = new FieldMask();
// Make the request
Budget response = budgetServiceClient.UpdateBudget(budget, updateMask);

UpdateBudget(UpdateBudgetRequest, CallSettings)

public virtual Budget UpdateBudget(UpdateBudgetRequest request, CallSettings callSettings = null)

Updates a budget and returns the updated budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method.

Parameters
NameDescription
requestUpdateBudgetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Budget

The RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = BudgetServiceClient.Create();
// Initialize request argument(s)
UpdateBudgetRequest request = new UpdateBudgetRequest
{
    Budget = new Budget(),
    UpdateMask = new FieldMask(),
};
// Make the request
Budget response = budgetServiceClient.UpdateBudget(request);

UpdateBudgetAsync(Budget, FieldMask, CallSettings)

public virtual Task<Budget> UpdateBudgetAsync(Budget budget, FieldMask updateMask, CallSettings callSettings = null)

Updates a budget and returns the updated budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method.

Parameters
NameDescription
budgetBudget

Required. The updated budget object. The budget to update is specified by the budget name in the budget.

updateMaskFieldMask

Optional. Indicates which fields in the provided budget to update. Read-only fields (such as name) cannot be changed. If this is not provided, then only fields with non-default values from the request are updated. See https://developers.google.com/protocol-buffers/docs/proto3#default for more details about default values.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
Budget budget = new Budget();
FieldMask updateMask = new FieldMask();
// Make the request
Budget response = await budgetServiceClient.UpdateBudgetAsync(budget, updateMask);

UpdateBudgetAsync(Budget, FieldMask, CancellationToken)

public virtual Task<Budget> UpdateBudgetAsync(Budget budget, FieldMask updateMask, CancellationToken cancellationToken)

Updates a budget and returns the updated budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method.

Parameters
NameDescription
budgetBudget

Required. The updated budget object. The budget to update is specified by the budget name in the budget.

updateMaskFieldMask

Optional. Indicates which fields in the provided budget to update. Read-only fields (such as name) cannot be changed. If this is not provided, then only fields with non-default values from the request are updated. See https://developers.google.com/protocol-buffers/docs/proto3#default for more details about default values.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
Budget budget = new Budget();
FieldMask updateMask = new FieldMask();
// Make the request
Budget response = await budgetServiceClient.UpdateBudgetAsync(budget, updateMask);

UpdateBudgetAsync(UpdateBudgetRequest, CallSettings)

public virtual Task<Budget> UpdateBudgetAsync(UpdateBudgetRequest request, CallSettings callSettings = null)

Updates a budget and returns the updated budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method.

Parameters
NameDescription
requestUpdateBudgetRequest

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

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateBudgetRequest request = new UpdateBudgetRequest
{
    Budget = new Budget(),
    UpdateMask = new FieldMask(),
};
// Make the request
Budget response = await budgetServiceClient.UpdateBudgetAsync(request);

UpdateBudgetAsync(UpdateBudgetRequest, CancellationToken)

public virtual Task<Budget> UpdateBudgetAsync(UpdateBudgetRequest request, CancellationToken cancellationToken)

Updates a budget and returns the updated budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method.

Parameters
NameDescription
requestUpdateBudgetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Budget>

A Task containing the RPC response.

Example
// Create client
BudgetServiceClient budgetServiceClient = await BudgetServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateBudgetRequest request = new UpdateBudgetRequest
{
    Budget = new Budget(),
    UpdateMask = new FieldMask(),
};
// Make the request
Budget response = await budgetServiceClient.UpdateBudgetAsync(request);