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\CertificateAuthorityService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CertificateAuthorityService\CaPool;
|
---|
21 | use Google\Service\CertificateAuthorityService\FetchCaCertsRequest;
|
---|
22 | use Google\Service\CertificateAuthorityService\FetchCaCertsResponse;
|
---|
23 | use Google\Service\CertificateAuthorityService\ListCaPoolsResponse;
|
---|
24 | use Google\Service\CertificateAuthorityService\Operation;
|
---|
25 | use Google\Service\CertificateAuthorityService\Policy;
|
---|
26 | use Google\Service\CertificateAuthorityService\SetIamPolicyRequest;
|
---|
27 | use Google\Service\CertificateAuthorityService\TestIamPermissionsRequest;
|
---|
28 | use Google\Service\CertificateAuthorityService\TestIamPermissionsResponse;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * The "caPools" collection of methods.
|
---|
32 | * Typical usage is:
|
---|
33 | * <code>
|
---|
34 | * $privatecaService = new Google\Service\CertificateAuthorityService(...);
|
---|
35 | * $caPools = $privatecaService->projects_locations_caPools;
|
---|
36 | * </code>
|
---|
37 | */
|
---|
38 | class ProjectsLocationsCaPools extends \Google\Service\Resource
|
---|
39 | {
|
---|
40 | /**
|
---|
41 | * Create a CaPool. (caPools.create)
|
---|
42 | *
|
---|
43 | * @param string $parent Required. The resource name of the location associated
|
---|
44 | * with the CaPool, in the format `projects/locations`.
|
---|
45 | * @param CaPool $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | *
|
---|
48 | * @opt_param string caPoolId Required. It must be unique within a location and
|
---|
49 | * match the regular expression `[a-zA-Z0-9_-]{1,63}`
|
---|
50 | * @opt_param string requestId Optional. An ID to identify requests. Specify a
|
---|
51 | * unique request ID so that if you must retry your request, the server will
|
---|
52 | * know to ignore the request if it has already been completed. The server will
|
---|
53 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
54 | * consider a situation where you make an initial request and the request times
|
---|
55 | * out. If you make the request again with the same request ID, the server can
|
---|
56 | * check if original operation with the same request ID was received, and if so,
|
---|
57 | * will ignore the second request. This prevents clients from accidentally
|
---|
58 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
59 | * exception that zero UUID is not supported
|
---|
60 | * (00000000-0000-0000-0000-000000000000).
|
---|
61 | * @return Operation
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function create($parent, CaPool $postBody, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('create', [$params], Operation::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Delete a CaPool. (caPools.delete)
|
---|
72 | *
|
---|
73 | * @param string $name Required. The resource name for this CaPool in the format
|
---|
74 | * `projects/locations/caPools`.
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | *
|
---|
77 | * @opt_param bool ignoreDependentResources Optional. This field allows this
|
---|
78 | * pool to be deleted even if it's being depended on by another resource.
|
---|
79 | * However, doing so may result in unintended and unrecoverable effects on any
|
---|
80 | * dependent resources since the pool will no longer be able to issue
|
---|
81 | * certificates.
|
---|
82 | * @opt_param string requestId Optional. An ID to identify requests. Specify a
|
---|
83 | * unique request ID so that if you must retry your request, the server will
|
---|
84 | * know to ignore the request if it has already been completed. The server will
|
---|
85 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
86 | * consider a situation where you make an initial request and the request times
|
---|
87 | * out. If you make the request again with the same request ID, the server can
|
---|
88 | * check if original operation with the same request ID was received, and if so,
|
---|
89 | * will ignore the second request. This prevents clients from accidentally
|
---|
90 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
91 | * exception that zero UUID is not supported
|
---|
92 | * (00000000-0000-0000-0000-000000000000).
|
---|
93 | * @return Operation
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function delete($name, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['name' => $name];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('delete', [$params], Operation::class);
|
---|
101 | }
|
---|
102 | /**
|
---|
103 | * FetchCaCerts returns the current trust anchor for the CaPool. This will
|
---|
104 | * include CA certificate chains for all certificate authorities in the ENABLED,
|
---|
105 | * DISABLED, or STAGED states. (caPools.fetchCaCerts)
|
---|
106 | *
|
---|
107 | * @param string $caPool Required. The resource name for the CaPool in the
|
---|
108 | * format `projects/locations/caPools`.
|
---|
109 | * @param FetchCaCertsRequest $postBody
|
---|
110 | * @param array $optParams Optional parameters.
|
---|
111 | * @return FetchCaCertsResponse
|
---|
112 | * @throws \Google\Service\Exception
|
---|
113 | */
|
---|
114 | public function fetchCaCerts($caPool, FetchCaCertsRequest $postBody, $optParams = [])
|
---|
115 | {
|
---|
116 | $params = ['caPool' => $caPool, 'postBody' => $postBody];
|
---|
117 | $params = array_merge($params, $optParams);
|
---|
118 | return $this->call('fetchCaCerts', [$params], FetchCaCertsResponse::class);
|
---|
119 | }
|
---|
120 | /**
|
---|
121 | * Returns a CaPool. (caPools.get)
|
---|
122 | *
|
---|
123 | * @param string $name Required. The name of the CaPool to get.
|
---|
124 | * @param array $optParams Optional parameters.
|
---|
125 | * @return CaPool
|
---|
126 | * @throws \Google\Service\Exception
|
---|
127 | */
|
---|
128 | public function get($name, $optParams = [])
|
---|
129 | {
|
---|
130 | $params = ['name' => $name];
|
---|
131 | $params = array_merge($params, $optParams);
|
---|
132 | return $this->call('get', [$params], CaPool::class);
|
---|
133 | }
|
---|
134 | /**
|
---|
135 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
136 | * resource exists and does not have a policy set. (caPools.getIamPolicy)
|
---|
137 | *
|
---|
138 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
139 | * requested. See [Resource
|
---|
140 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
141 | * appropriate value for this field.
|
---|
142 | * @param array $optParams Optional parameters.
|
---|
143 | *
|
---|
144 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
145 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
146 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
147 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
148 | * conditional role bindings may specify any valid value or leave the field
|
---|
149 | * unset. The policy in the response might use the policy version that you
|
---|
150 | * specified, or it might use a lower policy version. For example, if you
|
---|
151 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
152 | * response uses version 1. To learn which resources support conditions in their
|
---|
153 | * IAM policies, see the [IAM
|
---|
154 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
155 | * policies).
|
---|
156 | * @return Policy
|
---|
157 | * @throws \Google\Service\Exception
|
---|
158 | */
|
---|
159 | public function getIamPolicy($resource, $optParams = [])
|
---|
160 | {
|
---|
161 | $params = ['resource' => $resource];
|
---|
162 | $params = array_merge($params, $optParams);
|
---|
163 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
164 | }
|
---|
165 | /**
|
---|
166 | * Lists CaPools. (caPools.listProjectsLocationsCaPools)
|
---|
167 | *
|
---|
168 | * @param string $parent Required. The resource name of the location associated
|
---|
169 | * with the CaPools, in the format `projects/locations`.
|
---|
170 | * @param array $optParams Optional parameters.
|
---|
171 | *
|
---|
172 | * @opt_param string filter Optional. Only include resources that match the
|
---|
173 | * filter in the response.
|
---|
174 | * @opt_param string orderBy Optional. Specify how the results should be sorted.
|
---|
175 | * @opt_param int pageSize Optional. Limit on the number of CaPools to include
|
---|
176 | * in the response. Further CaPools can subsequently be obtained by including
|
---|
177 | * the ListCaPoolsResponse.next_page_token in a subsequent request. If
|
---|
178 | * unspecified, the server will pick an appropriate default.
|
---|
179 | * @opt_param string pageToken Optional. Pagination token, returned earlier via
|
---|
180 | * ListCaPoolsResponse.next_page_token.
|
---|
181 | * @return ListCaPoolsResponse
|
---|
182 | * @throws \Google\Service\Exception
|
---|
183 | */
|
---|
184 | public function listProjectsLocationsCaPools($parent, $optParams = [])
|
---|
185 | {
|
---|
186 | $params = ['parent' => $parent];
|
---|
187 | $params = array_merge($params, $optParams);
|
---|
188 | return $this->call('list', [$params], ListCaPoolsResponse::class);
|
---|
189 | }
|
---|
190 | /**
|
---|
191 | * Update a CaPool. (caPools.patch)
|
---|
192 | *
|
---|
193 | * @param string $name Output only. Identifier. The resource name for this
|
---|
194 | * CaPool in the format `projects/locations/caPools`.
|
---|
195 | * @param CaPool $postBody
|
---|
196 | * @param array $optParams Optional parameters.
|
---|
197 | *
|
---|
198 | * @opt_param string requestId Optional. An ID to identify requests. Specify a
|
---|
199 | * unique request ID so that if you must retry your request, the server will
|
---|
200 | * know to ignore the request if it has already been completed. The server will
|
---|
201 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
202 | * consider a situation where you make an initial request and the request times
|
---|
203 | * out. If you make the request again with the same request ID, the server can
|
---|
204 | * check if original operation with the same request ID was received, and if so,
|
---|
205 | * will ignore the second request. This prevents clients from accidentally
|
---|
206 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
207 | * exception that zero UUID is not supported
|
---|
208 | * (00000000-0000-0000-0000-000000000000).
|
---|
209 | * @opt_param string updateMask Required. A list of fields to be updated in this
|
---|
210 | * request.
|
---|
211 | * @return Operation
|
---|
212 | * @throws \Google\Service\Exception
|
---|
213 | */
|
---|
214 | public function patch($name, CaPool $postBody, $optParams = [])
|
---|
215 | {
|
---|
216 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
217 | $params = array_merge($params, $optParams);
|
---|
218 | return $this->call('patch', [$params], Operation::class);
|
---|
219 | }
|
---|
220 | /**
|
---|
221 | * Sets the access control policy on the specified resource. Replaces any
|
---|
222 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
223 | * `PERMISSION_DENIED` errors. (caPools.setIamPolicy)
|
---|
224 | *
|
---|
225 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
226 | * specified. See [Resource
|
---|
227 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
228 | * appropriate value for this field.
|
---|
229 | * @param SetIamPolicyRequest $postBody
|
---|
230 | * @param array $optParams Optional parameters.
|
---|
231 | * @return Policy
|
---|
232 | * @throws \Google\Service\Exception
|
---|
233 | */
|
---|
234 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
235 | {
|
---|
236 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
237 | $params = array_merge($params, $optParams);
|
---|
238 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
239 | }
|
---|
240 | /**
|
---|
241 | * Returns permissions that a caller has on the specified resource. If the
|
---|
242 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
243 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
244 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
245 | * This operation may "fail open" without warning. (caPools.testIamPermissions)
|
---|
246 | *
|
---|
247 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
248 | * being requested. See [Resource
|
---|
249 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
250 | * appropriate value for this field.
|
---|
251 | * @param TestIamPermissionsRequest $postBody
|
---|
252 | * @param array $optParams Optional parameters.
|
---|
253 | * @return TestIamPermissionsResponse
|
---|
254 | * @throws \Google\Service\Exception
|
---|
255 | */
|
---|
256 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
257 | {
|
---|
258 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
259 | $params = array_merge($params, $optParams);
|
---|
260 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
261 | }
|
---|
262 | }
|
---|
263 |
|
---|
264 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
265 | class_alias(ProjectsLocationsCaPools::class, 'Google_Service_CertificateAuthorityService_Resource_ProjectsLocationsCaPools');
|
---|