1 5
// Copyright 2020 Google LLC
2 5
//
3 5
// Licensed under the Apache License, Version 2.0 (the "License");
4 5
// you may not use this file except in compliance with the License.
5 5
// You may obtain a copy of the License at
6 5
//
7 5
//     https://www.apache.org/licenses/LICENSE-2.0
8 5
//
9 5
// Unless required by applicable law or agreed to in writing, software
10 5
// distributed under the License is distributed on an "AS IS" BASIS,
11 5
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 5
// See the License for the specific language governing permissions and
13 5
// limitations under the License.
14 5
//
15 5
// ** This file is automatically generated by gapic-generator-typescript. **
16 5
// ** https://github.com/googleapis/gapic-generator-typescript **
17 5
// ** All changes to this file may be overwritten. **
18 5

19 5
import * as gax from 'google-gax';
20 5
import {
21 5
  Callback,
22 5
  CallOptions,
23 5
  Descriptors,
24 5
  ClientOptions,
25 5
  LROperation,
26 5
  PaginationCallback,
27 5
  GaxCall,
28 5
} from 'google-gax';
29 5
import * as path from 'path';
30 5

31 5
import {Transform} from 'stream';
32 5
import {RequestType} from 'google-gax/build/src/apitypes';
33 5
import * as protos from '../../protos/protos';
34 5
import * as gapicConfig from './game_server_clusters_service_client_config.json';
35 5
import {operationsProtos} from 'google-gax';
36 5
const version = require('../../../package.json').version;
37 5

38 5
/**
39 5
 *  The game server cluster maps to Kubernetes clusters running Agones and is
40 5
 *  used to manage fleets within clusters.
41 5
 * @class
42 5
 * @memberof v1
43 5
 */
