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
/* global window */
20 5
import * as gax from 'google-gax';
21 5
import {
22 5
  Callback,
23 5
  CallOptions,
24 5
  Descriptors,
25 5
  ClientOptions,
26 5
  LROperation,
27 5
  PaginationCallback,
28 5
  GaxCall,
29 5
} from 'google-gax';
30 5
import * as path from 'path';
31 5

32 5
import {Transform} from 'stream';
33 5
import {RequestType} from 'google-gax/build/src/apitypes';
34 5
import * as protos from '../../protos/protos';
35 5
/**
36 5
 * Client JSON configuration object, loaded from
37 5
 * `src/v1beta/game_server_deployments_service_client_config.json`.
38 5
 * This file defines retry strategy and timeouts for all API methods in this library.
39 5
 */
40 5
import * as gapicConfig from './game_server_deployments_service_client_config.json';
41 5
import {operationsProtos} from 'google-gax';
42 5
const version = require('../../../package.json').version;
43 5

44 5
/**
45 5
 *  The game server deployment is used to control the deployment of Agones
46 5
 *  fleets.
47 5
 * @class
48 5
 * @memberof v1beta
49 5
 */
50 5
export class GameServerDeploymentsServiceClient {
51 5
  private _terminated = false;
52 5
  private _opts: ClientOptions;
53 5
  private _gaxModule: typeof gax | typeof gax.fallback;
54 5
  private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
55 5
  private _protos: {};
56 5
  private _defaults: {[method: string]: gax.CallSettings};
57 5
  auth: gax.GoogleAuth;
58 5
  descriptors: Descriptors = {
59 5
    page: {},
60 5
    stream: {},
61 5
    longrunning: {},
62 5
    batching: {},
63 5
  };
64 5
  innerApiCalls: {[name: string]: Function};
65 5
  pathTemplates: {[name: string]: gax.PathTemplate};
66 5
  operationsClient: gax.OperationsClient;
67 5
  gameServerDeploymentsServiceStub?: Promise<{[name: string]: Function}>;
68 5

69 5
  /**
70 5
   * Construct an instance of GameServerDeploymentsServiceClient.
71 5
   *
72 5
   * @param {object} [options] - The configuration object.
73 5
   * The options accepted by the constructor are described in detail
74 5
   * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
75 5
   * The common options are:
76 5
   * @param {object} [options.credentials] - Credentials object.
77 5
   * @param {string} [options.credentials.client_email]
78 5
   * @param {string} [options.credentials.private_key]
79 5
   * @param {string} [options.email] - Account email address. Required when
80 5
   *     using a .pem or .p12 keyFilename.
81 5
   * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
82 5
   *     .p12 key downloaded from the Google Developers Console. If you provide
83 5
   *     a path to a JSON file, the projectId option below is not necessary.
84 5
   *     NOTE: .pem and .p12 require you to specify options.email as well.
85 5
   * @param {number} [options.port] - The port on which to connect to
86 5
   *     the remote host.
87 5
   * @param {string} [options.projectId] - The project ID from the Google
88 5
   *     Developer's Console, e.g. 'grape-spaceship-123'. We will also check
89 5
   *     the environment variable GCLOUD_PROJECT for your project ID. If your
90 5
   *     app is running in an environment which supports
91 5
   *     {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
92 5
   *     your project ID will be detected automatically.
93 5
   * @param {string} [options.apiEndpoint] - The domain name of the
94 5
   *     API remote host.
95 5
   * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
96 5
   *     Follows the structure of {@link gapicConfig}.
97 5
   * @param {boolean} [options.fallback] - Use HTTP fallback mode.
98 5
   *     In fallback mode, a special browser-compatible transport implementation is used
99 5
   *     instead of gRPC transport. In browser context (if the `window` object is defined)
100 5
   *     the fallback mode is enabled automatically; set `options.fallback` to `false`
101 5
   *     if you need to override this behavior.
102 5
   */
103 5
  constructor(opts?: ClientOptions) {
104 5
    // Ensure that options include all the required fields.
105 5
    const staticMembers = this
106 5
      .constructor as typeof GameServerDeploymentsServiceClient;
107 5
    const servicePath =
108 5
      opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
109 5
    const port = opts?.port || staticMembers.port;
110 5
    const clientConfig = opts?.clientConfig ?? {};
111 5
    const fallback =
112 5
      opts?.fallback ??
113 5
      (typeof window !== 'undefined' && typeof window?.fetch === 'function');
114 5
    opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);
115 5

116 5
    // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
117 5
    if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
118 0
      opts['scopes'] = staticMembers.scopes;
119 0
    }
