1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\GameServices\Resource;
19
20use Google\Service\GameServices\GameServerConfig;
21use Google\Service\GameServices\ListGameServerConfigsResponse;
22use Google\Service\GameServices\Operation;
23
24/**
25 * The "configs" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $gameservicesService = new Google\Service\GameServices(...);
29 *   $configs = $gameservicesService->configs;
30 *  </code>
31 */
32class ProjectsLocationsGameServerDeploymentsConfigs extends \Google\Service\Resource
33{
34  /**
35   * Creates a new game server config in a given project, location, and game
36   * server deployment. Game server configs are immutable, and are not applied
37   * until referenced in the game server deployment rollout resource.
38   * (configs.create)
39   *
40   * @param string $parent Required. The parent resource name, in the following
41   * form: `projects/{project}/locations/{locationId}/gameServerDeployments/{deplo
42   * ymentId}/`.
43   * @param GameServerConfig $postBody
44   * @param array $optParams Optional parameters.
45   *
46   * @opt_param string configId Required. The ID of the game server config
47   * resource to create.
48   * @return Operation
49   */
50  public function create($parent, GameServerConfig $postBody, $optParams = [])
51  {
52    $params = ['parent' => $parent, 'postBody' => $postBody];
53    $params = array_merge($params, $optParams);
54    return $this->call('create', [$params], Operation::class);
55  }
56  /**
57   * Deletes a single game server config. The deletion fails if the game server
58   * config is referenced in a game server deployment rollout. (configs.delete)
59   *
60   * @param string $name Required. The name of the game server config to delete,
61   * in the following form: `projects/{project}/locations/{locationId}/gameServerD
62   * eployments/{deploymentId}/configs/{configId}`.
63   * @param array $optParams Optional parameters.
64   * @return Operation
65   */
66  public function delete($name, $optParams = [])
67  {
68    $params = ['name' => $name];
69    $params = array_merge($params, $optParams);
70    return $this->call('delete', [$params], Operation::class);
71  }
72  /**
73   * Gets details of a single game server config. (configs.get)
74   *
75   * @param string $name Required. The name of the game server config to retrieve,
76   * in the following form: `projects/{project}/locations/{locationId}/gameServerD
77   * eployments/{deploymentId}/configs/{configId}`.
78   * @param array $optParams Optional parameters.
79   * @return GameServerConfig
80   */
81  public function get($name, $optParams = [])
82  {
83    $params = ['name' => $name];
84    $params = array_merge($params, $optParams);
85    return $this->call('get', [$params], GameServerConfig::class);
86  }
87  /**
88   * Lists game server configs in a given project, location, and game server
89   * deployment. (configs.listProjectsLocationsGameServerDeploymentsConfigs)
90   *
91   * @param string $parent Required. The parent resource name, in the following
92   * form: `projects/{project}/locations/{locationId}/gameServerDeployments/{deplo
93   * ymentId}/configs`.
94   * @param array $optParams Optional parameters.
95   *
96   * @opt_param string filter Optional. The filter to apply to list results (see
97   * [Filtering](https://google.aip.dev/160)).
98   * @opt_param string orderBy Optional. Specifies the ordering of results
99   * following [Cloud API
100   * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order).
101   * @opt_param int pageSize Optional. The maximum number of items to return. If
102   * unspecified, the server picks an appropriate default. The server may return
103   * fewer items than requested. A caller should only rely on response's
104   * next_page_token to determine if there are more GameServerConfigs left to be
105   * queried.
106   * @opt_param string pageToken Optional. The next_page_token value returned from
107   * a previous list request, if any.
108   * @return ListGameServerConfigsResponse
109   */
110  public function listProjectsLocationsGameServerDeploymentsConfigs($parent, $optParams = [])
111  {
112    $params = ['parent' => $parent];
113    $params = array_merge($params, $optParams);
114    return $this->call('list', [$params], ListGameServerConfigsResponse::class);
115  }
116}
117
118// Adding a class alias for backwards compatibility with the previous class name.
119class_alias(ProjectsLocationsGameServerDeploymentsConfigs::class, 'Google_Service_GameServices_Resource_ProjectsLocationsGameServerDeploymentsConfigs');
120