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_deployments_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 deployment is used to control the deployment of Agones
40 5
 *  fleets.
41 5
 * @class
42 5
 * @memberof v1
43 5
 */
44 5
export class GameServerDeploymentsServiceClient {
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
  gameServerDeploymentsServiceStub?: Promise<{[name: string]: Function}>;
62 5

63 5
  /**
64 5
   * Construct an instance of GameServerDeploymentsServiceClient.
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 GameServerDeploymentsServiceClient;
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 GameServerDeploymentsServiceClient 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 GameServerDeploymentsServiceClient).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
      listGameServerDeployments: new this._gaxModule.PageDescriptor(
190 5
        'pageToken',
191 5
        'nextPageToken',
192 5
        'gameServerDeployments'
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 createGameServerDeploymentResponse = protoFilesRoot.lookup(
213 5
      '.google.cloud.gaming.v1.GameServerDeployment'
214 5
    ) as gax.protobuf.Type;
215 5
    const createGameServerDeploymentMetadata = protoFilesRoot.lookup(
216 5
      '.google.cloud.gaming.v1.OperationMetadata'
217 5
    ) as gax.protobuf.Type;
218 5
    const deleteGameServerDeploymentResponse = protoFilesRoot.lookup(
219 5
      '.google.protobuf.Empty'
220 5
    ) as gax.protobuf.Type;
221 5
    const deleteGameServerDeploymentMetadata = protoFilesRoot.lookup(
222 5
      '.google.cloud.gaming.v1.OperationMetadata'
223 5
    ) as gax.protobuf.Type;
224 5
    const updateGameServerDeploymentResponse = protoFilesRoot.lookup(
225 5
      '.google.cloud.gaming.v1.GameServerDeployment'
226 5
    ) as gax.protobuf.Type;
227 5
    const updateGameServerDeploymentMetadata = protoFilesRoot.lookup(
228 5
      '.google.cloud.gaming.v1.OperationMetadata'
229 5
    ) as gax.protobuf.Type;
230 5
    const updateGameServerDeploymentRolloutResponse = protoFilesRoot.lookup(
231 5
      '.google.cloud.gaming.v1.GameServerDeployment'
232 5
    ) as gax.protobuf.Type;
233 5
    const updateGameServerDeploymentRolloutMetadata = protoFilesRoot.lookup(
234 5
      '.google.cloud.gaming.v1.OperationMetadata'
235 5
    ) as gax.protobuf.Type;
236 5

237 5
    this.descriptors.longrunning = {
238 5
      createGameServerDeployment: new this._gaxModule.LongrunningDescriptor(
239 5
        this.operationsClient,
240 5
        createGameServerDeploymentResponse.decode.bind(
241 5
          createGameServerDeploymentResponse
242 5
        ),
243 5
        createGameServerDeploymentMetadata.decode.bind(
244 5
          createGameServerDeploymentMetadata
245 5
        )
246 5
      ),
247 5
      deleteGameServerDeployment: new this._gaxModule.LongrunningDescriptor(
248 5
        this.operationsClient,
249 5
        deleteGameServerDeploymentResponse.decode.bind(
250 5
          deleteGameServerDeploymentResponse
251 5
        ),
252 5
        deleteGameServerDeploymentMetadata.decode.bind(
253 5
          deleteGameServerDeploymentMetadata
254 5
        )
255 5
      ),
256 5
      updateGameServerDeployment: new this._gaxModule.LongrunningDescriptor(
257 5
        this.operationsClient,
258 5
        updateGameServerDeploymentResponse.decode.bind(
259 5
          updateGameServerDeploymentResponse
260 5
        ),
261 5
        updateGameServerDeploymentMetadata.decode.bind(
262 5
          updateGameServerDeploymentMetadata
263 5
        )
264 5
      ),
265 5
      updateGameServerDeploymentRollout: new this._gaxModule.LongrunningDescriptor(
266 5
        this.operationsClient,
267 5
        updateGameServerDeploymentRolloutResponse.decode.bind(
268 5
          updateGameServerDeploymentRolloutResponse
269 5
        ),
270 5
        updateGameServerDeploymentRolloutMetadata.decode.bind(
271 5
          updateGameServerDeploymentRolloutMetadata
272 5
        )
273 5
      ),
274 5
    };
275 5

276 5
    // Put together the default options sent with requests.
277 5
    this._defaults = this._gaxGrpc.constructSettings(
278 5
      'google.cloud.gaming.v1.GameServerDeploymentsService',
279 5
      gapicConfig as gax.ClientConfig,
280 5
      opts.clientConfig || {},
281 5
      {'x-goog-api-client': clientHeader.join(' ')}
282 5
    );
283 5

284 5
    // Set up a dictionary of "inner API calls"; the core implementation
285 5
    // of calling the API is handled in `google-gax`, with this code
286 5
    // merely providing the destination and request information.
287 5
    this.innerApiCalls = {};
288 5
  }
289 5

290 5
  /**
291 5
   * Initialize the client.
292 5
   * Performs asynchronous operations (such as authentication) and prepares the client.
293 5
   * This function will be called automatically when any class method is called for the
294 5
   * first time, but if you need to initialize it before calling an actual method,
295 5
   * feel free to call initialize() directly.
296 5
   *
297 5
   * You can await on this method if you want to make sure the client is initialized.
298 5
   *
299 5
   * @returns {Promise} A promise that resolves to an authenticated service stub.
300 5
   */
301 5
  initialize() {
302 5
    // If the client stub promise is already initialized, return immediately.
303 5
    if (this.gameServerDeploymentsServiceStub) {
304 5
      return this.gameServerDeploymentsServiceStub;
305 5
    }
306 5

307 5
    // Put together the "service stub" for
308 5
    // google.cloud.gaming.v1.GameServerDeploymentsService.
309 5
    this.gameServerDeploymentsServiceStub = this._gaxGrpc.createStub(
310 5
      this._opts.fallback
311 5
        ? (this._protos as protobuf.Root).lookupService(
312 0
            'google.cloud.gaming.v1.GameServerDeploymentsService'
313 5
          )
314 5
        : // eslint-disable-next-line @typescript-eslint/no-explicit-any
315 5
          (this._protos as any).google.cloud.gaming.v1
316 5
            .GameServerDeploymentsService,
317 5
      this._opts
318 5
    ) as Promise<{[method: string]: Function}>;
319 5

320 5
    // Iterate over each of the methods that the service provides
321 5
    // and create an API call method for each.
322 5
    const gameServerDeploymentsServiceStubMethods = [
323 5
      'listGameServerDeployments',
324 5
      'getGameServerDeployment',
325 5
      'createGameServerDeployment',
326 5
      'deleteGameServerDeployment',
327 5
      'updateGameServerDeployment',
328 5
      'getGameServerDeploymentRollout',
329 5
      'updateGameServerDeploymentRollout',
330 5
      'previewGameServerDeploymentRollout',
331 5
      'fetchDeploymentState',
332 5
    ];
333 5
    for (const methodName of gameServerDeploymentsServiceStubMethods) {
334 5
      const callPromise = this.gameServerDeploymentsServiceStub.then(
335 5
        stub => (...args: Array<{}>) => {
336 0
          if (this._terminated) {
337 0
            return Promise.reject('The client has already been closed.');
338 0
          }
339 0
          const func = stub[methodName];
340 0
          return func.apply(stub, args);
341 5
        },
342 5
        (err: Error | null | undefined) => () => {
343 0
          throw err;
344 0
        }
345 5
      );
346 5

347 5
      const apiCall = this._gaxModule.createApiCall(
348 5
        callPromise,
349 5
        this._defaults[methodName],
350 5
        this.descriptors.page[methodName] ||
351 5
          this.descriptors.stream[methodName] ||
352 5
          this.descriptors.longrunning[methodName]
353 5
      );
354 5

355 5
      this.innerApiCalls[methodName] = apiCall;
356 5
    }
357 5

358 5
    return this.gameServerDeploymentsServiceStub;
359 5
  }
360 5

361 5
  /**
362 5
   * The DNS address for this API service.
363 5
   */
364 5
  static get servicePath() {
365 5
    return 'gameservices.googleapis.com';
366 5
  }
367 5

368 5
  /**
369 5
   * The DNS address for this API service - same as servicePath(),
370 5
   * exists for compatibility reasons.
371 5
   */
372 5
  static get apiEndpoint() {
373 5
    return 'gameservices.googleapis.com';
374 5
  }
375 5

376 5
  /**
377 5
   * The port for this API service.
378 5
   */
379 5
  static get port() {
380 5
    return 443;
381 5
  }
382 5

383 5
  /**
384 5
   * The scopes needed to make gRPC calls for every method defined
385 5
   * in this service.
386 5
   */
387 5
  static get scopes() {
388 5
    return ['https://www.googleapis.com/auth/cloud-platform'];
389 5
  }
390 5

391 5
  getProjectId(): Promise<string>;
392 5
  getProjectId(callback: Callback<string, undefined, undefined>): void;
393 5
  /**
394 5
   * Return the project ID used by this class.
395 5
   * @param {function(Error, string)} callback - the callback to
396 5
   *   be called with the current project Id.
397 5
   */
398 5
  getProjectId(
399 5
    callback?: Callback<string, undefined, undefined>
400 5
  ): Promise<string> | void {
401 5
    if (callback) {
402 5
      this.auth.getProjectId(callback);
403 5
      return;
404 5
    }
405 5
    return this.auth.getProjectId();
406 5
  }
407 5

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

808 5
  createGameServerDeployment(
809 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest,
810 5
    options?: gax.CallOptions
811 5
  ): Promise<
812 5
    [
813 5
      LROperation<
814 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
815 5
        protos.google.cloud.gaming.v1.IOperationMetadata
816 5
      >,
817 5
      protos.google.longrunning.IOperation | undefined,
818 5
      {} | undefined
819 5
    ]
820 5
  >;
821 5
  createGameServerDeployment(
822 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest,
823 5
    options: gax.CallOptions,
824 5
    callback: Callback<
825 5
      LROperation<
826 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
827 5
        protos.google.cloud.gaming.v1.IOperationMetadata
828 5
      >,
829 5
      protos.google.longrunning.IOperation | null | undefined,
830 5
      {} | null | undefined
831 5
    >
832 5
  ): void;
833 5
  createGameServerDeployment(
834 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest,
835 5
    callback: Callback<
836 5
      LROperation<
837 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
838 5
        protos.google.cloud.gaming.v1.IOperationMetadata
839 5
      >,
840 5
      protos.google.longrunning.IOperation | null | undefined,
841 5
      {} | null | undefined
842 5
    >
843 5
  ): void;
844 5
  /**
845 5
   * Creates a new game server deployment in a given project and location.
846 5
   *
847 5
   * @param {Object} request
848 5
   *   The request object that will be sent.
849 5
   * @param {string} request.parent
850 5
   *   Required. The parent resource name. Uses the form:
851 5
   *   `projects/{project}/locations/{location}`.
852 5
   * @param {string} request.deploymentId
853 5
   *   Required. The ID of the game server delpoyment resource to be created.
854 5
   * @param {google.cloud.gaming.v1.GameServerDeployment} request.gameServerDeployment
855 5
   *   Required. The game server delpoyment resource to be created.
856 5
   * @param {object} [options]
857 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
858 5
   * @returns {Promise} - The promise which resolves to an array.
859 5
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
860 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
861 5
   */
862 5
  createGameServerDeployment(
863 5
    request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest,
864 5
    optionsOrCallback?:
865 5
      | gax.CallOptions
866 5
      | Callback<
867 5
          LROperation<
868 5
            protos.google.cloud.gaming.v1.IGameServerDeployment,
869 5
            protos.google.cloud.gaming.v1.IOperationMetadata
870 5
          >,
871 5
          protos.google.longrunning.IOperation | null | undefined,
872 5
          {} | null | undefined
873 5
        >,
874 5
    callback?: Callback<
875 5
      LROperation<
876 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
877 5
        protos.google.cloud.gaming.v1.IOperationMetadata
878 5
      >,
879 5
      protos.google.longrunning.IOperation | null | undefined,
880 5
      {} | null | undefined
881 5
    >
882 5
  ): Promise<
883 5
    [
884 5
      LROperation<
885 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
886 5
        protos.google.cloud.gaming.v1.IOperationMetadata
887 5
      >,
888 5
      protos.google.longrunning.IOperation | undefined,
889 5
      {} | undefined
890 5
    ]
891 5
  > | void {
892 5
    request = request || {};
893 5
    let options: gax.CallOptions;
894 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
895 5
      callback = optionsOrCallback;
896 5
      options = {};
897 5
    } else {
898 5
      options = optionsOrCallback as gax.CallOptions;
899 5
    }
900 5
    options = options || {};
901 5
    options.otherArgs = options.otherArgs || {};
902 5
    options.otherArgs.headers = options.otherArgs.headers || {};
903 5
    options.otherArgs.headers[
904 5
      'x-goog-request-params'
905 5
    ] = gax.routingHeader.fromParams({
906 5
      parent: request.parent || '',
907 5
    });
908 5
    this.initialize();
909 5
    return this.innerApiCalls.createGameServerDeployment(
910 5
      request,
911 5
      options,
912 5
      callback
913 5
    );
914 5
  }
