Class v1.GameServerClustersServiceClient (3.2.2)

The game server cluster maps to Kubernetes clusters running Agones and is used to manage fleets within clusters. v1

Package

@google-cloud/game-servers

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of GameServerClustersServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof gax.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 GameServerClustersServiceClient({fallback: 'rest'}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

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

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

gameServerClustersServiceStub

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

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

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

Methods

checkCreateGameServerClusterProgress(name)

checkCreateGameServerClusterProgress(name: string): Promise<LROperation<protos.google.cloud.gaming.v1.GameServerCluster, protos.google.cloud.gaming.v1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.gaming.v1.GameServerCluster, protos.google.cloud.gaming.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource name, in the following form:
   *  `projects/{project}/locations/{location}/realms/{realm-id}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The ID of the game server cluster resource to be created.
   */
  // const gameServerClusterId = 'abc123'
  /**
   *  Required. The game server cluster resource to be created.
   */
  // const gameServerCluster = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

  async function callCreateGameServerCluster() {
    // Construct request
    const request = {
      parent,
      gameServerClusterId,
      gameServerCluster,
    };

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

  callCreateGameServerCluster();

checkDeleteGameServerClusterProgress(name)

checkDeleteGameServerClusterProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.gaming.v1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.gaming.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the game server cluster to delete, in the following form:
   *  `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
   */
  // const name = 'abc123'

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

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

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

  callDeleteGameServerCluster();

checkUpdateGameServerClusterProgress(name)

checkUpdateGameServerClusterProgress(name: string): Promise<LROperation<protos.google.cloud.gaming.v1.GameServerCluster, protos.google.cloud.gaming.v1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.gaming.v1.GameServerCluster, protos.google.cloud.gaming.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The game server cluster to be updated.
   *  Only fields specified in update_mask are updated.
   */
  // const gameServerCluster = {}
  /**
   *  Required. Mask of fields to update. At least one path must be supplied in
   *  this field. For the `FieldMask` definition, see
   *  https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
   */
  // const updateMask = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

  async function callUpdateGameServerCluster() {
    // Construct request
    const request = {
      gameServerCluster,
      updateMask,
    };

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

  callUpdateGameServerCluster();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

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

createGameServerCluster(request, options)

createGameServerCluster(request?: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new game server cluster in a given project and location.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource name, in the following form:
   *  `projects/{project}/locations/{location}/realms/{realm-id}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The ID of the game server cluster resource to be created.
   */
  // const gameServerClusterId = 'abc123'
  /**
   *  Required. The game server cluster resource to be created.
   */
  // const gameServerCluster = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

  async function callCreateGameServerCluster() {
    // Construct request
    const request = {
      parent,
      gameServerClusterId,
      gameServerCluster,
    };

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

  callCreateGameServerCluster();

createGameServerCluster(request, options, callback)

createGameServerCluster(request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createGameServerCluster(request, callback)

createGameServerCluster(request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, callback: Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest
callback Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteGameServerCluster(request, options)

deleteGameServerCluster(request?: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single game server cluster.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the game server cluster to delete, in the following form:
   *  `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
   */
  // const name = 'abc123'

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

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

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

  callDeleteGameServerCluster();

deleteGameServerCluster(request, options, callback)

deleteGameServerCluster(request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteGameServerCluster(request, callback)

deleteGameServerCluster(request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

gameServerClusterPath(project, location, realm, cluster)

gameServerClusterPath(project: string, location: string, realm: string, cluster: string): string;

Return a fully-qualified gameServerCluster resource name string.

Parameters
NameDescription
project string
location string
realm string
cluster string
Returns
TypeDescription
string

{string} Resource name string.

gameServerConfigPath(project, location, deployment, config)

gameServerConfigPath(project: string, location: string, deployment: string, config: string): string;

Return a fully-qualified gameServerConfig resource name string.

Parameters
NameDescription
project string
location string
deployment string
config string
Returns
TypeDescription
string

{string} Resource name string.

gameServerDeploymentPath(project, location, deployment)

gameServerDeploymentPath(project: string, location: string, deployment: string): string;

Return a fully-qualified gameServerDeployment resource name string.

Parameters
NameDescription
project string
location string
deployment string
Returns
TypeDescription
string

{string} Resource name string.

gameServerDeploymentRolloutPath(project, location, deployment)

gameServerDeploymentRolloutPath(project: string, location: string, deployment: string): string;

Return a fully-qualified gameServerDeploymentRollout resource name string.

Parameters
NameDescription
project string
location string
deployment string
Returns
TypeDescription
string

{string} Resource name string.

getGameServerCluster(request, options)

getGameServerCluster(request?: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, options?: CallOptions): Promise<[
        protos.google.cloud.gaming.v1.IGameServerCluster,
        protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | undefined,
        {} | undefined
    ]>;

Gets details of a single game server cluster.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IGetGameServerClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the game server cluster to retrieve, in the following form:
   *  `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. View for the returned GameServerCluster objects. When `FULL` is
   *  specified, the `cluster_state` field is also returned in the
   *  GameServerCluster object, which includes the state of the referenced
   *  Kubernetes cluster such as versions and provider info. The default/unset
   *  value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
   *  not return the `cluster_state` field.
   */
  // const view = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

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

    // Run request
    const response = await gamingClient.getGameServerCluster(request);
    console.log(response);
  }

  callGetGameServerCluster();

getGameServerCluster(request, options, callback)

getGameServerCluster(request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, options: CallOptions, callback: Callback<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IGetGameServerClusterRequest
options CallOptions
callback Callback<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getGameServerCluster(request, callback)

getGameServerCluster(request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, callback: Callback<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IGetGameServerClusterRequest
callback Callback<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

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

getProjectId(callback)

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

initialize()

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

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

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

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

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

listGameServerClusters(request, options)

listGameServerClusters(request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, options?: CallOptions): Promise<[
        protos.google.cloud.gaming.v1.IGameServerCluster[],
        protos.google.cloud.gaming.v1.IListGameServerClustersRequest | null,
        protos.google.cloud.gaming.v1.IListGameServerClustersResponse
    ]>;

Lists game server clusters in a given project and location.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IListGameServerClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.gaming.v1.IGameServerCluster[], protos.google.cloud.gaming.v1.IListGameServerClustersRequest | null, protos.google.cloud.gaming.v1.IListGameServerClustersResponse ]>

{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 listGameServerClustersAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listGameServerClusters(request, options, callback)

listGameServerClusters(request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.gaming.v1.IListGameServerClustersRequest, protos.google.cloud.gaming.v1.IListGameServerClustersResponse | null | undefined, protos.google.cloud.gaming.v1.IGameServerCluster>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IListGameServerClustersRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.gaming.v1.IListGameServerClustersRequest, protos.google.cloud.gaming.v1.IListGameServerClustersResponse | null | undefined, protos.google.cloud.gaming.v1.IGameServerCluster>
Returns
TypeDescription
void

listGameServerClusters(request, callback)

listGameServerClusters(request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, callback: PaginationCallback<protos.google.cloud.gaming.v1.IListGameServerClustersRequest, protos.google.cloud.gaming.v1.IListGameServerClustersResponse | null | undefined, protos.google.cloud.gaming.v1.IGameServerCluster>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IListGameServerClustersRequest
callback PaginationCallback<protos.google.cloud.gaming.v1.IListGameServerClustersRequest, protos.google.cloud.gaming.v1.IListGameServerClustersResponse | null | undefined, protos.google.cloud.gaming.v1.IGameServerCluster>
Returns
TypeDescription
void

listGameServerClustersAsync(request, options)

listGameServerClustersAsync(request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.gaming.v1.IGameServerCluster>;

Equivalent to listGameServerClusters, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IListGameServerClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.gaming.v1.IGameServerCluster>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource name, in the following form:
   *  "projects/{project}/locations/{location}/realms/{realm}".
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of items to return. If unspecified, the server
   *  will pick an appropriate default. The server may return fewer items than
   *  requested. A caller should only rely on response's
   *  next_page_token google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token  to
   *  determine if there are more GameServerClusters left to be queried.
   */
  // const pageSize = 1234
  /**
   *  Optional. The next_page_token value returned from a previous List request, if any.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The filter to apply to list results.
   */
  // const filter = 'abc123'
  /**
   *  Optional. Specifies the ordering of results following syntax at
   *  https://cloud.google.com/apis/design/design_patterns#sorting_order.
   */
  // const orderBy = 'abc123'
  /**
   *  Optional. View for the returned GameServerCluster objects. When `FULL` is
   *  specified, the `cluster_state` field is also returned in the
   *  GameServerCluster object, which includes the state of the referenced
   *  Kubernetes cluster such as versions and provider info. The default/unset
   *  value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does
   *  not return the `cluster_state` field.
   */
  // const view = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

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

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

  callListGameServerClusters();

listGameServerClustersStream(request, options)

listGameServerClustersStream(request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IListGameServerClustersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listGameServerClustersAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

matchClusterFromGameServerClusterName(gameServerClusterName)

matchClusterFromGameServerClusterName(gameServerClusterName: string): string | number;

Parse the cluster from GameServerCluster resource.

Parameter
NameDescription
gameServerClusterName string

A fully-qualified path representing GameServerCluster resource.

Returns
TypeDescription
string | number

{string} A string representing the cluster.

matchConfigFromGameServerConfigName(gameServerConfigName)

matchConfigFromGameServerConfigName(gameServerConfigName: string): string | number;

Parse the config from GameServerConfig resource.

Parameter
NameDescription
gameServerConfigName string

A fully-qualified path representing GameServerConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the config.

matchDeploymentFromGameServerConfigName(gameServerConfigName)

matchDeploymentFromGameServerConfigName(gameServerConfigName: string): string | number;

Parse the deployment from GameServerConfig resource.

Parameter
NameDescription
gameServerConfigName string

A fully-qualified path representing GameServerConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the deployment.

matchDeploymentFromGameServerDeploymentName(gameServerDeploymentName)

matchDeploymentFromGameServerDeploymentName(gameServerDeploymentName: string): string | number;

Parse the deployment from GameServerDeployment resource.

Parameter
NameDescription
gameServerDeploymentName string

A fully-qualified path representing GameServerDeployment resource.

Returns
TypeDescription
string | number

{string} A string representing the deployment.

matchDeploymentFromGameServerDeploymentRolloutName(gameServerDeploymentRolloutName)

matchDeploymentFromGameServerDeploymentRolloutName(gameServerDeploymentRolloutName: string): string | number;

Parse the deployment from GameServerDeploymentRollout resource.

Parameter
NameDescription
gameServerDeploymentRolloutName string

A fully-qualified path representing GameServerDeploymentRollout resource.

Returns
TypeDescription
string | number

{string} A string representing the deployment.

matchLocationFromGameServerClusterName(gameServerClusterName)

matchLocationFromGameServerClusterName(gameServerClusterName: string): string | number;

Parse the location from GameServerCluster resource.

Parameter
NameDescription
gameServerClusterName string

A fully-qualified path representing GameServerCluster resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromGameServerConfigName(gameServerConfigName)

matchLocationFromGameServerConfigName(gameServerConfigName: string): string | number;

Parse the location from GameServerConfig resource.

Parameter
NameDescription
gameServerConfigName string

A fully-qualified path representing GameServerConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromGameServerDeploymentName(gameServerDeploymentName)

matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string): string | number;

Parse the location from GameServerDeployment resource.

Parameter
NameDescription
gameServerDeploymentName string

A fully-qualified path representing GameServerDeployment resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromGameServerDeploymentRolloutName(gameServerDeploymentRolloutName)

matchLocationFromGameServerDeploymentRolloutName(gameServerDeploymentRolloutName: string): string | number;

Parse the location from GameServerDeploymentRollout resource.

Parameter
NameDescription
gameServerDeploymentRolloutName string

A fully-qualified path representing GameServerDeploymentRollout resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromRealmName(realmName)

matchLocationFromRealmName(realmName: string): string | number;

Parse the location from Realm resource.

Parameter
NameDescription
realmName string

A fully-qualified path representing Realm resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromGameServerClusterName(gameServerClusterName)

matchProjectFromGameServerClusterName(gameServerClusterName: string): string | number;

Parse the project from GameServerCluster resource.

Parameter
NameDescription
gameServerClusterName string

A fully-qualified path representing GameServerCluster resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromGameServerConfigName(gameServerConfigName)

matchProjectFromGameServerConfigName(gameServerConfigName: string): string | number;

Parse the project from GameServerConfig resource.

Parameter
NameDescription
gameServerConfigName string

A fully-qualified path representing GameServerConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromGameServerDeploymentName(gameServerDeploymentName)

matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string): string | number;

Parse the project from GameServerDeployment resource.

Parameter
NameDescription
gameServerDeploymentName string

A fully-qualified path representing GameServerDeployment resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromGameServerDeploymentRolloutName(gameServerDeploymentRolloutName)

matchProjectFromGameServerDeploymentRolloutName(gameServerDeploymentRolloutName: string): string | number;

Parse the project from GameServerDeploymentRollout resource.

Parameter
NameDescription
gameServerDeploymentRolloutName string

A fully-qualified path representing GameServerDeploymentRollout resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromRealmName(realmName)

matchProjectFromRealmName(realmName: string): string | number;

Parse the project from Realm resource.

Parameter
NameDescription
realmName string

A fully-qualified path representing Realm resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchRealmFromGameServerClusterName(gameServerClusterName)

matchRealmFromGameServerClusterName(gameServerClusterName: string): string | number;

Parse the realm from GameServerCluster resource.

Parameter
NameDescription
gameServerClusterName string

A fully-qualified path representing GameServerCluster resource.

Returns
TypeDescription
string | number

{string} A string representing the realm.

matchRealmFromRealmName(realmName)

matchRealmFromRealmName(realmName: string): string | number;

Parse the realm from Realm resource.

Parameter
NameDescription
realmName string

A fully-qualified path representing Realm resource.

Returns
TypeDescription
string | number

{string} A string representing the realm.

previewCreateGameServerCluster(request, options)

previewCreateGameServerCluster(request?: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, options?: CallOptions): Promise<[
        protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse,
        (protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest | undefined),
        {} | undefined
    ]>;

Previews creation of a new game server cluster in a given project and location.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, (protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource name, in the following form:
   *  `projects/{project}/locations/{location}/realms/{realm}`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The ID of the game server cluster resource to be created.
   */
  // const gameServerClusterId = 'abc123'
  /**
   *  Required. The game server cluster resource to be created.
   */
  // const gameServerCluster = {}
  /**
   *  Optional. The target timestamp to compute the preview.
   */
  // const previewTime = {}
  /**
   *  Optional. This field is deprecated, preview will always return
   *  KubernetesClusterState.
   */
  // const view = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

  async function callPreviewCreateGameServerCluster() {
    // Construct request
    const request = {
      parent,
      gameServerClusterId,
      gameServerCluster,
    };

    // Run request
    const response = await gamingClient.previewCreateGameServerCluster(request);
    console.log(response);
  }

  callPreviewCreateGameServerCluster();

previewCreateGameServerCluster(request, options, callback)

previewCreateGameServerCluster(request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, options: CallOptions, callback: Callback<protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
options CallOptions
callback Callback<protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

previewCreateGameServerCluster(request, callback)

previewCreateGameServerCluster(request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, callback: Callback<protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
callback Callback<protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

previewDeleteGameServerCluster(request, options)

previewDeleteGameServerCluster(request?: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, options?: CallOptions): Promise<[
        protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse,
        (protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest | undefined),
        {} | undefined
    ]>;

Previews deletion of a single game server cluster.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, (protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the game server cluster to delete, in the following form:
   *  `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
   */
  // const name = 'abc123'
  /**
   *  Optional. The target timestamp to compute the preview.
   */
  // const previewTime = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

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

    // Run request
    const response = await gamingClient.previewDeleteGameServerCluster(request);
    console.log(response);
  }

  callPreviewDeleteGameServerCluster();

previewDeleteGameServerCluster(request, options, callback)

previewDeleteGameServerCluster(request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, options: CallOptions, callback: Callback<protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
options CallOptions
callback Callback<protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

previewDeleteGameServerCluster(request, callback)

previewDeleteGameServerCluster(request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, callback: Callback<protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
callback Callback<protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

previewUpdateGameServerCluster(request, options)

previewUpdateGameServerCluster(request?: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, options?: CallOptions): Promise<[
        protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse,
        (protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest | undefined),
        {} | undefined
    ]>;

Previews updating a GameServerCluster.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, (protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The game server cluster to be updated.
   *  Only fields specified in update_mask are updated.
   */
  // const gameServerCluster = {}
  /**
   *  Required. Mask of fields to update. At least one path must be supplied in
   *  this field. For the `FieldMask` definition, see
   *  https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
   */
  // const updateMask = {}
  /**
   *  Optional. The target timestamp to compute the preview.
   */
  // const previewTime = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

  async function callPreviewUpdateGameServerCluster() {
    // Construct request
    const request = {
      gameServerCluster,
      updateMask,
    };

    // Run request
    const response = await gamingClient.previewUpdateGameServerCluster(request);
    console.log(response);
  }

  callPreviewUpdateGameServerCluster();

previewUpdateGameServerCluster(request, options, callback)

previewUpdateGameServerCluster(request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, options: CallOptions, callback: Callback<protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
options CallOptions
callback Callback<protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

previewUpdateGameServerCluster(request, callback)

previewUpdateGameServerCluster(request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, callback: Callback<protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
callback Callback<protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

realmPath(project, location, realm)

realmPath(project: string, location: string, realm: string): string;

Return a fully-qualified realm resource name string.

Parameters
NameDescription
project string
location string
realm string
Returns
TypeDescription
string

{string} Resource name string.

updateGameServerCluster(request, options)

updateGameServerCluster(request?: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Patches a single game server cluster.

Parameters
NameDescription
request protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The game server cluster to be updated.
   *  Only fields specified in update_mask are updated.
   */
  // const gameServerCluster = {}
  /**
   *  Required. Mask of fields to update. At least one path must be supplied in
   *  this field. For the `FieldMask` definition, see
   *  https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
   */
  // const updateMask = {}

  // Imports the Gaming library
  const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1;

  // Instantiates a client
  const gamingClient = new GameServerClustersServiceClient();

  async function callUpdateGameServerCluster() {
    // Construct request
    const request = {
      gameServerCluster,
      updateMask,
    };

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

  callUpdateGameServerCluster();

updateGameServerCluster(request, options, callback)

updateGameServerCluster(request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateGameServerCluster(request, callback)

updateGameServerCluster(request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, callback: Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest
callback Callback<LROperation<protos.google.cloud.gaming.v1.IGameServerCluster, protos.google.cloud.gaming.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void