44 5
export class GameServerClustersServiceClient {
45 5
  private _terminated = false;
46 5
  private _opts: ClientOptions;
47 5
  private _gaxModule: typeof gax | typeof gax.fallback;
48 5
  private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
49 5
  private _protos: {};
50 5
  private _defaults: {[method: string]: gax.CallSettings};
51 5
  auth: gax.GoogleAuth;
52 5
  descriptors: Descriptors = {
53 5
    page: {},
54 5
    stream: {},
55 5
    longrunning: {},
56 5
    batching: {},
57 5
  };
58 5
  innerApiCalls: {[name: string]: Function};
59 5
  pathTemplates: {[name: string]: gax.PathTemplate};
60 5
  operationsClient: gax.OperationsClient;
61 5
  gameServerClustersServiceStub?: Promise<{[name: string]: Function}>;
62 5

63 5
  /**
64 5
   * Construct an instance of GameServerClustersServiceClient.
65 5
   *
66 5
   * @param {object} [options] - The configuration object. See the subsequent
67 5
   *   parameters for more details.
68 5
   * @param {object} [options.credentials] - Credentials object.
69 5
   * @param {string} [options.credentials.client_email]
70 5
   * @param {string} [options.credentials.private_key]
71 5
   * @param {string} [options.email] - Account email address. Required when
72 5
   *     using a .pem or .p12 keyFilename.
73 5
   * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
74 5
   *     .p12 key downloaded from the Google Developers Console. If you provide
75 5
   *     a path to a JSON file, the projectId option below is not necessary.
76 5
   *     NOTE: .pem and .p12 require you to specify options.email as well.
77 5
   * @param {number} [options.port] - The port on which to connect to
78 5
   *     the remote host.
79 5
   * @param {string} [options.projectId] - The project ID from the Google
80 5
   *     Developer's Console, e.g. 'grape-spaceship-123'. We will also check
81 5
   *     the environment variable GCLOUD_PROJECT for your project ID. If your
82 5
   *     app is running in an environment which supports
83 5
   *     {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
84 5
   *     your project ID will be detected automatically.
85 5
   * @param {string} [options.apiEndpoint] - The domain name of the
86 5
   *     API remote host.
87 5
   */
88 5

89 5
  constructor(opts?: ClientOptions) {
90 5
    // Ensure that options include the service address and port.
91 5
    const staticMembers = this
92 5
      .constructor as typeof GameServerClustersServiceClient;
93 5
    const servicePath =
94 5
      opts && opts.servicePath
95 5
        ? opts.servicePath
96 5
        : opts && opts.apiEndpoint
97 5
        ? opts.apiEndpoint
98 5
        : staticMembers.servicePath;
99 5
    const port = opts && opts.port ? opts.port : staticMembers.port;
100 5

101 5
    if (!opts) {
102 5
      opts = {servicePath, port};
103 5
    }
104 5
    opts.servicePath = opts.servicePath || servicePath;
105 5
    opts.port = opts.port || port;
106 5

107 5
    // users can override the config from client side, like retry codes name.
108 5
    // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546
109 5
    // The way to override client config for Showcase API:
110 5
    //
111 5
    // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}}
112 5
    // const showcaseClient = new showcaseClient({ projectId, customConfig });
113 5
    opts.clientConfig = opts.clientConfig || {};
114 5

115 5
    // If we're running in browser, it's OK to omit `fallback` since
116 5
    // google-gax has `browser` field in its `package.json`.
117 5
    // For Electron (which does not respect `browser` field),
118 5
    // pass `{fallback: true}` to the GameServerClustersServiceClient constructor.
119 5
    this._gaxModule = opts.fallback ? gax.fallback : gax;
120 5

121 5
    // Create a `gaxGrpc` object, with any grpc-specific options
122 5
    // sent to the client.
123 5
    opts.scopes = (this
124 5
      .constructor as typeof GameServerClustersServiceClient).scopes;
125 5
    this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
126 5

127 5
    // Save options to use in initialize() method.
128 5
    this._opts = opts;
129 5

130 5
    // Save the auth object to the client, for use by other methods.
131 5
    this.auth = this._gaxGrpc.auth as gax.GoogleAuth;
132 5

133 5
    // Determine the client header string.
134 5
    const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
135 5
    if (typeof process !== 'undefined' && 'versions' in process) {
136 5
      clientHeader.push(`gl-node/${process.versions.node}`);
137 5
    } else {
138 0
      clientHeader.push(`gl-web/${this._gaxModule.version}`);
139 0
    }
140 5
    if (!opts.fallback) {
141 5
      clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
142 5
    }
143 5
    if (opts.libName && opts.libVersion) {
144 0
      clientHeader.push(`${opts.libName}/${opts.libVersion}`);
145 0
    }
146 5
    // Load the applicable protos.
147 5
    // For Node.js, pass the path to JSON proto file.
148 5
    // For browsers, pass the JSON content.
149 5

150 5
    const nodejsProtoPath = path.join(
151 5
      __dirname,
152 5
      '..',
153 5
      '..',
154 5
      'protos',
155 5
      'protos.json'
156 5
    );
157 5
    this._protos = this._gaxGrpc.loadProto(
158 5
      opts.fallback
159 5
        ? // eslint-disable-next-line @typescript-eslint/no-var-requires
160 5
          require('../../protos/protos.json')
161 5
        : nodejsProtoPath
162 5
    );
163 5

164 5
    // This API contains "path templates"; forward-slash-separated
165 5
    // identifiers to uniquely identify resources within the API.
166 5
    // Create useful helper objects for these.
167 5
    this.pathTemplates = {
168 5
      gameServerClusterPathTemplate: new this._gaxModule.PathTemplate(
169 5
        'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}'
170 5
      ),
171 5
      gameServerConfigPathTemplate: new this._gaxModule.PathTemplate(
172 5
        'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}'
173 5
      ),
174 5
      gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate(
175 5
        'projects/{project}/locations/{location}/gameServerDeployments/{deployment}'
176 5
      ),
177 5
      gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate(
178 5
        'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout'
179 5
      ),
180 5
      realmPathTemplate: new this._gaxModule.PathTemplate(
181 5
        'projects/{project}/locations/{location}/realms/{realm}'
182 5
      ),
183 5
    };
184 5

185 5
    // Some of the methods on this service return "paged" results,
186 5
    // (e.g. 50 results at a time, with tokens to get subsequent
187 5
    // pages). Denote the keys used for pagination and results.
188 5
    this.descriptors.page = {
189 5
      listGameServerClusters: new this._gaxModule.PageDescriptor(
190 5
        'pageToken',
191 5
        'nextPageToken',
192 5
        'gameServerClusters'
193 5
      ),
194 5
    };
195 5

196 5
    // This API contains "long-running operations", which return a
197 5
    // an Operation object that allows for tracking of the operation,
198 5
    // rather than holding a request open.
199 5
    const protoFilesRoot = opts.fallback
200 5
      ? this._gaxModule.protobuf.Root.fromJSON(
201 5
          // eslint-disable-next-line @typescript-eslint/no-var-requires
202 5
          require('../../protos/protos.json')
203 5
        )
204 5
      : this._gaxModule.protobuf.loadSync(nodejsProtoPath);
205 5

206 5
    this.operationsClient = this._gaxModule
207 5
      .lro({
208 5
        auth: this.auth,
209 5
        grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
210 5
      })
211 5
      .operationsClient(opts);
212 5
    const createGameServerClusterResponse = protoFilesRoot.lookup(
213 5
      '.google.cloud.gaming.v1.GameServerCluster'
214 5
    ) as gax.protobuf.Type;
215 5
    const createGameServerClusterMetadata = protoFilesRoot.lookup(
216 5
      '.google.cloud.gaming.v1.OperationMetadata'
217 5
    ) as gax.protobuf.Type;
218 5
    const deleteGameServerClusterResponse = protoFilesRoot.lookup(
219 5
      '.google.protobuf.Empty'
220 5
    ) as gax.protobuf.Type;
221 5
    const deleteGameServerClusterMetadata = protoFilesRoot.lookup(
222 5
      '.google.cloud.gaming.v1.OperationMetadata'
223 5
    ) as gax.protobuf.Type;
224 5
    const updateGameServerClusterResponse = protoFilesRoot.lookup(
225 5
      '.google.cloud.gaming.v1.GameServerCluster'
226 5
    ) as gax.protobuf.Type;
227 5
    const updateGameServerClusterMetadata = protoFilesRoot.lookup(
228 5
      '.google.cloud.gaming.v1.OperationMetadata'
229 5
    ) as gax.protobuf.Type;
230 5

231 5
    this.descriptors.longrunning = {
232 5
      createGameServerCluster: new this._gaxModule.LongrunningDescriptor(
233 5
        this.operationsClient,
234 5
        createGameServerClusterResponse.decode.bind(
235 5
          createGameServerClusterResponse
236 5
        ),
237 5
        createGameServerClusterMetadata.decode.bind(
238 5
          createGameServerClusterMetadata
239 5
        )
240 5
      ),
241 5
      deleteGameServerCluster: new this._gaxModule.LongrunningDescriptor(
242 5
        this.operationsClient,
243 5
        deleteGameServerClusterResponse.decode.bind(
244 5
          deleteGameServerClusterResponse
245 5
        ),
246 5
        deleteGameServerClusterMetadata.decode.bind(
247 5
          deleteGameServerClusterMetadata
248 5
        )
249 5
      ),
250 5
      updateGameServerCluster: new this._gaxModule.LongrunningDescriptor(
251 5
        this.operationsClient,
252 5
        updateGameServerClusterResponse.decode.bind(
253 5
          updateGameServerClusterResponse
254 5
        ),
255 5
        updateGameServerClusterMetadata.decode.bind(
256 5
          updateGameServerClusterMetadata
257 5
        )
258 5
      ),
259 5
    };
260 5

261 5
    // Put together the default options sent with requests.
262 5
    this._defaults = this._gaxGrpc.constructSettings(
263 5
      'google.cloud.gaming.v1.GameServerClustersService',
264 5
      gapicConfig as gax.ClientConfig,
265 5
      opts.clientConfig || {},
266 5
      {'x-goog-api-client': clientHeader.join(' ')}
267 5
    );
268 5

269 5
    // Set up a dictionary of "inner API calls"; the core implementation
270 5
    // of calling the API is handled in `google-gax`, with this code
271 5
    // merely providing the destination and request information.
272 5
    this.innerApiCalls = {};
273 5
  }
274 5

275 5
  /**
276 5
   * Initialize the client.
277 5
   * Performs asynchronous operations (such as authentication) and prepares the client.
278 5
   * This function will be called automatically when any class method is called for the
279 5
   * first time, but if you need to initialize it before calling an actual method,
280 5
   * feel free to call initialize() directly.
281 5
   *
282 5
   * You can await on this method if you want to make sure the client is initialized.
283 5
   *
284 5
   * @returns {Promise} A promise that resolves to an authenticated service stub.
285 5
   */
286 5
  initialize() {
287 5
    // If the client stub promise is already initialized, return immediately.
288 5
    if (this.gameServerClustersServiceStub) {
289 5
      return this.gameServerClustersServiceStub;
290 5
    }
291 5

292 5
    // Put together the "service stub" for
293 5
    // google.cloud.gaming.v1.GameServerClustersService.
294 5
    this.gameServerClustersServiceStub = this._gaxGrpc.createStub(
295 5
      this._opts.fallback
296 5
        ? (this._protos as protobuf.Root).lookupService(
297 0
            'google.cloud.gaming.v1.GameServerClustersService'
298 5
          )
299 5
        : // eslint-disable-next-line @typescript-eslint/no-explicit-any
300 5
          (this._protos as any).google.cloud.gaming.v1
301 5
            .GameServerClustersService,
302 5
      this._opts
303 5
    ) as Promise<{[method: string]: Function}>;
304 5

305 5
    // Iterate over each of the methods that the service provides
306 5
    // and create an API call method for each.
307 5
    const gameServerClustersServiceStubMethods = [
308 5
      'listGameServerClusters',
309 5
      'getGameServerCluster',
310 5
      'createGameServerCluster',
311 5
      'previewCreateGameServerCluster',
312 5
      'deleteGameServerCluster',
313 5
      'previewDeleteGameServerCluster',
314 5
      'updateGameServerCluster',
315 5
      'previewUpdateGameServerCluster',
316 5
    ];
317 5
    for (const methodName of gameServerClustersServiceStubMethods) {
318 5
      const callPromise = this.gameServerClustersServiceStub.then(
319 5
        stub => (...args: Array<{}>) => {
320 0
          if (this._terminated) {
321 0
            return Promise.reject('The client has already been closed.');
322 0
          }
323 0
          const func = stub[methodName];
324 0
          return func.apply(stub, args);
325 5
        },
326 5
        (err: Error | null | undefined) => () => {
327 0
          throw err;
328 0
        }
329 5
      );
330 5

331 5
      const apiCall = this._gaxModule.createApiCall(
332 5
        callPromise,
333 5
        this._defaults[methodName],
334 5
        this.descriptors.page[methodName] ||
335 5
          this.descriptors.stream[methodName] ||
336 5
          this.descriptors.longrunning[methodName]
337 5
      );
338 5

339 5
      this.innerApiCalls[methodName] = apiCall;
340 5
    }
341 5

342 5
    return this.gameServerClustersServiceStub;
343 5
  }
344 5

345 5
  /**
346 5
   * The DNS address for this API service.
347 5
   */
348 5
  static get servicePath() {
349 5
    return 'gameservices.googleapis.com';
350 5
  }
351 5

352 5
  /**
353 5
   * The DNS address for this API service - same as servicePath(),
354 5
   * exists for compatibility reasons.
355 5
   */
356 5
  static get apiEndpoint() {
357 5
    return 'gameservices.googleapis.com';
358 5
  }
359 5

360 5
  /**
361 5
   * The port for this API service.
362 5
   */
363 5
  static get port() {
364 5
    return 443;
365 5
  }
366 5

367 5
  /**
368 5
   * The scopes needed to make gRPC calls for every method defined
369 5
   * in this service.
370 5
   */
371 5
  static get scopes() {
372 5
    return ['https://www.googleapis.com/auth/cloud-platform'];
373 5
  }
374 5

375 5
  getProjectId(): Promise<string>;
376 5
  getProjectId(callback: Callback<string, undefined, undefined>): void;
377 5
  /**
378 5
   * Return the project ID used by this class.
379 5
   * @param {function(Error, string)} callback - the callback to
380 5
   *   be called with the current project Id.
381 5
   */
382 5
  getProjectId(
383 5
    callback?: Callback<string, undefined, undefined>
384 5
  ): Promise<string> | void {
385 5
    if (callback) {
386 5
      this.auth.getProjectId(callback);
387 5
      return;
388 5
    }
389 5
    return this.auth.getProjectId();
390 5
  }
391 5

392 5
  // -------------------
393 5
  // -- Service calls --
394 5
  // -------------------
395 5
  getGameServerCluster(
396 5
    request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest,
397 5
    options?: gax.CallOptions
398 5
  ): Promise<
399 5
    [
400 5
      protos.google.cloud.gaming.v1.IGameServerCluster,
401 5
      protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | undefined,
402 5
      {} | undefined
403 5
    ]
404 5
  >;
405 5
  getGameServerCluster(
406 5
    request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest,
407 5
    options: gax.CallOptions,
408 5
    callback: Callback<
409 5
      protos.google.cloud.gaming.v1.IGameServerCluster,
410 5
      | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest
411 5
      | null
412 5
      | undefined,
413 5
      {} | null | undefined
414 5
    >
415 5
  ): void;
416 5
  getGameServerCluster(
417 5
    request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest,
418 5
    callback: Callback<
419 5
      protos.google.cloud.gaming.v1.IGameServerCluster,
420 5
      | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest
421 5
      | null
422 5
      | undefined,
423 5
      {} | null | undefined
424 5
    >
425 5
  ): void;
426 5
  /**
427 5
   * Gets details of a single game server cluster.
428 5
   *
429 5
   * @param {Object} request
430 5
   *   The request object that will be sent.
431 5
   * @param {string} request.name
432 5
   *   Required. The name of the game server cluster to retrieve. Uses the form:
433 5
   *
434 5
   *   `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
435 5
   * @param {object} [options]
436 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
437 5
   * @returns {Promise} - The promise which resolves to an array.
438 5
   *   The first element of the array is an object representing [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster}.
439 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
440 5
   */
441 5
  getGameServerCluster(
442 5
    request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest,
443 5
    optionsOrCallback?:
444 5
      | gax.CallOptions
445 5
      | Callback<
446 5
          protos.google.cloud.gaming.v1.IGameServerCluster,
447 5
          | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest
448 5
          | null
449 5
          | undefined,
450 5
          {} | null | undefined
451 5
        >,
452 5
    callback?: Callback<
453 5
      protos.google.cloud.gaming.v1.IGameServerCluster,
454 5
      | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest
455 5
      | null
456 5
      | undefined,
457 5
      {} | null | undefined
458 5
    >
459 5
  ): Promise<
460 5
    [
461 5
      protos.google.cloud.gaming.v1.IGameServerCluster,
462 5
      protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | undefined,
463 5
      {} | undefined
464 5
    ]
465 5
  > | void {
466 5
    request = request || {};
467 5
    let options: gax.CallOptions;
468 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
469 5
      callback = optionsOrCallback;
470 5
      options = {};
471 5
    } else {
472 5
      options = optionsOrCallback as gax.CallOptions;
473 5
    }
474 5
    options = options || {};
475 5
    options.otherArgs = options.otherArgs || {};
476 5
    options.otherArgs.headers = options.otherArgs.headers || {};
477 5
    options.otherArgs.headers[
478 5
      'x-goog-request-params'
479 5
    ] = gax.routingHeader.fromParams({
480 5
      name: request.name || '',
481 5
    });
482 5
    this.initialize();
483 5
    return this.innerApiCalls.getGameServerCluster(request, options, callback);
484 5
  }