120 5

121 5
    // Choose either gRPC or proto-over-HTTP implementation of google-gax.
122 5
    this._gaxModule = opts.fallback ? gax.fallback : gax;
123 5

124 5
    // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
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
    // Set the default scopes in auth client if needed.
134 5
    if (servicePath === staticMembers.servicePath) {
135 5
      this.auth.defaultScopes = staticMembers.scopes;
136 5
    }
137 5

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

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

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

190 5
    // Some of the methods on this service return "paged" results,
191 5
    // (e.g. 50 results at a time, with tokens to get subsequent
192 5
    // pages). Denote the keys used for pagination and results.
193 5
    this.descriptors.page = {
194 5
      listGameServerDeployments: new this._gaxModule.PageDescriptor(
195 5
        'pageToken',
196 5
        'nextPageToken',
197 5
        'gameServerDeployments'
198 5
      ),
199 5
    };
200 5

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

211 5
    this.operationsClient = this._gaxModule
212 5
      .lro({
213 5
        auth: this.auth,
214 5
        grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
215 5
      })
216 5
      .operationsClient(opts);
217 5
    const createGameServerDeploymentResponse = protoFilesRoot.lookup(
218 5
      '.google.cloud.gaming.v1beta.GameServerDeployment'
219 5
    ) as gax.protobuf.Type;
220 5
    const createGameServerDeploymentMetadata = protoFilesRoot.lookup(
221 5
      '.google.cloud.gaming.v1beta.OperationMetadata'
222 5
    ) as gax.protobuf.Type;
223 5
    const deleteGameServerDeploymentResponse = protoFilesRoot.lookup(
224 5
      '.google.protobuf.Empty'
225 5
    ) as gax.protobuf.Type;
226 5
    const deleteGameServerDeploymentMetadata = protoFilesRoot.lookup(
227 5
      '.google.cloud.gaming.v1beta.OperationMetadata'
228 5
    ) as gax.protobuf.Type;
229 5
    const updateGameServerDeploymentResponse = protoFilesRoot.lookup(
230 5
      '.google.cloud.gaming.v1beta.GameServerDeployment'
231 5
    ) as gax.protobuf.Type;
232 5
    const updateGameServerDeploymentMetadata = protoFilesRoot.lookup(
233 5
      '.google.cloud.gaming.v1beta.OperationMetadata'
234 5
    ) as gax.protobuf.Type;
235 5
    const updateGameServerDeploymentRolloutResponse = protoFilesRoot.lookup(
236 5
      '.google.cloud.gaming.v1beta.GameServerDeployment'
237 5
    ) as gax.protobuf.Type;
238 5
    const updateGameServerDeploymentRolloutMetadata = protoFilesRoot.lookup(
239 5
      '.google.cloud.gaming.v1beta.OperationMetadata'
240 5
    ) as gax.protobuf.Type;
241 5

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

281 5
    // Put together the default options sent with requests.
282 5
    this._defaults = this._gaxGrpc.constructSettings(
283 5
      'google.cloud.gaming.v1beta.GameServerDeploymentsService',
284 5
      gapicConfig as gax.ClientConfig,
285 5
      opts.clientConfig || {},
286 5
      {'x-goog-api-client': clientHeader.join(' ')}
287 5
    );
288 5

289 5
    // Set up a dictionary of "inner API calls"; the core implementation
290 5
    // of calling the API is handled in `google-gax`, with this code
291 5
    // merely providing the destination and request information.
292 5
    this.innerApiCalls = {};
293 5
  }
294 5

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

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

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

352 5
      const descriptor =
353 5
        this.descriptors.page[methodName] ||
354 5
        this.descriptors.longrunning[methodName] ||
355 5
        undefined;
356 5
      const apiCall = this._gaxModule.createApiCall(
357 5
        callPromise,
358 5
        this._defaults[methodName],
359 5
        descriptor
360 5
      );
361 5

362 5
      this.innerApiCalls[methodName] = apiCall;
363 5
    }
364 5

365 5
    return this.gameServerDeploymentsServiceStub;
366 5
  }
367 5

368 5
  /**
369 5
   * The DNS address for this API service.
370 5
   * @returns {string} The DNS address for this service.
371 5
   */
372 5
  static get servicePath() {
373 5
    return 'gameservices.googleapis.com';
374 5
  }
375 5