915 5
  /**
916 5
   * Check the status of the long running operation returned by the createGameServerDeployment() method.
917 5
   * @param {String} name
918 5
   *   The operation name that will be passed.
919 5
   * @returns {Promise} - The promise which resolves to an object.
920 5
   *   The decoded operation object has result and metadata field to get information from.
921 5
   *
922 5
   * @example:
923 5
   *   const decodedOperation = await checkCreateGameServerDeploymentProgress(name);
924 5
   *   console.log(decodedOperation.result);
925 5
   *   console.log(decodedOperation.done);
926 5
   *   console.log(decodedOperation.metadata);
927 5
   *
928 5
   */
929 5
  async checkCreateGameServerDeploymentProgress(
930 5
    name: string
931 5
  ): Promise<
932 5
    LROperation<
933 5
      protos.google.cloud.gaming.v1.GameServerDeployment,
934 5
      protos.google.cloud.gaming.v1.OperationMetadata
935 5
    >
936 5
  > {
937 5
    const request = new operationsProtos.google.longrunning.GetOperationRequest(
938 5
      {name}
939 5
    );
940 5
    const [operation] = await this.operationsClient.getOperation(request);
941 5
    const decodeOperation = new gax.Operation(
942 5
      operation,
943 5
      this.descriptors.longrunning.createGameServerDeployment,
944 5
      gax.createDefaultBackoffSettings()
945 5
    );
946 5
    return decodeOperation as LROperation<
947 5
      protos.google.cloud.gaming.v1.GameServerDeployment,
948 5
      protos.google.cloud.gaming.v1.OperationMetadata
949 5
    >;
950 5
  }