485 5
  previewCreateGameServerCluster(
486 5
    request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest,
487 5
    options?: gax.CallOptions
488 5
  ): Promise<
489 5
    [
490 5
      protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse,
491 5
      (
492 5
        | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
493 5
        | undefined
494 5
      ),
495 5
      {} | undefined
496 5
    ]
497 5
  >;
498 5
  previewCreateGameServerCluster(
499 5
    request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest,
500 5
    options: gax.CallOptions,
501 5
    callback: Callback<
502 5
      protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse,
503 5
      | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
504 5
      | null
505 5
      | undefined,
506 5
      {} | null | undefined
507 5
    >
508 5
  ): void;
509 5
  previewCreateGameServerCluster(
510 5
    request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest,
511 5
    callback: Callback<
512 5
      protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse,
513 5
      | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
514 5
      | null
515 5
      | undefined,
516 5
      {} | null | undefined
517 5
    >
518 5
  ): void;
519 5
  /**
520 5
   * Previews creation of a new game server cluster in a given project and
521 5
   * location.
522 5
   *
523 5
   * @param {Object} request
524 5
   *   The request object that will be sent.
525 5
   * @param {string} request.parent
526 5
   *   Required. The parent resource name. Uses the form:
527 5
   *   `projects/{project}/locations/{location}/realms/{realm}`.
528 5
   * @param {string} request.gameServerClusterId
529 5
   *   Required. The ID of the game server cluster resource to be created.
530 5
   * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster
531 5
   *   Required. The game server cluster resource to be created.
532 5
   * @param {google.protobuf.Timestamp} [request.previewTime]
533 5
   *   Optional. The target timestamp to compute the preview.
534 5
   * @param {object} [options]
535 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
536 5
   * @returns {Promise} - The promise which resolves to an array.
537 5
   *   The first element of the array is an object representing [PreviewCreateGameServerClusterResponse]{@link google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse}.
538 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
539 5
   */
540 5
  previewCreateGameServerCluster(
541 5
    request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest,
542 5
    optionsOrCallback?:
543 5
      | gax.CallOptions
544 5
      | Callback<
545 5
          protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse,
546 5
          | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
547 5
          | null
548 5
          | undefined,
549 5
          {} | null | undefined
550 5
        >,
551 5
    callback?: Callback<
552 5
      protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse,
553 5
      | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
554 5
      | null
555 5
      | undefined,
556 5
      {} | null | undefined
557 5
    >
558 5
  ): Promise<
559 5
    [
560 5
      protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse,
561 5
      (
562 5
        | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest
563 5
        | undefined
564 5
      ),
565 5
      {} | undefined
566 5
    ]
567 5
  > | void {
568 5
    request = request || {};
569 5
    let options: gax.CallOptions;
570 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
571 5
      callback = optionsOrCallback;
572 5
      options = {};
573 5
    } else {
574 5
      options = optionsOrCallback as gax.CallOptions;
575 5
    }
576 5
    options = options || {};
577 5
    options.otherArgs = options.otherArgs || {};
578 5
    options.otherArgs.headers = options.otherArgs.headers || {};
579 5
    options.otherArgs.headers[
580 5
      'x-goog-request-params'
581 5
    ] = gax.routingHeader.fromParams({
582 5
      parent: request.parent || '',
583 5
    });
584 5
    this.initialize();
585 5
    return this.innerApiCalls.previewCreateGameServerCluster(
586 5
      request,
587 5
      options,
588 5
      callback
589 5
    );
590 5
  }
591 5
  previewDeleteGameServerCluster(
592 5
    request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest,
593 5
    options?: gax.CallOptions
594 5
  ): Promise<
595 5
    [
596 5
      protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse,
597 5
      (
598 5
        | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
599 5
        | undefined
600 5
      ),
601 5
      {} | undefined
602 5
    ]
603 5
  >;
604 5
  previewDeleteGameServerCluster(
605 5
    request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest,
606 5
    options: gax.CallOptions,
607 5
    callback: Callback<
608 5
      protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse,
609 5
      | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
610 5
      | null
611 5
      | undefined,
612 5
      {} | null | undefined
613 5
    >
614 5
  ): void;
615 5
  previewDeleteGameServerCluster(
616 5
    request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest,
617 5
    callback: Callback<
618 5
      protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse,
619 5
      | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
620 5
      | null
621 5
      | undefined,
622 5
      {} | null | undefined
623 5
    >
624 5
  ): void;
625 5
  /**
626 5
   * Previews deletion of a single game server cluster.
627 5
   *
628 5
   * @param {Object} request
629 5
   *   The request object that will be sent.
630 5
   * @param {string} request.name
631 5
   *   Required. The name of the game server cluster to delete. Uses the form:
632 5
   *   `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
633 5
   * @param {google.protobuf.Timestamp} [request.previewTime]
634 5
   *   Optional. The target timestamp to compute the preview.
635 5
   * @param {object} [options]
636 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
637 5
   * @returns {Promise} - The promise which resolves to an array.
638 5
   *   The first element of the array is an object representing [PreviewDeleteGameServerClusterResponse]{@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse}.
639 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
640 5
   */
641 5
  previewDeleteGameServerCluster(
642 5
    request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest,
643 5
    optionsOrCallback?:
644 5
      | gax.CallOptions
645 5
      | Callback<
646 5
          protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse,
647 5
          | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
648 5
          | null
649 5
          | undefined,
650 5
          {} | null | undefined
651 5
        >,
652 5
    callback?: Callback<
653 5
      protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse,
654 5
      | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
655 5
      | null
656 5
      | undefined,
657 5
      {} | null | undefined
658 5
    >
659 5
  ): Promise<
660 5
    [
661 5
      protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse,
662 5
      (
663 5
        | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest
664 5
        | undefined
665 5
      ),
666 5
      {} | undefined
667 5
    ]
668 5
  > | void {
669 5
    request = request || {};
670 5
    let options: gax.CallOptions;
671 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
672 5
      callback = optionsOrCallback;
673 5
      options = {};
674 5
    } else {
675 5
      options = optionsOrCallback as gax.CallOptions;
676 5
    }
