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\EkmConfig;
|
---|
21 | use Google\Service\CloudKMS\GenerateRandomBytesRequest;
|
---|
22 | use Google\Service\CloudKMS\GenerateRandomBytesResponse;
|
---|
23 | use Google\Service\CloudKMS\ListLocationsResponse;
|
---|
24 | use Google\Service\CloudKMS\Location;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "locations" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $cloudkmsService = new Google\Service\CloudKMS(...);
|
---|
31 | * $locations = $cloudkmsService->projects_locations;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocations extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Generate random bytes using the Cloud KMS randomness source in the provided
|
---|
38 | * location. (locations.generateRandomBytes)
|
---|
39 | *
|
---|
40 | * @param string $location The project-specific location in which to generate
|
---|
41 | * random bytes. For example, "projects/my-project/locations/us-central1".
|
---|
42 | * @param GenerateRandomBytesRequest $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | * @return GenerateRandomBytesResponse
|
---|
45 | * @throws \Google\Service\Exception
|
---|
46 | */
|
---|
47 | public function generateRandomBytes($location, GenerateRandomBytesRequest $postBody, $optParams = [])
|
---|
48 | {
|
---|
49 | $params = ['location' => $location, 'postBody' => $postBody];
|
---|
50 | $params = array_merge($params, $optParams);
|
---|
51 | return $this->call('generateRandomBytes', [$params], GenerateRandomBytesResponse::class);
|
---|
52 | }
|
---|
53 | /**
|
---|
54 | * Gets information about a location. (locations.get)
|
---|
55 | *
|
---|
56 | * @param string $name Resource name for the location.
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | * @return Location
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function get($name, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['name' => $name];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('get', [$params], Location::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Returns the EkmConfig singleton resource for a given project and location.
|
---|
69 | * (locations.getEkmConfig)
|
---|
70 | *
|
---|
71 | * @param string $name Required. The name of the EkmConfig to get.
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | * @return EkmConfig
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function getEkmConfig($name, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['name' => $name];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('getEkmConfig', [$params], EkmConfig::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Lists information about the supported locations for this service.
|
---|
84 | * (locations.listProjectsLocations)
|
---|
85 | *
|
---|
86 | * @param string $name The resource that owns the locations collection, if
|
---|
87 | * applicable.
|
---|
88 | * @param array $optParams Optional parameters.
|
---|
89 | *
|
---|
90 | * @opt_param string filter A filter to narrow down results to a preferred
|
---|
91 | * subset. The filtering language accepts strings like `"displayName=tokyo"`,
|
---|
92 | * and is documented in more detail in [AIP-160](https://google.aip.dev/160).
|
---|
93 | * @opt_param int pageSize The maximum number of results to return. If not set,
|
---|
94 | * the service selects a default.
|
---|
95 | * @opt_param string pageToken A page token received from the `next_page_token`
|
---|
96 | * field in the response. Send that page token to receive the subsequent page.
|
---|
97 | * @return ListLocationsResponse
|
---|
98 | * @throws \Google\Service\Exception
|
---|
99 | */
|
---|
100 | public function listProjectsLocations($name, $optParams = [])
|
---|
101 | {
|
---|
102 | $params = ['name' => $name];
|
---|
103 | $params = array_merge($params, $optParams);
|
---|
104 | return $this->call('list', [$params], ListLocationsResponse::class);
|
---|
105 | }
|
---|
106 | /**
|
---|
107 | * Updates the EkmConfig singleton resource for a given project and location.
|
---|
108 | * (locations.updateEkmConfig)
|
---|
109 | *
|
---|
110 | * @param string $name Output only. The resource name for the EkmConfig in the
|
---|
111 | * format `projects/locations/ekmConfig`.
|
---|
112 | * @param EkmConfig $postBody
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | *
|
---|
115 | * @opt_param string updateMask Required. List of fields to be updated in this
|
---|
116 | * request.
|
---|
117 | * @return EkmConfig
|
---|
118 | * @throws \Google\Service\Exception
|
---|
119 | */
|
---|
120 | public function updateEkmConfig($name, EkmConfig $postBody, $optParams = [])
|
---|
121 | {
|
---|
122 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
123 | $params = array_merge($params, $optParams);
|
---|
124 | return $this->call('updateEkmConfig', [$params], EkmConfig::class);
|
---|
125 | }
|
---|
126 | }
|
---|
127 |
|
---|
128 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
129 | class_alias(ProjectsLocations::class, 'Google_Service_CloudKMS_Resource_ProjectsLocations');
|
---|