951 5
  deleteGameServerDeployment(
952 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest,
953 5
    options?: gax.CallOptions
954 5
  ): Promise<
955 5
    [
956 5
      LROperation<
957 5
        protos.google.protobuf.IEmpty,
958 5
        protos.google.cloud.gaming.v1.IOperationMetadata
959 5
      >,
960 5
      protos.google.longrunning.IOperation | undefined,
961 5
      {} | undefined
962 5
    ]
963 5
  >;
964 5
  deleteGameServerDeployment(
965 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest,
966 5
    options: gax.CallOptions,
967 5
    callback: Callback<
968 5
      LROperation<
969 5
        protos.google.protobuf.IEmpty,
970 5
        protos.google.cloud.gaming.v1.IOperationMetadata
971 5
      >,
972 5
      protos.google.longrunning.IOperation | null | undefined,
973 5
      {} | null | undefined
974 5
    >
975 5
  ): void;
976 5
  deleteGameServerDeployment(
977 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest,
978 5
    callback: Callback<
979 5
      LROperation<
980 5
        protos.google.protobuf.IEmpty,
981 5
        protos.google.cloud.gaming.v1.IOperationMetadata
982 5
      >,
983 5
      protos.google.longrunning.IOperation | null | undefined,
984 5
      {} | null | undefined
985 5
    >
986 5
  ): void;
987 5
  /**
988 5
   * Deletes a single game server deployment.
989 5
   *
990 5
   * @param {Object} request
991 5
   *   The request object that will be sent.
992 5
   * @param {string} request.name
993 5
   *   Required. The name of the game server delpoyment to delete. Uses the form:
994 5
   *
995 5
   *   `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`.
996 5
   * @param {object} [options]
997 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
998 5
   * @returns {Promise} - The promise which resolves to an array.
999 5
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1000 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1001 5
   */
1002 5
  deleteGameServerDeployment(
1003 5
    request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest,
1004 5
    optionsOrCallback?:
1005 5
      | gax.CallOptions
1006 5
      | 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
    callback?: Callback<
1015 5
      LROperation<
1016 5
        protos.google.protobuf.IEmpty,
1017 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1018 5
      >,
1019 5
      protos.google.longrunning.IOperation | null | undefined,
1020 5
      {} | null | undefined
1021 5
    >
1022 5
  ): Promise<
1023 5
    [
1024 5
      LROperation<
1025 5
        protos.google.protobuf.IEmpty,
1026 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1027 5
      >,
1028 5
      protos.google.longrunning.IOperation | undefined,
1029 5
      {} | undefined
1030 5
    ]
1031 5
  > | void {
1032 5
    request = request || {};
1033 5
    let options: gax.CallOptions;
1034 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
1035 5
      callback = optionsOrCallback;
1036 5
      options = {};
1037 5
    } else {
1038 5
      options = optionsOrCallback as gax.CallOptions;
1039 5
    }
1040 5
    options = options || {};
1041 5
    options.otherArgs = options.otherArgs || {};
1042 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1043 5
    options.otherArgs.headers[
1044 5
      'x-goog-request-params'
1045 5
    ] = gax.routingHeader.fromParams({
1046 5
      name: request.name || '',
1047 5
    });
1048 5
    this.initialize();
1049 5
    return this.innerApiCalls.deleteGameServerDeployment(
1050 5
      request,
1051 5
      options,
1052 5
      callback
1053 5
    );
1054 5
  }
1055 5
  /**
1056 5
   * Check the status of the long running operation returned by the deleteGameServerDeployment() method.
1057 5
   * @param {String} name
1058 5
   *   The operation name that will be passed.
1059 5
   * @returns {Promise} - The promise which resolves to an object.
1060 5
   *   The decoded operation object has result and metadata field to get information from.
1061 5
   *
1062 5
   * @example:
1063 5
   *   const decodedOperation = await checkDeleteGameServerDeploymentProgress(name);
1064 5
   *   console.log(decodedOperation.result);
1065 5
   *   console.log(decodedOperation.done);
1066 5
   *   console.log(decodedOperation.metadata);
1067 5
   *
1068 5
   */
1069 5
  async checkDeleteGameServerDeploymentProgress(
1070 5
    name: string
1071 5
  ): Promise<
1072 5
    LROperation<
1073 5
      protos.google.protobuf.Empty,
1074 5
      protos.google.cloud.gaming.v1.OperationMetadata
1075 5
    >
1076 5
  > {
1077 5
    const request = new operationsProtos.google.longrunning.GetOperationRequest(
1078 5
      {name}
1079 5
    );
1080 5
    const [operation] = await this.operationsClient.getOperation(request);
1081 5
    const decodeOperation = new gax.Operation(
1082 5
      operation,
1083 5
      this.descriptors.longrunning.deleteGameServerDeployment,
1084 5
      gax.createDefaultBackoffSettings()
1085 5
    );
1086 5
    return decodeOperation as LROperation<
1087 5
      protos.google.protobuf.Empty,
1088 5
      protos.google.cloud.gaming.v1.OperationMetadata
1089 5
    >;
1090 5
  }
1091 5
  updateGameServerDeployment(
1092 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest,
1093 5
    options?: gax.CallOptions
1094 5
  ): Promise<