677 5
    options = options || {};
678 5
    options.otherArgs = options.otherArgs || {};
679 5
    options.otherArgs.headers = options.otherArgs.headers || {};
680 5
    options.otherArgs.headers[
681 5
      'x-goog-request-params'
682 5
    ] = gax.routingHeader.fromParams({
683 5
      name: request.name || '',
684 5
    });
685 5
    this.initialize();
686 5
    return this.innerApiCalls.previewDeleteGameServerCluster(
687 5
      request,
688 5
      options,
689 5
      callback
690 5
    );
691 5
  }
692 5
  previewUpdateGameServerCluster(
693 5
    request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest,
694 5
    options?: gax.CallOptions
695 5
  ): Promise<
696 5
    [
697 5
      protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse,
698 5
      (
699 5
        | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
700 5
        | undefined
701 5
      ),
702 5
      {} | undefined
703 5
    ]
704 5
  >;
705 5
  previewUpdateGameServerCluster(
706 5
    request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest,
707 5
    options: gax.CallOptions,
708 5
    callback: Callback<
709 5
      protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse,
710 5
      | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
711 5
      | null
712 5
      | undefined,
713 5
      {} | null | undefined
714 5
    >
715 5
  ): void;
716 5
  previewUpdateGameServerCluster(
717 5
    request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest,
718 5
    callback: Callback<
719 5
      protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse,
720 5
      | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
721 5
      | null
722 5
      | undefined,
723 5
      {} | null | undefined
724 5
    >
725 5
  ): void;
726 5
  /**
727 5
   * Previews updating a GameServerCluster.
728 5
   *
729 5
   * @param {Object} request
730 5
   *   The request object that will be sent.
731 5
   * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster
732 5
   *   Required. The game server cluster to be updated.
733 5
   *   Only fields specified in update_mask are updated.
734 5
   * @param {google.protobuf.FieldMask} request.updateMask
735 5
   *   Required. Mask of fields to update. At least one path must be supplied in
736 5
   *   this field. For the `FieldMask` definition, see
737 5
   *
738 5
   *   https:
739 5
   *   //developers.google.com/protocol-buffers
740 5
   *   // /docs/reference/google.protobuf#fieldmask
741 5
   * @param {google.protobuf.Timestamp} [request.previewTime]
742 5
   *   Optional. The target timestamp to compute the preview.
743 5
   * @param {object} [options]
744 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
745 5
   * @returns {Promise} - The promise which resolves to an array.
746 5
   *   The first element of the array is an object representing [PreviewUpdateGameServerClusterResponse]{@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse}.
747 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
748 5
   */
749 5
  previewUpdateGameServerCluster(
750 5
    request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest,
751 5
    optionsOrCallback?:
752 5
      | gax.CallOptions
753 5
      | Callback<
754 5
          protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse,
755 5
          | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
756 5
          | null
757 5
          | undefined,
758 5
          {} | null | undefined
759 5
        >,
760 5
    callback?: Callback<
761 5
      protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse,
762 5
      | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
763 5
      | null
764 5
      | undefined,
765 5
      {} | null | undefined
766 5
    >
767 5
  ): Promise<
768 5
    [
769 5
      protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse,
770 5
      (
771 5
        | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest
772 5
        | undefined
773 5
      ),
774 5
      {} | undefined
775 5
    ]
776 5
  > | void {
777 5
    request = request || {};
778 5
    let options: gax.CallOptions;
779 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
780 5
      callback = optionsOrCallback;
781 5
      options = {};
782 5
    } else {
783 5
      options = optionsOrCallback as gax.CallOptions;
784 5
    }
785 5
    options = options || {};
786 5
    options.otherArgs = options.otherArgs || {};
787 5
    options.otherArgs.headers = options.otherArgs.headers || {};
788 5
    options.otherArgs.headers[
789 5
      'x-goog-request-params'
790 5
    ] = gax.routingHeader.fromParams({
791 5
      'game_server_cluster.name': request.gameServerCluster!.name || '',
792 5
    });
793 5
    this.initialize();
794 5
    return this.innerApiCalls.previewUpdateGameServerCluster(
795 5
      request,
796 5
      options,
797 5
      callback
798 5
    );
799 5
  }
800 5

801 5
  createGameServerCluster(
802 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest,
803 5
    options?: gax.CallOptions
804 5
  ): Promise<
805 5
    [
806 5
      LROperation<
807 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
808 5
        protos.google.cloud.gaming.v1.IOperationMetadata
809 5
      >,
810 5
      protos.google.longrunning.IOperation | undefined,
811 5
      {} | undefined
812 5
    ]
813 5
  >;
814 5
  createGameServerCluster(
815 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest,
816 5
    options: gax.CallOptions,
817 5
    callback: Callback<
818 5
      LROperation<
819 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
820 5
        protos.google.cloud.gaming.v1.IOperationMetadata
821 5
      >,
822 5
      protos.google.longrunning.IOperation | null | undefined,
823 5
      {} | null | undefined
824 5
    >
825 5
  ): void;
826 5
  createGameServerCluster(
827 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest,
828 5
    callback: Callback<
829 5
      LROperation<
830 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
831 5
        protos.google.cloud.gaming.v1.IOperationMetadata
832 5
      >,
833 5
      protos.google.longrunning.IOperation | null | undefined,
834 5
      {} | null | undefined
835 5
    >
836 5
  ): void;
837 5
  /**
838 5
   * Creates a new game server cluster in a given project and location.
839 5
   *
840 5
   * @param {Object} request
841 5
   *   The request object that will be sent.
842 5
   * @param {string} request.parent
843 5
   *   Required. The parent resource name. Uses the form:
844 5
   *   `projects/{project}/locations/{location}/realms/{realm-id}`.
845 5
   * @param {string} request.gameServerClusterId
846 5
   *   Required. The ID of the game server cluster resource to be created.
847 5
   * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster
848 5
   *   Required. The game server cluster resource to be created.
849 5
   * @param {object} [options]
850 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
851 5
   * @returns {Promise} - The promise which resolves to an array.
852 5
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
853 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
854 5
   */
855 5
  createGameServerCluster(
856 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest,
857 5
    optionsOrCallback?:
858 5
      | gax.CallOptions
859 5
      | Callback<
860 5
          LROperation<
861 5
            protos.google.cloud.gaming.v1.IGameServerCluster,
862 5
            protos.google.cloud.gaming.v1.IOperationMetadata
863 5
          >,
864 5
          protos.google.longrunning.IOperation | null | undefined,
865 5
          {} | null | undefined
866 5
        >,
867 5
    callback?: Callback<
868 5
      LROperation<
869 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
870 5
        protos.google.cloud.gaming.v1.IOperationMetadata
871 5
      >,
872 5
      protos.google.longrunning.IOperation | null | undefined,
873 5
      {} | null | undefined
874 5
    >
875 5
  ): Promise<
876 5
    [
877 5
      LROperation<
878 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
879 5
        protos.google.cloud.gaming.v1.IOperationMetadata
880 5
      >,
881 5
      protos.google.longrunning.IOperation | undefined,
882 5
      {} | undefined
883 5
    ]
884 5
  > | void {
885 5
    request = request || {};
886 5
    let options: gax.CallOptions;
887 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
888 5
      callback = optionsOrCallback;
889 5
      options = {};
890 5
    } else {
891 5
      options = optionsOrCallback as gax.CallOptions;
892 5
    }
893 5
    options = options || {};
894 5
    options.otherArgs = options.otherArgs || {};
895 5
    options.otherArgs.headers = options.otherArgs.headers || {};
896 5
    options.otherArgs.headers[
897 5
      'x-goog-request-params'
898 5
    ] = gax.routingHeader.fromParams({
899 5
      parent: request.parent || '',
900 5
    });
901 5
    this.initialize();
902 5
    return this.innerApiCalls.createGameServerCluster(
903 5
      request,
904 5
      options,
905 5
      callback
906 5
    );
907 5
  }
908 5
  /**
909 5
   * Check the status of the long running operation returned by the createGameServerCluster() method.
910 5
   * @param {String} name
911 5
   *   The operation name that will be passed.
912 5
   * @returns {Promise} - The promise which resolves to an object.
913 5
   *   The decoded operation object has result and metadata field to get information from.
914 5
   *
915 5
   * @example:
916 5
   *   const decodedOperation = await checkCreateGameServerClusterProgress(name);
917 5
   *   console.log(decodedOperation.result);
918 5
   *   console.log(decodedOperation.done);
919 5
   *   console.log(decodedOperation.metadata);
920 5
   *
921 5
   */
