Class v1beta.CloudQuotasClient (0.6.0)

The Cloud Quotas API is an infrastructure service for Google Cloud that lets service consumers list and manage their resource usage limits.

  • List/Get the metadata and current status of the quotas for a service. - Create/Update quota preferencess that declare the preferred quota values. - Check the status of a quota preference request. - List/Get pending and historical quota preference. v1beta

Package

@google-cloud/cloudquotas

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of CloudQuotasClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new CloudQuotasClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

cloudQuotasStub

cloudQuotasStub?: Promise<{
        [name: string]: Function;
    }>;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

pathTemplates

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

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

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

Methods

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
Type Description
Promise<void>

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

createQuotaPreference(request, options)

createQuotaPreference(request?: protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1beta.IQuotaPreference,
        (protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest | undefined),
        {} | undefined
    ]>;

Creates a new QuotaPreference that declares the desired value for a quota.

Parameters
Name Description
request ICreateQuotaPreferenceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.api.cloudquotas.v1beta.IQuotaPreference, (protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing QuotaPreference. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Value for parent.
   *  Example:
   *  `projects/123/locations/global`
   */
  // const parent = 'abc123'
  /**
   *  Optional. Id of the requesting object, must be unique under its parent.
   *  If client does not set this field, the service will generate one.
   */
  // const quotaPreferenceId = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const quotaPreference = {}
  /**
   *  The list of quota safety checks to be ignored.
   */
  // const ignoreSafetyChecks = [1,2,3,4]

  // Imports the Cloudquotas library
  const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta;

  // Instantiates a client
  const cloudquotasClient = new CloudQuotasClient();

  async function callCreateQuotaPreference() {
    // Construct request
    const request = {
      parent,
      quotaPreference,
    };

    // Run request
    const response = await cloudquotasClient.createQuotaPreference(request);
    console.log(response);
  }

  callCreateQuotaPreference();

createQuotaPreference(request, options, callback)

createQuotaPreference(request: protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateQuotaPreferenceRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createQuotaPreference(request, callback)

createQuotaPreference(request: protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateQuotaPreferenceRequest
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

folderLocationQuotaPreferencePath(folder, location, quotaPreference)

folderLocationQuotaPreferencePath(folder: string, location: string, quotaPreference: string): string;

Return a fully-qualified folderLocationQuotaPreference resource name string.

Parameters
Name Description
folder string
location string
quotaPreference string
Returns
Type Description
string

{string} Resource name string.

folderLocationServiceQuotaInfoPath(folder, location, service, quotaInfo)

folderLocationServiceQuotaInfoPath(folder: string, location: string, service: string, quotaInfo: string): string;

Return a fully-qualified folderLocationServiceQuotaInfo resource name string.

Parameters
Name Description
folder string
location string
service string
quotaInfo string
Returns
Type Description
string

{string} Resource name string.

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

getQuotaInfo(request, options)

getQuotaInfo(request?: protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1beta.IQuotaInfo,
        protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | undefined,
        {} | undefined
    ]>;

Retrieve the QuotaInfo of a quota for a project, folder or organization.

Parameters
Name Description
request IGetQuotaInfoRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.api.cloudquotas.v1beta.IQuotaInfo, protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the quota info.
   *  An example name:
   *  `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
   */
  // const name = 'abc123'

  // Imports the Cloudquotas library
  const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta;

  // Instantiates a client
  const cloudquotasClient = new CloudQuotasClient();

  async function callGetQuotaInfo() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await cloudquotasClient.getQuotaInfo(request);
    console.log(response);
  }

  callGetQuotaInfo();

getQuotaInfo(request, options, callback)

getQuotaInfo(request: protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaInfo, protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetQuotaInfoRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaInfo, protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getQuotaInfo(request, callback)

getQuotaInfo(request: protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaInfo, protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetQuotaInfoRequest
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaInfo, protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getQuotaPreference(request, options)

getQuotaPreference(request?: protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1beta.IQuotaPreference,
        (protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest | undefined),
        {} | undefined
    ]>;

Gets details of a single QuotaPreference.

Parameters
Name Description
request IGetQuotaPreferenceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.api.cloudquotas.v1beta.IQuotaPreference, (protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing QuotaPreference. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Name of the resource
   *  Example name:
   *  `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
   */
  // const name = 'abc123'

  // Imports the Cloudquotas library
  const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta;

  // Instantiates a client
  const cloudquotasClient = new CloudQuotasClient();

  async function callGetQuotaPreference() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await cloudquotasClient.getQuotaPreference(request);
    console.log(response);
  }

  callGetQuotaPreference();

getQuotaPreference(request, options, callback)

getQuotaPreference(request: protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetQuotaPreferenceRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getQuotaPreference(request, callback)

getQuotaPreference(request: protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetQuotaPreferenceRequest
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Type Description
Promise<{ [name: string]: Function; }>

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

listQuotaInfos(request, options)

listQuotaInfos(request?: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1beta.IQuotaInfo[],
        protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest | null,
        protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse
    ]>;

Lists QuotaInfos of all quotas for a given project, folder or organization.

Parameters
Name Description
request IListQuotaInfosRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.api.cloudquotas.v1beta.IQuotaInfo[], protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest | null, protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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. Note that it can affect your quota. We recommend using listQuotaInfosAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listQuotaInfos(request, options, callback)

listQuotaInfos(request: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaInfo>): void;
Parameters
Name Description
request IListQuotaInfosRequest
options CallOptions
callback PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaInfo>
Returns
Type Description
void

listQuotaInfos(request, callback)

listQuotaInfos(request: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, callback: PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaInfo>): void;
Parameters
Name Description
request IListQuotaInfosRequest
callback PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaInfo>
Returns
Type Description
void

listQuotaInfosAsync(request, options)

listQuotaInfosAsync(request?: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, options?: CallOptions): AsyncIterable<protos.google.api.cloudquotas.v1beta.IQuotaInfo>;

Equivalent to listQuotaInfos, but returns an iterable object.

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

Parameters
Name Description
request IListQuotaInfosRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.api.cloudquotas.v1beta.IQuotaInfo>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . 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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent value of QuotaInfo resources.
   *  Listing across different resource containers (such as 'projects/-') is not
   *  allowed.
   *  Example names:
   *  `projects/123/locations/global/services/compute.googleapis.com`
   *  `folders/234/locations/global/services/compute.googleapis.com`
   *  `organizations/345/locations/global/services/compute.googleapis.com`
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'

  // Imports the Cloudquotas library
  const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta;

  // Instantiates a client
  const cloudquotasClient = new CloudQuotasClient();

  async function callListQuotaInfos() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = cloudquotasClient.listQuotaInfosAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListQuotaInfos();

listQuotaInfosStream(request, options)

listQuotaInfosStream(request?: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, options?: CallOptions): Transform;

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

Parameters
Name Description
request IListQuotaInfosRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing 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 listQuotaInfosAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listQuotaPreferences(request, options)

listQuotaPreferences(request?: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1beta.IQuotaPreference[],
        protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest | null,
        protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse
    ]>;

Lists QuotaPreferences in a given project, folder or organization.

Parameters
Name Description
request IListQuotaPreferencesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.api.cloudquotas.v1beta.IQuotaPreference[], protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest | null, protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of QuotaPreference. 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. Note that it can affect your quota. We recommend using listQuotaPreferencesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listQuotaPreferences(request, options, callback)

listQuotaPreferences(request: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaPreference>): void;
Parameters
Name Description
request IListQuotaPreferencesRequest
options CallOptions
callback PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaPreference>
Returns
Type Description
void

listQuotaPreferences(request, callback)

listQuotaPreferences(request: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, callback: PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaPreference>): void;
Parameters
Name Description
request IListQuotaPreferencesRequest
callback PaginationCallback<protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1beta.IQuotaPreference>
Returns
Type Description
void

listQuotaPreferencesAsync(request, options)

listQuotaPreferencesAsync(request?: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, options?: CallOptions): AsyncIterable<protos.google.api.cloudquotas.v1beta.IQuotaPreference>;

Equivalent to listQuotaPreferences, but returns an iterable object.

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

Parameters
Name Description
request IListQuotaPreferencesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.api.cloudquotas.v1beta.IQuotaPreference>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing QuotaPreference. 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 for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent value of QuotaPreference resources.
   *  Listing across different resource containers (such as 'projects/-') is not
   *  allowed.
   *  When the value starts with 'folders' or 'organizations', it lists the
   *  QuotaPreferences for org quotas in the container. It does not list the
   *  QuotaPreferences in the descendant projects of the container.
   *  Example parents:
   *  `projects/123/locations/global`
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server may return fewer items than
   *  requested. If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filter result QuotaPreferences by their state, type,
   *  create/update time range.
   *  Example filters:
   *  `reconciling=true AND request_type=CLOUD_CONSOLE`,
   *  `reconciling=true OR creation_time>2022-12-03T10:30:00`
   */
  // const filter = 'abc123'
  /**
   *  Optional. How to order of the results. By default, the results are ordered
   *  by create time.
   *  Example orders:
   *  `quota_id`,
   *  `service, create_time`
   */
  // const orderBy = 'abc123'

  // Imports the Cloudquotas library
  const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta;

  // Instantiates a client
  const cloudquotasClient = new CloudQuotasClient();

  async function callListQuotaPreferences() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = cloudquotasClient.listQuotaPreferencesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListQuotaPreferences();

listQuotaPreferencesStream(request, options)

listQuotaPreferencesStream(request?: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, options?: CallOptions): Transform;

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

Parameters
Name Description
request IListQuotaPreferencesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing QuotaPreference 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 listQuotaPreferencesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

matchFolderFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName)

matchFolderFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName: string): string | number;

Parse the folder from FolderLocationQuotaPreference resource.

Parameter
Name Description
folderLocationQuotaPreferenceName string

A fully-qualified path representing folder_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchFolderFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the folder from FolderLocationServiceQuotaInfo resource.

Parameter
Name Description
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchLocationFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName)

matchLocationFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName: string): string | number;

