Class v1.CloudQuotasClient (0.1.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. v1

Package

@google-cloud/cloudquotas

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of CloudQuotasClient.

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

static get apiEndpoint(): string;

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

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.

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
TypeDescription
Promise<void>

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

createQuotaPreference(request, options)

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

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

Parameters
NameDescription
request ICreateQuotaPreferenceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.cloudquotas.v1.IQuotaPreference, (protos.google.api.cloudquotas.v1.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').v1;

  // 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.v1.ICreateQuotaPreferenceRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateQuotaPreferenceRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createQuotaPreference(request, callback)

createQuotaPreference(request: protos.google.api.cloudquotas.v1.ICreateQuotaPreferenceRequest, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateQuotaPreferenceRequest
callback Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.ICreateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

folderLocationQuotaPreferencePath(folder, location, quotaPreference)

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

Return a fully-qualified folderLocationQuotaPreference resource name string.

Parameters
NameDescription
folder string
location string
quotaPreference string
Returns
TypeDescription
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
NameDescription
folder string
location string
service string
quotaInfo string
Returns
TypeDescription
string

{string} Resource name string.

getProjectId()

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

getProjectId(callback)

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

getQuotaInfo(request, options)

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

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

Parameters
NameDescription
request IGetQuotaInfoRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.cloudquotas.v1.IQuotaInfo, protos.google.api.cloudquotas.v1.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').v1;

  // 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.v1.IGetQuotaInfoRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaInfo, protos.google.api.cloudquotas.v1.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetQuotaInfoRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1.IQuotaInfo, protos.google.api.cloudquotas.v1.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getQuotaInfo(request, callback)

getQuotaInfo(request: protos.google.api.cloudquotas.v1.IGetQuotaInfoRequest, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaInfo, protos.google.api.cloudquotas.v1.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetQuotaInfoRequest
callback Callback<protos.google.api.cloudquotas.v1.IQuotaInfo, protos.google.api.cloudquotas.v1.IGetQuotaInfoRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getQuotaPreference(request, options)

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

Gets details of a single QuotaPreference.

Parameters
NameDescription
request IGetQuotaPreferenceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.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').v1;

  // 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.v1.IGetQuotaPreferenceRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetQuotaPreferenceRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getQuotaPreference(request, callback)

getQuotaPreference(request: protos.google.api.cloudquotas.v1.IGetQuotaPreferenceRequest, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetQuotaPreferenceRequest
callback Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IGetQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

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

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

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

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

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

listQuotaInfos(request, options)

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

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

Parameters
NameDescription
request IListQuotaInfosRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.cloudquotas.v1.IQuotaInfo[], protos.google.api.cloudquotas.v1.IListQuotaInfosRequest | null, protos.google.api.cloudquotas.v1.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.v1.IListQuotaInfosRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaInfo>): void;
Parameters
NameDescription
request IListQuotaInfosRequest
options CallOptions
callback PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaInfo>
Returns
TypeDescription
void

listQuotaInfos(request, callback)

listQuotaInfos(request: protos.google.api.cloudquotas.v1.IListQuotaInfosRequest, callback: PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaInfo>): void;
Parameters
NameDescription
request IListQuotaInfosRequest
callback PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaInfosRequest, protos.google.api.cloudquotas.v1.IListQuotaInfosResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaInfo>
Returns
TypeDescription
void

listQuotaInfosAsync(request, options)

listQuotaInfosAsync(request?: protos.google.api.cloudquotas.v1.IListQuotaInfosRequest, options?: CallOptions): AsyncIterable<protos.google.api.cloudquotas.v1.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
NameDescription
request IListQuotaInfosRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.cloudquotas.v1.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').v1;

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

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

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

  callListQuotaInfos();

listQuotaInfosStream(request, options)

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

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

Parameters
NameDescription
request IListQuotaInfosRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing 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.v1.IListQuotaPreferencesRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1.IQuotaPreference[],
        protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest | null,
        protos.google.api.cloudquotas.v1.IListQuotaPreferencesResponse
    ]>;

Lists QuotaPreferences in a given project, folder or organization.

Parameters
NameDescription
request IListQuotaPreferencesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.cloudquotas.v1.IQuotaPreference[], protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest | null, protos.google.api.cloudquotas.v1.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.v1.IListQuotaPreferencesRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaPreference>): void;
Parameters
NameDescription
request IListQuotaPreferencesRequest
options CallOptions
callback PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaPreference>
Returns
TypeDescription
void

listQuotaPreferences(request, callback)

listQuotaPreferences(request: protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest, callback: PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaPreference>): void;
Parameters
NameDescription
request IListQuotaPreferencesRequest
callback PaginationCallback<protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest, protos.google.api.cloudquotas.v1.IListQuotaPreferencesResponse | null | undefined, protos.google.api.cloudquotas.v1.IQuotaPreference>
Returns
TypeDescription
void

listQuotaPreferencesAsync(request, options)

listQuotaPreferencesAsync(request?: protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest, options?: CallOptions): AsyncIterable<protos.google.api.cloudquotas.v1.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
NameDescription
request IListQuotaPreferencesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.cloudquotas.v1.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:
   *  `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
   *  `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
   *   creation_time>2022-12-03T10:30:00`
   *  If no filter is provided, returns all pending quota preferences.
   */
  // const filter = 'abc123'
  /**
   *  Optional. How to order of the results. By default, the results are ordered
   *  by create time.
   *  Example orders:
   *  `type`
   *  `state, create_time`
   */
  // const orderBy = 'abc123'

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

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

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

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

  callListQuotaPreferences();

listQuotaPreferencesStream(request, options)

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

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

Parameters
NameDescription
request IListQuotaPreferencesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing 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.

matchFolderFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName)

matchFolderFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName: string): string | number;

Parse the folder from FolderLocationQuotaPreference resource.

Parameter
NameDescription
folderLocationQuotaPreferenceName string

A fully-qualified path representing folder_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the folder.

matchFolderFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchFolderFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the folder from FolderLocationServiceQuotaInfo resource.

Parameter
NameDescription
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the folder.

matchLocationFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName)

matchLocationFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName: string): string | number;

Parse the location from FolderLocationQuotaPreference resource.

Parameter
NameDescription
folderLocationQuotaPreferenceName string

A fully-qualified path representing folder_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchLocationFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the location from FolderLocationServiceQuotaInfo resource.

Parameter
NameDescription
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName)

matchLocationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName: string): string | number;

Parse the location from OrganizationLocationQuotaPreference resource.

Parameter
NameDescription
organizationLocationQuotaPreferenceName string

A fully-qualified path representing organization_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchLocationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the location from OrganizationLocationServiceQuotaInfo resource.

Parameter
NameDescription
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationName(projectLocationName)

matchLocationFromProjectLocationName(projectLocationName: string): string | number;

Parse the location from ProjectLocation resource.

Parameter
NameDescription
projectLocationName string

A fully-qualified path representing project_location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName)

matchLocationFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName: string): string | number;

Parse the location from ProjectLocationQuotaPreference resource.

Parameter
NameDescription
projectLocationQuotaPreferenceName string

A fully-qualified path representing project_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationServiceName(projectLocationServiceName)

matchLocationFromProjectLocationServiceName(projectLocationServiceName: string): string | number;

Parse the location from ProjectLocationService resource.

Parameter
NameDescription
projectLocationServiceName string

A fully-qualified path representing project_location_service resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchLocationFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the location from ProjectLocationServiceQuotaInfo resource.

Parameter
NameDescription
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchOrganizationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName)

matchOrganizationFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName: string): string | number;

Parse the organization from OrganizationLocationQuotaPreference resource.

Parameter
NameDescription
organizationLocationQuotaPreferenceName string

A fully-qualified path representing organization_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchOrganizationFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the organization from OrganizationLocationServiceQuotaInfo resource.

Parameter
NameDescription
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchProjectFromProjectLocationName(projectLocationName)

matchProjectFromProjectLocationName(projectLocationName: string): string | number;

Parse the project from ProjectLocation resource.

Parameter
NameDescription
projectLocationName string

A fully-qualified path representing project_location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName)

matchProjectFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName: string): string | number;

Parse the project from ProjectLocationQuotaPreference resource.

Parameter
NameDescription
projectLocationQuotaPreferenceName string

A fully-qualified path representing project_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectLocationServiceName(projectLocationServiceName)

matchProjectFromProjectLocationServiceName(projectLocationServiceName: string): string | number;

Parse the project from ProjectLocationService resource.

Parameter
NameDescription
projectLocationServiceName string

A fully-qualified path representing project_location_service resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchProjectFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the project from ProjectLocationServiceQuotaInfo resource.

Parameter
NameDescription
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchQuotaInfoFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchQuotaInfoFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the quota_info from FolderLocationServiceQuotaInfo resource.

Parameter
NameDescription
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the quota_info.

matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the quota_info from OrganizationLocationServiceQuotaInfo resource.

Parameter
NameDescription
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the quota_info.

matchQuotaInfoFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchQuotaInfoFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the quota_info from ProjectLocationServiceQuotaInfo resource.

Parameter
NameDescription
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the quota_info.

matchQuotaPreferenceFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName)

matchQuotaPreferenceFromFolderLocationQuotaPreferenceName(folderLocationQuotaPreferenceName: string): string | number;

Parse the quota_preference from FolderLocationQuotaPreference resource.

Parameter
NameDescription
folderLocationQuotaPreferenceName string

A fully-qualified path representing folder_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the quota_preference.

matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName)

matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName(organizationLocationQuotaPreferenceName: string): string | number;

Parse the quota_preference from OrganizationLocationQuotaPreference resource.

Parameter
NameDescription
organizationLocationQuotaPreferenceName string

A fully-qualified path representing organization_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the quota_preference.

matchQuotaPreferenceFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName)

matchQuotaPreferenceFromProjectLocationQuotaPreferenceName(projectLocationQuotaPreferenceName: string): string | number;

Parse the quota_preference from ProjectLocationQuotaPreference resource.

Parameter
NameDescription
projectLocationQuotaPreferenceName string

A fully-qualified path representing project_location_quota_preference resource.

Returns
TypeDescription
string | number

{string} A string representing the quota_preference.

matchServiceFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName)

matchServiceFromFolderLocationServiceQuotaInfoName(folderLocationServiceQuotaInfoName: string): string | number;

Parse the service from FolderLocationServiceQuotaInfo resource.

Parameter
NameDescription
folderLocationServiceQuotaInfoName string

A fully-qualified path representing folder_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

matchServiceFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName)

matchServiceFromOrganizationLocationServiceQuotaInfoName(organizationLocationServiceQuotaInfoName: string): string | number;

Parse the service from OrganizationLocationServiceQuotaInfo resource.

Parameter
NameDescription
organizationLocationServiceQuotaInfoName string

A fully-qualified path representing organization_location_service_quota_info resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

matchServiceFromProjectLocationServiceName(projectLocationServiceName)

matchServiceFromProjectLocationServiceName(projectLocationServiceName: string): string | number;

Parse the service from ProjectLocationService resource.

Parameter
NameDescription
projectLocationServiceName string

A fully-qualified path representing project_location_service resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

matchServiceFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName)

matchServiceFromProjectLocationServiceQuotaInfoName(projectLocationServiceQuotaInfoName: string): string | number;

Parse the service from ProjectLocationServiceQuotaInfo resource.

Parameter
NameDescription
projectLocationServiceQuotaInfoName string

A fully-qualified path representing project_location_service_quota_info resource.

Returns
TypeDescription
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
NameDescription
organization string
location string
quotaPreference string
Returns
TypeDescription
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
NameDescription
organization string
location string
service string
quotaInfo string
Returns
TypeDescription
string

{string} Resource name string.

projectLocationPath(project, location)

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

Return a fully-qualified projectLocation resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
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
NameDescription
project string
location string
quotaPreference string
Returns
TypeDescription
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
NameDescription
project string
location string
service string
Returns
TypeDescription
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
NameDescription
project string
location string
service string
quotaInfo string
Returns
TypeDescription
string

{string} Resource name string.

updateQuotaPreference(request, options)

updateQuotaPreference(request?: protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest, options?: CallOptions): Promise<[
        protos.google.api.cloudquotas.v1.IQuotaPreference,
        (protos.google.api.cloudquotas.v1.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
NameDescription
request IUpdateQuotaPreferenceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.cloudquotas.v1.IQuotaPreference, (protos.google.api.cloudquotas.v1.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').v1;

  // 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.v1.IUpdateQuotaPreferenceRequest, options: CallOptions, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateQuotaPreferenceRequest
options CallOptions
callback Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateQuotaPreference(request, callback)

updateQuotaPreference(request: protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest, callback: Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateQuotaPreferenceRequest
callback Callback<protos.google.api.cloudquotas.v1.IQuotaPreference, protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void