Class v1.BudgetServiceClient (3.2.8)

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

Package

@google-cloud/billing-budgets!

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of BudgetServiceClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Property Value
TypeDescription
string

auth

auth: gax.GoogleAuth;
Property Value
TypeDescription
gax.GoogleAuth

budgetServiceStub

budgetServiceStub?: Promise<{
        [name: string]: Function;
    }>;
Property Value
TypeDescription
Promise<{ [name: string]: Function; }>

descriptors

descriptors: Descriptors;
Property Value
TypeDescription
Descriptors

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };
Property Value
TypeDescription
{ [name: string]: Function; }

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };
Property Value
TypeDescription
{ [name: string]: gax.PathTemplate; }

port

static get port(): number;

The port for this API service.

Property Value
TypeDescription
number

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

Property Value
TypeDescription
string[]

servicePath

static get servicePath(): string;

The DNS address for this API service.

Property Value
TypeDescription
string

warn

warn: (code: string, message: string, warnType?: string) => void;
Property Value
TypeDescription
(code: string, message: string, warnType?: string) => void

Methods

billingAccountPath(billingAccount)

billingAccountPath(billingAccount: string): string;

Return a fully-qualified billingAccount resource name string.

Parameter
NameDescription
billingAccount string
Returns
TypeDescription
string

{string} Resource name string.

budgetPath(billingAccount, budget)

budgetPath(billingAccount: string, budget: string): string;

Return a fully-qualified budget resource name string.

Parameters
NameDescription
billingAccount string
budget string
Returns
TypeDescription
string

{string} Resource name string.

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createBudget(request, options)

createBudget(request?: protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest | undefined, {} | undefined]>;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest
options CallOptions
Returns
TypeDescription
Promise<[protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest | undefined, {} | undefined]>

createBudget(request, options, callback)

createBudget(request: protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest
options CallOptions
callback Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createBudget(request, callback)

createBudget(request: protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest, callback: Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest
callback Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteBudget(request, options)

deleteBudget(request?: protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest | undefined, {} | undefined]>;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest
options CallOptions
Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest | undefined, {} | undefined]>

deleteBudget(request, options, callback)

deleteBudget(request: protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteBudget(request, callback)

deleteBudget(request: protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getBudget(request, options)

getBudget(request?: protos.google.cloud.billing.budgets.v1.IGetBudgetRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IGetBudgetRequest | undefined, {} | undefined]>;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IGetBudgetRequest
options CallOptions
Returns
TypeDescription
Promise<[protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IGetBudgetRequest | undefined, {} | undefined]>

getBudget(request, options, callback)

getBudget(request: protos.google.cloud.billing.budgets.v1.IGetBudgetRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IGetBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IGetBudgetRequest
options CallOptions
callback Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IGetBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getBudget(request, callback)

getBudget(request: protos.google.cloud.billing.budgets.v1.IGetBudgetRequest, callback: Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IGetBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IGetBudgetRequest
callback Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IGetBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listBudgets(request, options)

listBudgets(request?: protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.budgets.v1.IBudget[], protos.google.cloud.billing.budgets.v1.IListBudgetsRequest | null, protos.google.cloud.billing.budgets.v1.IListBudgetsResponse]>;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IListBudgetsRequest
options CallOptions
Returns
TypeDescription
Promise<[protos.google.cloud.billing.budgets.v1.IBudget[], protos.google.cloud.billing.budgets.v1.IListBudgetsRequest | null, protos.google.cloud.billing.budgets.v1.IListBudgetsResponse]>

listBudgets(request, options, callback)

listBudgets(request: protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, protos.google.cloud.billing.budgets.v1.IListBudgetsResponse | null | undefined, protos.google.cloud.billing.budgets.v1.IBudget>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IListBudgetsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, protos.google.cloud.billing.budgets.v1.IListBudgetsResponse | null | undefined, protos.google.cloud.billing.budgets.v1.IBudget>
Returns
TypeDescription
void

listBudgets(request, callback)

listBudgets(request: protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, callback: PaginationCallback<protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, protos.google.cloud.billing.budgets.v1.IListBudgetsResponse | null | undefined, protos.google.cloud.billing.budgets.v1.IBudget>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IListBudgetsRequest
callback PaginationCallback<protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, protos.google.cloud.billing.budgets.v1.IListBudgetsResponse | null | undefined, protos.google.cloud.billing.budgets.v1.IBudget>
Returns
TypeDescription
void

listBudgetsAsync(request, options)

listBudgetsAsync(request?: protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.billing.budgets.v1.IBudget>;

Equivalent to listBudgets, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IListBudgetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.billing.budgets.v1.IBudget>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Budget]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listBudgetsStream(request, options)

listBudgetsStream(request?: protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IListBudgetsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Budget] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listBudgetsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

matchBillingAccountFromBillingAccountName(billingAccountName)

matchBillingAccountFromBillingAccountName(billingAccountName: string): string | number;

Parse the billing_account from BillingAccount resource.

Parameter
NameDescription
billingAccountName string

A fully-qualified path representing BillingAccount resource.

Returns
TypeDescription
string | number

{string} A string representing the billing_account.

matchBillingAccountFromBudgetName(budgetName)

matchBillingAccountFromBudgetName(budgetName: string): string | number;

Parse the billing_account from Budget resource.

Parameter
NameDescription
budgetName string

A fully-qualified path representing Budget resource.

Returns
TypeDescription
string | number

{string} A string representing the billing_account.

matchBudgetFromBudgetName(budgetName)

matchBudgetFromBudgetName(budgetName: string): string | number;

Parse the budget from Budget resource.

Parameter
NameDescription
budgetName string

A fully-qualified path representing Budget resource.

Returns
TypeDescription
string | number

{string} A string representing the budget.

updateBudget(request, options)

updateBudget(request?: protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest | undefined, {} | undefined]>;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest
options CallOptions
Returns
TypeDescription
Promise<[protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest | undefined, {} | undefined]>

updateBudget(request, options, callback)

updateBudget(request: protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest
options CallOptions
callback Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateBudget(request, callback)

updateBudget(request: protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest, callback: Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest
callback Callback<protos.google.cloud.billing.budgets.v1.IBudget, protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void