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\ListRealmsResponse;
21use Google\Service\GameServices\Operation;
22use Google\Service\GameServices\PreviewRealmUpdateResponse;
23use Google\Service\GameServices\Realm;
24
25/**
26 * The "realms" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $gameservicesService = new Google\Service\GameServices(...);
30 *   $realms = $gameservicesService->realms;
31 *  </code>
32 */
33class ProjectsLocationsRealms extends \Google\Service\Resource
34{
35  /**
36   * Creates a new realm in a given project and location. (realms.create)
37   *
38   * @param string $parent Required. The parent resource name, in the following
39   * form: `projects/{project}/locations/{locationId}`.
40   * @param Realm $postBody
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string realmId Required. The ID of the realm resource to create.
44   * @return Operation
45   */
46  public function create($parent, Realm $postBody, $optParams = [])
47  {
48    $params = ['parent' => $parent, 'postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('create', [$params], Operation::class);
51  }
52  /**
53   * Deletes a single realm. (realms.delete)
54   *
55   * @param string $name Required. The name of the realm to delete, in the
56   * following form: `projects/{project}/locations/{locationId}/realms/{realmId}`.
57   * @param array $optParams Optional parameters.
58   * @return Operation
59   */
60  public function delete($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], Operation::class);
65  }
66  /**
67   * Gets details of a single realm. (realms.get)
68   *
69   * @param string $name Required. The name of the realm to retrieve, in the
70   * following form: `projects/{project}/locations/{locationId}/realms/{realmId}`.
71   * @param array $optParams Optional parameters.
72   * @return Realm
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], Realm::class);
79  }
80  /**
81   * Lists realms in a given project and location.
82   * (realms.listProjectsLocationsRealms)
83   *
84   * @param string $parent Required. The parent resource name, in the following
85   * form: `projects/{project}/locations/{locationId}`.
86   * @param array $optParams Optional parameters.
87   *
88   * @opt_param string filter Optional. The filter to apply to list results (see
89   * [Filtering](https://google.aip.dev/160)).
90   * @opt_param string orderBy Optional. Specifies the ordering of results
91   * following [Cloud API
92   * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order).
93   * @opt_param int pageSize Optional. The maximum number of items to return. If
94   * unspecified, the server picks an appropriate default. The server may return
95   * fewer items than requested. A caller should only rely on the response's
96   * next_page_token to determine if there are more realms left to be queried.
97   * @opt_param string pageToken Optional. The next_page_token value returned from
98   * a previous list request, if any.
99   * @return ListRealmsResponse
100   */
101  public function listProjectsLocationsRealms($parent, $optParams = [])
102  {
103    $params = ['parent' => $parent];
104    $params = array_merge($params, $optParams);
105    return $this->call('list', [$params], ListRealmsResponse::class);
106  }
107  /**
108   * Patches a single realm. (realms.patch)
109   *
110   * @param string $name The resource name of the realm, in the following form:
111   * `projects/{project}/locations/{locationId}/realms/{realmId}`. For example,
112   * `projects/my-project/locations/global/realms/my-realm`.
113   * @param Realm $postBody
114   * @param array $optParams Optional parameters.
115   *
116   * @opt_param string updateMask Required. The update mask to apply to the
117   * resource. For more information, see the [`FieldMask`
118   * definition](https://developers.google.com/protocol-
119   * buffers/docs/reference/google.protobuf#fieldmask).
120   * @return Operation
121   */
122  public function patch($name, Realm $postBody, $optParams = [])
123  {
124    $params = ['name' => $name, 'postBody' => $postBody];
125    $params = array_merge($params, $optParams);
126    return $this->call('patch', [$params], Operation::class);
127  }
128  /**
129   * Previews patches to a single realm. (realms.previewUpdate)
130   *
131   * @param string $name The resource name of the realm, in the following form:
132   * `projects/{project}/locations/{locationId}/realms/{realmId}`. For example,
133   * `projects/my-project/locations/global/realms/my-realm`.
134   * @param Realm $postBody
135   * @param array $optParams Optional parameters.
136   *
137   * @opt_param string previewTime Optional. The target timestamp to compute the
138   * preview.
139   * @opt_param string updateMask Required. The update mask to apply to the
140   * resource. For more information, see the [`FieldMask`
141   * definition](https://developers.google.com/protocol-
142   * buffers/docs/reference/google.protobuf#fieldmask).
143   * @return PreviewRealmUpdateResponse
144   */
145  public function previewUpdate($name, Realm $postBody, $optParams = [])
146  {
147    $params = ['name' => $name, 'postBody' => $postBody];
148    $params = array_merge($params, $optParams);
149    return $this->call('previewUpdate', [$params], PreviewRealmUpdateResponse::class);
150  }
151}
152
153// Adding a class alias for backwards compatibility with the previous class name.
154class_alias(ProjectsLocationsRealms::class, 'Google_Service_GameServices_Resource_ProjectsLocationsRealms');
155