Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/billing

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/billing - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

2

build/src/index.d.ts
import * as v1 from './v1';
declare const CloudBillingClient: typeof v1.CloudBillingClient;
declare type CloudBillingClient = v1.CloudBillingClient;
declare const CloudCatalogClient: typeof v1.CloudCatalogClient;
declare type CloudCatalogClient = v1.CloudCatalogClient;
export { v1, CloudBillingClient, CloudCatalogClient };

@@ -5,0 +7,0 @@ declare const _default: {

146

build/src/v1/cloud_billing_client.d.ts
/// <reference types="node" />
import * as gax from 'google-gax';
import { Callback, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import { Transform } from 'stream';

@@ -32,4 +32,6 @@ import * as protos from '../../protos/protos';

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -54,2 +56,9 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/

@@ -73,2 +82,3 @@ constructor(opts?: ClientOptions);

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -79,2 +89,3 @@ static get servicePath(): string;

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -84,2 +95,3 @@ static get apiEndpoint(): string;

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -90,2 +102,3 @@ static get port(): number;

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -95,42 +108,31 @@ static get scopes(): string[];

getProjectId(callback: Callback<string, undefined, undefined>): void;
getBillingAccount(request: protos.google.cloud.billing.v1.IGetBillingAccountRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IGetBillingAccountRequest | undefined, {} | undefined]>;
getBillingAccount(request: protos.google.cloud.billing.v1.IGetBillingAccountRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IGetBillingAccountRequest | null | undefined, {} | null | undefined>): void;
getBillingAccount(request: protos.google.cloud.billing.v1.IGetBillingAccountRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IGetBillingAccountRequest | undefined, {} | undefined]>;
getBillingAccount(request: protos.google.cloud.billing.v1.IGetBillingAccountRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IGetBillingAccountRequest | null | undefined, {} | null | undefined>): void;
getBillingAccount(request: protos.google.cloud.billing.v1.IGetBillingAccountRequest, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IGetBillingAccountRequest | null | undefined, {} | null | undefined>): void;
updateBillingAccount(request: protos.google.cloud.billing.v1.IUpdateBillingAccountRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IUpdateBillingAccountRequest | undefined, {} | undefined]>;
updateBillingAccount(request: protos.google.cloud.billing.v1.IUpdateBillingAccountRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IUpdateBillingAccountRequest | null | undefined, {} | null | undefined>): void;
updateBillingAccount(request: protos.google.cloud.billing.v1.IUpdateBillingAccountRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IUpdateBillingAccountRequest | undefined, {} | undefined]>;
updateBillingAccount(request: protos.google.cloud.billing.v1.IUpdateBillingAccountRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IUpdateBillingAccountRequest | null | undefined, {} | null | undefined>): void;
updateBillingAccount(request: protos.google.cloud.billing.v1.IUpdateBillingAccountRequest, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.IUpdateBillingAccountRequest | null | undefined, {} | null | undefined>): void;
createBillingAccount(request: protos.google.cloud.billing.v1.ICreateBillingAccountRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.ICreateBillingAccountRequest | undefined, {} | undefined]>;
createBillingAccount(request: protos.google.cloud.billing.v1.ICreateBillingAccountRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.ICreateBillingAccountRequest | null | undefined, {} | null | undefined>): void;
createBillingAccount(request: protos.google.cloud.billing.v1.ICreateBillingAccountRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.ICreateBillingAccountRequest | undefined, {} | undefined]>;
createBillingAccount(request: protos.google.cloud.billing.v1.ICreateBillingAccountRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.ICreateBillingAccountRequest | null | undefined, {} | null | undefined>): void;
createBillingAccount(request: protos.google.cloud.billing.v1.ICreateBillingAccountRequest, callback: Callback<protos.google.cloud.billing.v1.IBillingAccount, protos.google.cloud.billing.v1.ICreateBillingAccountRequest | null | undefined, {} | null | undefined>): void;
getProjectBillingInfo(request: protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest | undefined, {} | undefined]>;
getProjectBillingInfo(request: protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest | null | undefined, {} | null | undefined>): void;
getProjectBillingInfo(request: protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest | undefined, {} | undefined]>;
getProjectBillingInfo(request: protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest | null | undefined, {} | null | undefined>): void;
getProjectBillingInfo(request: protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest, callback: Callback<protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest | null | undefined, {} | null | undefined>): void;
updateProjectBillingInfo(request: protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IProjectBillingInfo, (protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest | undefined), {} | undefined]>;
updateProjectBillingInfo(request: protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest, options: gax.CallOptions, callback: Callback<protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest | null | undefined, {} | null | undefined>): void;
updateProjectBillingInfo(request: protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IProjectBillingInfo, (protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest | undefined), {} | undefined]>;
updateProjectBillingInfo(request: protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest, options: CallOptions, callback: Callback<protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest | null | undefined, {} | null | undefined>): void;
updateProjectBillingInfo(request: protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest, callback: Callback<protos.google.cloud.billing.v1.IProjectBillingInfo, protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest | null | undefined, {} | null | undefined>): void;
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>;
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>;
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>;
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>;
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>;
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>;
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
listBillingAccounts(request: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount[], protos.google.cloud.billing.v1.IListBillingAccountsRequest | null, protos.google.cloud.billing.v1.IListBillingAccountsResponse]>;
listBillingAccounts(request: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListBillingAccountsRequest, protos.google.cloud.billing.v1.IListBillingAccountsResponse | null | undefined, protos.google.cloud.billing.v1.IBillingAccount>): void;
listBillingAccounts(request: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IBillingAccount[], protos.google.cloud.billing.v1.IListBillingAccountsRequest | null, protos.google.cloud.billing.v1.IListBillingAccountsResponse]>;
listBillingAccounts(request: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListBillingAccountsRequest, protos.google.cloud.billing.v1.IListBillingAccountsResponse | null | undefined, protos.google.cloud.billing.v1.IBillingAccount>): void;
listBillingAccounts(request: protos.google.cloud.billing.v1.IListBillingAccountsRequest, callback: PaginationCallback<protos.google.cloud.billing.v1.IListBillingAccountsRequest, protos.google.cloud.billing.v1.IListBillingAccountsResponse | null | undefined, protos.google.cloud.billing.v1.IBillingAccount>): void;
/**
* Equivalent to {@link listBillingAccounts}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listBillingAccounts} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -156,9 +158,15 @@ * The request object that will be sent.

* An object stream which emits an object representing [BillingAccount]{@link google.cloud.billing.v1.BillingAccount} 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 `listBillingAccountsAsync()`
* 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.
*/
listBillingAccountsStream(request?: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options?: gax.CallOptions): Transform;
listBillingAccountsStream(request?: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options?: CallOptions): Transform;
/**
* Equivalent to {@link listBillingAccounts}, but returns an iterable object.
* Equivalent to `listBillingAccounts`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -183,21 +191,21 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [BillingAccount]{@link google.cloud.billing.v1.BillingAccount}. 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.
* @example
* const iterable = client.listBillingAccountsAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/
listBillingAccountsAsync(request?: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.billing.v1.IBillingAccount>;
listProjectBillingInfo(request: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IProjectBillingInfo[], protos.google.cloud.billing.v1.IListProjectBillingInfoRequest | null, protos.google.cloud.billing.v1.IListProjectBillingInfoResponse]>;
listProjectBillingInfo(request: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, protos.google.cloud.billing.v1.IListProjectBillingInfoResponse | null | undefined, protos.google.cloud.billing.v1.IProjectBillingInfo>): void;
listBillingAccountsAsync(request?: protos.google.cloud.billing.v1.IListBillingAccountsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.billing.v1.IBillingAccount>;
listProjectBillingInfo(request: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IProjectBillingInfo[], protos.google.cloud.billing.v1.IListProjectBillingInfoRequest | null, protos.google.cloud.billing.v1.IListProjectBillingInfoResponse]>;
listProjectBillingInfo(request: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, protos.google.cloud.billing.v1.IListProjectBillingInfoResponse | null | undefined, protos.google.cloud.billing.v1.IProjectBillingInfo>): void;
listProjectBillingInfo(request: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, callback: PaginationCallback<protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, protos.google.cloud.billing.v1.IListProjectBillingInfoResponse | null | undefined, protos.google.cloud.billing.v1.IProjectBillingInfo>): void;
/**
* Equivalent to {@link listProjectBillingInfo}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listProjectBillingInfo} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -219,9 +227,15 @@ * The request object that will be sent.

* An object stream which emits an object representing [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo} 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 `listProjectBillingInfoAsync()`
* 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.
*/
listProjectBillingInfoStream(request?: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options?: gax.CallOptions): Transform;
listProjectBillingInfoStream(request?: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options?: CallOptions): Transform;
/**
* Equivalent to {@link listProjectBillingInfo}, but returns an iterable object.
* Equivalent to `listProjectBillingInfo`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -242,5 +256,16 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo}. 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.
* @example
* const iterable = client.listProjectBillingInfoAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/
listProjectBillingInfoAsync(request?: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.billing.v1.IProjectBillingInfo>;
listProjectBillingInfoAsync(request?: protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.billing.v1.IProjectBillingInfo>;
/**

@@ -301,7 +326,8 @@ * Return a fully-qualified billingAccount resource name string.

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/
close(): Promise<void>;
}

@@ -21,4 +21,10 @@ "use strict";

exports.CloudBillingClient = void 0;
/* global window */
const gax = require("google-gax");
const path = require("path");
/**
* Client JSON configuration object, loaded from
* `src/v1/cloud_billing_client_config.json`.
* This file defines retry strategy and timeouts for all API methods in this library.
*/
const gapicConfig = require("./cloud_billing_client_config.json");

@@ -35,4 +41,6 @@ const version = require('../../../package.json').version;

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -57,4 +65,12 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/
constructor(opts) {
var _a, _b;
this._terminated = false;

@@ -67,30 +83,16 @@ this.descriptors = {

};
// Ensure that options include the service address and port.
// Ensure that options include all the required fields.
const staticMembers = this.constructor;
const servicePath = opts && opts.servicePath
? opts.servicePath
: opts && opts.apiEndpoint
? opts.apiEndpoint
: staticMembers.servicePath;
const port = opts && opts.port ? opts.port : staticMembers.port;
if (!opts) {
opts = { servicePath, port };
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
opts['scopes'] = staticMembers.scopes;
}
opts.servicePath = opts.servicePath || servicePath;
opts.port = opts.port || port;
// users can override the config from client side, like retry codes name.
// The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
// The way to override client config for Showcase API:
//
// const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the CloudBillingClient constructor.
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
this._gaxModule = opts.fallback ? gax.fallback : gax;
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

@@ -101,2 +103,6 @@ // Save options to use in initialize() method.

this.auth = this._gaxGrpc.auth;
// Set the default scopes in auth client if needed.
if (servicePath === staticMembers.servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}
// Determine the client header string.

@@ -192,5 +198,4 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];

});
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] ||
this.descriptors.stream[methodName] ||
this.descriptors.longrunning[methodName]);
const descriptor = this.descriptors.page[methodName] || undefined;
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
this.innerApiCalls[methodName] = apiCall;