1095 5
    [
1096 5
      LROperation<
1097 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1098 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1099 5
      >,
1100 5
      protos.google.longrunning.IOperation | undefined,
1101 5
      {} | undefined
1102 5
    ]
1103 5
  >;
1104 5
  updateGameServerDeployment(
1105 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest,
1106 5
    options: gax.CallOptions,
1107 5
    callback: Callback<
1108 5
      LROperation<
1109 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1110 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1111 5
      >,
1112 5
      protos.google.longrunning.IOperation | null | undefined,
1113 5
      {} | null | undefined
1114 5
    >
1115 5
  ): void;
1116 5
  updateGameServerDeployment(
1117 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest,
1118 5
    callback: Callback<
1119 5
      LROperation<
1120 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1121 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1122 5
      >,
1123 5
      protos.google.longrunning.IOperation | null | undefined,
1124 5
      {} | null | undefined
1125 5
    >
1126 5
  ): void;
1127 5
  /**
1128 5
   * Patches a game server deployment.
1129 5
   *
1130 5
   * @param {Object} request
1131 5
   *   The request object that will be sent.
1132 5
   * @param {google.cloud.gaming.v1.GameServerDeployment} request.gameServerDeployment
1133 5
   *   Required. The game server delpoyment to be updated.
1134 5
   *   Only fields specified in update_mask are updated.
1135 5
   * @param {google.protobuf.FieldMask} request.updateMask
1136 5
   *   Required. Mask of fields to update. At least one path must be supplied in
1137 5
   *   this field. For the `FieldMask` definition, see
1138 5
   *
1139 5
   *   https:
1140 5
   *   //developers.google.com/protocol-buffers
1141 5
   *   // /docs/reference/google.protobuf#fieldmask
1142 5
   * @param {object} [options]
1143 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1144 5
   * @returns {Promise} - The promise which resolves to an array.
1145 5
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1146 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1147 5
   */
1148 5
  updateGameServerDeployment(
1149 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest,
1150 5
    optionsOrCallback?:
1151 5
      | gax.CallOptions
1152 5
      | Callback<
1153 5
          LROperation<
1154 5
            protos.google.cloud.gaming.v1.IGameServerDeployment,
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
    callback?: Callback<
1161 5
      LROperation<
1162 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1163 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1164 5
      >,
1165 5
      protos.google.longrunning.IOperation | null | undefined,
1166 5
      {} | null | undefined
1167 5
    >
1168 5
  ): Promise<
1169 5
    [
1170 5
      LROperation<
1171 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1172 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1173 5
      >,
1174 5
      protos.google.longrunning.IOperation | undefined,
1175 5
      {} | undefined
1176 5
    ]
1177 5
  > | void {
1178 5
    request = request || {};
1179 5
    let options: gax.CallOptions;
1180 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
1181 5
      callback = optionsOrCallback;
1182 5
      options = {};
1183 5
    } else {
1184 5
      options = optionsOrCallback as gax.CallOptions;
1185 5
    }
1186 5
    options = options || {};
1187 5
    options.otherArgs = options.otherArgs || {};
1188 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1189 5
    options.otherArgs.headers[
1190 5
      'x-goog-request-params'
1191 5
    ] = gax.routingHeader.fromParams({
1192 5
      'game_server_deployment.name': request.gameServerDeployment!.name || '',
1193 5
    });
1194 5
    this.initialize();
1195 5
    return this.innerApiCalls.updateGameServerDeployment(
1196 5
      request,
1197 5
      options,
1198 5
      callback
1199 5
    );
1200 5
  }
1201 5
  /**
1202 5
   * Check the status of the long running operation returned by the updateGameServerDeployment() method.
1203 5
   * @param {String} name
1204 5
   *   The operation name that will be passed.
1205 5
   * @returns {Promise} - The promise which resolves to an object.
1206 5
   *   The decoded operation object has result and metadata field to get information from.
1207 5
   *
1208 5
   * @example:
1209 5
   *   const decodedOperation = await checkUpdateGameServerDeploymentProgress(name);
1210 5
   *   console.log(decodedOperation.result);
1211 5
   *   console.log(decodedOperation.done);
1212 5
   *   console.log(decodedOperation.metadata);
1213 5
   *
1214 5
   */
1215 5
  async checkUpdateGameServerDeploymentProgress(
1216 5
    name: string
1217 5
  ): Promise<
1218 5
    LROperation<
1219 5
      protos.google.cloud.gaming.v1.GameServerDeployment,
1220 5
      protos.google.cloud.gaming.v1.OperationMetadata
1221 5
    >
1222 5
  > {
1223 5
    const request = new operationsProtos.google.longrunning.GetOperationRequest(
1224 5
      {name}
1225 5
    );
1226 5
    const [operation] = await this.operationsClient.getOperation(request);
1227 5
    const decodeOperation = new gax.Operation(
1228 5
      operation,
1229 5
      this.descriptors.longrunning.updateGameServerDeployment,
1230 5
      gax.createDefaultBackoffSettings()
1231 5
    );
1232 5
    return decodeOperation as LROperation<
1233 5
      protos.google.cloud.gaming.v1.GameServerDeployment,
1234 5
      protos.google.cloud.gaming.v1.OperationMetadata
1235 5
    >;
1236 5
  }
1237 5
  updateGameServerDeploymentRollout(
1238 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest,
1239 5
    options?: gax.CallOptions
1240 5
  ): Promise<
1241 5
    [
1242 5
      LROperation<
1243 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1244 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1245 5
      >,
1246 5
      protos.google.longrunning.IOperation | undefined,
1247 5
      {} | undefined
1248 5
    ]
1249 5
  >;
1250 5
  updateGameServerDeploymentRollout(
1251 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest,
1252 5
    options: gax.CallOptions,
1253 5
    callback: Callback<
1254 5
      LROperation<
1255 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1256 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1257 5
      >,
1258 5
      protos.google.longrunning.IOperation | null | undefined,
1259 5
      {} | null | undefined
1260 5
    >
1261 5
  ): void;
1262 5
  updateGameServerDeploymentRollout(
1263 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest,
1264 5
    callback: Callback<
1265 5
      LROperation<
1266 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1267 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1268 5
      >,
1269 5
      protos.google.longrunning.IOperation | null | undefined,
1270 5
      {} | null | undefined
1271 5
    >
1272 5
  ): void;
