Class v1beta1.ServiceUsageClient (3.3.0)

Package

@google-cloud/service-usage

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of ServiceUsageClient.

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 ServiceUsageClient({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;

descriptors

descriptors: Descriptors;

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

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.

serviceUsageStub

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

universeDomain

get universeDomain(): string;

warn

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

Methods

batchEnableServices(request, options)

batchEnableServices(request?: protos.google.api.serviceusage.v1beta1.IBatchEnableServicesRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Enables multiple services on a project. The operation is atomic: if enabling any service fails, then the entire batch fails, and no state changes occur.

Operation response type: google.protobuf.Empty

Parameters
NameDescription
request IBatchEnableServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  Parent to enable services on.
   *  An example name would be:
   *  `projects/123`
   *  where `123` is the project number (not project ID).
   *  The `BatchEnableServices` method currently only supports projects.
   */
  // const parent = 'abc123'
  /**
   *  The identifiers of the services to enable on the project.
   *  A valid identifier would be:
   *  serviceusage.googleapis.com
   *  Enabling services requires that each service is public or is shared with
   *  the user enabling the service.
   *  Two or more services must be specified. To enable a single service,
   *  use the `EnableService` method instead.
   *  A single request can enable a maximum of 20 services at a time. If more
   *  than 20 services are specified, the request will fail, and no state changes
   *  will occur.
   */
  // const serviceIds = ['abc','def']

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callBatchEnableServices() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.batchEnableServices(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBatchEnableServices();

batchEnableServices(request, options, callback)

batchEnableServices(request: protos.google.api.serviceusage.v1beta1.IBatchEnableServicesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IBatchEnableServicesRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

batchEnableServices(request, callback)

batchEnableServices(request: protos.google.api.serviceusage.v1beta1.IBatchEnableServicesRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IBatchEnableServicesRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cancelOperation(request, options, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
NameDescription
request CancelOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkBatchEnableServicesProgress(name)

checkBatchEnableServicesProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by batchEnableServices().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  Parent to enable services on.
   *  An example name would be:
   *  `projects/123`
   *  where `123` is the project number (not project ID).
   *  The `BatchEnableServices` method currently only supports projects.
   */
  // const parent = 'abc123'
  /**
   *  The identifiers of the services to enable on the project.
   *  A valid identifier would be:
   *  serviceusage.googleapis.com
   *  Enabling services requires that each service is public or is shared with
   *  the user enabling the service.
   *  Two or more services must be specified. To enable a single service,
   *  use the `EnableService` method instead.
   *  A single request can enable a maximum of 20 services at a time. If more
   *  than 20 services are specified, the request will fail, and no state changes
   *  will occur.
   */
  // const serviceIds = ['abc','def']

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callBatchEnableServices() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.batchEnableServices(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callBatchEnableServices();

checkCreateAdminOverrideProgress(name)

checkCreateAdminOverrideProgress(name: string): Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by createAdminOverride().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the parent quota limit, returned by a
   *  ListConsumerQuotaMetrics or GetConsumerQuotaMetric call.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
   */
  // const parent = 'abc123'
  /**
   *  The admin override to create.
   */
  // const override = {}
  /**
   *  Whether to force the creation of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callCreateAdminOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.createAdminOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateAdminOverride();

checkCreateConsumerOverrideProgress(name)

checkCreateConsumerOverrideProgress(name: string): Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by createConsumerOverride().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the parent quota limit, returned by a
   *  ListConsumerQuotaMetrics or GetConsumerQuotaMetric call.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
   */
  // const parent = 'abc123'
  /**
   *  The override to create.
   */
  // const override = {}
  /**
   *  Whether to force the creation of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callCreateConsumerOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.createConsumerOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateConsumerOverride();

checkDeleteAdminOverrideProgress(name)

checkDeleteAdminOverrideProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by deleteAdminOverride().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the override to delete.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  Whether to force the deletion of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callDeleteAdminOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.deleteAdminOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteAdminOverride();

checkDeleteConsumerOverrideProgress(name)

checkDeleteConsumerOverrideProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by deleteConsumerOverride().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the override to delete.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  Whether to force the deletion of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callDeleteConsumerOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.deleteConsumerOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteConsumerOverride();

checkDisableServiceProgress(name)

checkDisableServiceProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by disableService().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  Name of the consumer and service to disable the service on.
   *  The enable and disable methods currently only support projects.
   *  An example name would be:
   *  `projects/123/services/serviceusage.googleapis.com`
   *  where `123` is the project number (not project ID).
   */
  // const name = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callDisableService() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.disableService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDisableService();

checkEnableServiceProgress(name)

checkEnableServiceProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by enableService().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  Name of the consumer and service to enable the service on.
   *  The `EnableService` and `DisableService` methods currently only support
   *  projects.
   *  Enabling a service requires that the service is public or is shared with
   *  the user enabling the service.
   *  An example name would be:
   *  `projects/123/services/serviceusage.googleapis.com`
   *  where `123` is the project number (not project ID).
   */
  // const name = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callEnableService() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.enableService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callEnableService();

checkGenerateServiceIdentityProgress(name)

checkGenerateServiceIdentityProgress(name: string): Promise<LROperation<protos.google.api.serviceusage.v1beta1.ServiceIdentity, protos.google.protobuf.Empty>>;

Check the status of the long running operation returned by generateServiceIdentity().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.serviceusage.v1beta1.ServiceIdentity, protos.google.protobuf.Empty>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  Name of the consumer and service to generate an identity for.
   *  The `GenerateServiceIdentity` methods currently support projects, folders,
   *  organizations.
   *  Example parents would be:
   *  `projects/123/services/example.googleapis.com`
   *  `folders/123/services/example.googleapis.com`
   *  `organizations/123/services/example.googleapis.com`
   */
  // const parent = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callGenerateServiceIdentity() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.generateServiceIdentity(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callGenerateServiceIdentity();

checkImportAdminOverridesProgress(name)

checkImportAdminOverridesProgress(name: string): Promise<LROperation<protos.google.api.serviceusage.v1beta1.ImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.ImportAdminOverridesMetadata>>;

Check the status of the long running operation returned by importAdminOverrides().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.serviceusage.v1beta1.ImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.ImportAdminOverridesMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the consumer.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com`
   */
  // const parent = 'abc123'
  /**
   *  The import data is specified in the request message itself
   */
  // const inlineSource = {}
  /**
   *  Whether to force the creation of the quota overrides.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callImportAdminOverrides() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.importAdminOverrides(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callImportAdminOverrides();

checkImportConsumerOverridesProgress(name)

checkImportConsumerOverridesProgress(name: string): Promise<LROperation<protos.google.api.serviceusage.v1beta1.ImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.ImportConsumerOverridesMetadata>>;

Check the status of the long running operation returned by importConsumerOverrides().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.serviceusage.v1beta1.ImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.ImportConsumerOverridesMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the consumer.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com`
   */
  // const parent = 'abc123'
  /**
   *  The import data is specified in the request message itself
   */
  // const inlineSource = {}
  /**
   *  Whether to force the creation of the quota overrides.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callImportConsumerOverrides() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.importConsumerOverrides(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callImportConsumerOverrides();

checkUpdateAdminOverrideProgress(name)

checkUpdateAdminOverrideProgress(name: string): Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by updateAdminOverride().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the override to update.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  The new override.
   *  Only the override_value is updated; all other fields are ignored.
   */
  // const override = {}
  /**
   *  Whether to force the update of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  Update only the specified fields of the override.
   *  If unset, all fields will be updated.
   */
  // const updateMask = {}
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callUpdateAdminOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.updateAdminOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateAdminOverride();

checkUpdateConsumerOverrideProgress(name)

checkUpdateConsumerOverrideProgress(name: string): Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by updateConsumerOverride().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.api.serviceusage.v1beta1.QuotaOverride, protos.google.api.serviceusage.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. 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.
   */
  /**
   *  The resource name of the override to update.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  The new override.
   *  Only the override_value is updated; all other fields are ignored.
   */
  // const override = {}
  /**
   *  Whether to force the update of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  Update only the specified fields of the override.
   *  If unset, all fields will be updated.
   */
  // const updateMask = {}
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callUpdateConsumerOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.updateConsumerOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateConsumerOverride();

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.

createAdminOverride(request, options)

createAdminOverride(request?: protos.google.api.serviceusage.v1beta1.ICreateAdminOverrideRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates an admin override. An admin override is applied by an administrator of a parent folder or parent organization of the consumer receiving the override. An admin override is intended to limit the amount of quota the consumer can use out of the total quota pool allocated to all children of the folder or organization.

Parameters
NameDescription
request ICreateAdminOverrideRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the parent quota limit, returned by a
   *  ListConsumerQuotaMetrics or GetConsumerQuotaMetric call.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
   */
  // const parent = 'abc123'
  /**
   *  The admin override to create.
   */
  // const override = {}
  /**
   *  Whether to force the creation of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callCreateAdminOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.createAdminOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateAdminOverride();

createAdminOverride(request, options, callback)

createAdminOverride(request: protos.google.api.serviceusage.v1beta1.ICreateAdminOverrideRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateAdminOverrideRequest
options CallOptions
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createAdminOverride(request, callback)

createAdminOverride(request: protos.google.api.serviceusage.v1beta1.ICreateAdminOverrideRequest, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateAdminOverrideRequest
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createConsumerOverride(request, options)

createConsumerOverride(request?: protos.google.api.serviceusage.v1beta1.ICreateConsumerOverrideRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a consumer override. A consumer override is applied to the consumer on its own authority to limit its own quota usage. Consumer overrides cannot be used to grant more quota than would be allowed by admin overrides, producer overrides, or the default limit of the service.

Parameters
NameDescription
request ICreateConsumerOverrideRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the parent quota limit, returned by a
   *  ListConsumerQuotaMetrics or GetConsumerQuotaMetric call.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
   */
  // const parent = 'abc123'
  /**
   *  The override to create.
   */
  // const override = {}
  /**
   *  Whether to force the creation of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callCreateConsumerOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.createConsumerOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateConsumerOverride();

createConsumerOverride(request, options, callback)

createConsumerOverride(request: protos.google.api.serviceusage.v1beta1.ICreateConsumerOverrideRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateConsumerOverrideRequest
options CallOptions
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createConsumerOverride(request, callback)

createConsumerOverride(request: protos.google.api.serviceusage.v1beta1.ICreateConsumerOverrideRequest, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateConsumerOverrideRequest
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteAdminOverride(request, options)

deleteAdminOverride(request?: protos.google.api.serviceusage.v1beta1.IDeleteAdminOverrideRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes an admin override.

Parameters
NameDescription
request IDeleteAdminOverrideRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the override to delete.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  Whether to force the deletion of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callDeleteAdminOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.deleteAdminOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteAdminOverride();

deleteAdminOverride(request, options, callback)

deleteAdminOverride(request: protos.google.api.serviceusage.v1beta1.IDeleteAdminOverrideRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteAdminOverrideRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteAdminOverride(request, callback)

deleteAdminOverride(request: protos.google.api.serviceusage.v1beta1.IDeleteAdminOverrideRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteAdminOverrideRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteConsumerOverride(request, options)

deleteConsumerOverride(request?: protos.google.api.serviceusage.v1beta1.IDeleteConsumerOverrideRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a consumer override.

Parameters
NameDescription
request IDeleteConsumerOverrideRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the override to delete.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  Whether to force the deletion of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callDeleteConsumerOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.deleteConsumerOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteConsumerOverride();

deleteConsumerOverride(request, options, callback)

deleteConsumerOverride(request: protos.google.api.serviceusage.v1beta1.IDeleteConsumerOverrideRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteConsumerOverrideRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteConsumerOverride(request, callback)

deleteConsumerOverride(request: protos.google.api.serviceusage.v1beta1.IDeleteConsumerOverrideRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteConsumerOverrideRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteOperation(request, options, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
NameDescription
request DeleteOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

disableService(request, options)

disableService(request?: protos.google.api.serviceusage.v1beta1.IDisableServiceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Disables a service so that it can no longer be used with a project. This prevents unintended usage that may cause unexpected billing charges or security leaks.

It is not valid to call the disable method on a service that is not currently enabled. Callers will receive a FAILED_PRECONDITION status if the target service is not currently enabled.

Operation response type: google.protobuf.Empty

Parameters
NameDescription
request IDisableServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  Name of the consumer and service to disable the service on.
   *  The enable and disable methods currently only support projects.
   *  An example name would be:
   *  `projects/123/services/serviceusage.googleapis.com`
   *  where `123` is the project number (not project ID).
   */
  // const name = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callDisableService() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.disableService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDisableService();

disableService(request, options, callback)

disableService(request: protos.google.api.serviceusage.v1beta1.IDisableServiceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDisableServiceRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

disableService(request, callback)

disableService(request: protos.google.api.serviceusage.v1beta1.IDisableServiceRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDisableServiceRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

enableService(request, options)

enableService(request?: protos.google.api.serviceusage.v1beta1.IEnableServiceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Enables a service so that it can be used with a project.

Operation response type: google.protobuf.Empty

Parameters
NameDescription
request IEnableServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  Name of the consumer and service to enable the service on.
   *  The `EnableService` and `DisableService` methods currently only support
   *  projects.
   *  Enabling a service requires that the service is public or is shared with
   *  the user enabling the service.
   *  An example name would be:
   *  `projects/123/services/serviceusage.googleapis.com`
   *  where `123` is the project number (not project ID).
   */
  // const name = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callEnableService() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.enableService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callEnableService();

enableService(request, options, callback)

enableService(request: protos.google.api.serviceusage.v1beta1.IEnableServiceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IEnableServiceRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

enableService(request, callback)

enableService(request: protos.google.api.serviceusage.v1beta1.IEnableServiceRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IEnableServiceRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateServiceIdentity(request, options)

generateServiceIdentity(request?: protos.google.api.serviceusage.v1beta1.IGenerateServiceIdentityRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.serviceusage.v1beta1.IServiceIdentity, protos.google.protobuf.IEmpty>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Generates service identity for service.

Parameters
NameDescription
request IGenerateServiceIdentityRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.serviceusage.v1beta1.IServiceIdentity, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  Name of the consumer and service to generate an identity for.
   *  The `GenerateServiceIdentity` methods currently support projects, folders,
   *  organizations.
   *  Example parents would be:
   *  `projects/123/services/example.googleapis.com`
   *  `folders/123/services/example.googleapis.com`
   *  `organizations/123/services/example.googleapis.com`
   */
  // const parent = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callGenerateServiceIdentity() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.generateServiceIdentity(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callGenerateServiceIdentity();

generateServiceIdentity(request, options, callback)

generateServiceIdentity(request: protos.google.api.serviceusage.v1beta1.IGenerateServiceIdentityRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IServiceIdentity, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateServiceIdentityRequest
options CallOptions
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IServiceIdentity, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateServiceIdentity(request, callback)

generateServiceIdentity(request: protos.google.api.serviceusage.v1beta1.IGenerateServiceIdentityRequest, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IServiceIdentity, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateServiceIdentityRequest
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IServiceIdentity, protos.google.protobuf.IEmpty>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConsumerQuotaLimit(request, options)

getConsumerQuotaLimit(request?: protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest, options?: CallOptions): Promise<[
        protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit,
        (protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest | undefined),
        {} | undefined
    ]>;

Retrieves a summary of quota information for a specific quota limit.

Parameters
NameDescription
request IGetConsumerQuotaLimitRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit, (protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ConsumerQuotaLimit. 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.
   */
  /**
   *  The resource name of the quota limit.
   *  Use the quota limit resource name returned by previous
   *  ListConsumerQuotaMetrics and GetConsumerQuotaMetric API calls.
   */
  // const name = 'abc123'
  /**
   *  Specifies the level of detail for quota information in the response.
   */
  // const view = {}

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callGetConsumerQuotaLimit() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await serviceusageClient.getConsumerQuotaLimit(request);
    console.log(response);
  }

  callGetConsumerQuotaLimit();

getConsumerQuotaLimit(request, options, callback)

getConsumerQuotaLimit(request: protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest, options: CallOptions, callback: Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConsumerQuotaLimitRequest
options CallOptions
callback Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConsumerQuotaLimit(request, callback)

getConsumerQuotaLimit(request: protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest, callback: Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConsumerQuotaLimitRequest
callback Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConsumerQuotaMetric(request, options)

getConsumerQuotaMetric(request?: protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest, options?: CallOptions): Promise<[
        protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric,
        (protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest | undefined),
        {} | undefined
    ]>;

Retrieves a summary of quota information for a specific quota metric

Parameters
NameDescription
request IGetConsumerQuotaMetricRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric, (protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ConsumerQuotaMetric. 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.
   */
  /**
   *  The resource name of the quota limit.
   *  An example name would be:
   *  `projects/123/services/serviceusage.googleapis.com/quotas/metrics/serviceusage.googleapis.com%2Fmutate_requests`
   */
  // const name = 'abc123'
  /**
   *  Specifies the level of detail for quota information in the response.
   */
  // const view = {}

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callGetConsumerQuotaMetric() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await serviceusageClient.getConsumerQuotaMetric(request);
    console.log(response);
  }

  callGetConsumerQuotaMetric();

getConsumerQuotaMetric(request, options, callback)

getConsumerQuotaMetric(request: protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest, options: CallOptions, callback: Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConsumerQuotaMetricRequest
options CallOptions
callback Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConsumerQuotaMetric(request, callback)

getConsumerQuotaMetric(request: protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest, callback: Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConsumerQuotaMetricRequest
callback Callback<protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric, protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getOperation(request, options, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters
NameDescription
request GetOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

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

getService(request, options)

getService(request?: protos.google.api.serviceusage.v1beta1.IGetServiceRequest, options?: CallOptions): Promise<[
        protos.google.api.serviceusage.v1beta1.IService,
        protos.google.api.serviceusage.v1beta1.IGetServiceRequest | undefined,
        {} | undefined
    ]>;

Returns the service configuration and enabled state for a given service.

Parameters
NameDescription
request IGetServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.serviceusage.v1beta1.IService, protos.google.api.serviceusage.v1beta1.IGetServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Service. 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.
   */
  /**
   *  Name of the consumer and service to get the `ConsumerState` for.
   *  An example name would be:
   *  `projects/123/services/serviceusage.googleapis.com`
   *  where `123` is the project number (not project ID).
   */
  // const name = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callGetService() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await serviceusageClient.getService(request);
    console.log(response);
  }

  callGetService();

getService(request, options, callback)

getService(request: protos.google.api.serviceusage.v1beta1.IGetServiceRequest, options: CallOptions, callback: Callback<protos.google.api.serviceusage.v1beta1.IService, protos.google.api.serviceusage.v1beta1.IGetServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceRequest
options CallOptions
callback Callback<protos.google.api.serviceusage.v1beta1.IService, protos.google.api.serviceusage.v1beta1.IGetServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getService(request, callback)

getService(request: protos.google.api.serviceusage.v1beta1.IGetServiceRequest, callback: Callback<protos.google.api.serviceusage.v1beta1.IService, protos.google.api.serviceusage.v1beta1.IGetServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetServiceRequest
callback Callback<protos.google.api.serviceusage.v1beta1.IService, protos.google.api.serviceusage.v1beta1.IGetServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

importAdminOverrides(request, options)

importAdminOverrides(request?: protos.google.api.serviceusage.v1beta1.IImportAdminOverridesRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates or updates multiple admin overrides atomically, all on the same consumer, but on many different metrics or limits. The name field in the quota override message should not be set.

Parameters
NameDescription
request IImportAdminOverridesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the consumer.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com`
   */
  // const parent = 'abc123'
  /**
   *  The import data is specified in the request message itself
   */
  // const inlineSource = {}
  /**
   *  Whether to force the creation of the quota overrides.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callImportAdminOverrides() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.importAdminOverrides(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callImportAdminOverrides();

importAdminOverrides(request, options, callback)

importAdminOverrides(request: protos.google.api.serviceusage.v1beta1.IImportAdminOverridesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IImportAdminOverridesRequest
options CallOptions
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

importAdminOverrides(request, callback)

importAdminOverrides(request: protos.google.api.serviceusage.v1beta1.IImportAdminOverridesRequest, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IImportAdminOverridesRequest
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

importConsumerOverrides(request, options)

importConsumerOverrides(request?: protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates or updates multiple consumer overrides atomically, all on the same consumer, but on many different metrics or limits. The name field in the quota override message should not be set.

Parameters
NameDescription
request IImportConsumerOverridesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the consumer.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com`
   */
  // const parent = 'abc123'
  /**
   *  The import data is specified in the request message itself
   */
  // const inlineSource = {}
  /**
   *  Whether to force the creation of the quota overrides.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callImportConsumerOverrides() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.importConsumerOverrides(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callImportConsumerOverrides();

importConsumerOverrides(request, options, callback)

importConsumerOverrides(request: protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IImportConsumerOverridesRequest
options CallOptions
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

importConsumerOverrides(request, callback)

importConsumerOverrides(request: protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesRequest, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IImportConsumerOverridesRequest
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata>, protos.google.longrunning.IOperation | 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.

listAdminOverrides(request, options)

listAdminOverrides(request?: protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, options?: CallOptions): Promise<[
        protos.google.api.serviceusage.v1beta1.IQuotaOverride[],
        protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest | null,
        protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse
    ]>;

Lists all admin overrides on this limit.

Parameters
NameDescription
request IListAdminOverridesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.serviceusage.v1beta1.IQuotaOverride[], protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest | null, protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of QuotaOverride. 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 listAdminOverridesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listAdminOverrides(request, options, callback)

listAdminOverrides(request: protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>): void;
Parameters
NameDescription
request IListAdminOverridesRequest
options CallOptions
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>
Returns
TypeDescription
void

listAdminOverrides(request, callback)

listAdminOverrides(request: protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>): void;
Parameters
NameDescription
request IListAdminOverridesRequest
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>
Returns
TypeDescription
void

listAdminOverridesAsync(request, options)

listAdminOverridesAsync(request?: protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, options?: CallOptions): AsyncIterable<protos.google.api.serviceusage.v1beta1.IQuotaOverride>;

Equivalent to listAdminOverrides, but returns an iterable object.

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

Parameters
NameDescription
request IListAdminOverridesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.serviceusage.v1beta1.IQuotaOverride>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing QuotaOverride. 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.
   */
  /**
   *  The resource name of the parent quota limit, returned by a
   *  ListConsumerQuotaMetrics or GetConsumerQuotaMetric call.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
   */
  // const parent = 'abc123'
  /**
   *  Requested size of the next page of data.
   */
  // const pageSize = 1234
  /**
   *  Token identifying which result to start with; returned by a previous list
   *  call.
   */
  // const pageToken = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callListAdminOverrides() {
    // Construct request
    const request = {
    };

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

  callListAdminOverrides();

listAdminOverridesStream(request, options)

listAdminOverridesStream(request?: protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListAdminOverridesRequest

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 QuotaOverride 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 listAdminOverridesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listConsumerOverrides(request, options)

listConsumerOverrides(request?: protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, options?: CallOptions): Promise<[
        protos.google.api.serviceusage.v1beta1.IQuotaOverride[],
        protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest | null,
        protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse
    ]>;

Lists all consumer overrides on this limit.

Parameters
NameDescription
request IListConsumerOverridesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.serviceusage.v1beta1.IQuotaOverride[], protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest | null, protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of QuotaOverride. 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 listConsumerOverridesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listConsumerOverrides(request, options, callback)

listConsumerOverrides(request: protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>): void;
Parameters
NameDescription
request IListConsumerOverridesRequest
options CallOptions
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>
Returns
TypeDescription
void

listConsumerOverrides(request, callback)

listConsumerOverrides(request: protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>): void;
Parameters
NameDescription
request IListConsumerOverridesRequest
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IQuotaOverride>
Returns
TypeDescription
void

listConsumerOverridesAsync(request, options)

listConsumerOverridesAsync(request?: protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, options?: CallOptions): AsyncIterable<protos.google.api.serviceusage.v1beta1.IQuotaOverride>;

Equivalent to listConsumerOverrides, but returns an iterable object.

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

Parameters
NameDescription
request IListConsumerOverridesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.serviceusage.v1beta1.IQuotaOverride>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing QuotaOverride. 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.
   */
  /**
   *  The resource name of the parent quota limit, returned by a
   *  ListConsumerQuotaMetrics or GetConsumerQuotaMetric call.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
   */
  // const parent = 'abc123'
  /**
   *  Requested size of the next page of data.
   */
  // const pageSize = 1234
  /**
   *  Token identifying which result to start with; returned by a previous list
   *  call.
   */
  // const pageToken = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callListConsumerOverrides() {
    // Construct request
    const request = {
    };

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

  callListConsumerOverrides();

listConsumerOverridesStream(request, options)

listConsumerOverridesStream(request?: protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListConsumerOverridesRequest

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 QuotaOverride 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 listConsumerOverridesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listConsumerQuotaMetrics(request, options)

listConsumerQuotaMetrics(request?: protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, options?: CallOptions): Promise<[
        protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric[],
        protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest | null,
        protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse
    ]>;

Retrieves a summary of all quota information visible to the service consumer, organized by service metric. Each metric includes information about all of its defined limits. Each limit includes the limit configuration (quota unit, preciseness, default value), the current effective limit value, and all of the overrides applied to the limit.

Parameters
NameDescription
request IListConsumerQuotaMetricsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric[], protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest | null, protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of ConsumerQuotaMetric. 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 listConsumerQuotaMetricsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listConsumerQuotaMetrics(request, options, callback)

listConsumerQuotaMetrics(request: protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric>): void;
Parameters
NameDescription
request IListConsumerQuotaMetricsRequest
options CallOptions
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric>
Returns
TypeDescription
void

listConsumerQuotaMetrics(request, callback)

listConsumerQuotaMetrics(request: protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric>): void;
Parameters
NameDescription
request IListConsumerQuotaMetricsRequest
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric>
Returns
TypeDescription
void

listConsumerQuotaMetricsAsync(request, options)

listConsumerQuotaMetricsAsync(request?: protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, options?: CallOptions): AsyncIterable<protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric>;

Equivalent to listConsumerQuotaMetrics, but returns an iterable object.

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

Parameters
NameDescription
request IListConsumerQuotaMetricsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ConsumerQuotaMetric. 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.
   */
  /**
   *  Parent of the quotas resource.
   *  Some example names would be:
   *  `projects/123/services/serviceconsumermanagement.googleapis.com`
   *  `folders/345/services/serviceconsumermanagement.googleapis.com`
   *  `organizations/456/services/serviceconsumermanagement.googleapis.com`
   */
  // const parent = 'abc123'
  /**
   *  Requested size of the next page of data.
   */
  // const pageSize = 1234
  /**
   *  Token identifying which result to start with; returned by a previous list
   *  call.
   */
  // const pageToken = 'abc123'
  /**
   *  Specifies the level of detail for quota information in the response.
   */
  // const view = {}

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callListConsumerQuotaMetrics() {
    // Construct request
    const request = {
    };

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

  callListConsumerQuotaMetrics();

listConsumerQuotaMetricsStream(request, options)

listConsumerQuotaMetricsStream(request?: protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListConsumerQuotaMetricsRequest

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 ConsumerQuotaMetric 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 listConsumerQuotaMetricsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listOperationsAsync(request, options)

listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters
NameDescription
request ListOperationsRequest

The request object that will be sent.

options CallOptions

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Returns
TypeDescription
AsyncIterable<protos.google.longrunning.ListOperationsResponse>

{Object} An iterable Object that conforms to iteration protocols.

Example

const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)

listServices(request, options)

listServices(request?: protos.google.api.serviceusage.v1beta1.IListServicesRequest, options?: CallOptions): Promise<[
        protos.google.api.serviceusage.v1beta1.IService[],
        protos.google.api.serviceusage.v1beta1.IListServicesRequest | null,
        protos.google.api.serviceusage.v1beta1.IListServicesResponse
    ]>;

Lists all services available to the specified project, and the current state of those services with respect to the project. The list includes all public services, all services for which the calling user has the servicemanagement.services.bind permission, and all services that have already been enabled on the project. The list can be filtered to only include services in a specific state, for example to only include services enabled on the project.

Parameters
NameDescription
request IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.serviceusage.v1beta1.IService[], protos.google.api.serviceusage.v1beta1.IListServicesRequest | null, protos.google.api.serviceusage.v1beta1.IListServicesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Service. 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 listServicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listServices(request, options, callback)

listServices(request: protos.google.api.serviceusage.v1beta1.IListServicesRequest, options: CallOptions, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListServicesRequest, protos.google.api.serviceusage.v1beta1.IListServicesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IService>): void;
Parameters
NameDescription
request IListServicesRequest
options CallOptions
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListServicesRequest, protos.google.api.serviceusage.v1beta1.IListServicesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IService>
Returns
TypeDescription
void

listServices(request, callback)

listServices(request: protos.google.api.serviceusage.v1beta1.IListServicesRequest, callback: PaginationCallback<protos.google.api.serviceusage.v1beta1.IListServicesRequest, protos.google.api.serviceusage.v1beta1.IListServicesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IService>): void;
Parameters
NameDescription
request IListServicesRequest
callback PaginationCallback<protos.google.api.serviceusage.v1beta1.IListServicesRequest, protos.google.api.serviceusage.v1beta1.IListServicesResponse | null | undefined, protos.google.api.serviceusage.v1beta1.IService>
Returns
TypeDescription
void

listServicesAsync(request, options)

listServicesAsync(request?: protos.google.api.serviceusage.v1beta1.IListServicesRequest, options?: CallOptions): AsyncIterable<protos.google.api.serviceusage.v1beta1.IService>;

Equivalent to listServices, but returns an iterable object.

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

Parameters
NameDescription
request IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.api.serviceusage.v1beta1.IService>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Service. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation 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.
   */
  /**
   *  Parent to search for services on.
   *  An example name would be:
   *  `projects/123`
   *  where `123` is the project number (not project ID).
   */
  // const parent = 'abc123'
  /**
   *  Requested size of the next page of data.
   *  Requested page size cannot exceed 200.
   *   If not set, the default page size is 50.
   */
  // const pageSize = 1234
  /**
   *  Token identifying which result to start with, which is returned by a
   *  previous list call.
   */
  // const pageToken = 'abc123'
  /**
   *  Only list services that conform to the given filter.
   *  The allowed filter strings are `state:ENABLED` and `state:DISABLED`.
   */
  // const filter = 'abc123'

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callListServices() {
    // Construct request
    const request = {
    };

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

  callListServices();

listServicesStream(request, options)

listServicesStream(request?: protos.google.api.serviceusage.v1beta1.IListServicesRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListServicesRequest

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 Service on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listServicesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

updateAdminOverride(request, options)

updateAdminOverride(request?: protos.google.api.serviceusage.v1beta1.IUpdateAdminOverrideRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates an admin override.

Parameters
NameDescription
request IUpdateAdminOverrideRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the override to update.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  The new override.
   *  Only the override_value is updated; all other fields are ignored.
   */
  // const override = {}
  /**
   *  Whether to force the update of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  Update only the specified fields of the override.
   *  If unset, all fields will be updated.
   */
  // const updateMask = {}
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callUpdateAdminOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.updateAdminOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateAdminOverride();

updateAdminOverride(request, options, callback)

updateAdminOverride(request: protos.google.api.serviceusage.v1beta1.IUpdateAdminOverrideRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateAdminOverrideRequest
options CallOptions
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateAdminOverride(request, callback)

updateAdminOverride(request: protos.google.api.serviceusage.v1beta1.IUpdateAdminOverrideRequest, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateAdminOverrideRequest
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateConsumerOverride(request, options)

updateConsumerOverride(request?: protos.google.api.serviceusage.v1beta1.IUpdateConsumerOverrideRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates a consumer override.

Parameters
NameDescription
request IUpdateConsumerOverrideRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. 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.
   */
  /**
   *  The resource name of the override to update.
   *  An example name would be:
   *  `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d`
   */
  // const name = 'abc123'
  /**
   *  The new override.
   *  Only the override_value is updated; all other fields are ignored.
   */
  // const override = {}
  /**
   *  Whether to force the update of the quota override.
   *  Setting the force parameter to 'true' ignores all quota safety checks that
   *  would fail the request. QuotaSafetyCheck lists all such validations.
   */
  // const force = true
  /**
   *  Update only the specified fields of the override.
   *  If unset, all fields will be updated.
   */
  // const updateMask = {}
  /**
   *  The list of quota safety checks to ignore before the override mutation.
   *  Unlike 'force' field that ignores all the quota safety checks, the
   *  'force_only' field ignores only the specified checks; other checks are
   *  still enforced. The 'force' and 'force_only' fields cannot both be set.
   */
  // const forceOnly = [1,2,3,4]

  // Imports the Serviceusage library
  const {ServiceUsageClient} = require('@google-cloud/service-usage').v1beta1;

  // Instantiates a client
  const serviceusageClient = new ServiceUsageClient();

  async function callUpdateConsumerOverride() {
    // Construct request
    const request = {
    };

    // Run request
    const [operation] = await serviceusageClient.updateConsumerOverride(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateConsumerOverride();

updateConsumerOverride(request, options, callback)

updateConsumerOverride(request: protos.google.api.serviceusage.v1beta1.IUpdateConsumerOverrideRequest, options: CallOptions, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateConsumerOverrideRequest
options CallOptions
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateConsumerOverride(request, callback)

updateConsumerOverride(request: protos.google.api.serviceusage.v1beta1.IUpdateConsumerOverrideRequest, callback: Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateConsumerOverrideRequest
callback Callback<LROperation<protos.google.api.serviceusage.v1beta1.IQuotaOverride, protos.google.api.serviceusage.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void