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;
19
20use Google\Client;
21
22/**
23 * Service definition for CloudRedis (v1).
24 *
25 * <p>
26 * Creates and manages Redis instances on the Google Cloud Platform.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/memorystore/docs/redis/" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class CloudRedis extends \Google\Service
36{
37  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
38  const CLOUD_PLATFORM =
39      "https://www.googleapis.com/auth/cloud-platform";
40
41  public $projects_locations;
42  public $projects_locations_instances;
43  public $projects_locations_operations;
44
45  /**
46   * Constructs the internal representation of the CloudRedis service.
47   *
48   * @param Client|array $clientOrConfig The client used to deliver requests, or a
49   *                                     config array to pass to a new Client instance.
50   * @param string $rootUrl The root URL used for requests to the service.
51   */
52  public function __construct($clientOrConfig = [], $rootUrl = null)
53  {
54    parent::__construct($clientOrConfig);
55    $this->rootUrl = $rootUrl ?: 'https://redis.googleapis.com/';
56    $this->servicePath = '';
57    $this->batchPath = 'batch';
58    $this->version = 'v1';
59    $this->serviceName = 'redis';
60
61    $this->projects_locations = new CloudRedis\Resource\ProjectsLocations(
62        $this,
63        $this->serviceName,
64        'locations',
65        [
66          'methods' => [
67            'get' => [
68              'path' => 'v1/{+name}',
69              'httpMethod' => 'GET',
70              'parameters' => [
71                'name' => [
72                  'location' => 'path',
73                  'type' => 'string',
74                  'required' => true,
75                ],
76              ],
77            ],'list' => [
78              'path' => 'v1/{+name}/locations',
79              'httpMethod' => 'GET',
80              'parameters' => [
81                'name' => [
82                  'location' => 'path',
83                  'type' => 'string',
84                  'required' => true,
85                ],
86                'filter' => [
87                  'location' => 'query',
88                  'type' => 'string',
89                ],
90                'pageSize' => [
91                  'location' => 'query',
92                  'type' => 'integer',
93                ],
94                'pageToken' => [
95                  'location' => 'query',
96                  'type' => 'string',
97                ],
98              ],
99            ],
100          ]
101        ]
102    );
103    $this->projects_locations_instances = new CloudRedis\Resource\ProjectsLocationsInstances(
104        $this,
105        $this->serviceName,
106        'instances',
107        [
108          'methods' => [
109            'create' => [
110              'path' => 'v1/{+parent}/instances',
111              'httpMethod' => 'POST',
112              'parameters' => [
113                'parent' => [
114                  'location' => 'path',
115                  'type' => 'string',
116                  'required' => true,
117                ],
118                'instanceId' => [
119                  'location' => 'query',
120                  'type' => 'string',
121                ],
122              ],
123            ],'delete' => [
124              'path' => 'v1/{+name}',
125              'httpMethod' => 'DELETE',
126              'parameters' => [
127                'name' => [
128                  'location' => 'path',
129                  'type' => 'string',
130                  'required' => true,
131                ],
132              ],
133            ],'export' => [
134              'path' => 'v1/{+name}:export',
135              'httpMethod' => 'POST',
136              'parameters' => [
137                'name' => [
138                  'location' => 'path',
139                  'type' => 'string',
140                  'required' => true,
141                ],
142              ],
143            ],'failover' => [
144              'path' => 'v1/{+name}:failover',
145              'httpMethod' => 'POST',
146              'parameters' => [
147                'name' => [
148                  'location' => 'path',
149                  'type' => 'string',
150                  'required' => true,
151                ],
152              ],
153            ],'get' => [
154              'path' => 'v1/{+name}',
155              'httpMethod' => 'GET',
156              'parameters' => [
157                'name' => [
158                  'location' => 'path',
159                  'type' => 'string',
160                  'required' => true,
161                ],
162              ],
163            ],'getAuthString' => [
164              'path' => 'v1/{+name}/authString',
165              'httpMethod' => 'GET',
166              'parameters' => [
167                'name' => [
168                  'location' => 'path',
169                  'type' => 'string',
170                  'required' => true,
171                ],
172              ],
173            ],'import' => [
174              'path' => 'v1/{+name}:import',
175              'httpMethod' => 'POST',
176              'parameters' => [
177                'name' => [
178                  'location' => 'path',
179                  'type' => 'string',
180                  'required' => true,
181                ],
182              ],
183            ],'list' => [
184              'path' => 'v1/{+parent}/instances',
185              'httpMethod' => 'GET',
186              'parameters' => [
187                'parent' => [
188                  'location' => 'path',
189                  'type' => 'string',
190                  'required' => true,
191                ],
192                'pageSize' => [
193                  'location' => 'query',
194                  'type' => 'integer',
195                ],
196                'pageToken' => [
197                  'location' => 'query',
198                  'type' => 'string',
199                ],
200              ],
201            ],'patch' => [
202              'path' => 'v1/{+name}',
203              'httpMethod' => 'PATCH',
204              'parameters' => [
205                'name' => [
206                  'location' => 'path',
207                  'type' => 'string',
208                  'required' => true,
209                ],
210                'updateMask' => [
211                  'location' => 'query',
212                  'type' => 'string',
213                ],
214              ],
215            ],'rescheduleMaintenance' => [
216              'path' => 'v1/{+name}:rescheduleMaintenance',
217              'httpMethod' => 'POST',
218              'parameters' => [
219                'name' => [
220                  'location' => 'path',
221                  'type' => 'string',
222                  'required' => true,
223                ],
224              ],
225            ],'upgrade' => [
226              'path' => 'v1/{+name}:upgrade',
227              'httpMethod' => 'POST',
228              'parameters' => [
229                'name' => [
230                  'location' => 'path',
231                  'type' => 'string',
232                  'required' => true,
233                ],
234              ],
235            ],
236          ]
237        ]
238    );
239    $this->projects_locations_operations = new CloudRedis\Resource\ProjectsLocationsOperations(
240        $this,
241        $this->serviceName,
242        'operations',
243        [
244          'methods' => [
245            'cancel' => [
246              'path' => 'v1/{+name}:cancel',
247              'httpMethod' => 'POST',
248              'parameters' => [
249                'name' => [
250                  'location' => 'path',
251                  'type' => 'string',
252                  'required' => true,
253                ],
254              ],
255            ],'delete' => [
256              'path' => 'v1/{+name}',
257              'httpMethod' => 'DELETE',
258              'parameters' => [
259                'name' => [
260                  'location' => 'path',
261                  'type' => 'string',
262                  'required' => true,
263                ],
264              ],
265            ],'get' => [
266              'path' => 'v1/{+name}',
267              'httpMethod' => 'GET',
268              'parameters' => [
269                'name' => [
270                  'location' => 'path',
271                  'type' => 'string',
272                  'required' => true,
273                ],
274              ],
275            ],'list' => [
276              'path' => 'v1/{+name}/operations',
277              'httpMethod' => 'GET',
278              'parameters' => [
279                'name' => [
280                  'location' => 'path',
281                  'type' => 'string',
282                  'required' => true,
283                ],
284                'filter' => [
285                  'location' => 'query',
286                  'type' => 'string',
287                ],
288                'pageSize' => [
289                  'location' => 'query',
290                  'type' => 'integer',
291                ],
292                'pageToken' => [
293                  'location' => 'query',
294                  'type' => 'string',
295                ],
296              ],
297            ],
298          ]
299        ]
300    );
301  }
302}
303
304// Adding a class alias for backwards compatibility with the previous class name.
305class_alias(CloudRedis::class, 'Google_Service_CloudRedis');
306