Class v1beta.WorkstationsClient (1.1.1)

Service for interacting with Cloud Workstations. v1beta

Package

@google-cloud/workstations

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of WorkstationsClient.

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 WorkstationsClient({fallback: true}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

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

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

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

locationsClient

locationsClient: LocationsClient;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

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

workstationsStub

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

Methods

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: ''});

checkCreateWorkstationClusterProgress(name)

checkCreateWorkstationClusterProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationCluster, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationCluster, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID to use for the workstation cluster.
   */
  // const workstationClusterId = 'abc123'
  /**
   *  Required. Workstation cluster to create.
   */
  // const workstationCluster = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callCreateWorkstationCluster() {
    // Construct request
    const request = {
      parent,
      workstationClusterId,
      workstationCluster,
    };

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

  callCreateWorkstationCluster();

checkCreateWorkstationConfigProgress(name)

checkCreateWorkstationConfigProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationConfig, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationConfig, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID to use for the workstation configuration.
   */
  // const workstationConfigId = 'abc123'
  /**
   *  Required. Config to create.
   */
  // const workstationConfig = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callCreateWorkstationConfig() {
    // Construct request
    const request = {
      parent,
      workstationConfigId,
      workstationConfig,
    };

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

  callCreateWorkstationConfig();

checkCreateWorkstationProgress(name)

checkCreateWorkstationProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID to use for the workstation.
   */
  // const workstationId = 'abc123'
  /**
   *  Required. Workstation to create.
   */
  // const workstation = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callCreateWorkstation() {
    // Construct request
    const request = {
      parent,
      workstationId,
      workstation,
    };

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

  callCreateWorkstation();

checkDeleteWorkstationClusterProgress(name)

checkDeleteWorkstationClusterProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationCluster, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationCluster, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation cluster to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation cluster on the server does not have this ETag.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, any workstation configurations and workstations in the
   *  workstation cluster are also deleted. Otherwise, the request only
   *  works if the workstation cluster has no configurations or workstations.
   */
  // const force = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callDeleteWorkstationCluster();

checkDeleteWorkstationConfigProgress(name)

checkDeleteWorkstationConfigProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationConfig, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationConfig, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation configuration to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request is rejected if the latest version of the
   *  workstation configuration on the server does not have this ETag.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, any workstations in the workstation configuration are
   *  also deleted. Otherwise, the request works only if the workstation
   *  configuration has no workstations.
   */
  // const force = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callDeleteWorkstationConfig();

checkDeleteWorkstationProgress(name)

checkDeleteWorkstationProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation on the server does not have this ETag.
   */
  // const etag = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callDeleteWorkstation();

checkStartWorkstationProgress(name)

checkStartWorkstationProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation to start.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation on the server does not have this ETag.
   */
  // const etag = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callStartWorkstation();

checkStopWorkstationProgress(name)

checkStopWorkstationProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation to stop.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation on the server does not have this ETag.
   */
  // const etag = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callStopWorkstation();

checkUpdateWorkstationClusterProgress(name)

checkUpdateWorkstationClusterProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationCluster, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationCluster, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Workstation cluster to update.
   */
  // const workstationCluster = {}
  /**
   *  Required. Mask that specifies which fields in the workstation cluster
   *  should be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, and the workstation cluster is not found, a new
   *  workstation cluster will be created. In this situation, update_mask is
   *  ignored.
   */
  // const allowMissing = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callUpdateWorkstationCluster() {
    // Construct request
    const request = {
      workstationCluster,
      updateMask,
    };

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

  callUpdateWorkstationCluster();

checkUpdateWorkstationConfigProgress(name)

checkUpdateWorkstationConfigProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationConfig, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.WorkstationConfig, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Config to update.
   */
  // const workstationConfig = {}
  /**
   *  Required. Mask specifying which fields in the workstation configuration
   *  should be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set and the workstation configuration is not found, a new
   *  workstation configuration will be created. In this situation,
   *  update_mask is ignored.
   */
  // const allowMissing = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callUpdateWorkstationConfig() {
    // Construct request
    const request = {
      workstationConfig,
      updateMask,
    };

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

  callUpdateWorkstationConfig();

checkUpdateWorkstationProgress(name)

checkUpdateWorkstationProgress(name: string): Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.workstations.v1beta.Workstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Workstation to update.
   */
  // const workstation = {}
  /**
   *  Required. Mask specifying which fields in the workstation configuration
   *  should be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set and the workstation configuration is not found, a new
   *  workstation configuration is created. In this situation, update_mask
   *  is ignored.
   */
  // const allowMissing = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callUpdateWorkstation() {
    // Construct request
    const request = {
      workstation,
      updateMask,
    };

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

  callUpdateWorkstation();

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.

createWorkstation(request, options)

createWorkstation(request?: protos.google.cloud.workstations.v1beta.ICreateWorkstationRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new workstation.

Parameters
NameDescription
request ICreateWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID to use for the workstation.
   */
  // const workstationId = 'abc123'
  /**
   *  Required. Workstation to create.
   */
  // const workstation = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callCreateWorkstation() {
    // Construct request
    const request = {
      parent,
      workstationId,
      workstation,
    };

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

  callCreateWorkstation();

createWorkstation(request, options, callback)

createWorkstation(request: protos.google.cloud.workstations.v1beta.ICreateWorkstationRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkstationRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createWorkstation(request, callback)

createWorkstation(request: protos.google.cloud.workstations.v1beta.ICreateWorkstationRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkstationRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createWorkstationCluster(request, options)

createWorkstationCluster(request?: protos.google.cloud.workstations.v1beta.ICreateWorkstationClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new workstation cluster.

Parameters
NameDescription
request ICreateWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID to use for the workstation cluster.
   */
  // const workstationClusterId = 'abc123'
  /**
   *  Required. Workstation cluster to create.
   */
  // const workstationCluster = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callCreateWorkstationCluster() {
    // Construct request
    const request = {
      parent,
      workstationClusterId,
      workstationCluster,
    };

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

  callCreateWorkstationCluster();

createWorkstationCluster(request, options, callback)

createWorkstationCluster(request: protos.google.cloud.workstations.v1beta.ICreateWorkstationClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkstationClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createWorkstationCluster(request, callback)

createWorkstationCluster(request: protos.google.cloud.workstations.v1beta.ICreateWorkstationClusterRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkstationClusterRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createWorkstationConfig(request, options)

createWorkstationConfig(request?: protos.google.cloud.workstations.v1beta.ICreateWorkstationConfigRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new workstation configuration.

Parameters
NameDescription
request ICreateWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Required. ID to use for the workstation configuration.
   */
  // const workstationConfigId = 'abc123'
  /**
   *  Required. Config to create.
   */
  // const workstationConfig = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callCreateWorkstationConfig() {
    // Construct request
    const request = {
      parent,
      workstationConfigId,
      workstationConfig,
    };

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

  callCreateWorkstationConfig();

createWorkstationConfig(request, options, callback)

createWorkstationConfig(request: protos.google.cloud.workstations.v1beta.ICreateWorkstationConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkstationConfigRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createWorkstationConfig(request, callback)

createWorkstationConfig(request: protos.google.cloud.workstations.v1beta.ICreateWorkstationConfigRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateWorkstationConfigRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.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: ''});

deleteWorkstation(request, options)

deleteWorkstation(request?: protos.google.cloud.workstations.v1beta.IDeleteWorkstationRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes the specified workstation.

Parameters
NameDescription
request IDeleteWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation on the server does not have this ETag.
   */
  // const etag = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callDeleteWorkstation();

deleteWorkstation(request, options, callback)

deleteWorkstation(request: protos.google.cloud.workstations.v1beta.IDeleteWorkstationRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkstationRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteWorkstation(request, callback)

deleteWorkstation(request: protos.google.cloud.workstations.v1beta.IDeleteWorkstationRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkstationRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteWorkstationCluster(request, options)

deleteWorkstationCluster(request?: protos.google.cloud.workstations.v1beta.IDeleteWorkstationClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes the specified workstation cluster.

Parameters
NameDescription
request IDeleteWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation cluster to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation cluster on the server does not have this ETag.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, any workstation configurations and workstations in the
   *  workstation cluster are also deleted. Otherwise, the request only
   *  works if the workstation cluster has no configurations or workstations.
   */
  // const force = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callDeleteWorkstationCluster();

deleteWorkstationCluster(request, options, callback)

deleteWorkstationCluster(request: protos.google.cloud.workstations.v1beta.IDeleteWorkstationClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkstationClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteWorkstationCluster(request, callback)

deleteWorkstationCluster(request: protos.google.cloud.workstations.v1beta.IDeleteWorkstationClusterRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkstationClusterRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteWorkstationConfig(request, options)

deleteWorkstationConfig(request?: protos.google.cloud.workstations.v1beta.IDeleteWorkstationConfigRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes the specified workstation configuration.

Parameters
NameDescription
request IDeleteWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation configuration to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request is rejected if the latest version of the
   *  workstation configuration on the server does not have this ETag.
   */
  // const etag = 'abc123'
  /**
   *  Optional. If set, any workstations in the workstation configuration are
   *  also deleted. Otherwise, the request works only if the workstation
   *  configuration has no workstations.
   */
  // const force = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callDeleteWorkstationConfig();

deleteWorkstationConfig(request, options, callback)

deleteWorkstationConfig(request: protos.google.cloud.workstations.v1beta.IDeleteWorkstationConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkstationConfigRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteWorkstationConfig(request, callback)

deleteWorkstationConfig(request: protos.google.cloud.workstations.v1beta.IDeleteWorkstationConfigRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteWorkstationConfigRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateAccessToken(request, options)

generateAccessToken(request?: protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse,
        (protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | undefined),
        {} | undefined
    ]>;

Returns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation.

Parameters
NameDescription
request IGenerateAccessTokenRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse, (protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing GenerateAccessTokenResponse. 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.
   */
  /**
   *  Desired expiration time of the access token. This value must
   *  be at most 24 hours in the future. If a value is not specified, the
   *  token's expiration time will be set to a default value of 1 hour in the
   *  future.
   */
  // const expireTime = {}
  /**
   *  Desired lifetime duration of the access token. This value must
   *  be at most 24 hours. If a value is not specified, the token's lifetime
   *  will be set to a default value of 1 hour.
   */
  // const ttl = {}
  /**
   *  Required. Name of the workstation for which the access token should be
   *  generated.
   */
  // const workstation = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callGenerateAccessToken() {
    // Construct request
    const request = {
      workstation,
    };

    // Run request
    const response = await workstationsClient.generateAccessToken(request);
    console.log(response);
  }

  callGenerateAccessToken();

generateAccessToken(request, options, callback)

generateAccessToken(request: protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest, options: CallOptions, callback: Callback<protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse, protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateAccessTokenRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse, protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

generateAccessToken(request, callback)

generateAccessToken(request: protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest, callback: Callback<protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse, protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGenerateAccessTokenRequest
callback Callback<protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse, protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options, callback)

getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
NameDescription
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | 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<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | 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 .

Returns
TypeDescription
Promise<[google.iam.v1.Policy]>

{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.

getLocation(request, options, callback)

getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

Parameters
NameDescription
request LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
Promise<google.cloud.location.ILocation>

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

Example

const [response] = await client.getLocation(request);

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

getWorkstation(request, options)

getWorkstation(request?: protos.google.cloud.workstations.v1beta.IGetWorkstationRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstation,
        (protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | undefined),
        {} | undefined
    ]>;

Returns the requested workstation.

Parameters
NameDescription
request IGetWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstation, (protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | undefined), {} | undefined ]>

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

Example

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

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

    // Run request
    const response = await workstationsClient.getWorkstation(request);
    console.log(response);
  }

  callGetWorkstation();

getWorkstation(request, options, callback)

getWorkstation(request: protos.google.cloud.workstations.v1beta.IGetWorkstationRequest, options: CallOptions, callback: Callback<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkstationRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getWorkstation(request, callback)

getWorkstation(request: protos.google.cloud.workstations.v1beta.IGetWorkstationRequest, callback: Callback<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkstationRequest
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getWorkstationCluster(request, options)

getWorkstationCluster(request?: protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstationCluster,
        (protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | undefined),
        {} | undefined
    ]>;

Returns the requested workstation cluster.

Parameters
NameDescription
request IGetWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstationCluster, (protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | undefined), {} | undefined ]>

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

Example

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

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

    // Run request
    const response = await workstationsClient.getWorkstationCluster(request);
    console.log(response);
  }

  callGetWorkstationCluster();

getWorkstationCluster(request, options, callback)

getWorkstationCluster(request: protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest, options: CallOptions, callback: Callback<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkstationClusterRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getWorkstationCluster(request, callback)

getWorkstationCluster(request: protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest, callback: Callback<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkstationClusterRequest
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getWorkstationConfig(request, options)

getWorkstationConfig(request?: protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstationConfig,
        (protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | undefined),
        {} | undefined
    ]>;

Returns the requested workstation configuration.

Parameters
NameDescription
request IGetWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstationConfig, (protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | undefined), {} | undefined ]>

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

Example

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

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

    // Run request
    const response = await workstationsClient.getWorkstationConfig(request);
    console.log(response);
  }

  callGetWorkstationConfig();

getWorkstationConfig(request, options, callback)

getWorkstationConfig(request: protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkstationConfigRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getWorkstationConfig(request, callback)

getWorkstationConfig(request: protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest, callback: Callback<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetWorkstationConfigRequest
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | 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.

listLocationsAsync(request, options)

listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

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

Parameters
NameDescription
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<google.cloud.location.ILocation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
  // process response
}

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)

listUsableWorkstationConfigs(request, options)

listUsableWorkstationConfigs(request?: protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstationConfig[],
        protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest | null,
        protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsResponse
    ]>;

Returns all workstation configurations in the specified cluster on which the caller has the "workstations.workstation.create" permission.

Parameters
NameDescription
request IListUsableWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstationConfig[], protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest | null, protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listUsableWorkstationConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listUsableWorkstationConfigs(request, options, callback)

listUsableWorkstationConfigs(request: protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>): void;
Parameters
NameDescription
request IListUsableWorkstationConfigsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>
Returns
TypeDescription
void

listUsableWorkstationConfigs(request, callback)

listUsableWorkstationConfigs(request: protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>): void;
Parameters
NameDescription
request IListUsableWorkstationConfigsRequest
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>
Returns
TypeDescription
void

listUsableWorkstationConfigsAsync(request, options)

listUsableWorkstationConfigsAsync(request?: protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstationConfig>;

Equivalent to listUsableWorkstationConfigs, but returns an iterable object.

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

Parameters
NameDescription
request IListUsableWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstationConfig>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. next_page_token value returned from a previous List request, if
   *  any.
   */
  // const pageToken = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callListUsableWorkstationConfigs();

listUsableWorkstationConfigsStream(request, options)

listUsableWorkstationConfigsStream(request?: protos.google.cloud.workstations.v1beta.IListUsableWorkstationConfigsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListUsableWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listUsableWorkstationConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listUsableWorkstations(request, options)

listUsableWorkstations(request?: protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstation[],
        protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest | null,
        protos.google.cloud.workstations.v1beta.IListUsableWorkstationsResponse
    ]>;

Returns all workstations using the specified workstation configuration on which the caller has the "workstations.workstations.use" permission.

Parameters
NameDescription
request IListUsableWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstation[], protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest | null, protos.google.cloud.workstations.v1beta.IListUsableWorkstationsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listUsableWorkstationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listUsableWorkstations(request, options, callback)

listUsableWorkstations(request: protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>): void;
Parameters
NameDescription
request IListUsableWorkstationsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>
Returns
TypeDescription
void

listUsableWorkstations(request, callback)

listUsableWorkstations(request: protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>): void;
Parameters
NameDescription
request IListUsableWorkstationsRequest
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListUsableWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>
Returns
TypeDescription
void

listUsableWorkstationsAsync(request, options)

listUsableWorkstationsAsync(request?: protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstation>;

Equivalent to listUsableWorkstations, but returns an iterable object.

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

Parameters
NameDescription
request IListUsableWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. next_page_token value returned from a previous List request, if
   *  any.
   */
  // const pageToken = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callListUsableWorkstations();

listUsableWorkstationsStream(request, options)

listUsableWorkstationsStream(request?: protos.google.cloud.workstations.v1beta.IListUsableWorkstationsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListUsableWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listUsableWorkstationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkstationClusters(request, options)

listWorkstationClusters(request?: protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstationCluster[],
        protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest | null,
        protos.google.cloud.workstations.v1beta.IListWorkstationClustersResponse
    ]>;

Returns all workstation clusters in the specified location.

Parameters
NameDescription
request IListWorkstationClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstationCluster[], protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest | null, protos.google.cloud.workstations.v1beta.IListWorkstationClustersResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listWorkstationClustersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkstationClusters(request, options, callback)

listWorkstationClusters(request: protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, protos.google.cloud.workstations.v1beta.IListWorkstationClustersResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationCluster>): void;
Parameters
NameDescription
request IListWorkstationClustersRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, protos.google.cloud.workstations.v1beta.IListWorkstationClustersResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationCluster>
Returns
TypeDescription
void

listWorkstationClusters(request, callback)

listWorkstationClusters(request: protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, protos.google.cloud.workstations.v1beta.IListWorkstationClustersResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationCluster>): void;
Parameters
NameDescription
request IListWorkstationClustersRequest
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, protos.google.cloud.workstations.v1beta.IListWorkstationClustersResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationCluster>
Returns
TypeDescription
void

listWorkstationClustersAsync(request, options)

listWorkstationClustersAsync(request?: protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstationCluster>;

Equivalent to listWorkstationClusters, but returns an iterable object.

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

Parameters
NameDescription
request IListWorkstationClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstationCluster>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. next_page_token value returned from a previous List request, if
   *  any.
   */
  // const pageToken = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callListWorkstationClusters();

listWorkstationClustersStream(request, options)

listWorkstationClustersStream(request?: protos.google.cloud.workstations.v1beta.IListWorkstationClustersRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListWorkstationClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listWorkstationClustersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkstationConfigs(request, options)

listWorkstationConfigs(request?: protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstationConfig[],
        protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest | null,
        protos.google.cloud.workstations.v1beta.IListWorkstationConfigsResponse
    ]>;

Returns all workstation configurations in the specified cluster.

Parameters
NameDescription
request IListWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstationConfig[], protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest | null, protos.google.cloud.workstations.v1beta.IListWorkstationConfigsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listWorkstationConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkstationConfigs(request, options, callback)

listWorkstationConfigs(request: protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>): void;
Parameters
NameDescription
request IListWorkstationConfigsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>
Returns
TypeDescription
void

listWorkstationConfigs(request, callback)

listWorkstationConfigs(request: protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>): void;
Parameters
NameDescription
request IListWorkstationConfigsRequest
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationConfigsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstationConfig>
Returns
TypeDescription
void

listWorkstationConfigsAsync(request, options)

listWorkstationConfigsAsync(request?: protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstationConfig>;

Equivalent to listWorkstationConfigs, but returns an iterable object.

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

Parameters
NameDescription
request IListWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstationConfig>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. next_page_token value returned from a previous List request, if
   *  any.
   */
  // const pageToken = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callListWorkstationConfigs();

listWorkstationConfigsStream(request, options)

listWorkstationConfigsStream(request?: protos.google.cloud.workstations.v1beta.IListWorkstationConfigsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listWorkstationConfigsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkstations(request, options)

listWorkstations(request?: protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.workstations.v1beta.IWorkstation[],
        protos.google.cloud.workstations.v1beta.IListWorkstationsRequest | null,
        protos.google.cloud.workstations.v1beta.IListWorkstationsResponse
    ]>;

Returns all Workstations using the specified workstation configuration.

Parameters
NameDescription
request IListWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.workstations.v1beta.IWorkstation[], protos.google.cloud.workstations.v1beta.IListWorkstationsRequest | null, protos.google.cloud.workstations.v1beta.IListWorkstationsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listWorkstationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listWorkstations(request, options, callback)

listWorkstations(request: protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>): void;
Parameters
NameDescription
request IListWorkstationsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>
Returns
TypeDescription
void

listWorkstations(request, callback)

listWorkstations(request: protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, callback: PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>): void;
Parameters
NameDescription
request IListWorkstationsRequest
callback PaginationCallback<protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, protos.google.cloud.workstations.v1beta.IListWorkstationsResponse | null | undefined, protos.google.cloud.workstations.v1beta.IWorkstation>
Returns
TypeDescription
void

listWorkstationsAsync(request, options)

listWorkstationsAsync(request?: protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstation>;

Equivalent to listWorkstations, but returns an iterable object.

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

Parameters
NameDescription
request IListWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.workstations.v1beta.IWorkstation>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Parent resource name.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. next_page_token value returned from a previous List request, if
   *  any.
   */
  // const pageToken = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callListWorkstations();

listWorkstationsStream(request, options)

listWorkstationsStream(request?: protos.google.cloud.workstations.v1beta.IListWorkstationsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listWorkstationsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location)

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

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromWorkstationClusterName(workstationClusterName)

matchLocationFromWorkstationClusterName(workstationClusterName: string): string | number;

Parse the location from WorkstationCluster resource.

Parameter
NameDescription
workstationClusterName string

A fully-qualified path representing WorkstationCluster resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromWorkstationConfigName(workstationConfigName)

matchLocationFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the location from WorkstationConfig resource.

Parameter
NameDescription
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromWorkstationName(workstationName)

matchLocationFromWorkstationName(workstationName: string): string | number;

Parse the location from Workstation resource.

Parameter
NameDescription
workstationName string

A fully-qualified path representing Workstation resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromWorkstationClusterName(workstationClusterName)

matchProjectFromWorkstationClusterName(workstationClusterName: string): string | number;

Parse the project from WorkstationCluster resource.

Parameter
NameDescription
workstationClusterName string

A fully-qualified path representing WorkstationCluster resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromWorkstationConfigName(workstationConfigName)

matchProjectFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the project from WorkstationConfig resource.

Parameter
NameDescription
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromWorkstationName(workstationName)

matchProjectFromWorkstationName(workstationName: string): string | number;

Parse the project from Workstation resource.

Parameter
NameDescription
workstationName string

A fully-qualified path representing Workstation resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchWorkstationClusterFromWorkstationClusterName(workstationClusterName)

matchWorkstationClusterFromWorkstationClusterName(workstationClusterName: string): string | number;

Parse the workstation_cluster from WorkstationCluster resource.

Parameter
NameDescription
workstationClusterName string

A fully-qualified path representing WorkstationCluster resource.

Returns
TypeDescription
string | number

{string} A string representing the workstation_cluster.

matchWorkstationClusterFromWorkstationConfigName(workstationConfigName)

matchWorkstationClusterFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the workstation_cluster from WorkstationConfig resource.

Parameter
NameDescription
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the workstation_cluster.

matchWorkstationClusterFromWorkstationName(workstationName)

matchWorkstationClusterFromWorkstationName(workstationName: string): string | number;

Parse the workstation_cluster from Workstation resource.

Parameter
NameDescription
workstationName string

A fully-qualified path representing Workstation resource.

Returns
TypeDescription
string | number

{string} A string representing the workstation_cluster.

matchWorkstationConfigFromWorkstationConfigName(workstationConfigName)

matchWorkstationConfigFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the workstation_config from WorkstationConfig resource.

Parameter
NameDescription
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the workstation_config.

matchWorkstationConfigFromWorkstationName(workstationName)

matchWorkstationConfigFromWorkstationName(workstationName: string): string | number;

Parse the workstation_config from Workstation resource.

Parameter
NameDescription
workstationName string

A fully-qualified path representing Workstation resource.

Returns
TypeDescription
string | number

{string} A string representing the workstation_config.

matchWorkstationFromWorkstationName(workstationName)

matchWorkstationFromWorkstationName(workstationName: string): string | number;

Parse the workstation from Workstation resource.

Parameter
NameDescription
workstationName string

A fully-qualified path representing Workstation resource.

Returns
TypeDescription
string | number

{string} A string representing the workstation.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

setIamPolicy(request, options, callback)

setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
request IamProtos.google.iam.v1.SetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | 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<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | 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 .

Returns
TypeDescription
Promise<[google.iam.v1.Policy]>

{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.

startWorkstation(request, options)

startWorkstation(request?: protos.google.cloud.workstations.v1beta.IStartWorkstationRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Starts running a workstation so that users can connect to it.

Parameters
NameDescription
request IStartWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation to start.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation on the server does not have this ETag.
   */
  // const etag = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callStartWorkstation();

startWorkstation(request, options, callback)

startWorkstation(request: protos.google.cloud.workstations.v1beta.IStartWorkstationRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IStartWorkstationRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

startWorkstation(request, callback)

startWorkstation(request: protos.google.cloud.workstations.v1beta.IStartWorkstationRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IStartWorkstationRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

stopWorkstation(request, options)

stopWorkstation(request?: protos.google.cloud.workstations.v1beta.IStopWorkstationRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Stops running a workstation, reducing costs.

Parameters
NameDescription
request IStopWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Name of the workstation to stop.
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, the request will be rejected if the latest version of the
   *  workstation on the server does not have this ETag.
   */
  // const etag = 'abc123'

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

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

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

  callStopWorkstation();

stopWorkstation(request, options, callback)

stopWorkstation(request: protos.google.cloud.workstations.v1beta.IStopWorkstationRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IStopWorkstationRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

stopWorkstation(request, callback)

stopWorkstation(request: protos.google.cloud.workstations.v1beta.IStopWorkstationRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IStopWorkstationRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, options, callback)

testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]>;

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
request IamProtos.google.iam.v1.TestIamPermissionsRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | 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<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | 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 .

Returns
TypeDescription
Promise<[google.iam.v1.TestIamPermissionsResponse]>

{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.

updateWorkstation(request, options)

updateWorkstation(request?: protos.google.cloud.workstations.v1beta.IUpdateWorkstationRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates an existing workstation.

Parameters
NameDescription
request IUpdateWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Workstation to update.
   */
  // const workstation = {}
  /**
   *  Required. Mask specifying which fields in the workstation configuration
   *  should be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set and the workstation configuration is not found, a new
   *  workstation configuration is created. In this situation, update_mask
   *  is ignored.
   */
  // const allowMissing = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callUpdateWorkstation() {
    // Construct request
    const request = {
      workstation,
      updateMask,
    };

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

  callUpdateWorkstation();

updateWorkstation(request, options, callback)

updateWorkstation(request: protos.google.cloud.workstations.v1beta.IUpdateWorkstationRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateWorkstationRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateWorkstation(request, callback)

updateWorkstation(request: protos.google.cloud.workstations.v1beta.IUpdateWorkstationRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateWorkstationRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateWorkstationCluster(request, options)

updateWorkstationCluster(request?: protos.google.cloud.workstations.v1beta.IUpdateWorkstationClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates an existing workstation cluster.

Parameters
NameDescription
request IUpdateWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Workstation cluster to update.
   */
  // const workstationCluster = {}
  /**
   *  Required. Mask that specifies which fields in the workstation cluster
   *  should be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set, and the workstation cluster is not found, a new
   *  workstation cluster will be created. In this situation, update_mask is
   *  ignored.
   */
  // const allowMissing = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callUpdateWorkstationCluster() {
    // Construct request
    const request = {
      workstationCluster,
      updateMask,
    };

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

  callUpdateWorkstationCluster();

updateWorkstationCluster(request, options, callback)

updateWorkstationCluster(request: protos.google.cloud.workstations.v1beta.IUpdateWorkstationClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateWorkstationClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateWorkstationCluster(request, callback)

updateWorkstationCluster(request: protos.google.cloud.workstations.v1beta.IUpdateWorkstationClusterRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateWorkstationClusterRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateWorkstationConfig(request, options)

updateWorkstationConfig(request?: protos.google.cloud.workstations.v1beta.IUpdateWorkstationConfigRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates an existing workstation configuration.

Parameters
NameDescription
request IUpdateWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.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.
   */
  /**
   *  Required. Config to update.
   */
  // const workstationConfig = {}
  /**
   *  Required. Mask specifying which fields in the workstation configuration
   *  should be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. If set, validate the request and preview the review, but do not
   *  actually apply it.
   */
  // const validateOnly = true
  /**
   *  Optional. If set and the workstation configuration is not found, a new
   *  workstation configuration will be created. In this situation,
   *  update_mask is ignored.
   */
  // const allowMissing = true

  // Imports the Workstations library
  const {WorkstationsClient} = require('@google-cloud/workstations').v1beta;

  // Instantiates a client
  const workstationsClient = new WorkstationsClient();

  async function callUpdateWorkstationConfig() {
    // Construct request
    const request = {
      workstationConfig,
      updateMask,
    };

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

  callUpdateWorkstationConfig();

updateWorkstationConfig(request, options, callback)

updateWorkstationConfig(request: protos.google.cloud.workstations.v1beta.IUpdateWorkstationConfigRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateWorkstationConfigRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateWorkstationConfig(request, callback)

updateWorkstationConfig(request: protos.google.cloud.workstations.v1beta.IUpdateWorkstationConfigRequest, callback: Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateWorkstationConfigRequest
callback Callback<LROperation<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

workstationClusterPath(project, location, workstationCluster)

workstationClusterPath(project: string, location: string, workstationCluster: string): string;

Return a fully-qualified workstationCluster resource name string.

Parameters
NameDescription
project string
location string
workstationCluster string
Returns
TypeDescription
string

{string} Resource name string.

workstationConfigPath(project, location, workstationCluster, workstationConfig)

workstationConfigPath(project: string, location: string, workstationCluster: string, workstationConfig: string): string;

Return a fully-qualified workstationConfig resource name string.

Parameters
NameDescription
project string
location string
workstationCluster string
workstationConfig string
Returns
TypeDescription
string

{string} Resource name string.

workstationPath(project, location, workstationCluster, workstationConfig, workstation)

workstationPath(project: string, location: string, workstationCluster: string, workstationConfig: string, workstation: string): string;

Return a fully-qualified workstation resource name string.

Parameters
NameDescription
project string
location string
workstationCluster string
workstationConfig string
workstation string
Returns
TypeDescription
string

{string} Resource name string.