376 5
  /**
377 5
   * The DNS address for this API service - same as servicePath(),
378 5
   * exists for compatibility reasons.
379 5
   * @returns {string} The DNS address for this service.
380 5
   */
381 5
  static get apiEndpoint() {
382 5
    return 'gameservices.googleapis.com';
383 5
  }
384 5

385 5
  /**
386 5
   * The port for this API service.
387 5
   * @returns {number} The default port for this service.
388 5
   */
389 5
  static get port() {
390 5
    return 443;
391 5
  }
392 5

393 5
  /**
394 5
   * The scopes needed to make gRPC calls for every method defined
395 5
   * in this service.
396 5
   * @returns {string[]} List of default scopes.
397 5
   */
398 5
  static get scopes() {
399 5
    return ['https://www.googleapis.com/auth/cloud-platform'];
400 5
  }
401 5

402 5
  getProjectId(): Promise<string>;
403 5
  getProjectId(callback: Callback<string, undefined, undefined>): void;
404 5
  /**
405 5
   * Return the project ID used by this class.
406 5
   * @returns {Promise} A promise that resolves to string containing the project ID.
407 5
   */
408 5
  getProjectId(
409 5
    callback?: Callback<string, undefined, undefined>
410 5
  ): Promise<string> | void {
411 5
    if (callback) {
412 5
      this.auth.getProjectId(callback);
413 5
      return;
414 5
    }
415 5
    return this.auth.getProjectId();
416 5
  }
417 5

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

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

1573 5
  /**
1574 5
   * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
1575 5
   * @param {Object} request
1576 5
   *   The request object that will be sent.
1577 5
   * @param {string} request.parent
1578 5
   *   Required. The parent resource name. Uses the form:
1579 5
   *   `projects/{project}/locations/{location}`.
1580 5
   * @param {number} [request.pageSize]
1581 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1582 5
   *   will pick an appropriate default. The server may return fewer items than
1583 5
   *   requested. A caller should only rely on response's
1584 5
   *   {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to
1585 5
   *   determine if there are more GameServerDeployments left to be queried.
1586 5
   * @param {string} [request.pageToken]
1587 5
   *   Optional. The next_page_token value returned from a previous List request,
1588 5
   *   if any.
1589 5
   * @param {string} [request.filter]
1590 5
   *   Optional. The filter to apply to list results.
1591 5
   * @param {string} [request.orderBy]
1592 5
   *   Optional. Specifies the ordering of results following syntax at
1593 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1594 5
   * @param {object} [options]
1595 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1596 5
   * @returns {Stream}
1597 5
   *   An object stream which emits an object representing [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment} on 'data' event.
1598 5
   *   The client library will perform auto-pagination by default: it will call the API as many
1599 5
   *   times as needed. Note that it can affect your quota.
1600 5
   *   We recommend using `listGameServerDeploymentsAsync()`
1601 5
   *   method described below for async iteration which you can stop as needed.
1602 5
   *   Please see the
1603 5
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1604 5
   *   for more details and examples.
1605 5
   */
1606 5
  listGameServerDeploymentsStream(
1607 5
    request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest,
1608 5
    options?: CallOptions
1609 5
  ): Transform {
1610 5
    request = request || {};
1611 5
    options = options || {};
1612 5
    options.otherArgs = options.otherArgs || {};
1613 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1614 5
    options.otherArgs.headers[
1615 5
      'x-goog-request-params'
1616 5
    ] = gax.routingHeader.fromParams({
1617 5
      parent: request.parent || '',
1618 5
    });
1619 5
    const callSettings = new gax.CallSettings(options);
1620 5
    this.initialize();
1621 5
    return this.descriptors.page.listGameServerDeployments.createStream(
1622 5
      this.innerApiCalls.listGameServerDeployments as gax.GaxCall,
1623 5
      request,
1624 5
      callSettings
1625 5
    );
1626 5
  }
1627 5