922 5
  async checkCreateGameServerClusterProgress(
923 5
    name: string
924 5
  ): Promise<
925 5
    LROperation<
926 5
      protos.google.cloud.gaming.v1.GameServerCluster,
927 5
      protos.google.cloud.gaming.v1.OperationMetadata
928 5
    >
929 5
  > {
930 5
    const request = new operationsProtos.google.longrunning.GetOperationRequest(
931 5
      {name}
932 5
    );
933 5
    const [operation] = await this.operationsClient.getOperation(request);
934 5
    const decodeOperation = new gax.Operation(
935 5
      operation,
936 5
      this.descriptors.longrunning.createGameServerCluster,
937 5
      gax.createDefaultBackoffSettings()
938 5
    );
939 5
    return decodeOperation as LROperation<
940 5
      protos.google.cloud.gaming.v1.GameServerCluster,
941 5
      protos.google.cloud.gaming.v1.OperationMetadata
942 5
    >;
943 5
  }
944 5
  deleteGameServerCluster(
945 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest,
946 5
    options?: gax.CallOptions
947 5
  ): Promise<
948 5
    [
949 5
      LROperation<
950 5
        protos.google.protobuf.IEmpty,
951 5
        protos.google.cloud.gaming.v1.IOperationMetadata
952 5
      >,
953 5
      protos.google.longrunning.IOperation | undefined,
954 5
      {} | undefined
955 5
    ]
956 5
  >;
957 5
  deleteGameServerCluster(
958 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest,
959 5
    options: gax.CallOptions,
960 5
    callback: Callback<
961 5
      LROperation<
962 5
        protos.google.protobuf.IEmpty,
963 5
        protos.google.cloud.gaming.v1.IOperationMetadata
964 5
      >,
965 5
      protos.google.longrunning.IOperation | null | undefined,
966 5
      {} | null | undefined
967 5
    >
968 5
  ): void;
969 5
  deleteGameServerCluster(
970 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest,
971 5
    callback: Callback<
972 5
      LROperation<
973 5
        protos.google.protobuf.IEmpty,
974 5
        protos.google.cloud.gaming.v1.IOperationMetadata
975 5
      >,
976 5
      protos.google.longrunning.IOperation | null | undefined,
977 5
      {} | null | undefined
978 5
    >
979 5
  ): void;
980 5
  /**
981 5
   * Deletes a single game server cluster.
982 5
   *
983 5
   * @param {Object} request
984 5
   *   The request object that will be sent.
985 5
   * @param {string} request.name
986 5
   *   Required. The name of the game server cluster to delete. Uses the form:
987 5
   *   `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
988 5
   * @param {object} [options]
989 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
990 5
   * @returns {Promise} - The promise which resolves to an array.
991 5
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
992 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
993 5
   */
994 5
  deleteGameServerCluster(
995 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest,
996 5
    optionsOrCallback?:
997 5
      | gax.CallOptions
998 5
      | Callback<
999 5
          LROperation<
1000 5
            protos.google.protobuf.IEmpty,
1001 5
            protos.google.cloud.gaming.v1.IOperationMetadata
1002 5
          >,
1003 5
          protos.google.longrunning.IOperation | null | undefined,
1004 5
          {} | null | undefined
1005 5
        >,
1006 5
    callback?: Callback<
1007 5
      LROperation<
1008 5
        protos.google.protobuf.IEmpty,
1009 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1010 5
      >,
1011 5
      protos.google.longrunning.IOperation | null | undefined,
1012 5
      {} | null | undefined
1013 5
    >
1014 5
  ): Promise<
1015 5
    [
1016 5
      LROperation<
1017 5
        protos.google.protobuf.IEmpty,
1018 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1019 5
      >,
1020 5
      protos.google.longrunning.IOperation | undefined,
1021 5
      {} | undefined
1022 5
    ]
1023 5
  > | void {
1024 5
    request = request || {};
1025 5
    let options: gax.CallOptions;
1026 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
1027 5
      callback = optionsOrCallback;
1028 5
      options = {};
1029 5
    } else {
1030 5
      options = optionsOrCallback as gax.CallOptions;
1031 5
    }
1032 5
    options = options || {};
1033 5
    options.otherArgs = options.otherArgs || {};
1034 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1035 5
    options.otherArgs.headers[
1036 5
      'x-goog-request-params'
1037 5
    ] = gax.routingHeader.fromParams({
1038 5
      name: request.name || '',
1039 5
    });
1040 5
    this.initialize();
1041 5
    return this.innerApiCalls.deleteGameServerCluster(
1042 5
      request,
1043 5
      options,
1044 5
      callback
1045 5
    );
1046 5
  }
1047 5
  /**
1048 5
   * Check the status of the long running operation returned by the deleteGameServerCluster() method.
1049 5
   * @param {String} name
1050 5
   *   The operation name that will be passed.
1051 5
   * @returns {Promise} - The promise which resolves to an object.
1052 5
   *   The decoded operation object has result and metadata field to get information from.
1053 5
   *
1054 5
   * @example:
1055 5
   *   const decodedOperation = await checkDeleteGameServerClusterProgress(name);
1056 5
   *   console.log(decodedOperation.result);
1057 5
   *   console.log(decodedOperation.done);
1058 5
   *   console.log(decodedOperation.metadata);
1059 5
   *
1060 5
   */
1061 5
  async checkDeleteGameServerClusterProgress(
1062 5
    name: string
1063 5
  ): Promise<
1064 5
    LROperation<
1065 5
      protos.google.protobuf.Empty,
1066 5
      protos.google.cloud.gaming.v1.OperationMetadata
1067 5
    >
1068 5
  > {
1069 5
    const request = new operationsProtos.google.longrunning.GetOperationRequest(
1070 5
      {name}
1071 5
    );
1072 5
    const [operation] = await this.operationsClient.getOperation(request);
1073 5
    const decodeOperation = new gax.Operation(
1074 5
      operation,
1075 5
      this.descriptors.longrunning.deleteGameServerCluster,
1076 5
      gax.createDefaultBackoffSettings()
1077 5
    );
1078 5
    return decodeOperation as LROperation<
1079 5
      protos.google.protobuf.Empty,
1080 5
      protos.google.cloud.gaming.v1.OperationMetadata
1081 5
    >;
1082 5
  }
1083 5
  updateGameServerCluster(
1084 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest,
1085 5
    options?: gax.CallOptions
1086 5
  ): Promise<
1087 5
    [
1088 5
      LROperation<
1089 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
1090 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1091 5
      >,
1092 5
      protos.google.longrunning.IOperation | undefined,
1093 5
      {} | undefined
1094 5
    ]
1095 5
  >;
1096 5
  updateGameServerCluster(
1097 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest,
1098 5
    options: gax.CallOptions,
1099 5
    callback: Callback<
1100 5
      LROperation<
1101 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
1102 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1103 5
      >,
1104 5
      protos.google.longrunning.IOperation | null | undefined,
1105 5
      {} | null | undefined
1106 5
    >
1107 5
  ): void;
1108 5
  updateGameServerCluster(
1109 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest,
1110 5
    callback: Callback<
1111 5
      LROperation<
1112 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
1113 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1114 5
      >,
1115 5
      protos.google.longrunning.IOperation | null | undefined,
1116 5
      {} | null | undefined
1117 5
    >
1118 5
  ): void;
1119 5
  /**
1120 5
   * Patches a single game server cluster.
1121 5
   *
1122 5
   * @param {Object} request
1123 5
   *   The request object that will be sent.
1124 5
   * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster
1125 5
   *   Required. The game server cluster to be updated.
1126 5
   *   Only fields specified in update_mask are updated.
1127 5
   * @param {google.protobuf.FieldMask} request.updateMask
1128 5
   *   Required. Mask of fields to update. At least one path must be supplied in
1129 5
   *   this field. For the `FieldMask` definition, see
1130 5
   *
1131 5
   *   https:
1132 5
   *   //developers.google.com/protocol-buffers
1133 5
   *   // /docs/reference/google.protobuf#fieldmask
1134 5
   * @param {object} [options]
1135 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1136 5
   * @returns {Promise} - The promise which resolves to an array.
1137 5
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1138 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1139 5
   */
