Class v1beta.WorkstationsClient (2.1.0)

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
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

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

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

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

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

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.

universeDomain

get universeDomain(): string;

warn

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

workstationsStub

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

Methods

cancelOperation(request, optionsOrCallback, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | 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
Name Description
request CancelOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
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
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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
Type Description
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
Name Description
request ICreateWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request ICreateWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request ICreateWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
void

deleteOperation(request, optionsOrCallback, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: 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
Name Description
request DeleteOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
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
Type Description
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
Name Description
request IDeleteWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IDeleteWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IDeleteWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IGenerateAccessTokenRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
request IGenerateAccessTokenRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse, protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
request IGenerateAccessTokenRequest
callback Callback<protos.google.cloud.workstations.v1beta.IGenerateAccessTokenResponse, protos.google.cloud.workstations.v1beta.IGenerateAccessTokenRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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, optionsOrCallback, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: 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
Name Description
request GetOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
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
Type Description
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
Type Description
Promise<string>

getProjectId(callback)

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

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
Name Description
request IGetWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
request IGetWorkstationRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
request IGetWorkstationRequest
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstation, protos.google.cloud.workstations.v1beta.IGetWorkstationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
request IGetWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
request IGetWorkstationClusterRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
request IGetWorkstationClusterRequest
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationCluster, protos.google.cloud.workstations.v1beta.IGetWorkstationClusterRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
request IGetWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
request IGetWorkstationConfigRequest
options CallOptions
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
request IGetWorkstationConfigRequest
callback Callback<protos.google.cloud.workstations.v1beta.IWorkstationConfig, protos.google.cloud.workstations.v1beta.IGetWorkstationConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

initialize()

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

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

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

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

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

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
Name Description
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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.IOperation>;

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
Name Description
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
Type Description
AsyncIterable<protos.google.longrunning.IOperation>

{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
Name Description
request IListUsableWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IListUsableWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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 = 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 listUsableWorkstationConfigs, but returns a NodeJS Stream object.

Parameters
Name Description
request IListUsableWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using 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
Name Description
request IListUsableWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IListUsableWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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 = 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 listUsableWorkstations, but returns a NodeJS Stream object.

Parameters
Name Description
request IListUsableWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using 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
Name Description
request IListWorkstationClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IListWorkstationClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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 = 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 listWorkstationClusters, but returns a NodeJS Stream object.

Parameters
Name Description
request IListWorkstationClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using 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
Name Description
request IListWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IListWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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 = 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 listWorkstationConfigs, but returns a NodeJS Stream object.

Parameters
Name Description
request IListWorkstationConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using 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
Name Description
request IListWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IListWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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 = 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 listWorkstations, but returns a NodeJS Stream object.

Parameters
Name Description
request IListWorkstationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using 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
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromWorkstationClusterName(workstationClusterName)

matchLocationFromWorkstationClusterName(workstationClusterName: string): string | number;

Parse the location from WorkstationCluster resource.

Parameter
Name Description
workstationClusterName string

A fully-qualified path representing WorkstationCluster resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromWorkstationConfigName(workstationConfigName)

matchLocationFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the location from WorkstationConfig resource.

Parameter
Name Description
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromWorkstationName(workstationName)

matchLocationFromWorkstationName(workstationName: string): string | number;

Parse the location from Workstation resource.

Parameter
Name Description
workstationName string

A fully-qualified path representing Workstation resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
Name Description
projectName string

A fully-qualified path representing Project resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromWorkstationClusterName(workstationClusterName)

matchProjectFromWorkstationClusterName(workstationClusterName: string): string | number;

Parse the project from WorkstationCluster resource.

Parameter
Name Description
workstationClusterName string

A fully-qualified path representing WorkstationCluster resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromWorkstationConfigName(workstationConfigName)

matchProjectFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the project from WorkstationConfig resource.

Parameter
Name Description
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromWorkstationName(workstationName)

matchProjectFromWorkstationName(workstationName: string): string | number;

Parse the project from Workstation resource.

Parameter
Name Description
workstationName string

A fully-qualified path representing Workstation resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchWorkstationClusterFromWorkstationClusterName(workstationClusterName)

matchWorkstationClusterFromWorkstationClusterName(workstationClusterName: string): string | number;

Parse the workstation_cluster from WorkstationCluster resource.

Parameter
Name Description
workstationClusterName string

A fully-qualified path representing WorkstationCluster resource.

Returns
Type Description
string | number

{string} A string representing the workstation_cluster.

matchWorkstationClusterFromWorkstationConfigName(workstationConfigName)

matchWorkstationClusterFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the workstation_cluster from WorkstationConfig resource.

Parameter
Name Description
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
Type Description
string | number

{string} A string representing the workstation_cluster.

matchWorkstationClusterFromWorkstationName(workstationName)

matchWorkstationClusterFromWorkstationName(workstationName: string): string | number;

Parse the workstation_cluster from Workstation resource.

Parameter
Name Description
workstationName string

A fully-qualified path representing Workstation resource.

Returns
Type Description
string | number

{string} A string representing the workstation_cluster.

matchWorkstationConfigFromWorkstationConfigName(workstationConfigName)

matchWorkstationConfigFromWorkstationConfigName(workstationConfigName: string): string | number;

Parse the workstation_config from WorkstationConfig resource.

Parameter
Name Description
workstationConfigName string

A fully-qualified path representing WorkstationConfig resource.

Returns
Type Description
string | number

{string} A string representing the workstation_config.

matchWorkstationConfigFromWorkstationName(workstationName)

matchWorkstationConfigFromWorkstationName(workstationName: string): string | number;

Parse the workstation_config from Workstation resource.

Parameter
Name Description
workstationName string

A fully-qualified path representing Workstation resource.

Returns
Type Description
string | number

{string} A string representing the workstation_config.

matchWorkstationFromWorkstationName(workstationName)

matchWorkstationFromWorkstationName(workstationName: string): string | number;

Parse the workstation from Workstation resource.

Parameter
Name Description
workstationName string

A fully-qualified path representing Workstation resource.

Returns
Type Description
string | number

{string} A string representing the workstation.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
Name Description
project string
Returns
Type Description
string

{string} Resource name string.

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
Name Description
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
Type Description
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
Name Description
request IStartWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IStopWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IUpdateWorkstationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IUpdateWorkstationClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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
Name Description
request IUpdateWorkstationConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
void

workstationClusterPath(project, location, workstationCluster)

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

Return a fully-qualified workstationCluster resource name string.

Parameters
Name Description
project string
location string
workstationCluster string
Returns
Type Description
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
Name Description
project string
location string
workstationCluster string
workstationConfig string
Returns
Type Description
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
Name Description
project string
location string
workstationCluster string
workstationConfig string
workstation string
Returns
Type Description
string

{string} Resource name string.