1273 5
  /**
1274 5
   * Patches a single game server deployment rollout.
1275 5
   * The method will not return an error if the update does not affect any
1276 5
   * existing realms. For example - if the default_game_server_config is changed
1277 5
   * but all existing realms use the override, that is valid. Similarly, if a
1278 5
   * non existing realm is explicitly called out in game_server_config_overrides
1279 5
   * field, that will also not result in an error.
1280 5
   *
1281 5
   * @param {Object} request
1282 5
   *   The request object that will be sent.
1283 5
   * @param {google.cloud.gaming.v1.GameServerDeploymentRollout} request.rollout
1284 5
   *   Required. The game server delpoyment rollout to be updated.
1285 5
   *   Only fields specified in update_mask are updated.
1286 5
   * @param {google.protobuf.FieldMask} request.updateMask
1287 5
   *   Required. Mask of fields to update. At least one path must be supplied in
1288 5
   *   this field. For the `FieldMask` definition, see
1289 5
   *
1290 5
   *   https:
1291 5
   *   //developers.google.com/protocol-buffers
1292 5
   *   // /docs/reference/google.protobuf#fieldmask
1293 5
   * @param {object} [options]
1294 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1295 5
   * @returns {Promise} - The promise which resolves to an array.
1296 5
   *   The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}.
1297 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1298 5
   */
1299 5
  updateGameServerDeploymentRollout(
1300 5
    request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest,
1301 5
    optionsOrCallback?:
1302 5
      | gax.CallOptions
1303 5
      | Callback<
1304 5
          LROperation<
1305 5
            protos.google.cloud.gaming.v1.IGameServerDeployment,
1306 5
            protos.google.cloud.gaming.v1.IOperationMetadata
1307 5
          >,
1308 5
          protos.google.longrunning.IOperation | null | undefined,
1309 5
          {} | null | undefined
1310 5
        >,
1311 5
    callback?: Callback<
1312 5
      LROperation<
1313 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1314 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1315 5
      >,
1316 5
      protos.google.longrunning.IOperation | null | undefined,
1317 5
      {} | null | undefined
1318 5
    >
1319 5
  ): Promise<
1320 5
    [
1321 5
      LROperation<
1322 5
        protos.google.cloud.gaming.v1.IGameServerDeployment,
1323 5
        protos.google.cloud.gaming.v1.IOperationMetadata
1324 5
      >,
1325 5
      protos.google.longrunning.IOperation | undefined,
1326 5
      {} | undefined
1327 5
    ]
1328 5
  > | void {
1329 5
    request = request || {};
1330 5
    let options: gax.CallOptions;
1331 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
1332 5
      callback = optionsOrCallback;
1333 5
      options = {};
1334 5
    } else {
1335 5
      options = optionsOrCallback as gax.CallOptions;
1336 5
    }
1337 5
    options = options || {};
1338 5
    options.otherArgs = options.otherArgs || {};
1339 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1340 5
    options.otherArgs.headers[
1341 5
      'x-goog-request-params'
1342 5
    ] = gax.routingHeader.fromParams({
1343 5
      'rollout.name': request.rollout!.name || '',
1344 5
    });
1345 5
    this.initialize();
1346 5
    return this.innerApiCalls.updateGameServerDeploymentRollout(
1347 5
      request,
1348 5
      options,
1349 5
      callback
1350 5
    );
1351 5
  }
1352 5
  /**
1353 5
   * Check the status of the long running operation returned by the updateGameServerDeploymentRollout() method.
1354 5
   * @param {String} name
1355 5
   *   The operation name that will be passed.
1356 5
   * @returns {Promise} - The promise which resolves to an object.
1357 5
   *   The decoded operation object has result and metadata field to get information from.
1358 5
   *
1359 5
   * @example:
1360 5
   *   const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name);
1361 5
   *   console.log(decodedOperation.result);
1362 5
   *   console.log(decodedOperation.done);
1363 5
   *   console.log(decodedOperation.metadata);
1364 5
   *
1365 5
   */
1366 5
  async checkUpdateGameServerDeploymentRolloutProgress(
1367 5
    name: string
1368 5
  ): Promise<
1369 5
    LROperation<
1370 5
      protos.google.cloud.gaming.v1.GameServerDeployment,
1371 5
      protos.google.cloud.gaming.v1.OperationMetadata
1372 5
    >
1373 5
  > {
1374 5
    const request = new operationsProtos.google.longrunning.GetOperationRequest(
1375 5
      {name}
1376 5
    );
1377 5
    const [operation] = await this.operationsClient.getOperation(request);
1378 5
    const decodeOperation = new gax.Operation(
1379 5
      operation,
1380 5
      this.descriptors.longrunning.updateGameServerDeploymentRollout,
1381 5
      gax.createDefaultBackoffSettings()
1382 5
    );
1383 5
    return decodeOperation as LROperation<
1384 5
      protos.google.cloud.gaming.v1.GameServerDeployment,
1385 5
      protos.google.cloud.gaming.v1.OperationMetadata
1386 5
    >;
1387 5
  }
1388 5
  listGameServerDeployments(
1389 5
    request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1390 5
    options?: gax.CallOptions
1391 5
  ): Promise<
1392 5
    [
1393 5
      protos.google.cloud.gaming.v1.IGameServerDeployment[],
1394 5
      protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest | null,
1395 5
      protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse
1396 5
    ]
1397 5
  >;
1398 5
  listGameServerDeployments(
1399 5
    request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1400 5
    options: gax.CallOptions,
1401 5
    callback: PaginationCallback<
1402 5
      protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1403 5
      | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse
1404 5
      | null
1405 5
      | undefined,
1406 5
      protos.google.cloud.gaming.v1.IGameServerDeployment
1407 5
    >
1408 5
  ): void;
1409 5
  listGameServerDeployments(
1410 5
    request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1411 5
    callback: PaginationCallback<
1412 5
      protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1413 5
      | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse
1414 5
      | null
1415 5
      | undefined,
1416 5
      protos.google.cloud.gaming.v1.IGameServerDeployment
1417 5
    >
1418 5
  ): void;
1419 5
  /**
1420 5
   * Lists game server deployments in a given project and location.
1421 5
   *
1422 5
   * @param {Object} request
1423 5
   *   The request object that will be sent.
1424 5
   * @param {string} request.parent
1425 5
   *   Required. The parent resource name. Uses the form:
1426 5
   *   `projects/{project}/locations/{location}`.
1427 5
   * @param {number} [request.pageSize]
1428 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1429 5
   *   will pick an appropriate default. The server may return fewer items than
1430 5
   *   requested. A caller should only rely on response's
1431 5
   *   {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to
1432 5
   *   determine if there are more GameServerDeployments left to be queried.
1433 5
   * @param {string} [request.pageToken]
1434 5
   *   Optional. The next_page_token value returned from a previous List request,
1435 5
   *   if any.
1436 5
   * @param {string} [request.filter]
1437 5
   *   Optional. The filter to apply to list results.
1438 5
   * @param {string} [request.orderBy]
1439 5
   *   Optional. Specifies the ordering of results following syntax at
1440 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1441 5
   * @param {object} [options]
1442 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1443 5
   * @returns {Promise} - The promise which resolves to an array.
1444 5
   *   The first element of the array is Array of [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment}.
1445 5
   *   The client library support auto-pagination by default: it will call the API as many
1446 5
   *   times as needed and will merge results from all the pages into this array.
1447 5
   *
1448 5
   *   When autoPaginate: false is specified through options, the array has three elements.
1449 5
   *   The first element is Array of [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment} that corresponds to
1450 5
   *   the one page received from the API server.
1451 5
   *   If the second element is not null it contains the request object of type [ListGameServerDeploymentsRequest]{@link google.cloud.gaming.v1.ListGameServerDeploymentsRequest}
1452 5
   *   that can be used to obtain the next page of the results.
1453 5
   *   If it is null, the next page does not exist.
1454 5
   *   The third element contains the raw response received from the API server. Its type is
1455 5
   *   [ListGameServerDeploymentsResponse]{@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse}.
1456 5
   *
1457 5
   *   The promise has a method named "cancel" which cancels the ongoing API call.
1458 5
   */
