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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

320 4
    // Iterate over each of the methods that the service provides
321 4
    // and create an API call method for each.
322 4
    const gameServerDeploymentsServiceStubMethods = [
323 4
      'listGameServerDeployments',
324 4
      'getGameServerDeployment',
325 4
      'createGameServerDeployment',
326 4
      'deleteGameServerDeployment',
327 4
      'updateGameServerDeployment',
328 4
      'getGameServerDeploymentRollout',
329 4
      'updateGameServerDeploymentRollout',
330 4
      'previewGameServerDeploymentRollout',
331 4
      'fetchDeploymentState',
332 4
    ];
333 4
    for (const methodName of gameServerDeploymentsServiceStubMethods) {
334 4
      const callPromise = this.gameServerDeploymentsServiceStub.then(
335 4
        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 4
        },
342 4
        (err: Error | null | undefined) => () => {
343 0
          throw err;
344 0
        }
345 4
      );
346 4

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

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

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

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

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

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

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

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

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

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

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

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

1634 4
  /**
1635 4
   * Return a fully-qualified gameServerCluster resource name string.
1636 4
   *
1637 4
   * @param {string} project
1638 4
   * @param {string} location
1639 4
   * @param {string} realm
1640 4
   * @param {string} cluster
1641 4
   * @returns {string} Resource name string.
1642 4
   */
1643 4
  gameServerClusterPath(
1644 4
    project: string,
1645 4
    location: string,
1646 4
    realm: string,
1647 4
    cluster: string
1648 4
  ) {
1649 4
    return this.pathTemplates.gameServerClusterPathTemplate.render({
1650 4
      project: project,
1651 4
      location: location,
1652 4
      realm: realm,
1653 4
      cluster: cluster,
1654 4
    });
1655 4
  }
1656 4

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

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

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

1696 4
  /**
1697 4
   * Parse the cluster from GameServerCluster resource.
1698 4
   *
1699 4
   * @param {string} gameServerClusterName
1700 4
   *   A fully-qualified path representing GameServerCluster resource.
1701 4
   * @returns {string} A string representing the cluster.
1702 4
   */
1703 4
  matchClusterFromGameServerClusterName(gameServerClusterName: string) {
1704 4
    return this.pathTemplates.gameServerClusterPathTemplate.match(
1705 4
      gameServerClusterName
1706 4
    ).cluster;
1707 4
  }
1708 4

1709 4
  /**
1710 4
   * Return a fully-qualified gameServerConfig resource name string.
1711 4
   *
1712 4
   * @param {string} project
1713 4
   * @param {string} location
1714 4
   * @param {string} deployment
1715 4
   * @param {string} config
1716 4
   * @returns {string} Resource name string.
1717 4
   */
1718 4
  gameServerConfigPath(
1719 4
    project: string,
1720 4
    location: string,
1721 4
    deployment: string,
1722 4
    config: string
1723 4
  ) {
1724 4
    return this.pathTemplates.gameServerConfigPathTemplate.render({
1725 4
      project: project,
1726 4
      location: location,
1727 4
      deployment: deployment,
1728 4
      config: config,
1729 4
    });
1730 4
  }
1731 4

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

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

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

1771 4
  /**
1772 4
   * Parse the config from GameServerConfig resource.
1773 4
   *
1774 4
   * @param {string} gameServerConfigName
1775 4
   *   A fully-qualified path representing GameServerConfig resource.
1776 4
   * @returns {string} A string representing the config.
1777 4
   */
1778 4
  matchConfigFromGameServerConfigName(gameServerConfigName: string) {
1779 4
    return this.pathTemplates.gameServerConfigPathTemplate.match(
1780 4
      gameServerConfigName
1781 4
    ).config;
1782 4
  }
1783 4

1784 4
  /**
1785 4
   * Return a fully-qualified gameServerDeployment resource name string.
1786 4
   *
1787 4
   * @param {string} project
1788 4
   * @param {string} location
1789 4
   * @param {string} deployment
1790 4
   * @returns {string} Resource name string.
1791 4
   */
1792 4
  gameServerDeploymentPath(
1793 4
    project: string,
1794 4
    location: string,
1795 4
    deployment: string
1796 4
  ) {
1797 4
    return this.pathTemplates.gameServerDeploymentPathTemplate.render({
1798 4
      project: project,
1799 4
      location: location,
1800 4
      deployment: deployment,
1801 4
    });
1802 4
  }
1803 4

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

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

