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