1459 5
  listGameServerDeployments(
1460 5
    request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1461 5
    optionsOrCallback?:
1462 5
      | gax.CallOptions
1463 5
      | PaginationCallback<
1464 5
          protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1465 5
          | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse
1466 5
          | null
1467 5
          | undefined,
1468 5
          protos.google.cloud.gaming.v1.IGameServerDeployment
1469 5
        >,
1470 5
    callback?: PaginationCallback<
1471 5
      protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1472 5
      | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse
1473 5
      | null
1474 5
      | undefined,
1475 5
      protos.google.cloud.gaming.v1.IGameServerDeployment
1476 5
    >
1477 5
  ): Promise<
1478 5
    [
1479 5
      protos.google.cloud.gaming.v1.IGameServerDeployment[],
1480 5
      protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest | null,
1481 5
      protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse
1482 5
    ]
1483 5
  > | void {
1484 5
    request = request || {};
1485 5
    let options: gax.CallOptions;
1486 5
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
1487 5
      callback = optionsOrCallback;
1488 5
      options = {};
1489 5
    } else {
1490 5
      options = optionsOrCallback as gax.CallOptions;
1491 5
    }
1492 5
    options = options || {};
1493 5
    options.otherArgs = options.otherArgs || {};
1494 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1495 5
    options.otherArgs.headers[
1496 5
      'x-goog-request-params'
1497 5
    ] = gax.routingHeader.fromParams({
1498 5
      parent: request.parent || '',
1499 5
    });
1500 5
    this.initialize();
1501 5
    return this.innerApiCalls.listGameServerDeployments(
1502 5
      request,
1503 5
      options,
1504 5
      callback
1505 5
    );
1506 5
  }
1507 5

1508 5
  /**
1509 5
   * Equivalent to {@link listGameServerDeployments}, but returns a NodeJS Stream object.
1510 5
   *
1511 5
   * This fetches the paged responses for {@link listGameServerDeployments} continuously
1512 5
   * and invokes the callback registered for 'data' event for each element in the
1513 5
   * responses.
1514 5
   *
1515 5
   * The returned object has 'end' method when no more elements are required.
1516 5
   *
1517 5
   * autoPaginate option will be ignored.
1518 5
   *
1519 5
   * @see {@link https://nodejs.org/api/stream.html}
1520 5
   *
1521 5
   * @param {Object} request
1522 5
   *   The request object that will be sent.
1523 5
   * @param {string} request.parent
1524 5
   *   Required. The parent resource name. Uses the form:
1525 5
   *   `projects/{project}/locations/{location}`.
1526 5
   * @param {number} [request.pageSize]
1527 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1528 5
   *   will pick an appropriate default. The server may return fewer items than
1529 5
   *   requested. A caller should only rely on response's
1530 5
   *   {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to
1531 5
   *   determine if there are more GameServerDeployments left to be queried.
1532 5
   * @param {string} [request.pageToken]
1533 5
   *   Optional. The next_page_token value returned from a previous List request,
1534 5
   *   if any.
1535 5
   * @param {string} [request.filter]
1536 5
   *   Optional. The filter to apply to list results.
1537 5
   * @param {string} [request.orderBy]
1538 5
   *   Optional. Specifies the ordering of results following syntax at
1539 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1540 5
   * @param {object} [options]
1541 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1542 5
   * @returns {Stream}
1543 5
   *   An object stream which emits an object representing [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment} on 'data' event.
1544 5
   */
1545 5
  listGameServerDeploymentsStream(
1546 5
    request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1547 5
    options?: gax.CallOptions
1548 5
  ): Transform {
1549 5
    request = request || {};
1550 5
    options = options || {};
1551 5
    options.otherArgs = options.otherArgs || {};
1552 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1553 5
    options.otherArgs.headers[
1554 5
      'x-goog-request-params'
1555 5
    ] = gax.routingHeader.fromParams({
1556 5
      parent: request.parent || '',
1557 5
    });
1558 5
    const callSettings = new gax.CallSettings(options);
1559 5
    this.initialize();
1560 5
    return this.descriptors.page.listGameServerDeployments.createStream(
1561 5
      this.innerApiCalls.listGameServerDeployments as gax.GaxCall,
1562 5
      request,
1563 5
      callSettings
1564 5
    );
1565 5
  }
1566 5

1567 5
  /**
1568 5
   * Equivalent to {@link listGameServerDeployments}, but returns an iterable object.
1569 5
   *
1570 5
   * for-await-of syntax is used with the iterable to recursively get response element on-demand.
1571 5
   *
1572 5
   * @param {Object} request
1573 5
   *   The request object that will be sent.
1574 5
   * @param {string} request.parent
1575 5
   *   Required. The parent resource name. Uses the form:
1576 5
   *   `projects/{project}/locations/{location}`.
1577 5
   * @param {number} [request.pageSize]
1578 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1579 5
   *   will pick an appropriate default. The server may return fewer items than
1580 5
   *   requested. A caller should only rely on response's
1581 5
   *   {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to
1582 5
   *   determine if there are more GameServerDeployments left to be queried.
1583 5
   * @param {string} [request.pageToken]
1584 5
   *   Optional. The next_page_token value returned from a previous List request,
1585 5
   *   if any.
1586 5
   * @param {string} [request.filter]
1587 5
   *   Optional. The filter to apply to list results.
1588 5
   * @param {string} [request.orderBy]
1589 5
   *   Optional. Specifies the ordering of results following syntax at
1590 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1591 5
   * @param {object} [options]
1592 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1593 5
   * @returns {Object}
1594 5
   *   An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
1595 5
   */
