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\GameServerCluster;
21use Google\Service\GameServices\ListGameServerClustersResponse;
22use Google\Service\GameServices\Operation;
23use Google\Service\GameServices\PreviewCreateGameServerClusterResponse;
24use Google\Service\GameServices\PreviewDeleteGameServerClusterResponse;
25use Google\Service\GameServices\PreviewUpdateGameServerClusterResponse;
26
27/**
28 * The "gameServerClusters" collection of methods.
29 * Typical usage is:
30 *  <code>
31 *   $gameservicesService = new Google\Service\GameServices(...);
32 *   $gameServerClusters = $gameservicesService->gameServerClusters;
33 *  </code>
34 */
35class ProjectsLocationsRealmsGameServerClusters extends \Google\Service\Resource
36{
37  /**
38   * Creates a new game server cluster in a given project and location.
39   * (gameServerClusters.create)
40   *
41   * @param string $parent Required. The parent resource name, in the following
42   * form: `projects/{project}/locations/{locationId}/realms/{realmId}`.
43   * @param GameServerCluster $postBody
44   * @param array $optParams Optional parameters.
45   *
46   * @opt_param string gameServerClusterId Required. The ID of the game server
47   * cluster resource to create.
48   * @return Operation
49   */
50  public function create($parent, GameServerCluster $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 cluster. (gameServerClusters.delete)
58   *
59   * @param string $name Required. The name of the game server cluster to delete,
60   * in the following form: `projects/{project}/locations/{locationId}/gameServerC
61   * lusters/{gameServerClusterId}`.
62   * @param array $optParams Optional parameters.
63   * @return Operation
64   */
65  public function delete($name, $optParams = [])
66  {
67    $params = ['name' => $name];
68    $params = array_merge($params, $optParams);
69    return $this->call('delete', [$params], Operation::class);
70  }
71  /**
72   * Gets details of a single game server cluster. (gameServerClusters.get)
73   *
74   * @param string $name Required. The name of the game server cluster to
75   * retrieve, in the following form: `projects/{project}/locations/{locationId}/r
76   * ealms/{realmId}/gameServerClusters/{gameServerClusterId}`.
77   * @param array $optParams Optional parameters.
78   *
79   * @opt_param string view Optional. View for the returned GameServerCluster
80   * objects. When `FULL` is specified, the `cluster_state` field is also returned
81   * in the GameServerCluster object, which includes the state of the referenced
82   * Kubernetes cluster such as versions and provider info. The default/unset
83   * value is `GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED`, the same as `BASIC`, which
84   * does not return the `cluster_state` field.
85   * @return GameServerCluster
86   */
87  public function get($name, $optParams = [])
88  {
89    $params = ['name' => $name];
90    $params = array_merge($params, $optParams);
91    return $this->call('get', [$params], GameServerCluster::class);
92  }
93  /**
94   * Lists game server clusters in a given project and location.
95   * (gameServerClusters.listProjectsLocationsRealmsGameServerClusters)
96   *
97   * @param string $parent Required. The parent resource name, in the following
98   * form: `projects/{project}/locations/{locationId}/realms/{realmId}`.
99   * @param array $optParams Optional parameters.
100   *
101   * @opt_param string filter Optional. The filter to apply to list results (see
102   * [Filtering](https://google.aip.dev/160)).
103   * @opt_param string orderBy Optional. Specifies the ordering of results
104   * following [Cloud API
105   * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order).
106   * @opt_param int pageSize Optional. The maximum number of items to return. If
107   * unspecified, the server picks an appropriate default. The server may return
108   * fewer items than requested. A caller should only rely on response's
109   * next_page_token to determine if there are more GameServerClusters left to be
110   * queried.
111   * @opt_param string pageToken Optional. The next_page_token value returned from
112   * a previous list request, if any.
113   * @opt_param string view Optional. View for the returned GameServerCluster
114   * objects. When `FULL` is specified, the `cluster_state` field is also returned
115   * in the GameServerCluster object, which includes the state of the referenced
116   * Kubernetes cluster such as versions and provider info. The default/unset
117   * value is `GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED`, the same as `BASIC`, which
118   * does not return the `cluster_state` field.
119   * @return ListGameServerClustersResponse
120   */
121  public function listProjectsLocationsRealmsGameServerClusters($parent, $optParams = [])
122  {
123    $params = ['parent' => $parent];
124    $params = array_merge($params, $optParams);
125    return $this->call('list', [$params], ListGameServerClustersResponse::class);
126  }
127  /**
128   * Patches a single game server cluster. (gameServerClusters.patch)
129   *
130   * @param string $name Required. The resource name of the game server cluster,
131   * in the following form: `projects/{project}/locations/{locationId}/realms/{rea
132   * lmId}/gameServerClusters/{gameServerClusterId}`. For example, `projects/my-
133   * project/locations/global/realms/zanzibar/gameServerClusters/my-gke-cluster`.
134   * @param GameServerCluster $postBody
135   * @param array $optParams Optional parameters.
136   *
137   * @opt_param string updateMask Required. The update mask to apply to the
138   * resource. At least one path must be supplied in this field. For more
139   * information, see the [`FieldMask` definition](https://developers.google.com
140   * /protocol-buffers/docs/reference/google.protobuf#fieldmask).
141   * @return Operation
142   */
143  public function patch($name, GameServerCluster $postBody, $optParams = [])
144  {
145    $params = ['name' => $name, 'postBody' => $postBody];
146    $params = array_merge($params, $optParams);
147    return $this->call('patch', [$params], Operation::class);
148  }
149  /**
150   * Previews creation of a new game server cluster in a given project and
151   * location. (gameServerClusters.previewCreate)
152   *
153   * @param string $parent Required. The parent resource name, in the following
154   * form: `projects/{project}/locations/{locationId}/realms/{realmId}`.
155   * @param GameServerCluster $postBody
156   * @param array $optParams Optional parameters.
157   *
158   * @opt_param string gameServerClusterId Required. The ID of the game server
159   * cluster resource to create.
160   * @opt_param string previewTime Optional. The target timestamp to compute the
161   * preview.
162   * @opt_param string view Optional. This field is deprecated. Preview will
163   * always return KubernetesClusterState.
164   * @return PreviewCreateGameServerClusterResponse
165   */
166  public function previewCreate($parent, GameServerCluster $postBody, $optParams = [])
167  {
168    $params = ['parent' => $parent, 'postBody' => $postBody];
169    $params = array_merge($params, $optParams);
170    return $this->call('previewCreate', [$params], PreviewCreateGameServerClusterResponse::class);
171  }
172  /**
173   * Previews deletion of a single game server cluster.
174   * (gameServerClusters.previewDelete)
175   *
176   * @param string $name Required. The name of the game server cluster to delete,
177   * in the following form: `projects/{project}/locations/{locationId}/gameServerC
178   * lusters/{gameServerClusterId}`.
179   * @param array $optParams Optional parameters.
180   *
181   * @opt_param string previewTime Optional. The target timestamp to compute the
182   * preview.
183   * @return PreviewDeleteGameServerClusterResponse
184   */
185  public function previewDelete($name, $optParams = [])
186  {
187    $params = ['name' => $name];
188    $params = array_merge($params, $optParams);
189    return $this->call('previewDelete', [$params], PreviewDeleteGameServerClusterResponse::class);
190  }
191  /**
192   * Previews updating a GameServerCluster. (gameServerClusters.previewUpdate)
193   *
194   * @param string $name Required. The resource name of the game server cluster,
195   * in the following form: `projects/{project}/locations/{locationId}/realms/{rea
196   * lmId}/gameServerClusters/{gameServerClusterId}`. For example, `projects/my-
197   * project/locations/global/realms/zanzibar/gameServerClusters/my-gke-cluster`.
198   * @param GameServerCluster $postBody
199   * @param array $optParams Optional parameters.
200   *
201   * @opt_param string previewTime Optional. The target timestamp to compute the
202   * preview.
203   * @opt_param string updateMask Required. Mask of fields to update. At least one
204   * path must be supplied in this field. For more information, see the
205   * [`FieldMask` definition](https://developers.google.com/protocol-
206   * buffers/docs/reference/google.protobuf#fieldmask).
207   * @return PreviewUpdateGameServerClusterResponse
208   */
209  public function previewUpdate($name, GameServerCluster $postBody, $optParams = [])
210  {
211    $params = ['name' => $name, 'postBody' => $postBody];
212    $params = array_merge($params, $optParams);
213    return $this->call('previewUpdate', [$params], PreviewUpdateGameServerClusterResponse::class);
214  }
215}
216
217// Adding a class alias for backwards compatibility with the previous class name.
218class_alias(ProjectsLocationsRealmsGameServerClusters::class, 'Google_Service_GameServices_Resource_ProjectsLocationsRealmsGameServerClusters');
219