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 ServiceDirectory (v1).
24 *
25 * <p>
26 * Service Directory is a platform for discovering, publishing, and connecting
27 * services.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://cloud.google.com/service-directory" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class ServiceDirectory extends \Google\Service
37{
38  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
39  const CLOUD_PLATFORM =
40      "https://www.googleapis.com/auth/cloud-platform";
41
42  public $projects_locations;
43  public $projects_locations_namespaces;
44  public $projects_locations_namespaces_services;
45  public $projects_locations_namespaces_services_endpoints;
46
47  /**
48   * Constructs the internal representation of the ServiceDirectory service.
49   *
50   * @param Client|array $clientOrConfig The client used to deliver requests, or a
51   *                                     config array to pass to a new Client instance.
52   * @param string $rootUrl The root URL used for requests to the service.
53   */
54  public function __construct($clientOrConfig = [], $rootUrl = null)
55  {
56    parent::__construct($clientOrConfig);
57    $this->rootUrl = $rootUrl ?: 'https://servicedirectory.googleapis.com/';
58    $this->servicePath = '';
59    $this->batchPath = 'batch';
60    $this->version = 'v1';
61    $this->serviceName = 'servicedirectory';
62
63    $this->projects_locations = new ServiceDirectory\Resource\ProjectsLocations(
64        $this,
65        $this->serviceName,
66        'locations',
67        [
68          'methods' => [
69            'get' => [
70              'path' => 'v1/{+name}',
71              'httpMethod' => 'GET',
72              'parameters' => [
73                'name' => [
74                  'location' => 'path',
75                  'type' => 'string',
76                  'required' => true,
77                ],
78              ],
79            ],'list' => [
80              'path' => 'v1/{+name}/locations',
81              'httpMethod' => 'GET',
82              'parameters' => [
83                'name' => [
84                  'location' => 'path',
85                  'type' => 'string',
86                  'required' => true,
87                ],
88                'filter' => [
89                  'location' => 'query',
90                  'type' => 'string',
91                ],
92                'pageSize' => [
93                  'location' => 'query',
94                  'type' => 'integer',
95                ],
96                'pageToken' => [
97                  'location' => 'query',
98                  'type' => 'string',
99                ],
100              ],
101            ],
102          ]
103        ]
104    );
105    $this->projects_locations_namespaces = new ServiceDirectory\Resource\ProjectsLocationsNamespaces(
106        $this,
107        $this->serviceName,
108        'namespaces',
109        [
110          'methods' => [
111            'create' => [
112              'path' => 'v1/{+parent}/namespaces',
113              'httpMethod' => 'POST',
114              'parameters' => [
115                'parent' => [
116                  'location' => 'path',
117                  'type' => 'string',
118                  'required' => true,
119                ],
120                'namespaceId' => [
121                  'location' => 'query',
122                  'type' => 'string',
123                ],
124              ],
125            ],'delete' => [
126              'path' => 'v1/{+name}',
127              'httpMethod' => 'DELETE',
128              'parameters' => [
129                'name' => [
130                  'location' => 'path',
131                  'type' => 'string',
132                  'required' => true,
133                ],
134              ],
135            ],'get' => [
136              'path' => 'v1/{+name}',
137              'httpMethod' => 'GET',
138              'parameters' => [
139                'name' => [
140                  'location' => 'path',
141                  'type' => 'string',
142                  'required' => true,
143                ],
144              ],
145            ],'getIamPolicy' => [
146              'path' => 'v1/{+resource}:getIamPolicy',
147              'httpMethod' => 'POST',
148              'parameters' => [
149                'resource' => [
150                  'location' => 'path',
151                  'type' => 'string',
152                  'required' => true,
153                ],
154              ],
155            ],'list' => [
156              'path' => 'v1/{+parent}/namespaces',
157              'httpMethod' => 'GET',
158              'parameters' => [
159                'parent' => [
160                  'location' => 'path',
161                  'type' => 'string',
162                  'required' => true,
163                ],
164                'filter' => [
165                  'location' => 'query',
166                  'type' => 'string',
167                ],
168                'orderBy' => [
169                  'location' => 'query',
170                  'type' => 'string',
171                ],
172                'pageSize' => [
173                  'location' => 'query',
174                  'type' => 'integer',
175                ],
176                'pageToken' => [
177                  'location' => 'query',
178                  'type' => 'string',
179                ],
180              ],
181            ],'patch' => [
182              'path' => 'v1/{+name}',
183              'httpMethod' => 'PATCH',
184              'parameters' => [
185                'name' => [
186                  'location' => 'path',
187                  'type' => 'string',
188                  'required' => true,
189                ],
190                'updateMask' => [
191                  'location' => 'query',
192                  'type' => 'string',
193                ],
194              ],
195            ],'setIamPolicy' => [
196              'path' => 'v1/{+resource}:setIamPolicy',
197              'httpMethod' => 'POST',
198              'parameters' => [
199                'resource' => [
200                  'location' => 'path',
201                  'type' => 'string',
202                  'required' => true,
203                ],
204              ],
205            ],'testIamPermissions' => [
206              'path' => 'v1/{+resource}:testIamPermissions',
207              'httpMethod' => 'POST',
208              'parameters' => [
209                'resource' => [
210                  'location' => 'path',
211                  'type' => 'string',
212                  'required' => true,
213                ],
214              ],
215            ],
216          ]
217        ]
218    );
219    $this->projects_locations_namespaces_services = new ServiceDirectory\Resource\ProjectsLocationsNamespacesServices(
220        $this,
221        $this->serviceName,
222        'services',
223        [
224          'methods' => [
225            'create' => [
226              'path' => 'v1/{+parent}/services',
227              'httpMethod' => 'POST',
228              'parameters' => [
229                'parent' => [
230                  'location' => 'path',
231                  'type' => 'string',
232                  'required' => true,
233                ],
234                'serviceId' => [
235                  'location' => 'query',
236                  'type' => 'string',
237                ],
238              ],
239            ],'delete' => [
240              'path' => 'v1/{+name}',
241              'httpMethod' => 'DELETE',
242              'parameters' => [
243                'name' => [
244                  'location' => 'path',
245                  'type' => 'string',
246                  'required' => true,
247                ],
248              ],
249            ],'get' => [
250              'path' => 'v1/{+name}',
251              'httpMethod' => 'GET',
252              'parameters' => [
253                'name' => [
254                  'location' => 'path',
255                  'type' => 'string',
256                  'required' => true,
257                ],
258              ],
259            ],'getIamPolicy' => [
260              'path' => 'v1/{+resource}:getIamPolicy',
261              'httpMethod' => 'POST',
262              'parameters' => [
263                'resource' => [
264                  'location' => 'path',
265                  'type' => 'string',
266                  'required' => true,
267                ],
268              ],
269            ],'list' => [
270              'path' => 'v1/{+parent}/services',
271              'httpMethod' => 'GET',
272              'parameters' => [
273                'parent' => [
274                  'location' => 'path',
275                  'type' => 'string',
276                  'required' => true,
277                ],
278                'filter' => [
279                  'location' => 'query',
280                  'type' => 'string',
281                ],
282                'orderBy' => [
283                  'location' => 'query',
284                  'type' => 'string',
285                ],
286                'pageSize' => [
287                  'location' => 'query',
288                  'type' => 'integer',
289                ],
290                'pageToken' => [
291                  'location' => 'query',
292                  'type' => 'string',
293                ],
294              ],
295            ],'patch' => [
296              'path' => 'v1/{+name}',
297              'httpMethod' => 'PATCH',
298              'parameters' => [
299                'name' => [
300                  'location' => 'path',
301                  'type' => 'string',
302                  'required' => true,
303                ],
304                'updateMask' => [
305                  'location' => 'query',
306                  'type' => 'string',
307                ],
308              ],
309            ],'resolve' => [
310              'path' => 'v1/{+name}:resolve',
311              'httpMethod' => 'POST',
312              'parameters' => [
313                'name' => [
314                  'location' => 'path',
315                  'type' => 'string',
316                  'required' => true,
317                ],
318              ],
319            ],'setIamPolicy' => [
320              'path' => 'v1/{+resource}:setIamPolicy',
321              'httpMethod' => 'POST',
322              'parameters' => [
323                'resource' => [
324                  'location' => 'path',
325                  'type' => 'string',
326                  'required' => true,
327                ],
328              ],
329            ],'testIamPermissions' => [
330              'path' => 'v1/{+resource}:testIamPermissions',
331              'httpMethod' => 'POST',
332              'parameters' => [
333                'resource' => [
334                  'location' => 'path',
335                  'type' => 'string',
336                  'required' => true,
337                ],
338              ],
339            ],
340          ]
341        ]
342    );
343    $this->projects_locations_namespaces_services_endpoints = new ServiceDirectory\Resource\ProjectsLocationsNamespacesServicesEndpoints(
344        $this,
345        $this->serviceName,
346        'endpoints',
347        [
348          'methods' => [
349            'create' => [
350              'path' => 'v1/{+parent}/endpoints',
351              'httpMethod' => 'POST',
352              'parameters' => [
353                'parent' => [
354                  'location' => 'path',
355                  'type' => 'string',
356                  'required' => true,
357                ],
358                'endpointId' => [
359                  'location' => 'query',
360                  'type' => 'string',
361                ],
362              ],
363            ],'delete' => [
364              'path' => 'v1/{+name}',
365              'httpMethod' => 'DELETE',
366              'parameters' => [
367                'name' => [
368                  'location' => 'path',
369                  'type' => 'string',
370                  'required' => true,
371                ],
372              ],
373            ],'get' => [
374              'path' => 'v1/{+name}',
375              'httpMethod' => 'GET',
376              'parameters' => [
377                'name' => [
378                  'location' => 'path',
379                  'type' => 'string',
380                  'required' => true,
381                ],
382              ],
383            ],'list' => [
384              'path' => 'v1/{+parent}/endpoints',
385              'httpMethod' => 'GET',
386              'parameters' => [
387                'parent' => [
388                  'location' => 'path',
389                  'type' => 'string',
390                  'required' => true,
391                ],
392                'filter' => [
393                  'location' => 'query',
394                  'type' => 'string',
395                ],
396                'orderBy' => [
397                  'location' => 'query',
398                  'type' => 'string',
399                ],
400                'pageSize' => [
401                  'location' => 'query',
402                  'type' => 'integer',
403                ],
404                'pageToken' => [
405                  'location' => 'query',
406                  'type' => 'string',
407                ],
408              ],
409            ],'patch' => [
410              'path' => 'v1/{+name}',
411              'httpMethod' => 'PATCH',
412              'parameters' => [
413                'name' => [
414                  'location' => 'path',
415                  'type' => 'string',
416                  'required' => true,
417                ],
418                'updateMask' => [
419                  'location' => 'query',
420                  'type' => 'string',
421                ],
422              ],
423            ],
424          ]
425        ]
426    );
427  }
428}
429
430// Adding a class alias for backwards compatibility with the previous class name.
431class_alias(ServiceDirectory::class, 'Google_Service_ServiceDirectory');
432