1596 5
  listGameServerDeploymentsAsync(
1597 5
    request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest,
1598 5
    options?: gax.CallOptions
1599 5
  ): AsyncIterable<protos.google.cloud.gaming.v1.IGameServerDeployment> {
1600 5
    request = request || {};
1601 5
    options = options || {};
1602 5
    options.otherArgs = options.otherArgs || {};
1603 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1604 5
    options.otherArgs.headers[
1605 5
      'x-goog-request-params'
1606 5
    ] = gax.routingHeader.fromParams({
1607 5
      parent: request.parent || '',
1608 5
    });
1609 5
    options = options || {};
1610 5
    const callSettings = new gax.CallSettings(options);
1611 5
    this.initialize();
1612 5
    return this.descriptors.page.listGameServerDeployments.asyncIterate(
1613 5
      this.innerApiCalls['listGameServerDeployments'] as GaxCall,
1614 5
      (request as unknown) as RequestType,
1615 5
      callSettings
1616 5
    ) as AsyncIterable<protos.google.cloud.gaming.v1.IGameServerDeployment>;
1617 5
  }
1618 5
  // --------------------
1619 5
  // -- Path templates --
1620 5
  // --------------------
1621 5

1622 5
  /**
1623 5
   * Return a fully-qualified gameServerCluster resource name string.
1624 5
   *
1625 5
   * @param {string} project
1626 5
   * @param {string} location
1627 5
   * @param {string} realm
1628 5
   * @param {string} cluster
1629 5
   * @returns {string} Resource name string.
1630 5
   */
1631 5
  gameServerClusterPath(
1632 5
    project: string,
1633 5
    location: string,
1634 5
    realm: string,
1635 5
    cluster: string
1636 5
  ) {
1637 5
    return this.pathTemplates.gameServerClusterPathTemplate.render({
1638 5
      project: project,
1639 5
      location: location,
1640 5
      realm: realm,
1641 5
      cluster: cluster,
1642 5
    });
1643 5
  }
1644 5

1645 5
  /**
1646 5
   * Parse the project from GameServerCluster resource.
1647 5
   *
1648 5
   * @param {string} gameServerClusterName
1649 5
   *   A fully-qualified path representing GameServerCluster resource.
1650 5
   * @returns {string} A string representing the project.
1651 5
   */
1652 5
  matchProjectFromGameServerClusterName(gameServerClusterName: string) {
1653 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1654 5
      gameServerClusterName
1655 5
    ).project;
1656 5
  }
1657 5

1658 5
  /**
1659 5
   * Parse the location from GameServerCluster resource.
1660 5
   *
1661 5
   * @param {string} gameServerClusterName
1662 5
   *   A fully-qualified path representing GameServerCluster resource.
1663 5
   * @returns {string} A string representing the location.
1664 5
   */
1665 5
  matchLocationFromGameServerClusterName(gameServerClusterName: string) {
1666 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1667 5
      gameServerClusterName
1668 5
    ).location;
1669 5
  }
1670 5

1671 5
  /**
1672 5
   * Parse the realm from GameServerCluster resource.
1673 5
   *
1674 5
   * @param {string} gameServerClusterName
1675 5
   *   A fully-qualified path representing GameServerCluster resource.
1676 5
   * @returns {string} A string representing the realm.
1677 5
   */
1678 5
  matchRealmFromGameServerClusterName(gameServerClusterName: string) {
1679 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1680 5
      gameServerClusterName
1681 5
    ).realm;
1682 5
  }
1683 5

1684 5
  /**
1685 5
   * Parse the cluster from GameServerCluster resource.
1686 5
   *
1687 5
   * @param {string} gameServerClusterName
1688 5
   *   A fully-qualified path representing GameServerCluster resource.
1689 5
   * @returns {string} A string representing the cluster.
1690 5
   */
1691 5
  matchClusterFromGameServerClusterName(gameServerClusterName: string) {
1692 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1693 5
      gameServerClusterName
1694 5
    ).cluster;
1695 5
  }
1696 5

1697 5
  /**
1698 5
   * Return a fully-qualified gameServerConfig resource name string.
1699 5
   *
1700 5
   * @param {string} project
1701 5
   * @param {string} location
1702 5
   * @param {string} deployment
1703 5
   * @param {string} config
1704 5
   * @returns {string} Resource name string.
1705 5
   */
1706 5
  gameServerConfigPath(
1707 5
    project: string,
1708 5
    location: string,
1709 5
    deployment: string,
1710 5
    config: string
1711 5
  ) {
1712 5
    return this.pathTemplates.gameServerConfigPathTemplate.render({
1713 5
      project: project,
1714 5
      location: location,
1715 5
      deployment: deployment,
1716 5
      config: config,
1717 5
    });
1718 5
  }
1719 5

1720 5
  /**
1721 5
   * Parse the project from GameServerConfig resource.
1722 5
   *
1723 5
   * @param {string} gameServerConfigName
1724 5
   *   A fully-qualified path representing GameServerConfig resource.
1725 5
   * @returns {string} A string representing the project.
1726 5
   */
1727 5
  matchProjectFromGameServerConfigName(gameServerConfigName: string) {
1728 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1729 5
      gameServerConfigName
1730 5
    ).project;
1731 5
  }
1732 5

1733 5
  /**
1734 5
   * Parse the location from GameServerConfig resource.
1735 5
   *
1736 5
   * @param {string} gameServerConfigName
1737 5
   *   A fully-qualified path representing GameServerConfig resource.
1738 5
   * @returns {string} A string representing the location.
1739 5
   */
1740 5
  matchLocationFromGameServerConfigName(gameServerConfigName: string) {
1741 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1742 5
      gameServerConfigName
1743 5
    ).location;
1744 5
  }
1745 5

1746 5
  /**
1747 5
   * Parse the deployment from GameServerConfig resource.
1748 5
   *
1749 5
   * @param {string} gameServerConfigName
1750 5
   *   A fully-qualified path representing GameServerConfig resource.
1751 5
   * @returns {string} A string representing the deployment.
1752 5
   */
1753 5
  matchDeploymentFromGameServerConfigName(gameServerConfigName: string) {
1754 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1755 5
      gameServerConfigName
1756 5
    ).deployment;
1757 5
  }
1758 5

1759 5
  /**
1760 5
   * Parse the config from GameServerConfig resource.
1761 5
   *
1762 5
   * @param {string} gameServerConfigName
1763 5
   *   A fully-qualified path representing GameServerConfig resource.
1764 5
   * @returns {string} A string representing the config.
1765 5
   */
1766 5
  matchConfigFromGameServerConfigName(gameServerConfigName: string) {
1767 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1768 5
      gameServerConfigName
1769 5
    ).config;
1770 5
  }
1771 5

1772 5
  /**
1773 5
   * Return a fully-qualified gameServerDeployment resource name string.
1774 5
   *
1775 5
   * @param {string} project
1776 5
   * @param {string} location
1777 5
   * @param {string} deployment
1778 5
   * @returns {string} Resource name string.
1779 5
   */
