[e3d4e0a] | 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\KeyHandle;
|
---|
| 21 | use Google\Service\CloudKMS\ListKeyHandlesResponse;
|
---|
| 22 | use Google\Service\CloudKMS\Operation;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "keyHandles" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $cloudkmsService = new Google\Service\CloudKMS(...);
|
---|
| 29 | * $keyHandles = $cloudkmsService->projects_locations_keyHandles;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsKeyHandles extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a new KeyHandle, triggering the provisioning of a new CryptoKey for
|
---|
| 36 | * CMEK use with the given resource type in the configured key project and the
|
---|
| 37 | * same location. GetOperation should be used to resolve the resulting long-
|
---|
| 38 | * running operation and get the resulting KeyHandle and CryptoKey.
|
---|
| 39 | * (keyHandles.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. Name of the resource project and location to
|
---|
| 42 | * create the KeyHandle in, e.g. `projects/{PROJECT_ID}/locations/{LOCATION}`.
|
---|
| 43 | * @param KeyHandle $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | *
|
---|
| 46 | * @opt_param string keyHandleId Optional. Id of the KeyHandle. Must be unique
|
---|
| 47 | * to the resource project and location. If not provided by the caller, a new
|
---|
| 48 | * UUID is used.
|
---|
| 49 | * @return Operation
|
---|
| 50 | * @throws \Google\Service\Exception
|
---|
| 51 | */
|
---|
| 52 | public function create($parent, KeyHandle $postBody, $optParams = [])
|
---|
| 53 | {
|
---|
| 54 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 55 | $params = array_merge($params, $optParams);
|
---|
| 56 | return $this->call('create', [$params], Operation::class);
|
---|
| 57 | }
|
---|
| 58 | /**
|
---|
| 59 | * Returns the KeyHandle. (keyHandles.get)
|
---|
| 60 | *
|
---|
| 61 | * @param string $name Required. Name of the KeyHandle resource, e.g.
|
---|
| 62 | * `projects/{PROJECT_ID}/locations/{LOCATION}/keyHandles/{KEY_HANDLE_ID}`.
|
---|
| 63 | * @param array $optParams Optional parameters.
|
---|
| 64 | * @return KeyHandle
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function get($name, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['name' => $name];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('get', [$params], KeyHandle::class);
|
---|
| 72 | }
|
---|
| 73 | /**
|
---|
| 74 | * Lists KeyHandles. (keyHandles.listProjectsLocationsKeyHandles)
|
---|
| 75 | *
|
---|
| 76 | * @param string $parent Required. Name of the resource project and location
|
---|
| 77 | * from which to list KeyHandles, e.g.
|
---|
| 78 | * `projects/{PROJECT_ID}/locations/{LOCATION}`.
|
---|
| 79 | * @param array $optParams Optional parameters.
|
---|
| 80 | *
|
---|
| 81 | * @opt_param string filter Optional. Filter to apply when listing KeyHandles,
|
---|
| 82 | * e.g. `resource_type_selector="{SERVICE}.googleapis.com/{TYPE}"`.
|
---|
| 83 | * @opt_param int pageSize Optional. Optional limit on the number of KeyHandles
|
---|
| 84 | * to include in the response. The service may return fewer than this value.
|
---|
| 85 | * Further KeyHandles can subsequently be obtained by including the
|
---|
| 86 | * ListKeyHandlesResponse.next_page_token in a subsequent request. If
|
---|
| 87 | * unspecified, at most 100 KeyHandles will be returned.
|
---|
| 88 | * @opt_param string pageToken Optional. Optional pagination token, returned
|
---|
| 89 | * earlier via ListKeyHandlesResponse.next_page_token.
|
---|
| 90 | * @return ListKeyHandlesResponse
|
---|
| 91 | * @throws \Google\Service\Exception
|
---|
| 92 | */
|
---|
| 93 | public function listProjectsLocationsKeyHandles($parent, $optParams = [])
|
---|
| 94 | {
|
---|
| 95 | $params = ['parent' => $parent];
|
---|
| 96 | $params = array_merge($params, $optParams);
|
---|
| 97 | return $this->call('list', [$params], ListKeyHandlesResponse::class);
|
---|
| 98 | }
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 102 | class_alias(ProjectsLocationsKeyHandles::class, 'Google_Service_CloudKMS_Resource_ProjectsLocationsKeyHandles');
|
---|