Parse the location from FolderLocationQuotaPreference resource.

Parameter
Name Description
folderLocationQuotaPreferenceName string

A fully-qualified path representing folder_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchLocationFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the location from FolderLocationServiceQuotaInfo resource.

Parameter
Name Description
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName)

matchLocationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName: string): string | number;

Parse the location from OrganizationLocationQuotaPreference resource.

Parameter
Name Description
organizationLocationQuotaPreferenceName string

A fully-qualified path representing organization_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchLocationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the location from OrganizationLocationServiceQuotaInfo resource.

Parameter
Name Description
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName)

matchLocationFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName: string): string | number;

Parse the location from ProjectLocationQuotaPreference resource.

Parameter
Name Description
projectLocationQuotaPreferenceName string

A fully-qualified path representing project_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationServiceName(projectLocationServiceName)

matchLocationFromProjectLocationServiceName(projectLocationServiceName: string): string | number;

Parse the location from ProjectLocationService resource.

Parameter
Name Description
projectLocationServiceName string

A fully-qualified path representing project_location_service resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchLocationFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the location from ProjectLocationServiceQuotaInfo resource.

Parameter
Name Description
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromQuotaAdjusterSettingsName(quotaAdjusterSettingsName)

matchLocationFromQuotaAdjusterSettingsName(quotaAdjusterSettingsName: string): string | number;

