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 18namespace Google\Service\CloudDeploy\Resource; 19 20use Google\Service\CloudDeploy\DeliveryPipeline; 21use Google\Service\CloudDeploy\ListDeliveryPipelinesResponse; 22use Google\Service\CloudDeploy\Operation; 23use Google\Service\CloudDeploy\Policy; 24use Google\Service\CloudDeploy\SetIamPolicyRequest; 25use Google\Service\CloudDeploy\TestIamPermissionsRequest; 26use Google\Service\CloudDeploy\TestIamPermissionsResponse; 27 28/** 29 * The "deliveryPipelines" collection of methods. 30 * Typical usage is: 31 * <code> 32 * $clouddeployService = new Google\Service\CloudDeploy(...); 33 * $deliveryPipelines = $clouddeployService->deliveryPipelines; 34 * </code> 35 */ 36class ProjectsLocationsDeliveryPipelines extends \Google\Service\Resource 37{ 38 /** 39 * Creates a new DeliveryPipeline in a given project and location. 40 * (deliveryPipelines.create) 41 * 42 * @param string $parent Required. The parent collection in which the 43 * `DeliveryPipeline` should be created. Format should be 44 * projects/{project_id}/locations/{location_name}. 45 * @param DeliveryPipeline $postBody 46 * @param array $optParams Optional parameters. 47 * 48 * @opt_param string deliveryPipelineId Required. ID of the `DeliveryPipeline`. 49 * @opt_param string requestId Optional. A request ID to identify requests. 50 * Specify a unique request ID so that if you must retry your request, the 51 * server will know to ignore the request if it has already been completed. The 52 * server will guarantee that for at least 60 minutes since the first request. 53 * For example, consider a situation where you make an initial request and the 54 * request times out. If you make the request again with the same request ID, 55 * the server can check if original operation with the same request ID was 56 * received, and if so, will ignore the second request. This prevents clients 57 * from accidentally creating duplicate commitments. The request ID must be a 58 * valid UUID with the exception that zero UUID is not supported 59 * (00000000-0000-0000-0000-000000000000). 60 * @opt_param bool validateOnly Optional. If set to true, the request is 61 * validated and the user is provided with an expected result, but no actual 62 * change is made. 63 * @return Operation 64 */ 65 public function create($parent, DeliveryPipeline $postBody, $optParams = []) 66 { 67 $params = ['parent' => $parent, 'postBody' => $postBody]; 68 $params = array_merge($params, $optParams); 69 return $this->call('create', [$params], Operation::class); 70 } 71 /** 72 * Deletes a single DeliveryPipeline. (deliveryPipelines.delete) 73 * 74 * @param string $name Required. The name of the `DeliveryPipeline` to delete. 75 * Format should be projects/{project_id}/locations/{location_name}/deliveryPipe 76 * lines/{pipeline_name}. 77 * @param array $optParams Optional parameters. 78 * 79 * @opt_param bool allowMissing Optional. If set to true, then deleting an 80 * already deleted or non-existing `DeliveryPipeline` will succeed. 81 * @opt_param string etag Optional. This checksum is computed by the server 82 * based on the value of other fields, and may be sent on update and delete 83 * requests to ensure the client has an up-to-date value before proceeding. 84 * @opt_param bool force Optional. If set to true, all child resources under 85 * this pipeline will also be deleted. Otherwise, the request will only work if 86 * the pipeline has no child resources. 87 * @opt_param string requestId Optional. A request ID to identify requests. 88 * Specify a unique request ID so that if you must retry your request, the 89 * server will know to ignore the request if it has already been completed. The 90 * server will guarantee that for at least 60 minutes after the first request. 91 * For example, consider a situation where you make an initial request and the 92 * request times out. If you make the request again with the same request ID, 93 * the server can check if original operation with the same request ID was 94 * received, and if so, will ignore the second request. This prevents clients 95 * from accidentally creating duplicate commitments. The request ID must be a 96 * valid UUID with the exception that zero UUID is not supported 97 * (00000000-0000-0000-0000-000000000000). 98 * @opt_param bool validateOnly Optional. If set, validate the request and 99 * preview the review, but do not actually post it. 100 * @return Operation 101 */ 102 public function delete($name, $optParams = []) 103 { 104 $params = ['name' => $name]; 105 $params = array_merge($params, $optParams); 106 return $this->call('delete', [$params], Operation::class); 107 } 108 /** 109 * Gets details of a single DeliveryPipeline. (deliveryPipelines.get) 110 * 111 * @param string $name Required. Name of the `DeliveryPipeline`. Format must be 112 * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_n 113 * ame}. 114 * @param array $optParams Optional parameters. 115 * @return DeliveryPipeline 116 */ 117 public function get($name, $optParams = []) 118 { 119 $params = ['name' => $name]; 120 $params = array_merge($params, $optParams); 121 return $this->call('get', [$params], DeliveryPipeline::class); 122 } 123 /** 124 * Gets the access control policy for a resource. Returns an empty policy if the 125 * resource exists and does not have a policy set. 126 * (deliveryPipelines.getIamPolicy) 127 * 128 * @param string $resource REQUIRED: The resource for which the policy is being 129 * requested. See the operation documentation for the appropriate value for this 130 * field. 131 * @param array $optParams Optional parameters. 132 * 133 * @opt_param int options.requestedPolicyVersion Optional. The maximum policy 134 * version that will be used to format the policy. Valid values are 0, 1, and 3. 135 * Requests specifying an invalid value will be rejected. Requests for policies 136 * with any conditional role bindings must specify version 3. Policies with no 137 * conditional role bindings may specify any valid value or leave the field 138 * unset. The policy in the response might use the policy version that you 139 * specified, or it might use a lower policy version. For example, if you 140 * specify version 3, but the policy has no conditional role bindings, the 141 * response uses version 1. To learn which resources support conditions in their 142 * IAM policies, see the [IAM 143 * documentation](https://cloud.google.com/iam/help/conditions/resource- 144 * policies). 145 * @return Policy 146 */ 147 public function getIamPolicy($resource, $optParams = []) 148 { 149 $params = ['resource' => $resource]; 150 $params = array_merge($params, $optParams); 151 return $this->call('getIamPolicy', [$params], Policy::class); 152 } 153 /** 154 * Lists DeliveryPipelines in a given project and location. 155 * (deliveryPipelines.listProjectsLocationsDeliveryPipelines) 156 * 157 * @param string $parent Required. The parent, which owns this collection of 158 * pipelines. Format must be projects/{project_id}/locations/{location_name}. 159 * @param array $optParams Optional parameters. 160 * 161 * @opt_param string filter Filter pipelines to be returned. See 162 * https://google.aip.dev/160 for more details. 163 * @opt_param string orderBy Field to sort by. See 164 * https://google.aip.dev/132#ordering for more details. 165 * @opt_param int pageSize The maximum number of pipelines to return. The 166 * service may return fewer than this value. If unspecified, at most 50 167 * pipelines will be returned. The maximum value is 1000; values above 1000 will 168 * be set to 1000. 169 * @opt_param string pageToken A page token, received from a previous 170 * `ListDeliveryPipelines` call. Provide this to retrieve the subsequent page. 171 * When paginating, all other provided parameters match the call that provided 172 * the page token. 173 * @return ListDeliveryPipelinesResponse 174 */ 175 public function listProjectsLocationsDeliveryPipelines($parent, $optParams = []) 176 { 177 $params = ['parent' => $parent]; 178 $params = array_merge($params, $optParams); 179 return $this->call('list', [$params], ListDeliveryPipelinesResponse::class); 180 } 181 /** 182 * Updates the parameters of a single DeliveryPipeline. 183 * (deliveryPipelines.patch) 184 * 185 * @param string $name Optional. Name of the `DeliveryPipeline`. Format is 186 * projects/{project}/ locations/{location}/deliveryPipelines/a-z{0,62}. 187 * @param DeliveryPipeline $postBody 188 * @param array $optParams Optional parameters. 189 * 190 * @opt_param bool allowMissing Optional. If set to true, updating a 191 * `DeliveryPipeline` that does not exist will result in the creation of a new 192 * `DeliveryPipeline`. 193 * @opt_param string requestId Optional. A request ID to identify requests. 194 * Specify a unique request ID so that if you must retry your request, the 195 * server will know to ignore the request if it has already been completed. The 196 * server will guarantee that for at least 60 minutes since the first request. 197 * For example, consider a situation where you make an initial request and the 198 * request times out. If you make the request again with the same request ID, 199 * the server can check if original operation with the same request ID was 200 * received, and if so, will ignore the second request. This prevents clients 201 * from accidentally creating duplicate commitments. The request ID must be a 202 * valid UUID with the exception that zero UUID is not supported 203 * (00000000-0000-0000-0000-000000000000). 204 * @opt_param string updateMask Required. Field mask is used to specify the 205 * fields to be overwritten in the `DeliveryPipeline` resource by the update. 206 * The fields specified in the update_mask are relative to the resource, not the 207 * full request. A field will be overwritten if it is in the mask. If the user 208 * does not provide a mask then all fields will be overwritten. 209 * @opt_param bool validateOnly Optional. If set to true, the request is 210 * validated and the user is provided with an expected result, but no actual 211 * change is made. 212 * @return Operation 213 */ 214 public function patch($name, DeliveryPipeline $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. (deliveryPipelines.setIamPolicy) 224 * 225 * @param string $resource REQUIRED: The resource for which the policy is being 226 * specified. See the operation documentation for the appropriate value for this 227 * field. 228 * @param SetIamPolicyRequest $postBody 229 * @param array $optParams Optional parameters. 230 * @return Policy 231 */ 232 public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = []) 233 { 234 $params = ['resource' => $resource, 'postBody' => $postBody]; 235 $params = array_merge($params, $optParams); 236 return $this->call('setIamPolicy', [$params], Policy::class); 237 } 238 /** 239 * Returns permissions that a caller has on the specified resource. If the 240 * resource does not exist, this will return an empty set of permissions, not a 241 * `NOT_FOUND` error. Note: This operation is designed to be used for building 242 * permission-aware UIs and command-line tools, not for authorization checking. 243 * This operation may "fail open" without warning. 244 * (deliveryPipelines.testIamPermissions) 245 * 246 * @param string $resource REQUIRED: The resource for which the policy detail is 247 * being requested. See the operation documentation for the appropriate value 248 * for this field. 249 * @param TestIamPermissionsRequest $postBody 250 * @param array $optParams Optional parameters. 251 * @return TestIamPermissionsResponse 252 */ 253 public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = []) 254 { 255 $params = ['resource' => $resource, 'postBody' => $postBody]; 256 $params = array_merge($params, $optParams); 257 return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class); 258 } 259} 260 261// Adding a class alias for backwards compatibility with the previous class name. 262class_alias(ProjectsLocationsDeliveryPipelines::class, 'Google_Service_CloudDeploy_Resource_ProjectsLocationsDeliveryPipelines'); 263