1140 5
  updateGameServerCluster(
1141 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest,
1142 5
    optionsOrCallback?:
1143 5
      | gax.CallOptions
1144 5
      | Callback<
1145 5
          LROperation<
1146 5
            protos.google.cloud.gaming.v1.IGameServerCluster,
1147 5
            protos.google.cloud.gaming.v1.IOperationMetadata
1148 5
          >,
1149 5
          protos.google.longrunning.IOperation | null | undefined,
1150 5
          {} | null | undefined
1151 5
        >,
1152 5
    callback?: Callback<
1153 5
      LROperation<
1154 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
1155 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1156 5
      >,
1157 5
      protos.google.longrunning.IOperation | null | undefined,
1158 5
      {} | null | undefined
1159 5
    >
1160 5
  ): Promise<
1161 5
    [
1162 5
      LROperation<
1163 5
        protos.google.cloud.gaming.v1.IGameServerCluster,
1164 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1165 5
      >,
1166 5
      protos.google.longrunning.IOperation | undefined,
1167 5
      {} | undefined
1168 5
    ]
1169 5
  > | void {
1170 5
    request = request || {};
1171 5
    let options: gax.CallOptions;
1172 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
1173 5
      callback = optionsOrCallback;
1174 5
      options = {};
1175 5
    } else {
1176 5
      options = optionsOrCallback as gax.CallOptions;
1177 5
    }
1178 5
    options = options || {};
1179 5
    options.otherArgs = options.otherArgs || {};
1180 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1181 5
    options.otherArgs.headers[
1182 5
      'x-goog-request-params'
1183 5
    ] = gax.routingHeader.fromParams({
1184 5
      'game_server_cluster.name': request.gameServerCluster!.name || '',
1185 5
    });
1186 5
    this.initialize();
1187 5
    return this.innerApiCalls.updateGameServerCluster(
1188 5
      request,
1189 5
      options,
1190 5
      callback
1191 5
    );
1192 5
  }
1193 5
  /**
1194 5
   * Check the status of the long running operation returned by the updateGameServerCluster() method.
1195 5
   * @param {String} name
1196 5
   *   The operation name that will be passed.
1197 5
   * @returns {Promise} - The promise which resolves to an object.
1198 5
   *   The decoded operation object has result and metadata field to get information from.
1199 5
   *
1200 5
   * @example:
1201 5
   *   const decodedOperation = await checkUpdateGameServerClusterProgress(name);
1202 5
   *   console.log(decodedOperation.result);
1203 5
   *   console.log(decodedOperation.done);
1204 5
   *   console.log(decodedOperation.metadata);
1205 5
   *
1206 5
   */
1207 5
  async checkUpdateGameServerClusterProgress(
1208 5
    name: string
1209 5
  ): Promise<
1210 5
    LROperation<
1211 5
      protos.google.cloud.gaming.v1.GameServerCluster,
1212 5
      protos.google.cloud.gaming.v1.OperationMetadata
1213 5
    >
1214 5
  > {
1215 5
    const request = new operationsProtos.google.longrunning.GetOperationRequest(
1216 5
      {name}
1217 5
    );
1218 5
    const [operation] = await this.operationsClient.getOperation(request);
1219 5
    const decodeOperation = new gax.Operation(
1220 5
      operation,
1221 5
      this.descriptors.longrunning.updateGameServerCluster,
1222 5
      gax.createDefaultBackoffSettings()
1223 5
    );
1224 5
    return decodeOperation as LROperation<
1225 5
      protos.google.cloud.gaming.v1.GameServerCluster,
1226 5
      protos.google.cloud.gaming.v1.OperationMetadata
1227 5
    >;
1228 5
  }
1229 5
  listGameServerClusters(
1230 5
    request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1231 5
    options?: gax.CallOptions
1232 5
  ): Promise<
1233 5
    [
1234 5
      protos.google.cloud.gaming.v1.IGameServerCluster[],
1235 5
      protos.google.cloud.gaming.v1.IListGameServerClustersRequest | null,
1236 5
      protos.google.cloud.gaming.v1.IListGameServerClustersResponse
1237 5
    ]
1238 5
  >;
1239 5
  listGameServerClusters(
1240 5
    request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1241 5
    options: gax.CallOptions,
1242 5
    callback: PaginationCallback<
1243 5
      protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1244 5
      | protos.google.cloud.gaming.v1.IListGameServerClustersResponse
1245 5
      | null
1246 5
      | undefined,
1247 5
      protos.google.cloud.gaming.v1.IGameServerCluster
1248 5
    >
1249 5
  ): void;
1250 5
  listGameServerClusters(
1251 5
    request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1252 5
    callback: PaginationCallback<
1253 5
      protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1254 5
      | protos.google.cloud.gaming.v1.IListGameServerClustersResponse
1255 5
      | null
1256 5
      | undefined,
1257 5
      protos.google.cloud.gaming.v1.IGameServerCluster
1258 5
    >
1259 5
  ): void;
1260 5
  /**
1261 5
   * Lists game server clusters in a given project and location.
1262 5
   *
1263 5
   * @param {Object} request
1264 5
   *   The request object that will be sent.
1265 5
   * @param {string} request.parent
1266 5
   *   Required. The parent resource name. Uses the form:
1267 5
   *   "projects/{project}/locations/{location}/realms/{realm}".
1268 5
   * @param {number} [request.pageSize]
1269 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1270 5
   *   will pick an appropriate default. The server may return fewer items than
1271 5
   *   requested. A caller should only rely on response's
1272 5
   *   {@link google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token|next_page_token} to
1273 5
   *   determine if there are more GameServerClusters left to be queried.
1274 5
   * @param {string} [request.pageToken]
1275 5
   *   Optional. The next_page_token value returned from a previous List request, if any.
1276 5
   * @param {string} [request.filter]
1277 5
   *   Optional. The filter to apply to list results.
1278 5
   * @param {string} [request.orderBy]
1279 5
   *   Optional. Specifies the ordering of results following syntax at
1280 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1281 5
   * @param {object} [options]
1282 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1283 5
   * @returns {Promise} - The promise which resolves to an array.
1284 5
   *   The first element of the array is Array of [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster}.
1285 5
   *   The client library support auto-pagination by default: it will call the API as many
1286 5
   *   times as needed and will merge results from all the pages into this array.
1287 5
   *
1288 5
   *   When autoPaginate: false is specified through options, the array has three elements.
1289 5
   *   The first element is Array of [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster} that corresponds to
1290 5
   *   the one page received from the API server.
1291 5
   *   If the second element is not null it contains the request object of type [ListGameServerClustersRequest]{@link google.cloud.gaming.v1.ListGameServerClustersRequest}
1292 5
   *   that can be used to obtain the next page of the results.
1293 5
   *   If it is null, the next page does not exist.
1294 5
   *   The third element contains the raw response received from the API server. Its type is
1295 5
   *   [ListGameServerClustersResponse]{@link google.cloud.gaming.v1.ListGameServerClustersResponse}.
1296 5
   *
1297 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1298 5
   */
1299 5
  listGameServerClusters(
1300 5
    request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1301 5
    optionsOrCallback?:
1302 5
      | gax.CallOptions
1303 5
      | PaginationCallback<
1304 5
          protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1305 5
          | protos.google.cloud.gaming.v1.IListGameServerClustersResponse
1306 5
          | null
1307 5
          | undefined,
1308 5
          protos.google.cloud.gaming.v1.IGameServerCluster
1309 5
        >,
1310 5
    callback?: PaginationCallback<
1311 5
      protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1312 5
      | protos.google.cloud.gaming.v1.IListGameServerClustersResponse
1313 5
      | null
1314 5
      | undefined,
1315 5
      protos.google.cloud.gaming.v1.IGameServerCluster
1316 5
    >
1317 5
  ): Promise<
1318 5
    [
1319 5
      protos.google.cloud.gaming.v1.IGameServerCluster[],
1320 5
      protos.google.cloud.gaming.v1.IListGameServerClustersRequest | null,
1321 5
      protos.google.cloud.gaming.v1.IListGameServerClustersResponse
1322 5
    ]
1323 5
  > | void {
1324 5
    request = request || {};
1325 5
    let options: gax.CallOptions;
1326 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
1327 5
      callback = optionsOrCallback;
1328 5
      options = {};
1329 5
    } else {
1330 5
      options = optionsOrCallback as gax.CallOptions;
1331 5
    }
1332 5
    options = options || {};
1333 5
    options.otherArgs = options.otherArgs || {};
1334 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1335 5
    options.otherArgs.headers[
1336 5
      'x-goog-request-params'
1337 5
    ] = gax.routingHeader.fromParams({
1338 5
      parent: request.parent || '',
1339 5
    });
1340 5
    this.initialize();
1341 5
    return this.innerApiCalls.listGameServerClusters(
1342 5
      request,
1343 5
      options,
1344 5
      callback
1345 5
    );
1346 5
  }
1347 5