1628 5
  /**
1629 5
   * Equivalent to `listGameServerDeployments`, but returns an iterable object.
1630 5
   *
1631 5
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1632 5
   * @param {Object} request
1633 5
   *   The request object that will be sent.
1634 5
   * @param {string} request.parent
1635 5
   *   Required. The parent resource name. Uses the form:
1636 5
   *   `projects/{project}/locations/{location}`.
1637 5
   * @param {number} [request.pageSize]
1638 5
   *   Optional. The maximum number of items to return.  If unspecified, the server
1639 5
   *   will pick an appropriate default. The server may return fewer items than
1640 5
   *   requested. A caller should only rely on response's
1641 5
   *   {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to
1642 5
   *   determine if there are more GameServerDeployments left to be queried.
1643 5
   * @param {string} [request.pageToken]
1644 5
   *   Optional. The next_page_token value returned from a previous List request,
1645 5
   *   if any.
1646 5
   * @param {string} [request.filter]
1647 5
   *   Optional. The filter to apply to list results.
1648 5
   * @param {string} [request.orderBy]
1649 5
   *   Optional. Specifies the ordering of results following syntax at
1650 5
   *   https://cloud.google.com/apis/design/design_patterns#sorting_order.
1651 5
   * @param {object} [options]
1652 5
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1653 5
   * @returns {Object}
1654 5
   *   An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
1655 5
   *   When you iterate the returned iterable, each element will be an object representing
1656 5
   *   [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment}. The API will be called under the hood as needed, once per the page,
1657 5
   *   so you can stop the iteration when you don't need more results.
1658 5
   *   Please see the
1659 5
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1660 5
   *   for more details and examples.
1661 5
   * @example
1662 5
   * const iterable = client.listGameServerDeploymentsAsync(request);
1663 5
   * for await (const response of iterable) {
1664 5
   *   // process response
1665 5
   * }
1666 5
   */
1667 5
  listGameServerDeploymentsAsync(
1668 5
    request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest,
1669 5
    options?: CallOptions
1670 5
  ): AsyncIterable<protos.google.cloud.gaming.v1beta.IGameServerDeployment> {
1671 5
    request = request || {};
1672 5
    options = options || {};
1673 5
    options.otherArgs = options.otherArgs || {};
1674 5
    options.otherArgs.headers = options.otherArgs.headers || {};
1675 5
    options.otherArgs.headers[
1676 5
      'x-goog-request-params'
1677 5
    ] = gax.routingHeader.fromParams({
1678 5
      parent: request.parent || '',
1679 5
    });
1680 5
    options = options || {};
1681 5
    const callSettings = new gax.CallSettings(options);
1682 5
    this.initialize();
1683 5
    return this.descriptors.page.listGameServerDeployments.asyncIterate(
1684 5
      this.innerApiCalls['listGameServerDeployments'] as GaxCall,
1685 5
      (request as unknown) as RequestType,
1686 5
      callSettings
1687 5
    ) as AsyncIterable<protos.google.cloud.gaming.v1beta.IGameServerDeployment>;
1688 5
  }
1689 5
  // --------------------
1690 5
  // -- Path templates --
1691 5
  // --------------------
1692 5

1693 5
  /**
1694 5
   * Return a fully-qualified gameServerCluster resource name string.
1695 5
   *
1696 5
   * @param {string} project
1697 5
   * @param {string} location
1698 5
   * @param {string} realm
1699 5
   * @param {string} cluster
1700 5
   * @returns {string} Resource name string.
1701 5
   */
1702 5
  gameServerClusterPath(
1703 5
    project: string,
1704 5
    location: string,
1705 5
    realm: string,
1706 5
    cluster: string
1707 5
  ) {
1708 5
    return this.pathTemplates.gameServerClusterPathTemplate.render({
1709 5
      project: project,
1710 5
      location: location,
1711 5
      realm: realm,
1712 5
      cluster: cluster,
1713 5
    });
1714 5
  }
1715 5

1716 5
  /**
1717 5
   * Parse the project from GameServerCluster resource.
1718 5
   *
1719 5
   * @param {string} gameServerClusterName
1720 5
   *   A fully-qualified path representing GameServerCluster resource.
1721 5
   * @returns {string} A string representing the project.
1722 5
   */
1723 5
  matchProjectFromGameServerClusterName(gameServerClusterName: string) {
1724 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1725 5
      gameServerClusterName
1726 5
    ).project;
1727 5
  }
1728 5

1729 5
  /**
1730 5
   * Parse the location from GameServerCluster resource.
1731 5
   *
1732 5
   * @param {string} gameServerClusterName
1733 5
   *   A fully-qualified path representing GameServerCluster resource.
1734 5
   * @returns {string} A string representing the location.
1735 5
   */
1736 5
  matchLocationFromGameServerClusterName(gameServerClusterName: string) {
1737 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1738 5
      gameServerClusterName
1739 5
    ).location;
1740 5
  }
1741 5