@@ -202,2 +207,3 @@ }

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -210,2 +216,3 @@ static get servicePath() {

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -217,2 +224,3 @@ static get apiEndpoint() {

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -225,2 +233,3 @@ static get port() {

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -232,4 +241,3 @@ static get scopes() {

* Return the project ID used by this class.
* @param {function(Error, string)} callback - the callback to
* be called with the current project Id.
* @returns {Promise} A promise that resolves to string containing the project ID.
*/

@@ -257,3 +265,7 @@ getProjectId(callback) {

* The first element of the array is an object representing [BillingAccount]{@link google.cloud.billing.v1.BillingAccount}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.getBillingAccount(request);
*/

@@ -300,3 +312,7 @@ getBillingAccount(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [BillingAccount]{@link google.cloud.billing.v1.BillingAccount}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.updateBillingAccount(request);
*/

@@ -345,3 +361,7 @@ updateBillingAccount(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [BillingAccount]{@link google.cloud.billing.v1.BillingAccount}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.createBillingAccount(request);
*/

@@ -377,3 +397,7 @@ createBillingAccount(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.getProjectBillingInfo(request);
*/

@@ -444,3 +468,7 @@ getProjectBillingInfo(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.updateProjectBillingInfo(request);
*/

@@ -484,3 +512,7 @@ updateProjectBillingInfo(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.getIamPolicy(request);
*/

@@ -527,3 +559,7 @@ getIamPolicy(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.setIamPolicy(request);
*/

@@ -568,3 +604,7 @@ setIamPolicy(request, optionsOrCallback, callback) {

* The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
* The promise has a method named "cancel" which cancels the ongoing API call.
* Please see the
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
* for more details and examples.
* @example
* const [response] = await client.testIamPermissions(request);
*/

@@ -615,15 +655,10 @@ testIamPermissions(request, optionsOrCallback, callback) {

* The first element of the array is Array of [BillingAccount]{@link google.cloud.billing.v1.BillingAccount}.
* The client library support auto-pagination by default: it will call the API as many
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
*
* When autoPaginate: false is specified through options, the array has three elements.
* The first element is Array of [BillingAccount]{@link google.cloud.billing.v1.BillingAccount} that corresponds to
* the one page received from the API server.
* If the second element is not null it contains the request object of type [ListBillingAccountsRequest]{@link google.cloud.billing.v1.ListBillingAccountsRequest}
* that can be used to obtain the next page of the results.
* If it is null, the next page does not exist.
* The third element contains the raw response received from the API server. Its type is
* [ListBillingAccountsResponse]{@link google.cloud.billing.v1.ListBillingAccountsResponse}.
*
* The promise has a method named "cancel" which cancels the ongoing API call.
* Note that it can affect your quota.
* We recommend using `listBillingAccountsAsync()`
* 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.
*/

@@ -645,14 +680,3 @@ listBillingAccounts(request, optionsOrCallback, callback) {

/**
* Equivalent to {@link listBillingAccounts}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listBillingAccounts} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -678,2 +702,9 @@ * The request object that will be sent.

* An object stream which emits an object representing [BillingAccount]{@link google.cloud.billing.v1.BillingAccount} 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 `listBillingAccountsAsync()`
* 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.
*/

@@ -688,6 +719,5 @@ listBillingAccountsStream(request, options) {

/**
* Equivalent to {@link listBillingAccounts}, but returns an iterable object.
* Equivalent to `listBillingAccounts`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -712,3 +742,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [BillingAccount]{@link google.cloud.billing.v1.BillingAccount}. 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.
* @example
* const iterable = client.listBillingAccountsAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -745,15 +786,10 @@ listBillingAccountsAsync(request, options) {

* The first element of the array is Array of [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo}.
* The client library support auto-pagination by default: it will call the API as many
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
*
* When autoPaginate: false is specified through options, the array has three elements.
* The first element is Array of [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo} that corresponds to
* the one page received from the API server.
* If the second element is not null it contains the request object of type [ListProjectBillingInfoRequest]{@link google.cloud.billing.v1.ListProjectBillingInfoRequest}
* that can be used to obtain the next page of the results.
* If it is null, the next page does not exist.
* The third element contains the raw response received from the API server. Its type is
* [ListProjectBillingInfoResponse]{@link google.cloud.billing.v1.ListProjectBillingInfoResponse}.
*
* The promise has a method named "cancel" which cancels the ongoing API call.
* Note that it can affect your quota.
* We recommend using `listProjectBillingInfoAsync()`
* 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.
*/

@@ -780,14 +816,3 @@ listProjectBillingInfo(request, optionsOrCallback, callback) {

/**
* Equivalent to {@link listProjectBillingInfo}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listProjectBillingInfo} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -809,2 +834,9 @@ * The request object that will be sent.

* An object stream which emits an object representing [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo} 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 `listProjectBillingInfoAsync()`
* 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.
*/

@@ -824,6 +856,5 @@ listProjectBillingInfoStream(request, options) {

/**
* Equivalent to {@link listProjectBillingInfo}, but returns an iterable object.
* Equivalent to `listProjectBillingInfo`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -844,3 +875,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [ProjectBillingInfo]{@link google.cloud.billing.v1.ProjectBillingInfo}. 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.
* @example
* const iterable = client.listProjectBillingInfoAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -939,5 +981,6 @@ listProjectBillingInfoAsync(request, options) {

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/

@@ -944,0 +987,0 @@ close() {

/// <reference types="node" />
import * as gax from 'google-gax';
import { Callback, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
import { Transform } from 'stream';

@@ -34,4 +34,6 @@ import * as protos from '../../protos/protos';

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -56,2 +58,9 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/

@@ -75,2 +84,3 @@ constructor(opts?: ClientOptions);

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -81,2 +91,3 @@ static get servicePath(): string;

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -86,2 +97,3 @@ static get apiEndpoint(): string;

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -92,2 +104,3 @@ static get port(): number;

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -97,18 +110,7 @@ static get scopes(): string[];

getProjectId(callback: Callback<string, undefined, undefined>): void;
listServices(request: protos.google.cloud.billing.v1.IListServicesRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.IService[], protos.google.cloud.billing.v1.IListServicesRequest | null, protos.google.cloud.billing.v1.IListServicesResponse]>;
listServices(request: protos.google.cloud.billing.v1.IListServicesRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListServicesRequest, protos.google.cloud.billing.v1.IListServicesResponse | null | undefined, protos.google.cloud.billing.v1.IService>): void;
listServices(request: protos.google.cloud.billing.v1.IListServicesRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.IService[], protos.google.cloud.billing.v1.IListServicesRequest | null, protos.google.cloud.billing.v1.IListServicesResponse]>;
listServices(request: protos.google.cloud.billing.v1.IListServicesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListServicesRequest, protos.google.cloud.billing.v1.IListServicesResponse | null | undefined, protos.google.cloud.billing.v1.IService>): void;
listServices(request: protos.google.cloud.billing.v1.IListServicesRequest, callback: PaginationCallback<protos.google.cloud.billing.v1.IListServicesRequest, protos.google.cloud.billing.v1.IListServicesResponse | null | undefined, protos.google.cloud.billing.v1.IService>): void;
/**
* Equivalent to {@link listServices}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listServices} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -126,9 +128,15 @@ * The request object that will be sent.

* An object stream which emits an object representing [Service]{@link google.cloud.billing.v1.Service} 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 `listServicesAsync()`
* 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.
*/
listServicesStream(request?: protos.google.cloud.billing.v1.IListServicesRequest, options?: gax.CallOptions): Transform;
listServicesStream(request?: protos.google.cloud.billing.v1.IListServicesRequest, options?: CallOptions): Transform;
/**
* Equivalent to {@link listServices}, but returns an iterable object.
* Equivalent to `listServices`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -145,21 +153,21 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [Service]{@link google.cloud.billing.v1.Service}. 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.
* @example
* const iterable = client.listServicesAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/
listServicesAsync(request?: protos.google.cloud.billing.v1.IListServicesRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.billing.v1.IService>;
listSkus(request: protos.google.cloud.billing.v1.IListSkusRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.billing.v1.ISku[], protos.google.cloud.billing.v1.IListSkusRequest | null, protos.google.cloud.billing.v1.IListSkusResponse]>;
listSkus(request: protos.google.cloud.billing.v1.IListSkusRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListSkusRequest, protos.google.cloud.billing.v1.IListSkusResponse | null | undefined, protos.google.cloud.billing.v1.ISku>): void;
listServicesAsync(request?: protos.google.cloud.billing.v1.IListServicesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.billing.v1.IService>;
listSkus(request: protos.google.cloud.billing.v1.IListSkusRequest, options?: CallOptions): Promise<[protos.google.cloud.billing.v1.ISku[], protos.google.cloud.billing.v1.IListSkusRequest | null, protos.google.cloud.billing.v1.IListSkusResponse]>;
listSkus(request: protos.google.cloud.billing.v1.IListSkusRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.billing.v1.IListSkusRequest, protos.google.cloud.billing.v1.IListSkusResponse | null | undefined, protos.google.cloud.billing.v1.ISku>): void;
listSkus(request: protos.google.cloud.billing.v1.IListSkusRequest, callback: PaginationCallback<protos.google.cloud.billing.v1.IListSkusRequest, protos.google.cloud.billing.v1.IListSkusResponse | null | undefined, protos.google.cloud.billing.v1.ISku>): void;
/**
* Equivalent to {@link listSkus}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listSkus} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -198,9 +206,15 @@ * The request object that will be sent.

* An object stream which emits an object representing [Sku]{@link google.cloud.billing.v1.Sku} 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 `listSkusAsync()`
* 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.
*/
listSkusStream(request?: protos.google.cloud.billing.v1.IListSkusRequest, options?: gax.CallOptions): Transform;
listSkusStream(request?: protos.google.cloud.billing.v1.IListSkusRequest, options?: CallOptions): Transform;
/**
* Equivalent to {@link listSkus}, but returns an iterable object.
* Equivalent to `listSkus`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -238,5 +252,16 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [Sku]{@link google.cloud.billing.v1.Sku}. 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.
* @example
* const iterable = client.listSkusAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/
listSkusAsync(request?: protos.google.cloud.billing.v1.IListSkusRequest, options?: gax.CallOptions): AsyncIterable<protos.google.cloud.billing.v1.ISku>;
listSkusAsync(request?: protos.google.cloud.billing.v1.IListSkusRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.billing.v1.ISku>;
/**

@@ -282,7 +307,8 @@ * Return a fully-qualified service resource name string.

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/
close(): Promise<void>;
}

@@ -21,4 +21,10 @@ "use strict";

exports.CloudCatalogClient = void 0;
/* global window */
const gax = require("google-gax");
const path = require("path");
/**
* Client JSON configuration object, loaded from
* `src/v1/cloud_catalog_client_config.json`.
* This file defines retry strategy and timeouts for all API methods in this library.
*/
const gapicConfig = require("./cloud_catalog_client_config.json");

@@ -37,4 +43,6 @@ const version = require('../../../package.json').version;

*
* @param {object} [options] - The configuration object. See the subsequent
* parameters for more details.
* @param {object} [options] - The configuration object.
* The options accepted by the constructor are described in detail
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
* The common options are:
* @param {object} [options.credentials] - Credentials object.

@@ -59,4 +67,12 @@ * @param {string} [options.credentials.client_email]

* API remote host.
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
* Follows the structure of {@link gapicConfig}.
* @param {boolean} [options.fallback] - Use HTTP fallback mode.
* In fallback mode, a special browser-compatible transport implementation is used
* instead of gRPC transport. In browser context (if the `window` object is defined)
* the fallback mode is enabled automatically; set `options.fallback` to `false`
* if you need to override this behavior.
*/
constructor(opts) {
var _a, _b;
this._terminated = false;

@@ -69,30 +85,16 @@ this.descriptors = {

};
// Ensure that options include the service address and port.
// Ensure that options include all the required fields.
const staticMembers = this.constructor;
const servicePath = opts && opts.servicePath
? opts.servicePath
: opts && opts.apiEndpoint
? opts.apiEndpoint
: staticMembers.servicePath;
const port = opts && opts.port ? opts.port : staticMembers.port;
if (!opts) {
opts = { servicePath, port };
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
opts['scopes'] = staticMembers.scopes;
}
opts.servicePath = opts.servicePath || servicePath;
opts.port = opts.port || port;
// users can override the config from client side, like retry codes name.
// The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
// The way to override client config for Showcase API:
//
// const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
// const showcaseClient = new showcaseClient({ projectId, customConfig });
opts.clientConfig = opts.clientConfig || {};
// If we're running in browser, it's OK to omit `fallback` since
// google-gax has `browser` field in its `package.json`.
// For Electron (which does not respect `browser` field),
// pass `{fallback: true}` to the CloudCatalogClient constructor.
// Choose either gRPC or proto-over-HTTP implementation of google-gax.
this._gaxModule = opts.fallback ? gax.fallback : gax;
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

@@ -103,2 +105,6 @@ // Save options to use in initialize() method.

this.auth = this._gaxGrpc.auth;
// Set the default scopes in auth client if needed.
if (servicePath === staticMembers.servicePath) {
this.auth.defaultScopes = staticMembers.scopes;
}
// Determine the client header string.

@@ -182,5 +188,4 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];

});
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], this.descriptors.page[methodName] ||
this.descriptors.stream[methodName] ||
this.descriptors.longrunning[methodName]);
const descriptor = this.descriptors.page[methodName] || undefined;
const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor);
this.innerApiCalls[methodName] = apiCall;

@@ -192,2 +197,3 @@ }

* The DNS address for this API service.
* @returns {string} The DNS address for this service.
*/

@@ -200,2 +206,3 @@ static get servicePath() {

* exists for compatibility reasons.
* @returns {string} The DNS address for this service.
*/

@@ -207,2 +214,3 @@ static get apiEndpoint() {

* The port for this API service.
* @returns {number} The default port for this service.
*/

@@ -215,2 +223,3 @@ static get port() {

* in this service.
* @returns {string[]} List of default scopes.
*/

@@ -222,4 +231,3 @@ static get scopes() {

* Return the project ID used by this class.
* @param {function(Error, string)} callback - the callback to
* be called with the current project Id.
* @returns {Promise} A promise that resolves to string containing the project ID.
*/

@@ -248,15 +256,10 @@ getProjectId(callback) {

* The first element of the array is Array of [Service]{@link google.cloud.billing.v1.Service}.
* The client library support auto-pagination by default: it will call the API as many
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
*
* When autoPaginate: false is specified through options, the array has three elements.
* The first element is Array of [Service]{@link google.cloud.billing.v1.Service} that corresponds to
* the one page received from the API server.
* If the second element is not null it contains the request object of type [ListServicesRequest]{@link google.cloud.billing.v1.ListServicesRequest}
* that can be used to obtain the next page of the results.
* If it is null, the next page does not exist.
* The third element contains the raw response received from the API server. Its type is
* [ListServicesResponse]{@link google.cloud.billing.v1.ListServicesResponse}.
*
* The promise has a method named "cancel" which cancels the ongoing API call.
* Note that it can affect your quota.
* We recommend using `listServicesAsync()`
* 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.
*/

@@ -278,14 +281,3 @@ listServices(request, optionsOrCallback, callback) {

/**
* Equivalent to {@link listServices}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listServices} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -303,2 +295,9 @@ * The request object that will be sent.

* An object stream which emits an object representing [Service]{@link google.cloud.billing.v1.Service} 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 `listServicesAsync()`
* 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.
*/

@@ -313,6 +312,5 @@ listServicesStream(request, options) {

/**
* Equivalent to {@link listServices}, but returns an iterable object.
* Equivalent to `listServices`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -329,3 +327,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [Service]{@link google.cloud.billing.v1.Service}. 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.
* @example
* const iterable = client.listServicesAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -376,15 +385,10 @@ listServicesAsync(request, options) {

* The first element of the array is Array of [Sku]{@link google.cloud.billing.v1.Sku}.
* The client library support auto-pagination by default: it will call the API as many
* The client library will perform auto-pagination by default: it will call the API as many
* times as needed and will merge results from all the pages into this array.
*
* When autoPaginate: false is specified through options, the array has three elements.
* The first element is Array of [Sku]{@link google.cloud.billing.v1.Sku} that corresponds to
* the one page received from the API server.
* If the second element is not null it contains the request object of type [ListSkusRequest]{@link google.cloud.billing.v1.ListSkusRequest}
* that can be used to obtain the next page of the results.
* If it is null, the next page does not exist.
* The third element contains the raw response received from the API server. Its type is
* [ListSkusResponse]{@link google.cloud.billing.v1.ListSkusResponse}.
*
* The promise has a method named "cancel" which cancels the ongoing API call.
* Note that it can affect your quota.
* We recommend using `listSkusAsync()`
* 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.
*/

@@ -411,14 +415,3 @@ listSkus(request, optionsOrCallback, callback) {

/**
* Equivalent to {@link listSkus}, but returns a NodeJS Stream object.
*
* This fetches the paged responses for {@link listSkus} continuously
* and invokes the callback registered for 'data' event for each element in the
* responses.
*
* The returned object has 'end' method when no more elements are required.
*
* autoPaginate option will be ignored.
*
* @see {@link https://nodejs.org/api/stream.html}
*
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
* @param {Object} request

@@ -457,2 +450,9 @@ * The request object that will be sent.

* An object stream which emits an object representing [Sku]{@link google.cloud.billing.v1.Sku} 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 `listSkusAsync()`
* 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.
*/

@@ -472,6 +472,5 @@ listSkusStream(request, options) {

/**
* Equivalent to {@link listSkus}, but returns an iterable object.
* Equivalent to `listSkus`, but returns an iterable object.
*
* for-await-of syntax is used with the iterable to recursively get response element on-demand.
*
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
* @param {Object} request

@@ -509,3 +508,14 @@ * The request object that will be sent.

* @returns {Object}
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
* 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
* [Sku]{@link google.cloud.billing.v1.Sku}. 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.
* @example
* const iterable = client.listSkusAsync(request);
* for await (const response of iterable) {
* // process response
* }
*/

@@ -583,5 +593,6 @@ listSkusAsync(request, options) {

/**
* Terminate the GRPC channel and close the client.
* Terminate the gRPC channel and close the client.
*
* The client will no longer be usable and all future behavior is undefined.
* @returns {Promise} A promise that resolves when the client is closed.
*/

@@ -588,0 +599,0 @@ close() {

# Changelog
### [2.1.3](https://www.github.com/googleapis/nodejs-billing/compare/v2.1.2...v2.1.3) (2020-11-25)
### Bug Fixes
* **browser:** check for fetch on window ([abd3067](https://www.github.com/googleapis/nodejs-billing/commit/abd30678d328bdb62c54dc892c5300342c275e72))
* do not modify options object, use defaultScopes ([#111](https://www.github.com/googleapis/nodejs-billing/issues/111)) ([be029ad](https://www.github.com/googleapis/nodejs-billing/commit/be029ad5c807cc8d04b8bddde83eb2d53f580a1c))
### [2.1.2](https://www.github.com/googleapis/nodejs-billing/compare/v2.1.1...v2.1.2) (2020-07-09)

@@ -4,0 +12,0 @@

{
"name": "@google-cloud/billing",
"version": "2.1.2",
"version": "2.1.3",
"description": "Billing client for Node.js",

@@ -27,9 +27,11 @@ "repository": "googleapis/nodejs-billing",

"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"precompile": "gts clean"
"precompile": "gts clean",
"api-extractor": "api-extractor run --local",
"api-documenter": "api-documenter yaml --input-folder=temp"
},
"dependencies": {
"google-gax": "^2.1.0"
"google-gax": "^2.9.2"
},
"devDependencies": {
"@types/mocha": "^7.0.0",
"@types/mocha": "^8.0.0",
"@types/node": "^12.0.0",

@@ -47,6 +49,8 @@ "@types/sinon": "^9.0.0",

"sinon": "^9.0.1",
"ts-loader": "^7.0.0",
"ts-loader": "^8.0.0",
"typescript": "^3.8.3",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
"webpack": "^5.0.0",
"webpack-cli": "^4.0.0",
"@microsoft/api-documenter": "^7.8.10",
"@microsoft/api-extractor": "^7.8.10"
},

@@ -53,0 +57,0 @@ "engines": {

@@ -17,2 +17,5 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

A comprehensive list of changes in each version may be found in
[the CHANGELOG](https://github.com/googleapis/nodejs-billing/blob/master/CHANGELOG.md).
* [Cloud Billing Node.js Client API Reference][client-docs]

@@ -104,3 +107,3 @@ * [Cloud Billing Documentation][product-docs]

Client libraries targetting some end-of-life versions of Node.js are available, and
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).

@@ -107,0 +110,0 @@ The dist-tags follow the naming convention `legacy-(version)`.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc