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\ApigeeRegistry\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ApigeeRegistry\ApiDeployment;
|
---|
21 | use Google\Service\ApigeeRegistry\ApigeeregistryEmpty;
|
---|
22 | use Google\Service\ApigeeRegistry\ListApiDeploymentRevisionsResponse;
|
---|
23 | use Google\Service\ApigeeRegistry\ListApiDeploymentsResponse;
|
---|
24 | use Google\Service\ApigeeRegistry\Policy;
|
---|
25 | use Google\Service\ApigeeRegistry\RollbackApiDeploymentRequest;
|
---|
26 | use Google\Service\ApigeeRegistry\SetIamPolicyRequest;
|
---|
27 | use Google\Service\ApigeeRegistry\TagApiDeploymentRevisionRequest;
|
---|
28 | use Google\Service\ApigeeRegistry\TestIamPermissionsRequest;
|
---|
29 | use Google\Service\ApigeeRegistry\TestIamPermissionsResponse;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "deployments" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $apigeeregistryService = new Google\Service\ApigeeRegistry(...);
|
---|
36 | * $deployments = $apigeeregistryService->projects_locations_apis_deployments;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsLocationsApisDeployments extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Creates a specified deployment. (deployments.create)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. The parent, which owns this collection of
|
---|
45 | * deployments. Format: `projects/locations/apis`
|
---|
46 | * @param ApiDeployment $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | *
|
---|
49 | * @opt_param string apiDeploymentId Required. The ID to use for the deployment,
|
---|
50 | * which will become the final component of the deployment's resource name. This
|
---|
51 | * value should be 4-63 characters, and valid characters are /a-z-/. Following
|
---|
52 | * AIP-162, IDs must not have the form of a UUID.
|
---|
53 | * @return ApiDeployment
|
---|
54 | * @throws \Google\Service\Exception
|
---|
55 | */
|
---|
56 | public function create($parent, ApiDeployment $postBody, $optParams = [])
|
---|
57 | {
|
---|
58 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
59 | $params = array_merge($params, $optParams);
|
---|
60 | return $this->call('create', [$params], ApiDeployment::class);
|
---|
61 | }
|
---|
62 | /**
|
---|
63 | * Removes a specified deployment, all revisions, and all child resources (e.g.,
|
---|
64 | * artifacts). (deployments.delete)
|
---|
65 | *
|
---|
66 | * @param string $name Required. The name of the deployment to delete. Format:
|
---|
67 | * `projects/locations/apis/deployments`
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | *
|
---|
70 | * @opt_param bool force If set to true, any child resources will also be
|
---|
71 | * deleted. (Otherwise, the request will only work if there are no child
|
---|
72 | * resources.)
|
---|
73 | * @return ApigeeregistryEmpty
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function delete($name, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['name' => $name];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('delete', [$params], ApigeeregistryEmpty::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Deletes a revision of a deployment. (deployments.deleteRevision)
|
---|
84 | *
|
---|
85 | * @param string $name Required. The name of the deployment revision to be
|
---|
86 | * deleted, with a revision ID explicitly included. Example:
|
---|
87 | * `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8`
|
---|
88 | * @param array $optParams Optional parameters.
|
---|
89 | * @return ApiDeployment
|
---|
90 | * @throws \Google\Service\Exception
|
---|
91 | */
|
---|
92 | public function deleteRevision($name, $optParams = [])
|
---|
93 | {
|
---|
94 | $params = ['name' => $name];
|
---|
95 | $params = array_merge($params, $optParams);
|
---|
96 | return $this->call('deleteRevision', [$params], ApiDeployment::class);
|
---|
97 | }
|
---|
98 | /**
|
---|
99 | * Returns a specified deployment. (deployments.get)
|
---|
100 | *
|
---|
101 | * @param string $name Required. The name of the deployment to retrieve. Format:
|
---|
102 | * `projects/locations/apis/deployments`
|
---|
103 | * @param array $optParams Optional parameters.
|
---|
104 | * @return ApiDeployment
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function get($name, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['name' => $name];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('get', [$params], ApiDeployment::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
115 | * resource exists and does not have a policy set. (deployments.getIamPolicy)
|
---|
116 | *
|
---|
117 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
118 | * requested. See [Resource
|
---|
119 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
120 | * appropriate value for this field.
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | *
|
---|
123 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
124 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
125 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
126 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
127 | * conditional role bindings may specify any valid value or leave the field
|
---|
128 | * unset. The policy in the response might use the policy version that you
|
---|
129 | * specified, or it might use a lower policy version. For example, if you
|
---|
130 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
131 | * response uses version 1. To learn which resources support conditions in their
|
---|
132 | * IAM policies, see the [IAM
|
---|
133 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
134 | * policies).
|
---|
135 | * @return Policy
|
---|
136 | * @throws \Google\Service\Exception
|
---|
137 | */
|
---|
138 | public function getIamPolicy($resource, $optParams = [])
|
---|
139 | {
|
---|
140 | $params = ['resource' => $resource];
|
---|
141 | $params = array_merge($params, $optParams);
|
---|
142 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
143 | }
|
---|
144 | /**
|
---|
145 | * Returns matching deployments.
|
---|
146 | * (deployments.listProjectsLocationsApisDeployments)
|
---|
147 | *
|
---|
148 | * @param string $parent Required. The parent, which owns this collection of
|
---|
149 | * deployments. Format: `projects/locations/apis`
|
---|
150 | * @param array $optParams Optional parameters.
|
---|
151 | *
|
---|
152 | * @opt_param string filter An expression that can be used to filter the list.
|
---|
153 | * Filters use the Common Expression Language and can refer to all message
|
---|
154 | * fields.
|
---|
155 | * @opt_param string orderBy A comma-separated list of fields, e.g. "foo,bar"
|
---|
156 | * Fields can be sorted in descending order using the "desc" identifier, e.g.
|
---|
157 | * "foo desc,bar"
|
---|
158 | * @opt_param int pageSize The maximum number of deployments to return. The
|
---|
159 | * service may return fewer than this value. If unspecified, at most 50 values
|
---|
160 | * will be returned. The maximum is 1000; values above 1000 will be coerced to
|
---|
161 | * 1000.
|
---|
162 | * @opt_param string pageToken A page token, received from a previous
|
---|
163 | * `ListApiDeployments` call. Provide this to retrieve the subsequent page. When
|
---|
164 | * paginating, all other parameters provided to `ListApiDeployments` must match
|
---|
165 | * the call that provided the page token.
|
---|
166 | * @return ListApiDeploymentsResponse
|
---|
167 | * @throws \Google\Service\Exception
|
---|
168 | */
|
---|
169 | public function listProjectsLocationsApisDeployments($parent, $optParams = [])
|
---|
170 | {
|
---|
171 | $params = ['parent' => $parent];
|
---|
172 | $params = array_merge($params, $optParams);
|
---|
173 | return $this->call('list', [$params], ListApiDeploymentsResponse::class);
|
---|
174 | }
|
---|
175 | /**
|
---|
176 | * Lists all revisions of a deployment. Revisions are returned in descending
|
---|
177 | * order of revision creation time. (deployments.listRevisions)
|
---|
178 | *
|
---|
179 | * @param string $name Required. The name of the deployment to list revisions
|
---|
180 | * for.
|
---|
181 | * @param array $optParams Optional parameters.
|
---|
182 | *
|
---|
183 | * @opt_param string filter An expression that can be used to filter the list.
|
---|
184 | * Filters use the Common Expression Language and can refer to all message
|
---|
185 | * fields.
|
---|
186 | * @opt_param int pageSize The maximum number of revisions to return per page.
|
---|
187 | * @opt_param string pageToken The page token, received from a previous
|
---|
188 | * ListApiDeploymentRevisions call. Provide this to retrieve the subsequent
|
---|
189 | * page.
|
---|
190 | * @return ListApiDeploymentRevisionsResponse
|
---|
191 | * @throws \Google\Service\Exception
|
---|
192 | */
|
---|
193 | public function listRevisions($name, $optParams = [])
|
---|
194 | {
|
---|
195 | $params = ['name' => $name];
|
---|
196 | $params = array_merge($params, $optParams);
|
---|
197 | return $this->call('listRevisions', [$params], ListApiDeploymentRevisionsResponse::class);
|
---|
198 | }
|
---|
199 | /**
|
---|
200 | * Used to modify a specified deployment. (deployments.patch)
|
---|
201 | *
|
---|
202 | * @param string $name Resource name.
|
---|
203 | * @param ApiDeployment $postBody
|
---|
204 | * @param array $optParams Optional parameters.
|
---|
205 | *
|
---|
206 | * @opt_param bool allowMissing If set to true, and the deployment is not found,
|
---|
207 | * a new deployment will be created. In this situation, `update_mask` is
|
---|
208 | * ignored.
|
---|
209 | * @opt_param string updateMask The list of fields to be updated. If omitted,
|
---|
210 | * all fields are updated that are set in the request message (fields set to
|
---|
211 | * default values are ignored). If an asterisk "*" is specified, all fields are
|
---|
212 | * updated, including fields that are unspecified/default in the request.
|
---|
213 | * @return ApiDeployment
|
---|
214 | * @throws \Google\Service\Exception
|
---|
215 | */
|
---|
216 | public function patch($name, ApiDeployment $postBody, $optParams = [])
|
---|
217 | {
|
---|
218 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
219 | $params = array_merge($params, $optParams);
|
---|
220 | return $this->call('patch', [$params], ApiDeployment::class);
|
---|
221 | }
|
---|
222 | /**
|
---|
223 | * Sets the current revision to a specified prior revision. Note that this
|
---|
224 | * creates a new revision with a new revision ID. (deployments.rollback)
|
---|
225 | *
|
---|
226 | * @param string $name Required. The deployment being rolled back.
|
---|
227 | * @param RollbackApiDeploymentRequest $postBody
|
---|
228 | * @param array $optParams Optional parameters.
|
---|
229 | * @return ApiDeployment
|
---|
230 | * @throws \Google\Service\Exception
|
---|
231 | */
|
---|
232 | public function rollback($name, RollbackApiDeploymentRequest $postBody, $optParams = [])
|
---|
233 | {
|
---|
234 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
235 | $params = array_merge($params, $optParams);
|
---|
236 | return $this->call('rollback', [$params], ApiDeployment::class);
|
---|
237 | }
|
---|
238 | /**
|
---|
239 | * Sets the access control policy on the specified resource. Replaces any
|
---|
240 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
241 | * `PERMISSION_DENIED` errors. (deployments.setIamPolicy)
|
---|
242 | *
|
---|
243 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
244 | * specified. See [Resource
|
---|
245 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
246 | * appropriate value for this field.
|
---|
247 | * @param SetIamPolicyRequest $postBody
|
---|
248 | * @param array $optParams Optional parameters.
|
---|
249 | * @return Policy
|
---|
250 | * @throws \Google\Service\Exception
|
---|
251 | */
|
---|
252 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
253 | {
|
---|
254 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
255 | $params = array_merge($params, $optParams);
|
---|
256 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
257 | }
|
---|
258 | /**
|
---|
259 | * Adds a tag to a specified revision of a deployment. (deployments.tagRevision)
|
---|
260 | *
|
---|
261 | * @param string $name Required. The name of the deployment to be tagged,
|
---|
262 | * including the revision ID is optional. If a revision is not specified, it
|
---|
263 | * will tag the latest revision.
|
---|
264 | * @param TagApiDeploymentRevisionRequest $postBody
|
---|
265 | * @param array $optParams Optional parameters.
|
---|
266 | * @return ApiDeployment
|
---|
267 | * @throws \Google\Service\Exception
|
---|
268 | */
|
---|
269 | public function tagRevision($name, TagApiDeploymentRevisionRequest $postBody, $optParams = [])
|
---|
270 | {
|
---|
271 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
272 | $params = array_merge($params, $optParams);
|
---|
273 | return $this->call('tagRevision', [$params], ApiDeployment::class);
|
---|
274 | }
|
---|
275 | /**
|
---|
276 | * Returns permissions that a caller has on the specified resource. If the
|
---|
277 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
278 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
279 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
280 | * This operation may "fail open" without warning.
|
---|
281 | * (deployments.testIamPermissions)
|
---|
282 | *
|
---|
283 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
284 | * being requested. See [Resource
|
---|
285 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
286 | * appropriate value for this field.
|
---|
287 | * @param TestIamPermissionsRequest $postBody
|
---|
288 | * @param array $optParams Optional parameters.
|
---|
289 | * @return TestIamPermissionsResponse
|
---|
290 | * @throws \Google\Service\Exception
|
---|
291 | */
|
---|
292 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
293 | {
|
---|
294 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
295 | $params = array_merge($params, $optParams);
|
---|
296 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
297 | }
|
---|
298 | }
|
---|
299 |
|
---|
300 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
301 | class_alias(ProjectsLocationsApisDeployments::class, 'Google_Service_ApigeeRegistry_Resource_ProjectsLocationsApisDeployments');
|
---|