Parse the location from QuotaAdjusterSettings resource.

Parameter
Name Description
quotaAdjusterSettingsName string

A fully-qualified path representing QuotaAdjusterSettings resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchOrganizationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName)

matchOrganizationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName: string): string | number;

Parse the organization from OrganizationLocationQuotaPreference resource.

Parameter
Name Description
organizationLocationQuotaPreferenceName string

A fully-qualified path representing organization_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchOrganizationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the organization from OrganizationLocationServiceQuotaInfo resource.

Parameter
Name Description
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName)

matchProjectFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName: string): string | number;

Parse the project from ProjectLocationQuotaPreference resource.

Parameter
Name Description
projectLocationQuotaPreferenceName string

A fully-qualified path representing project_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationServiceName(projectLocationServiceName)

matchProjectFromProjectLocationServiceName(projectLocationServiceName: string): string | number;

Parse the project from ProjectLocationService resource.

Parameter
Name Description
projectLocationServiceName string

A fully-qualified path representing project_location_service resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchProjectFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the project from ProjectLocationServiceQuotaInfo resource.

Parameter
Name Description
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
Name Description
projectName string

A fully-qualified path representing Project resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromQuotaAdjusterSettingsName(quotaAdjusterSettingsName)

matchProjectFromQuotaAdjusterSettingsName(quotaAdjusterSettingsName: string): string | number;

Parse the project from QuotaAdjusterSettings resource.

Parameter
Name Description
quotaAdjusterSettingsName string

A fully-qualified path representing QuotaAdjusterSettings resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchQuotaInfoFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchQuotaInfoFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the quota_info from FolderLocationServiceQuotaInfo resource.

Parameter
Name Description
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the quota_info.

matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the quota_info from OrganizationLocationServiceQuotaInfo resource.

Parameter
Name Description
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the quota_info.

matchQuotaInfoFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchQuotaInfoFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the quota_info from ProjectLocationServiceQuotaInfo resource.

Parameter
Name Description
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the quota_info.

matchQuotaPreferenceFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName)

matchQuotaPreferenceFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName: string): string | number;

Parse the quota_preference from FolderLocationQuotaPreference resource.

Parameter
Name Description
folderLocationQuotaPreferenceName string

A fully-qualified path representing folder_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the quota_preference.

matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName)

matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName: string): string | number;

Parse the quota_preference from OrganizationLocationQuotaPreference resource.

Parameter
Name Description
organizationLocationQuotaPreferenceName string

A fully-qualified path representing organization_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the quota_preference.

matchQuotaPreferenceFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName)

matchQuotaPreferenceFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName: string): string | number;