1348 5
  /**
1349 5
   * Equivalent to {@link listGameServerClusters}, but returns a NodeJS Stream object.
1350 5
   *
1351 5
   * This fetches the paged responses for {@link listGameServerClusters} continuously
1352 5
   * and invokes the callback registered for 'data' event for each element in the
1353 5
   * responses.
1354 5
   *
1355 5
   * The returned object has 'end' method when no more elements are required.
1356 5
   *
1357 5
   * autoPaginate option will be ignored.
1358 5
   *
1359 5
   * @see {@link https://nodejs.org/api/stream.html}
1360 5
   *
1361 5
   * @param {Object} request
1362 5
   *   The request object that will be sent.
1363 5
   * @param {string} request.parent
1364 5
   *   Required. The parent resource name. Uses the form:
1365 5
   *   "projects/{project}/locations/{location}/realms/{realm}".
1366 5
   * @param {number} [request.pageSize]
1367 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1368 5
   *   will pick an appropriate default. The server may return fewer items than
1369 5
   *   requested. A caller should only rely on response's
1370 5
   *   {@link google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token|next_page_token} to
1371 5
   *   determine if there are more GameServerClusters left to be queried.
1372 5
   * @param {string} [request.pageToken]
1373 5
   *   Optional. The next_page_token value returned from a previous List request, if any.
1374 5
   * @param {string} [request.filter]
1375 5
   *   Optional. The filter to apply to list results.
1376 5
   * @param {string} [request.orderBy]
1377 5
   *   Optional. Specifies the ordering of results following syntax at
1378 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1379 5
   * @param {object} [options]
1380 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1381 5
   * @returns {Stream}
1382 5
   *   An object stream which emits an object representing [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster} on 'data' event.
1383 5
   */
1384 5
  listGameServerClustersStream(
1385 5
    request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1386 5
    options?: gax.CallOptions
1387 5
  ): Transform {
1388 5
    request = request || {};
1389 5
    options = options || {};
1390 5
    options.otherArgs = options.otherArgs || {};
1391 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1392 5
    options.otherArgs.headers[
1393 5
      'x-goog-request-params'
1394 5
    ] = gax.routingHeader.fromParams({
1395 5
      parent: request.parent || '',
1396 5
    });
1397 5
    const callSettings = new gax.CallSettings(options);
1398 5
    this.initialize();
1399 5
    return this.descriptors.page.listGameServerClusters.createStream(
1400 5
      this.innerApiCalls.listGameServerClusters as gax.GaxCall,
1401 5
      request,
1402 5
      callSettings
1403 5
    );
1404 5
  }
1405 5

1406 5
  /**
1407 5
   * Equivalent to {@link listGameServerClusters}, but returns an iterable object.
1408 5
   *
1409 5
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
1410 5
   *
1411 5
   * @param {Object} request
1412 5
   *   The request object that will be sent.
1413 5
   * @param {string} request.parent
1414 5
   *   Required. The parent resource name. Uses the form:
1415 5
   *   "projects/{project}/locations/{location}/realms/{realm}".
1416 5
   * @param {number} [request.pageSize]
1417 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1418 5
   *   will pick an appropriate default. The server may return fewer items than
1419 5
   *   requested. A caller should only rely on response's
1420 5
   *   {@link google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token|next_page_token} to
1421 5
   *   determine if there are more GameServerClusters left to be queried.
1422 5
   * @param {string} [request.pageToken]
1423 5
   *   Optional. The next_page_token value returned from a previous List request, if any.
1424 5
   * @param {string} [request.filter]
1425 5
   *   Optional. The filter to apply to list results.
1426 5
   * @param {string} [request.orderBy]
1427 5
   *   Optional. Specifies the ordering of results following syntax at
1428 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1429 5
   * @param {object} [options]
1430 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1431 5
   * @returns {Object}
1432 5
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
1433 5
   */
1434 5
  listGameServerClustersAsync(
1435 5
    request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest,
1436 5
    options?: gax.CallOptions
1437 5
  ): AsyncIterable<protos.google.cloud.gaming.v1.IGameServerCluster> {
1438 5
    request = request || {};
1439 5
    options = options || {};
1440 5
    options.otherArgs = options.otherArgs || {};
1441 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1442 5
    options.otherArgs.headers[
1443 5
      'x-goog-request-params'
1444 5
    ] = gax.routingHeader.fromParams({
1445 5
      parent: request.parent || '',
1446 5
    });
1447 5
    options = options || {};
1448 5
    const callSettings = new gax.CallSettings(options);
1449 5
    this.initialize();
1450 5
    return this.descriptors.page.listGameServerClusters.asyncIterate(
1451 5
      this.innerApiCalls['listGameServerClusters'] as GaxCall,
1452 5
      (request as unknown) as RequestType,
1453 5
      callSettings
1454 5
    ) as AsyncIterable<protos.google.cloud.gaming.v1.IGameServerCluster>;
1455 5
  }
1456 5
  // --------------------
1457 5
  // -- Path templates --
1458 5
  // --------------------
1459 5

1460 5
  /**
1461 5
   * Return a fully-qualified gameServerCluster resource name string.
1462 5
   *
1463 5
   * @param {string} project
1464 5
   * @param {string} location
1465 5
   * @param {string} realm
1466 5
   * @param {string} cluster
1467 5
   * @returns {string} Resource name string.
1468 5
   */
1469 5
  gameServerClusterPath(
1470 5
    project: string,
1471 5
    location: string,
1472 5
    realm: string,
1473 5
    cluster: string
1474 5
  ) {
1475 5
    return this.pathTemplates.gameServerClusterPathTemplate.render({
1476 5
      project: project,
1477 5
      location: location,
1478 5
      realm: realm,
1479 5
      cluster: cluster,
1480 5
    });
1481 5
  }
1482 5

1483 5
  /**
1484 5
   * Parse the project from GameServerCluster resource.
1485 5
   *
1486 5
   * @param {string} gameServerClusterName
1487 5
   *   A fully-qualified path representing GameServerCluster resource.
1488 5
   * @returns {string} A string representing the project.
1489 5
   */
1490 5
  matchProjectFromGameServerClusterName(gameServerClusterName: string) {
1491 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1492 5
      gameServerClusterName
1493 5
    ).project;
1494 5
  }
1495 5

1496 5
  /**
1497 5
   * Parse the location from GameServerCluster resource.
1498 5
   *
1499 5
   * @param {string} gameServerClusterName
1500 5
   *   A fully-qualified path representing GameServerCluster resource.
1501 5
   * @returns {string} A string representing the location.
1502 5
   */
1503 5
  matchLocationFromGameServerClusterName(gameServerClusterName: string) {
1504 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1505 5
      gameServerClusterName
1506 5
    ).location;
1507 5
  }
1508 5

1509 5
  /**
1510 5
   * Parse the realm from GameServerCluster resource.
1511 5
   *
1512 5
   * @param {string} gameServerClusterName
1513 5
   *   A fully-qualified path representing GameServerCluster resource.
1514 5
   * @returns {string} A string representing the realm.
1515 5
   */
1516 5
  matchRealmFromGameServerClusterName(gameServerClusterName: string) {
1517 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1518 5
      gameServerClusterName
1519 5
    ).realm;
1520 5
  }
1521 5

1522 5
  /**
1523 5
   * Parse the cluster from GameServerCluster resource.
1524 5
   *
1525 5
   * @param {string} gameServerClusterName
1526 5
   *   A fully-qualified path representing GameServerCluster resource.
1527 5
   * @returns {string} A string representing the cluster.
1528 5
   */
1529 5
  matchClusterFromGameServerClusterName(gameServerClusterName: string) {
1530 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1531 5
      gameServerClusterName
1532 5
    ).cluster;
1533 5
  }
1534 5

1535 5
  /**
1536 5
   * Return a fully-qualified gameServerConfig resource name string.
1537 5
   *
1538 5
   * @param {string} project
1539 5
   * @param {string} location
1540 5
   * @param {string} deployment
1541 5
   * @param {string} config
1542 5
   * @returns {string} Resource name string.
1543 5
   */
1544 5
  gameServerConfigPath(
1545 5
    project: string,
1546 5
    location: string,
1547 5
    deployment: string,
1548 5
    config: string
1549 5
  ) {
1550 5
    return this.pathTemplates.gameServerConfigPathTemplate.render({
1551 5
      project: project,
1552 5
      location: location,
1553 5
      deployment: deployment,
1554 5
      config: config,
1555 5
    });
1556 5
  }
1557 5

1558 5
  /**
1559 5
   * Parse the project from GameServerConfig resource.
1560 5
   *
1561 5
   * @param {string} gameServerConfigName
1562 5
   *   A fully-qualified path representing GameServerConfig resource.
1563 5
   * @returns {string} A string representing the project.
1564 5
   */