1742 5
  /**
1743 5
   * Parse the realm from GameServerCluster resource.
1744 5
   *
1745 5
   * @param {string} gameServerClusterName
1746 5
   *   A fully-qualified path representing GameServerCluster resource.
1747 5
   * @returns {string} A string representing the realm.
1748 5
   */
1749 5
  matchRealmFromGameServerClusterName(gameServerClusterName: string) {
1750 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1751 5
      gameServerClusterName
1752 5
    ).realm;
1753 5
  }
1754 5

1755 5
  /**
1756 5
   * Parse the cluster from GameServerCluster resource.
1757 5
   *
1758 5
   * @param {string} gameServerClusterName
1759 5
   *   A fully-qualified path representing GameServerCluster resource.
1760 5
   * @returns {string} A string representing the cluster.
1761 5
   */
1762 5
  matchClusterFromGameServerClusterName(gameServerClusterName: string) {
1763 5
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1764 5
      gameServerClusterName
1765 5
    ).cluster;
1766 5
  }
1767 5

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

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

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

1817 5
  /**
1818 5
   * Parse the deployment from GameServerConfig resource.
1819 5
   *
1820 5
   * @param {string} gameServerConfigName
1821 5
   *   A fully-qualified path representing GameServerConfig resource.
1822 5
   * @returns {string} A string representing the deployment.
1823 5
   */
1824 5
  matchDeploymentFromGameServerConfigName(gameServerConfigName: string) {
1825 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1826 5
      gameServerConfigName
1827 5
    ).deployment;
1828 5
  }
1829 5

1830 5
  /**
1831 5
   * Parse the config from GameServerConfig resource.
1832 5
   *
1833 5
   * @param {string} gameServerConfigName
1834 5
   *   A fully-qualified path representing GameServerConfig resource.
1835 5
   * @returns {string} A string representing the config.
1836 5
   */
1837 5
  matchConfigFromGameServerConfigName(gameServerConfigName: string) {
1838 5
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1839 5
      gameServerConfigName
1840 5
    ).config;
1841 5
  }
1842 5

1843 5
  /**
1844 5
   * Return a fully-qualified gameServerDeployment resource name string.
1845 5
   *
1846 5
   * @param {string} project
1847 5
   * @param {string} location
1848 5
   * @param {string} deployment
1849 5
   * @returns {string} Resource name string.
1850 5
   */
1851 5
  gameServerDeploymentPath(
1852 5
    project: string,
1853 5
    location: string,
1854 5
    deployment: string
1855 5
  ) {
1856 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.render({
1857 5
      project: project,
1858 5
      location: location,
1859 5
      deployment: deployment,
1860 5
    });
1861 5
  }
1862 5

1863 5
  /**
1864 5
   * Parse the project from GameServerDeployment resource.
1865 5
   *
1866 5
   * @param {string} gameServerDeploymentName
1867 5
   *   A fully-qualified path representing GameServerDeployment resource.
1868 5
   * @returns {string} A string representing the project.
1869 5
   */
1870 5
  matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) {
1871 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1872 5
      gameServerDeploymentName
1873 5
    ).project;
1874 5
  }
1875 5

1876 5
  /**
1877 5
   * Parse the location from GameServerDeployment resource.
1878 5
   *
1879 5
   * @param {string} gameServerDeploymentName
1880 5
   *   A fully-qualified path representing GameServerDeployment resource.
1881 5
   * @returns {string} A string representing the location.
1882 5
   */
1883 5
  matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) {
1884 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1885 5
      gameServerDeploymentName
1886 5
    ).location;
1887 5
  }
1888 5

1889 5
  /**
1890 5
   * Parse the deployment from GameServerDeployment resource.
1891 5
   *
1892 5
   * @param {string} gameServerDeploymentName
1893 5
   *   A fully-qualified path representing GameServerDeployment resource.
1894 5
   * @returns {string} A string representing the deployment.
1895 5
   */
1896 5
  matchDeploymentFromGameServerDeploymentName(
1897 5
    gameServerDeploymentName: string
1898 5
  ) {
1899 5
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1900 5
      gameServerDeploymentName
1901 5
    ).deployment;
1902 5
  }
1903 5

1904 5
  /**
1905 5
   * Return a fully-qualified gameServerDeploymentRollout resource name string.
1906 5
   *
1907 5
   * @param {string} project
1908 5
   * @param {string} location
1909 5
   * @param {string} deployment
1910 5
   * @returns {string} Resource name string.
1911 5
   */