1830 4
  /**
1831 4
   * Parse the deployment from GameServerDeployment resource.
1832 4
   *
1833 4
   * @param {string} gameServerDeploymentName
1834 4
   *   A fully-qualified path representing GameServerDeployment resource.
1835 4
   * @returns {string} A string representing the deployment.
1836 4
   */
1837 4
  matchDeploymentFromGameServerDeploymentName(
1838 4
    gameServerDeploymentName: string
1839 4
  ) {
1840 4
    return this.pathTemplates.gameServerDeploymentPathTemplate.match(
1841 4
      gameServerDeploymentName
1842 4
    ).deployment;
1843 4
  }
1844 4

1845 4
  /**
1846 4
   * Return a fully-qualified gameServerDeploymentRollout resource name string.
1847 4
   *
1848 4
   * @param {string} project
1849 4
   * @param {string} location
1850 4
   * @param {string} deployment
1851 4
   * @returns {string} Resource name string.
1852 4
   */
1853 4
  gameServerDeploymentRolloutPath(
1854 4
    project: string,
1855 4
    location: string,
1856 4
    deployment: string
1857 4
  ) {
1858 4
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({
1859 4
      project: project,
1860 4
      location: location,
1861 4
      deployment: deployment,
1862 4
    });
1863 4
  }
1864 4

1865 4
  /**
1866 4
   * Parse the project from GameServerDeploymentRollout resource.
1867 4
   *
1868 4
   * @param {string} gameServerDeploymentRolloutName
1869 4
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1870 4
   * @returns {string} A string representing the project.
1871 4
   */
1872 4
  matchProjectFromGameServerDeploymentRolloutName(
1873 4
    gameServerDeploymentRolloutName: string
1874 4
  ) {
1875 4
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1876 4
      gameServerDeploymentRolloutName
1877 4
    ).project;
1878 4
  }
1879 4

1880 4
  /**
1881 4
   * Parse the location from GameServerDeploymentRollout resource.
1882 4
   *
1883 4
   * @param {string} gameServerDeploymentRolloutName
1884 4
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1885 4
   * @returns {string} A string representing the location.
1886 4
   */
1887 4
  matchLocationFromGameServerDeploymentRolloutName(
1888 4
    gameServerDeploymentRolloutName: string
1889 4
  ) {
1890 4
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1891 4
      gameServerDeploymentRolloutName
1892 4
    ).location;
1893 4
  }
1894 4

1895 4
  /**
1896 4
   * Parse the deployment from GameServerDeploymentRollout resource.
1897 4
   *
1898 4
   * @param {string} gameServerDeploymentRolloutName
1899 4
   *   A fully-qualified path representing GameServerDeploymentRollout resource.
1900 4
   * @returns {string} A string representing the deployment.
1901 4
   */
1902 4
  matchDeploymentFromGameServerDeploymentRolloutName(
1903 4
    gameServerDeploymentRolloutName: string
1904 4
  ) {
1905 4
    return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match(
1906 4
      gameServerDeploymentRolloutName
1907 4
    ).deployment;
1908 4
  }
1909 4

1910 4
  /**
1911 4
   * Return a fully-qualified realm resource name string.
1912 4
   *
1913 4
   * @param {string} project
1914 4
   * @param {string} location
1915 4
   * @param {string} realm
1916 4
   * @returns {string} Resource name string.
1917 4
   */
1918 4
  realmPath(project: string, location: string, realm: string) {
1919 4
    return this.pathTemplates.realmPathTemplate.render({
1920 4
      project: project,
1921 4
      location: location,
1922 4
      realm: realm,
1923 4
    });
1924 4
  }
1925 4

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

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

1948 4
  /**
1949 4
   * Parse the realm from Realm resource.
1950 4
   *
1951 4
   * @param {string} realmName
1952 4
   *   A fully-qualified path representing Realm resource.
1953 4
   * @returns {string} A string representing the realm.
1954 4
   */
1955 4
  matchRealmFromRealmName(realmName: string) {
1956 4
    return this.pathTemplates.realmPathTemplate.match(realmName).realm;
1957 4
  }
1958 4

1959 4
  /**
1960 4
   * Terminate the GRPC channel and close the client.
1961 4
   *
1962 4
   * The client will no longer be usable and all future behavior is undefined.
1963 4
   */
1964 4
  close(): Promise<void> {
1965 4
    this.initialize();
1966 4
    if (!this._terminated) {
1967 4
      return this.gameServerDeploymentsServiceStub!.then(stub => {
1968 4
        this._terminated = true;
1969 4
        stub.close();
1970 4
      });
1971 4
    }
1972 0
    return Promise.resolve();
1973 0
  }
1974 4
}

Read our documentation on viewing source code .

Loading