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 SecretManager (v1).
24 *
25 * <p>
26 * Stores sensitive data such as API keys, passwords, and certificates. Provides
27 * convenience while improving security.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://cloud.google.com/secret-manager/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class SecretManager 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_secrets;
44  public $projects_secrets_versions;
45
46  /**
47   * Constructs the internal representation of the SecretManager service.
48   *
49   * @param Client|array $clientOrConfig The client used to deliver requests, or a
50   *                                     config array to pass to a new Client instance.
51   * @param string $rootUrl The root URL used for requests to the service.
52   */
53  public function __construct($clientOrConfig = [], $rootUrl = null)
54  {
55    parent::__construct($clientOrConfig);
56    $this->rootUrl = $rootUrl ?: 'https://secretmanager.googleapis.com/';
57    $this->servicePath = '';
58    $this->batchPath = 'batch';
59    $this->version = 'v1';
60    $this->serviceName = 'secretmanager';
61
62    $this->projects_locations = new SecretManager\Resource\ProjectsLocations(
63        $this,
64        $this->serviceName,
65        'locations',
66        [
67          'methods' => [
68            'get' => [
69              'path' => 'v1/{+name}',
70              'httpMethod' => 'GET',
71              'parameters' => [
72                'name' => [
73                  'location' => 'path',
74                  'type' => 'string',
75                  'required' => true,
76                ],
77              ],
78            ],'list' => [
79              'path' => 'v1/{+name}/locations',
80              'httpMethod' => 'GET',
81              'parameters' => [
82                'name' => [
83                  'location' => 'path',
84                  'type' => 'string',
85                  'required' => true,
86                ],
87                'filter' => [
88                  'location' => 'query',
89                  'type' => 'string',
90                ],
91                'pageSize' => [
92                  'location' => 'query',
93                  'type' => 'integer',
94                ],
95                'pageToken' => [
96                  'location' => 'query',
97                  'type' => 'string',
98                ],
99              ],
100            ],
101          ]
102        ]
103    );
104    $this->projects_secrets = new SecretManager\Resource\ProjectsSecrets(
105        $this,
106        $this->serviceName,
107        'secrets',
108        [
109          'methods' => [
110            'addVersion' => [
111              'path' => 'v1/{+parent}:addVersion',
112              'httpMethod' => 'POST',
113              'parameters' => [
114                'parent' => [
115                  'location' => 'path',
116                  'type' => 'string',
117                  'required' => true,
118                ],
119              ],
120            ],'create' => [
121              'path' => 'v1/{+parent}/secrets',
122              'httpMethod' => 'POST',
123              'parameters' => [
124                'parent' => [
125                  'location' => 'path',
126                  'type' => 'string',
127                  'required' => true,
128                ],
129                'secretId' => [
130                  'location' => 'query',
131                  'type' => 'string',
132                ],
133              ],
134            ],'delete' => [
135              'path' => 'v1/{+name}',
136              'httpMethod' => 'DELETE',
137              'parameters' => [
138                'name' => [
139                  'location' => 'path',
140                  'type' => 'string',
141                  'required' => true,
142                ],
143                'etag' => [
144                  'location' => 'query',
145                  'type' => 'string',
146                ],
147              ],
148            ],'get' => [
149              'path' => 'v1/{+name}',
150              'httpMethod' => 'GET',
151              'parameters' => [
152                'name' => [
153                  'location' => 'path',
154                  'type' => 'string',
155                  'required' => true,
156                ],
157              ],
158            ],'getIamPolicy' => [
159              'path' => 'v1/{+resource}:getIamPolicy',
160              'httpMethod' => 'GET',
161              'parameters' => [
162                'resource' => [
163                  'location' => 'path',
164                  'type' => 'string',
165                  'required' => true,
166                ],
167                'options.requestedPolicyVersion' => [
168                  'location' => 'query',
169                  'type' => 'integer',
170                ],
171              ],
172            ],'list' => [
173              'path' => 'v1/{+parent}/secrets',
174              'httpMethod' => 'GET',
175              'parameters' => [
176                'parent' => [
177                  'location' => 'path',
178                  'type' => 'string',
179                  'required' => true,
180                ],
181                'filter' => [
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              ],
194            ],'patch' => [
195              'path' => 'v1/{+name}',
196              'httpMethod' => 'PATCH',
197              'parameters' => [
198                'name' => [
199                  'location' => 'path',
200                  'type' => 'string',
201                  'required' => true,
202                ],
203                'updateMask' => [
204                  'location' => 'query',
205                  'type' => 'string',
206                ],
207              ],
208            ],'setIamPolicy' => [
209              'path' => 'v1/{+resource}:setIamPolicy',
210              'httpMethod' => 'POST',
211              'parameters' => [
212                'resource' => [
213                  'location' => 'path',
214                  'type' => 'string',
215                  'required' => true,
216                ],
217              ],
218            ],'testIamPermissions' => [
219              'path' => 'v1/{+resource}:testIamPermissions',
220              'httpMethod' => 'POST',
221              'parameters' => [
222                'resource' => [
223                  'location' => 'path',
224                  'type' => 'string',
225                  'required' => true,
226                ],
227              ],
228            ],
229          ]
230        ]
231    );
232    $this->projects_secrets_versions = new SecretManager\Resource\ProjectsSecretsVersions(
233        $this,
234        $this->serviceName,
235        'versions',
236        [
237          'methods' => [
238            'access' => [
239              'path' => 'v1/{+name}:access',
240              'httpMethod' => 'GET',
241              'parameters' => [
242                'name' => [
243                  'location' => 'path',
244                  'type' => 'string',
245                  'required' => true,
246                ],
247              ],
248            ],'destroy' => [
249              'path' => 'v1/{+name}:destroy',
250              'httpMethod' => 'POST',
251              'parameters' => [
252                'name' => [
253                  'location' => 'path',
254                  'type' => 'string',
255                  'required' => true,
256                ],
257              ],
258            ],'disable' => [
259              'path' => 'v1/{+name}:disable',
260              'httpMethod' => 'POST',
261              'parameters' => [
262                'name' => [
263                  'location' => 'path',
264                  'type' => 'string',
265                  'required' => true,
266                ],
267              ],
268            ],'enable' => [
269              'path' => 'v1/{+name}:enable',
270              'httpMethod' => 'POST',
271              'parameters' => [
272                'name' => [
273                  'location' => 'path',
274                  'type' => 'string',
275                  'required' => true,
276                ],
277              ],
278            ],'get' => [
279              'path' => 'v1/{+name}',
280              'httpMethod' => 'GET',
281              'parameters' => [
282                'name' => [
283                  'location' => 'path',
284                  'type' => 'string',
285                  'required' => true,
286                ],
287              ],
288            ],'list' => [
289              'path' => 'v1/{+parent}/versions',
290              'httpMethod' => 'GET',
291              'parameters' => [
292                'parent' => [
293                  'location' => 'path',
294                  'type' => 'string',
295                  'required' => true,
296                ],
297                'filter' => [
298                  'location' => 'query',
299                  'type' => 'string',
300                ],
301                'pageSize' => [
302                  'location' => 'query',
303                  'type' => 'integer',
304                ],
305                'pageToken' => [
306                  'location' => 'query',
307                  'type' => 'string',
308                ],
309              ],
310            ],
311          ]
312        ]
313    );
314  }
315}
316
317// Adding a class alias for backwards compatibility with the previous class name.
318class_alias(SecretManager::class, 'Google_Service_SecretManager');
319