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 |
|
---|
18 | namespace Google\Service\CloudKMS\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudKMS\AutokeyConfig;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * The "folders" collection of methods.
|
---|
24 | * Typical usage is:
|
---|
25 | * <code>
|
---|
26 | * $cloudkmsService = new Google\Service\CloudKMS(...);
|
---|
27 | * $folders = $cloudkmsService->folders;
|
---|
28 | * </code>
|
---|
29 | */
|
---|
30 | class Folders extends \Google\Service\Resource
|
---|
31 | {
|
---|
32 | /**
|
---|
33 | * Returns the AutokeyConfig for a folder. (folders.getAutokeyConfig)
|
---|
34 | *
|
---|
35 | * @param string $name Required. Name of the AutokeyConfig resource, e.g.
|
---|
36 | * `folders/{FOLDER_NUMBER}/autokeyConfig`.
|
---|
37 | * @param array $optParams Optional parameters.
|
---|
38 | * @return AutokeyConfig
|
---|
39 | * @throws \Google\Service\Exception
|
---|
40 | */
|
---|
41 | public function getAutokeyConfig($name, $optParams = [])
|
---|
42 | {
|
---|
43 | $params = ['name' => $name];
|
---|
44 | $params = array_merge($params, $optParams);
|
---|
45 | return $this->call('getAutokeyConfig', [$params], AutokeyConfig::class);
|
---|
46 | }
|
---|
47 | /**
|
---|
48 | * Updates the AutokeyConfig for a folder. The caller must have both
|
---|
49 | * `cloudkms.autokeyConfigs.update` permission on the parent folder and
|
---|
50 | * `cloudkms.cryptoKeys.setIamPolicy` permission on the provided key project. A
|
---|
51 | * KeyHandle creation in the folder's descendant projects will use this
|
---|
52 | * configuration to determine where to create the resulting CryptoKey.
|
---|
53 | * (folders.updateAutokeyConfig)
|
---|
54 | *
|
---|
55 | * @param string $name Identifier. Name of the AutokeyConfig resource, e.g.
|
---|
56 | * `folders/{FOLDER_NUMBER}/autokeyConfig`.
|
---|
57 | * @param AutokeyConfig $postBody
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | *
|
---|
60 | * @opt_param string updateMask Required. Masks which fields of the
|
---|
61 | * AutokeyConfig to update, e.g. `keyProject`.
|
---|
62 | * @return AutokeyConfig
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function updateAutokeyConfig($name, AutokeyConfig $postBody, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('updateAutokeyConfig', [$params], AutokeyConfig::class);
|
---|
70 | }
|
---|
71 | }
|
---|
72 |
|
---|
73 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
74 | class_alias(Folders::class, 'Google_Service_CloudKMS_Resource_Folders');
|
---|