Parse the quota_preference from ProjectLocationQuotaPreference resource.

Parameter
Name Description
projectLocationQuotaPreferenceName string

A fully-qualified path representing project_location_quota_preference resource.

Returns
Type Description
string | number

{string} A string representing the quota_preference.

matchServiceFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchServiceFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the service from FolderLocationServiceQuotaInfo resource.

Parameter
Name Description
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchServiceFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the service from OrganizationLocationServiceQuotaInfo resource.

Parameter
Name Description
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromProjectLocationServiceName(projectLocationServiceName)

matchServiceFromProjectLocationServiceName(projectLocationServiceName: string): string | number;

Parse the service from ProjectLocationService resource.

Parameter
Name Description
projectLocationServiceName string

A fully-qualified path representing project_location_service resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchServiceFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the service from ProjectLocationServiceQuotaInfo resource.

Parameter
Name Description
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
Type Description
string | number

{string} A string representing the service.

organizationLocationQuotaPreferencePath(organization, location, quotaPreference)

organizationLocationQuotaPreferencePath(organization: string, location: string, quotaPreference: string): string;

Return a fully-qualified organizationLocationQuotaPreference resource name string.

Parameters
Name Description
organization string
location string
quotaPreference string
Returns
Type Description
string

{string} Resource name string.

organizationLocationServiceQuotaInfoPath(organization, location, service, quotaInfo)

organizationLocationServiceQuotaInfoPath(organization: string, location: string, service: string, quotaInfo: string): string;

Return a fully-qualified organizationLocationServiceQuotaInfo resource name string.

Parameters
Name Description
organization string
location string
service string
quotaInfo string
Returns
Type Description
string

{string} Resource name string.

projectLocationQuotaPreferencePath(project, location, quotaPreference)

projectLocationQuotaPreferencePath(project: string, location: string, quotaPreference: string): string;

Return a fully-qualified projectLocationQuotaPreference resource name string.

Parameters
Name Description
project string
location string
quotaPreference string
Returns
Type Description
string

{string} Resource name string.

projectLocationServicePath(project, location, service)

projectLocationServicePath(project: string, location: string, service: string): string;

Return a fully-qualified projectLocationService resource name string.

Parameters
Name Description
project string
location string
service string
Returns
Type Description
string

{string} Resource name string.

projectLocationServiceQuotaInfoPath(project, location, service, quotaInfo)

projectLocationServiceQuotaInfoPath(project: string, location: string, service: string, quotaInfo: string): string;

Return a fully-qualified projectLocationServiceQuotaInfo resource name string.

Parameters
Name Description
project string
location string
service string
quotaInfo string
Returns
Type Description
string

{string} Resource name string.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
Name Description
project string
Returns
Type Description
string

{string} Resource name string.

quotaAdjusterSettingsPath(project, location)

quotaAdjusterSettingsPath(project: string, location: string): string;

Return a fully-qualified quotaAdjusterSettings resource name string.

Parameters
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

updateQuotaPreference(request, options)

updateQuotaPreference(request?: protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1beta.IQuotaPreference,
        (protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest | undefined),
        {} | undefined
    ]>;

Updates the parameters of a single QuotaPreference. It can updates the config in any states, not just the ones pending approval.

Parameters
Name Description
request IUpdateQuotaPreferenceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.api.cloudquotas.v1beta.IQuotaPreference, (protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing QuotaPreference. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. Field mask is used to specify the fields to be overwritten in the
   *  QuotaPreference resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated
   */
  // const quotaPreference = {}
  /**
   *  Optional. If set to true, and the quota preference is not found, a new one
   *  will be created. In this situation, `update_mask` is ignored.
   */
  // const allowMissing = true
  /**
   *  Optional. If set to true, validate the request, but do not actually update.
   *  Note that a request being valid does not mean that the request is
   *  guaranteed to be fulfilled.
   */
  // const validateOnly = true
  /**
   *  The list of quota safety checks to be ignored.
   */
  // const ignoreSafetyChecks = [1,2,3,4]

  // Imports the Cloudquotas library
  const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta;

  // Instantiates a client
  const cloudquotasClient = new CloudQuotasClient();

  async function callUpdateQuotaPreference() {
    // Construct request
    const request = {
      quotaPreference,
    };

    // Run request
    const response = await cloudquotasClient.updateQuotaPreference(request);
    console.log(response);
  }

  callUpdateQuotaPreference();

updateQuotaPreference(request, options, callback)

updateQuotaPreference(request: protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateQuotaPreferenceRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateQuotaPreference(request, callback)

updateQuotaPreference(request: protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, callback: Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateQuotaPreferenceRequest
callback Callback<protos.google.api.cloudquotas.v1beta.IQuotaPreference, protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void