1912 5
  gameServerDeploymentRolloutPath(
1913 5
    project: string,
1914 5
    location: string,
1915 5
    deployment: string
1916 5
  ) {
1917 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({
1918 5
      project: project,
1919 5
      location: location,
1920 5
      deployment: deployment,
1921 5
    });
1922 5
  }
1923 5

1924 5
  /**
1925 5
   * Parse the project from GameServerDeploymentRollout resource.
1926 5
   *
1927 5
   * @param {string} gameServerDeploymentRolloutName
1928 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1929 5
   * @returns {string} A string representing the project.
1930 5
   */
1931 5
  matchProjectFromGameServerDeploymentRolloutName(
1932 5
    gameServerDeploymentRolloutName: string
1933 5
  ) {
1934 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1935 5
      gameServerDeploymentRolloutName
1936 5
    ).project;
1937 5
  }
1938 5

1939 5
  /**
1940 5
   * Parse the location from GameServerDeploymentRollout resource.
1941 5
   *
1942 5
   * @param {string} gameServerDeploymentRolloutName
1943 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1944 5
   * @returns {string} A string representing the location.
1945 5
   */
1946 5
  matchLocationFromGameServerDeploymentRolloutName(
1947 5
    gameServerDeploymentRolloutName: string
1948 5
  ) {
1949 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1950 5
      gameServerDeploymentRolloutName
1951 5
    ).location;
1952 5
  }
1953 5

1954 5
  /**
1955 5
   * Parse the deployment from GameServerDeploymentRollout resource.
1956 5
   *
1957 5
   * @param {string} gameServerDeploymentRolloutName
1958 5
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1959 5
   * @returns {string} A string representing the deployment.
1960 5
   */
1961 5
  matchDeploymentFromGameServerDeploymentRolloutName(
1962 5
    gameServerDeploymentRolloutName: string
1963 5
  ) {
1964 5
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1965 5
      gameServerDeploymentRolloutName
1966 5
    ).deployment;
1967 5
  }
1968 5

1969 5
  /**
1970 5
   * Return a fully-qualified realm resource name string.
1971 5
   *
1972 5
   * @param {string} project
1973 5
   * @param {string} location
1974 5
   * @param {string} realm
1975 5
   * @returns {string} Resource name string.
1976 5
   */
1977 5
  realmPath(project: string, location: string, realm: string) {
1978 5
    return this.pathTemplates.realmPathTemplate.render({
1979 5
      project: project,
1980 5
      location: location,
1981 5
      realm: realm,
1982 5
    });
1983 5
  }
1984 5

1985 5
  /**
1986 5
   * Parse the project from Realm resource.
1987 5
   *
1988 5
   * @param {string} realmName
1989 5
   *   A fully-qualified path representing Realm resource.
1990 5
   * @returns {string} A string representing the project.
1991 5
   */
1992 5
  matchProjectFromRealmName(realmName: string) {
1993 5
    return this.pathTemplates.realmPathTemplate.match(realmName).project;
1994 5
  }
1995 5

1996 5
  /**
1997 5
   * Parse the location from Realm resource.
1998 5
   *
1999 5
   * @param {string} realmName
2000 5
   *   A fully-qualified path representing Realm resource.
2001 5
   * @returns {string} A string representing the location.
2002 5
   */
2003 5
  matchLocationFromRealmName(realmName: string) {
2004 5
    return this.pathTemplates.realmPathTemplate.match(realmName).location;
2005 5
  }
2006 5

2007 5
  /**
2008 5
   * Parse the realm from Realm resource.
2009 5
   *
2010 5
   * @param {string} realmName
2011 5
   *   A fully-qualified path representing Realm resource.
2012 5
   * @returns {string} A string representing the realm.
2013 5
   */
2014 5
  matchRealmFromRealmName(realmName: string) {
2015 5
    return this.pathTemplates.realmPathTemplate.match(realmName).realm;
2016 5
  }
2017 5

2018 5
  /**
2019 5
   * Terminate the gRPC channel and close the client.
2020 5
   *
2021 5
   * The client will no longer be usable and all future behavior is undefined.
2022 5
   * @returns {Promise} A promise that resolves when the client is closed.
2023 5
   */
2024 5
  close(): Promise<void> {
2025 5
    this.initialize();
2026 5
    if (!this._terminated) {
2027 5
      return this.gameServerDeploymentsServiceStub!.then(stub => {
2028 5
        this._terminated = true;
2029 5
        stub.close();
2030 5
      });
2031 5
    }
2032 5
    return Promise.resolve();
2033 0
  }
2034 5
}

Read our documentation on viewing source code .

Loading