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\CloudDeploy\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudDeploy\DeployPolicy;
|
---|
21 | use Google\Service\CloudDeploy\ListDeployPoliciesResponse;
|
---|
22 | use Google\Service\CloudDeploy\Operation;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "deployPolicies" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $clouddeployService = new Google\Service\CloudDeploy(...);
|
---|
29 | * $deployPolicies = $clouddeployService->projects_locations_deployPolicies;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsDeployPolicies extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new DeployPolicy in a given project and location.
|
---|
36 | * (deployPolicies.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The parent collection in which the
|
---|
39 | * `DeployPolicy` must be created. The format is
|
---|
40 | * `projects/{project_id}/locations/{location_name}`.
|
---|
41 | * @param DeployPolicy $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | *
|
---|
44 | * @opt_param string deployPolicyId Required. ID of the `DeployPolicy`.
|
---|
45 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
46 | * Specify a unique request ID so that if you must retry your request, the
|
---|
47 | * server knows to ignore the request if it has already been completed. The
|
---|
48 | * server guarantees that for at least 60 minutes after the first request. For
|
---|
49 | * example, consider a situation where you make an initial request and the
|
---|
50 | * request times out. If you make the request again with the same request ID,
|
---|
51 | * the server can check if original operation with the same request ID was
|
---|
52 | * received, and if so, will ignore the second request. This prevents clients
|
---|
53 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
54 | * valid UUID with the exception that zero UUID is not supported
|
---|
55 | * (00000000-0000-0000-0000-000000000000).
|
---|
56 | * @opt_param bool validateOnly Optional. If set to true, the request is
|
---|
57 | * validated and the user is provided with an expected result, but no actual
|
---|
58 | * change is made.
|
---|
59 | * @return Operation
|
---|
60 | * @throws \Google\Service\Exception
|
---|
61 | */
|
---|
62 | public function create($parent, DeployPolicy $postBody, $optParams = [])
|
---|
63 | {
|
---|
64 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
65 | $params = array_merge($params, $optParams);
|
---|
66 | return $this->call('create', [$params], Operation::class);
|
---|
67 | }
|
---|
68 | /**
|
---|
69 | * Deletes a single DeployPolicy. (deployPolicies.delete)
|
---|
70 | *
|
---|
71 | * @param string $name Required. The name of the `DeployPolicy` to delete. The
|
---|
72 | * format is `projects/{project_id}/locations/{location_name}/deployPolicies/{de
|
---|
73 | * ploy_policy_name}`.
|
---|
74 | * @param array $optParams Optional parameters.
|
---|
75 | *
|
---|
76 | * @opt_param bool allowMissing Optional. If set to true, then deleting an
|
---|
77 | * already deleted or non-existing `DeployPolicy` will succeed.
|
---|
78 | * @opt_param string etag Optional. This checksum is computed by the server
|
---|
79 | * based on the value of other fields, and may be sent on update and delete
|
---|
80 | * requests to ensure the client has an up-to-date value before proceeding.
|
---|
81 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
82 | * Specify a unique request ID so that if you must retry your request, the
|
---|
83 | * server knows to ignore the request if it has already been completed. The
|
---|
84 | * server guarantees that for at least 60 minutes after the first request. For
|
---|
85 | * example, consider a situation where you make an initial request and the
|
---|
86 | * request times out. If you make the request again with the same request ID,
|
---|
87 | * the server can check if original operation with the same request ID was
|
---|
88 | * received, and if so, will ignore the second request. This prevents clients
|
---|
89 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
90 | * valid UUID with the exception that zero UUID is not supported
|
---|
91 | * (00000000-0000-0000-0000-000000000000).
|
---|
92 | * @opt_param bool validateOnly Optional. If set, validate the request and
|
---|
93 | * preview the review, but do not actually post it.
|
---|
94 | * @return Operation
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function delete($name, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['name' => $name];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('delete', [$params], Operation::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Gets details of a single DeployPolicy. (deployPolicies.get)
|
---|
105 | *
|
---|
106 | * @param string $name Required. Name of the `DeployPolicy`. Format must be `pro
|
---|
107 | * jects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_na
|
---|
108 | * me}`.
|
---|
109 | * @param array $optParams Optional parameters.
|
---|
110 | * @return DeployPolicy
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function get($name, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['name' => $name];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('get', [$params], DeployPolicy::class);
|
---|
118 | }
|
---|
119 | /**
|
---|
120 | * Lists DeployPolicies in a given project and location.
|
---|
121 | * (deployPolicies.listProjectsLocationsDeployPolicies)
|
---|
122 | *
|
---|
123 | * @param string $parent Required. The parent, which owns this collection of
|
---|
124 | * deploy policies. Format must be
|
---|
125 | * `projects/{project_id}/locations/{location_name}`.
|
---|
126 | * @param array $optParams Optional parameters.
|
---|
127 | *
|
---|
128 | * @opt_param string filter Filter deploy policies to be returned. See
|
---|
129 | * https://google.aip.dev/160 for more details. All fields can be used in the
|
---|
130 | * filter.
|
---|
131 | * @opt_param string orderBy Field to sort by. See
|
---|
132 | * https://google.aip.dev/132#ordering for more details.
|
---|
133 | * @opt_param int pageSize The maximum number of deploy policies to return. The
|
---|
134 | * service may return fewer than this value. If unspecified, at most 50 deploy
|
---|
135 | * policies will be returned. The maximum value is 1000; values above 1000 will
|
---|
136 | * be set to 1000.
|
---|
137 | * @opt_param string pageToken A page token, received from a previous
|
---|
138 | * `ListDeployPolicies` call. Provide this to retrieve the subsequent page. When
|
---|
139 | * paginating, all other provided parameters match the call that provided the
|
---|
140 | * page token.
|
---|
141 | * @return ListDeployPoliciesResponse
|
---|
142 | * @throws \Google\Service\Exception
|
---|
143 | */
|
---|
144 | public function listProjectsLocationsDeployPolicies($parent, $optParams = [])
|
---|
145 | {
|
---|
146 | $params = ['parent' => $parent];
|
---|
147 | $params = array_merge($params, $optParams);
|
---|
148 | return $this->call('list', [$params], ListDeployPoliciesResponse::class);
|
---|
149 | }
|
---|
150 | /**
|
---|
151 | * Updates the parameters of a single DeployPolicy. (deployPolicies.patch)
|
---|
152 | *
|
---|
153 | * @param string $name Output only. Name of the `DeployPolicy`. Format is
|
---|
154 | * `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. The
|
---|
155 | * `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
|
---|
156 | * @param DeployPolicy $postBody
|
---|
157 | * @param array $optParams Optional parameters.
|
---|
158 | *
|
---|
159 | * @opt_param bool allowMissing Optional. If set to true, updating a
|
---|
160 | * `DeployPolicy` that does not exist will result in the creation of a new
|
---|
161 | * `DeployPolicy`.
|
---|
162 | * @opt_param string requestId Optional. A request ID to identify requests.
|
---|
163 | * Specify a unique request ID so that if you must retry your request, the
|
---|
164 | * server knows to ignore the request if it has already been completed. The
|
---|
165 | * server guarantees that for at least 60 minutes after the first request. For
|
---|
166 | * example, consider a situation where you make an initial request and the
|
---|
167 | * request times out. If you make the request again with the same request ID,
|
---|
168 | * the server can check if original operation with the same request ID was
|
---|
169 | * received, and if so, will ignore the second request. This prevents clients
|
---|
170 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
171 | * valid UUID with the exception that zero UUID is not supported
|
---|
172 | * (00000000-0000-0000-0000-000000000000).
|
---|
173 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
174 | * fields to be overwritten by the update in the `DeployPolicy` resource. The
|
---|
175 | * fields specified in the update_mask are relative to the resource, not the
|
---|
176 | * full request. A field will be overwritten if it's in the mask. If the user
|
---|
177 | * doesn't provide a mask then all fields are overwritten.
|
---|
178 | * @opt_param bool validateOnly Optional. If set to true, the request is
|
---|
179 | * validated and the user is provided with an expected result, but no actual
|
---|
180 | * change is made.
|
---|
181 | * @return Operation
|
---|
182 | * @throws \Google\Service\Exception
|
---|
183 | */
|
---|
184 | public function patch($name, DeployPolicy $postBody, $optParams = [])
|
---|
185 | {
|
---|
186 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
187 | $params = array_merge($params, $optParams);
|
---|
188 | return $this->call('patch', [$params], Operation::class);
|
---|
189 | }
|
---|
190 | }
|
---|
191 |
|
---|
192 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
193 | class_alias(ProjectsLocationsDeployPolicies::class, 'Google_Service_CloudDeploy_Resource_ProjectsLocationsDeployPolicies');
|
---|