1780 5
  gameServerDeploymentPath(
1781 5
    project: string,
1782 5
    location: string,
1783 5
    deployment: string
1784 5
  ) {
1785 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.render({
1786 5
      project: project,
1787 5
      location: location,
1788 5
      deployment: deployment,
1789 5
    });
1790 5
  }
1791 5

1792 5
  /**
1793 5
   * Parse the project from GameServerDeployment resource.
1794 5
   *
1795 5
   * @param {string} gameServerDeploymentName
1796 5
   *   A fully-qualified path representing GameServerDeployment resource.
1797 5
   * @returns {string} A string representing the project.
1798 5
   */
1799 5
  matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) {
1800 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1801 5
      gameServerDeploymentName
1802 5
    ).project;
1803 5
  }
1804 5

1805 5
  /**
1806 5
   * Parse the location from GameServerDeployment resource.
1807 5
   *
1808 5
   * @param {string} gameServerDeploymentName
1809 5
   *   A fully-qualified path representing GameServerDeployment resource.
1810 5
   * @returns {string} A string representing the location.
1811 5
   */
1812 5
  matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) {
1813 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1814 5
      gameServerDeploymentName
1815 5
    ).location;
1816 5
  }
1817 5

1818 5
  /**
1819 5
   * Parse the deployment from GameServerDeployment resource.
1820 5
   *
1821 5
   * @param {string} gameServerDeploymentName
1822 5
   *   A fully-qualified path representing GameServerDeployment resource.
1823 5
   * @returns {string} A string representing the deployment.
1824 5
   */
1825 5
  matchDeploymentFromGameServerDeploymentName(
1826 5
    gameServerDeploymentName: string
1827 5
  ) {
1828 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1829 5
      gameServerDeploymentName
1830 5
    ).deployment;
1831 5
  }
1832 5

1833 5
  /**
1834 5
   * Return a fully-qualified gameServerDeploymentRollout resource name string.
1835 5
   *
1836 5
   * @param {string} project
1837 5
   * @param {string} location
1838 5
   * @param {string} deployment
1839 5
   * @returns {string} Resource name string.
1840 5
   */
1841 5
  gameServerDeploymentRolloutPath(
1842 5
    project: string,
1843 5
    location: string,
1844 5
    deployment: string
1845 5
  ) {
1846 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({
1847 5
      project: project,
1848 5
      location: location,
1849 5
      deployment: deployment,
1850 5
    });
1851 5
  }
1852 5

1853 5
  /**
1854 5
   * Parse the project from GameServerDeploymentRollout resource.
1855 5
   *
1856 5
   * @param {string} gameServerDeploymentRolloutName
1857 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1858 5
   * @returns {string} A string representing the project.
1859 5
   */
1860 5
  matchProjectFromGameServerDeploymentRolloutName(
1861 5
    gameServerDeploymentRolloutName: string
1862 5
  ) {
1863 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1864 5
      gameServerDeploymentRolloutName
1865 5
    ).project;
1866 5
  }
1867 5

1868 5
  /**
1869 5
   * Parse the location from GameServerDeploymentRollout resource.
1870 5
   *
1871 5
   * @param {string} gameServerDeploymentRolloutName
1872 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1873 5
   * @returns {string} A string representing the location.
1874 5
   */
1875 5
  matchLocationFromGameServerDeploymentRolloutName(
1876 5
    gameServerDeploymentRolloutName: string
1877 5
  ) {
1878 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1879 5
      gameServerDeploymentRolloutName
1880 5
    ).location;
1881 5
  }
1882 5

1883 5
  /**
1884 5
   * Parse the deployment from GameServerDeploymentRollout resource.
1885 5
   *
1886 5
   * @param {string} gameServerDeploymentRolloutName
1887 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1888 5
   * @returns {string} A string representing the deployment.
1889 5
   */
1890 5
  matchDeploymentFromGameServerDeploymentRolloutName(
1891 5
    gameServerDeploymentRolloutName: string
1892 5
  ) {
1893 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1894 5
      gameServerDeploymentRolloutName
1895 5
    ).deployment;
1896 5
  }
1897 5

1898 5
  /**
1899 5
   * Return a fully-qualified realm resource name string.
1900 5
   *
1901 5
   * @param {string} project
1902 5
   * @param {string} location
1903 5
   * @param {string} realm
1904 5
   * @returns {string} Resource name string.
1905 5
   */
1906 5
  realmPath(project: string, location: string, realm: string) {
1907 5
    return this.pathTemplates.realmPathTemplate.render({
1908 5
      project: project,
1909 5
      location: location,
1910 5
      realm: realm,
1911 5
    });
1912 5
  }
1913 5

1914 5
  /**
1915 5
   * Parse the project from Realm resource.
1916 5
   *
1917 5
   * @param {string} realmName
1918 5
   *   A fully-qualified path representing Realm resource.
1919 5
   * @returns {string} A string representing the project.
1920 5
   */
1921 5
  matchProjectFromRealmName(realmName: string) {
1922 5
    return this.pathTemplates.realmPathTemplate.match(realmName).project;
1923 5
  }
1924 5

1925 5
  /**
1926 5
   * Parse the location from Realm resource.
1927 5
   *
1928 5
   * @param {string} realmName
1929 5
   *   A fully-qualified path representing Realm resource.
1930 5
   * @returns {string} A string representing the location.
1931 5
   */
1932 5
  matchLocationFromRealmName(realmName: string) {
1933 5
    return this.pathTemplates.realmPathTemplate.match(realmName).location;
1934 5
  }
1935 5

1936 5
  /**
1937 5
   * Parse the realm from Realm resource.
1938 5
   *
1939 5
   * @param {string} realmName
1940 5
   *   A fully-qualified path representing Realm resource.
1941 5
   * @returns {string} A string representing the realm.
1942 5
   */
1943 5
  matchRealmFromRealmName(realmName: string) {
1944 5
    return this.pathTemplates.realmPathTemplate.match(realmName).realm;
1945 5
  }
1946 5

1947 5
  /**
1948 5
   * Terminate the GRPC channel and close the client.
1949 5
   *
1950 5
   * The client will no longer be usable and all future behavior is undefined.
1951 5
   */
1952 5
  close(): Promise<void> {
1953 5
    this.initialize();
1954 5
    if (!this._terminated) {
1955 5
      return this.gameServerDeploymentsServiceStub!.then(stub => {
1956 5
        this._terminated = true;
1957 5
        stub.close();
1958 5
      });
1959 5
    }
1960 5
    return Promise.resolve();
1961 0
  }
1962 5
}

Read our documentation on viewing source code .

Loading