1565 5
  matchProjectFromGameServerConfigName(gameServerConfigName: string) {
1566 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1567 5
      gameServerConfigName
1568 5
    ).project;
1569 5
  }
1570 5

1571 5
  /**
1572 5
   * Parse the location from GameServerConfig resource.
1573 5
   *
1574 5
   * @param {string} gameServerConfigName
1575 5
   *   A fully-qualified path representing GameServerConfig resource.
1576 5
   * @returns {string} A string representing the location.
1577 5
   */
1578 5
  matchLocationFromGameServerConfigName(gameServerConfigName: string) {
1579 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1580 5
      gameServerConfigName
1581 5
    ).location;
1582 5
  }
1583 5

1584 5
  /**
1585 5
   * Parse the deployment from GameServerConfig resource.
1586 5
   *
1587 5
   * @param {string} gameServerConfigName
1588 5
   *   A fully-qualified path representing GameServerConfig resource.
1589 5
   * @returns {string} A string representing the deployment.
1590 5
   */
1591 5
  matchDeploymentFromGameServerConfigName(gameServerConfigName: string) {
1592 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1593 5
      gameServerConfigName
1594 5
    ).deployment;
1595 5
  }
1596 5

1597 5
  /**
1598 5
   * Parse the config from GameServerConfig resource.
1599 5
   *
1600 5
   * @param {string} gameServerConfigName
1601 5
   *   A fully-qualified path representing GameServerConfig resource.
1602 5
   * @returns {string} A string representing the config.
1603 5
   */
1604 5
  matchConfigFromGameServerConfigName(gameServerConfigName: string) {
1605 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1606 5
      gameServerConfigName
1607 5
    ).config;
1608 5
  }
1609 5

1610 5
  /**
1611 5
   * Return a fully-qualified gameServerDeployment resource name string.
1612 5
   *
1613 5
   * @param {string} project
1614 5
   * @param {string} location
1615 5
   * @param {string} deployment
1616 5
   * @returns {string} Resource name string.
1617 5
   */
1618 5
  gameServerDeploymentPath(
1619 5
    project: string,
1620 5
    location: string,
1621 5
    deployment: string
1622 5
  ) {
1623 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.render({
1624 5
      project: project,
1625 5
      location: location,
1626 5
      deployment: deployment,
1627 5
    });
1628 5
  }
1629 5

1630 5
  /**
1631 5
   * Parse the project from GameServerDeployment resource.
1632 5
   *
1633 5
   * @param {string} gameServerDeploymentName
1634 5
   *   A fully-qualified path representing GameServerDeployment resource.
1635 5
   * @returns {string} A string representing the project.
1636 5
   */
1637 5
  matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) {
1638 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1639 5
      gameServerDeploymentName
1640 5
    ).project;
1641 5
  }
1642 5

1643 5
  /**
1644 5
   * Parse the location from GameServerDeployment resource.
1645 5
   *
1646 5
   * @param {string} gameServerDeploymentName
1647 5
   *   A fully-qualified path representing GameServerDeployment resource.
1648 5
   * @returns {string} A string representing the location.
1649 5
   */
1650 5
  matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) {
1651 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1652 5
      gameServerDeploymentName
1653 5
    ).location;
1654 5
  }
1655 5

1656 5
  /**
1657 5
   * Parse the deployment from GameServerDeployment resource.
1658 5
   *
1659 5
   * @param {string} gameServerDeploymentName
1660 5
   *   A fully-qualified path representing GameServerDeployment resource.
1661 5
   * @returns {string} A string representing the deployment.
1662 5
   */
1663 5
  matchDeploymentFromGameServerDeploymentName(
1664 5
    gameServerDeploymentName: string
1665 5
  ) {
1666 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1667 5
      gameServerDeploymentName
1668 5
    ).deployment;
1669 5
  }
1670 5

1671 5
  /**
1672 5
   * Return a fully-qualified gameServerDeploymentRollout resource name string.
1673 5
   *
1674 5
   * @param {string} project
1675 5
   * @param {string} location
1676 5
   * @param {string} deployment
1677 5
   * @returns {string} Resource name string.
1678 5
   */
1679 5
  gameServerDeploymentRolloutPath(
1680 5
    project: string,
1681 5
    location: string,
1682 5
    deployment: string
1683 5
  ) {
1684 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({
1685 5
      project: project,
1686 5
      location: location,
1687 5
      deployment: deployment,
1688 5
    });
1689 5
  }
1690 5

1691 5
  /**
1692 5
   * Parse the project from GameServerDeploymentRollout resource.
1693 5
   *
1694 5
   * @param {string} gameServerDeploymentRolloutName
1695 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1696 5
   * @returns {string} A string representing the project.
1697 5
   */
1698 5
  matchProjectFromGameServerDeploymentRolloutName(
1699 5
    gameServerDeploymentRolloutName: string
1700 5
  ) {
1701 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1702 5
      gameServerDeploymentRolloutName
1703 5
    ).project;
1704 5
  }
1705 5

1706 5
  /**
1707 5
   * Parse the location from GameServerDeploymentRollout resource.
1708 5
   *
1709 5
   * @param {string} gameServerDeploymentRolloutName
1710 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1711 5
   * @returns {string} A string representing the location.
1712 5
   */
1713 5
  matchLocationFromGameServerDeploymentRolloutName(
1714 5
    gameServerDeploymentRolloutName: string
1715 5
  ) {
1716 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1717 5
      gameServerDeploymentRolloutName
1718 5
    ).location;
1719 5
  }
1720 5

1721 5
  /**
1722 5
   * Parse the deployment from GameServerDeploymentRollout resource.
1723 5
   *
1724 5
   * @param {string} gameServerDeploymentRolloutName
1725 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1726 5
   * @returns {string} A string representing the deployment.
1727 5
   */
1728 5
  matchDeploymentFromGameServerDeploymentRolloutName(
1729 5
    gameServerDeploymentRolloutName: string
1730 5
  ) {
1731 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1732 5
      gameServerDeploymentRolloutName
1733 5
    ).deployment;
1734 5
  }
1735 5

1736 5
  /**
1737 5
   * Return a fully-qualified realm resource name string.
1738 5
   *
1739 5
   * @param {string} project
1740 5
   * @param {string} location
1741 5
   * @param {string} realm
1742 5
   * @returns {string} Resource name string.
1743 5
   */
1744 5
  realmPath(project: string, location: string, realm: string) {
1745 5
    return this.pathTemplates.realmPathTemplate.render({
1746 5
      project: project,
1747 5
      location: location,
1748 5
      realm: realm,
1749 5
    });
1750 5
  }
1751 5

1752 5
  /**
1753 5
   * Parse the project from Realm resource.
1754 5
   *
1755 5
   * @param {string} realmName
1756 5
   *   A fully-qualified path representing Realm resource.
1757 5
   * @returns {string} A string representing the project.
1758 5
   */
1759 5
  matchProjectFromRealmName(realmName: string) {
1760 5
    return this.pathTemplates.realmPathTemplate.match(realmName).project;
1761 5
  }
1762 5

1763 5
  /**
1764 5
   * Parse the location from Realm resource.
1765 5
   *
1766 5
   * @param {string} realmName
1767 5
   *   A fully-qualified path representing Realm resource.
1768 5
   * @returns {string} A string representing the location.
1769 5
   */
1770 5
  matchLocationFromRealmName(realmName: string) {
1771 5
    return this.pathTemplates.realmPathTemplate.match(realmName).location;
1772 5
  }
1773 5

1774 5
  /**
1775 5
   * Parse the realm from Realm resource.
1776 5
   *
1777 5
   * @param {string} realmName
1778 5
   *   A fully-qualified path representing Realm resource.
1779 5
   * @returns {string} A string representing the realm.
1780 5
   */
1781 5
  matchRealmFromRealmName(realmName: string) {
1782 5
    return this.pathTemplates.realmPathTemplate.match(realmName).realm;
1783 5
  }
1784 5

1785 5
  /**
1786 5
   * Terminate the GRPC channel and close the client.
1787 5
   *
1788 5
   * The client will no longer be usable and all future behavior is undefined.
1789 5
   */
1790 5
  close(): Promise<void> {
1791 5
    this.initialize();
1792 5
    if (!this._terminated) {
1793 5
      return this.gameServerClustersServiceStub!.then(stub => {
1794 5
        this._terminated = true;
1795 5
        stub.close();
1796 5
      });
1797 5
    }
1798 5
    return Promise.resolve();
1799 0
  }
1800 5
}

Read our documentation on viewing source code .

Loading