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\Compute\Resource; 19 20use Google\Service\Compute\BackendBucket; 21use Google\Service\Compute\BackendBucketList; 22use Google\Service\Compute\Operation; 23use Google\Service\Compute\SecurityPolicyReference; 24use Google\Service\Compute\SignedUrlKey; 25 26/** 27 * The "backendBuckets" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $computeService = new Google\Service\Compute(...); 31 * $backendBuckets = $computeService->backendBuckets; 32 * </code> 33 */ 34class BackendBuckets extends \Google\Service\Resource 35{ 36 /** 37 * Adds a key for validating requests with signed URLs for this backend bucket. 38 * (backendBuckets.addSignedUrlKey) 39 * 40 * @param string $project Project ID for this request. 41 * @param string $backendBucket Name of the BackendBucket resource to which the 42 * Signed URL Key should be added. The name should conform to RFC1035. 43 * @param SignedUrlKey $postBody 44 * @param array $optParams Optional parameters. 45 * 46 * @opt_param string requestId An optional request ID to identify requests. 47 * Specify a unique request ID so that if you must retry your request, the 48 * server will know to ignore the request if it has already been completed. 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 * @return Operation 57 */ 58 public function addSignedUrlKey($project, $backendBucket, SignedUrlKey $postBody, $optParams = []) 59 { 60 $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody]; 61 $params = array_merge($params, $optParams); 62 return $this->call('addSignedUrlKey', [$params], Operation::class); 63 } 64 /** 65 * Deletes the specified BackendBucket resource. (backendBuckets.delete) 66 * 67 * @param string $project Project ID for this request. 68 * @param string $backendBucket Name of the BackendBucket resource to delete. 69 * @param array $optParams Optional parameters. 70 * 71 * @opt_param string requestId An optional request ID to identify requests. 72 * Specify a unique request ID so that if you must retry your request, the 73 * server will know to ignore the request if it has already been completed. For 74 * example, consider a situation where you make an initial request and the 75 * request times out. If you make the request again with the same request ID, 76 * the server can check if original operation with the same request ID was 77 * received, and if so, will ignore the second request. This prevents clients 78 * from accidentally creating duplicate commitments. The request ID must be a 79 * valid UUID with the exception that zero UUID is not supported ( 80 * 00000000-0000-0000-0000-000000000000). 81 * @return Operation 82 */ 83 public function delete($project, $backendBucket, $optParams = []) 84 { 85 $params = ['project' => $project, 'backendBucket' => $backendBucket]; 86 $params = array_merge($params, $optParams); 87 return $this->call('delete', [$params], Operation::class); 88 } 89 /** 90 * Deletes a key for validating requests with signed URLs for this backend 91 * bucket. (backendBuckets.deleteSignedUrlKey) 92 * 93 * @param string $project Project ID for this request. 94 * @param string $backendBucket Name of the BackendBucket resource to which the 95 * Signed URL Key should be added. The name should conform to RFC1035. 96 * @param string $keyName The name of the Signed URL Key to delete. 97 * @param array $optParams Optional parameters. 98 * 99 * @opt_param string requestId An optional request ID to identify requests. 100 * Specify a unique request ID so that if you must retry your request, the 101 * server will know to ignore the request if it has already been completed. For 102 * example, consider a situation where you make an initial request and the 103 * request times out. If you make the request again with the same request ID, 104 * the server can check if original operation with the same request ID was 105 * received, and if so, will ignore the second request. This prevents clients 106 * from accidentally creating duplicate commitments. The request ID must be a 107 * valid UUID with the exception that zero UUID is not supported ( 108 * 00000000-0000-0000-0000-000000000000). 109 * @return Operation 110 */ 111 public function deleteSignedUrlKey($project, $backendBucket, $keyName, $optParams = []) 112 { 113 $params = ['project' => $project, 'backendBucket' => $backendBucket, 'keyName' => $keyName]; 114 $params = array_merge($params, $optParams); 115 return $this->call('deleteSignedUrlKey', [$params], Operation::class); 116 } 117 /** 118 * Returns the specified BackendBucket resource. Gets a list of available 119 * backend buckets by making a list() request. (backendBuckets.get) 120 * 121 * @param string $project Project ID for this request. 122 * @param string $backendBucket Name of the BackendBucket resource to return. 123 * @param array $optParams Optional parameters. 124 * @return BackendBucket 125 */ 126 public function get($project, $backendBucket, $optParams = []) 127 { 128 $params = ['project' => $project, 'backendBucket' => $backendBucket]; 129 $params = array_merge($params, $optParams); 130 return $this->call('get', [$params], BackendBucket::class); 131 } 132 /** 133 * Creates a BackendBucket resource in the specified project using the data 134 * included in the request. (backendBuckets.insert) 135 * 136 * @param string $project Project ID for this request. 137 * @param BackendBucket $postBody 138 * @param array $optParams Optional parameters. 139 * 140 * @opt_param string requestId An optional request ID to identify requests. 141 * Specify a unique request ID so that if you must retry your request, the 142 * server will know to ignore the request if it has already been completed. For 143 * example, consider a situation where you make an initial request and the 144 * request times out. If you make the request again with the same request ID, 145 * the server can check if original operation with the same request ID was 146 * received, and if so, will ignore the second request. This prevents clients 147 * from accidentally creating duplicate commitments. The request ID must be a 148 * valid UUID with the exception that zero UUID is not supported ( 149 * 00000000-0000-0000-0000-000000000000). 150 * @return Operation 151 */ 152 public function insert($project, BackendBucket $postBody, $optParams = []) 153 { 154 $params = ['project' => $project, 'postBody' => $postBody]; 155 $params = array_merge($params, $optParams); 156 return $this->call('insert', [$params], Operation::class); 157 } 158 /** 159 * Retrieves the list of BackendBucket resources available to the specified 160 * project. (backendBuckets.listBackendBuckets) 161 * 162 * @param string $project Project ID for this request. 163 * @param array $optParams Optional parameters. 164 * 165 * @opt_param string filter A filter expression that filters resources listed in 166 * the response. The expression must specify the field name, an operator, and 167 * the value that you want to use for filtering. The value must be a string, a 168 * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 169 * `>=` or `:`. For example, if you are filtering Compute Engine instances, you 170 * can exclude instances named `example-instance` by specifying `name != 171 * example-instance`. The `:` operator can be used with string fields to match 172 * substrings. For non-string fields it is equivalent to the `=` operator. The 173 * `:*` comparison can be used to test whether a key has been defined. For 174 * example, to find all objects with `owner` label use: ``` labels.owner:* ``` 175 * You can also filter nested fields. For example, you could specify 176 * `scheduling.automaticRestart = false` to include instances only if they are 177 * not scheduled for automatic restarts. You can use filtering on nested fields 178 * to filter based on resource labels. To filter on multiple expressions, 179 * provide each separate expression within parentheses. For example: ``` 180 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By 181 * default, each expression is an `AND` expression. However, you can include 182 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel 183 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND 184 * (scheduling.automaticRestart = true) ``` 185 * @opt_param string maxResults The maximum number of results per page that 186 * should be returned. If the number of available results is larger than 187 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to 188 * get the next page of results in subsequent list requests. Acceptable values 189 * are `0` to `500`, inclusive. (Default: `500`) 190 * @opt_param string orderBy Sorts list results by a certain order. By default, 191 * results are returned in alphanumerical order based on the resource name. You 192 * can also sort results in descending order based on the creation timestamp 193 * using `orderBy="creationTimestamp desc"`. This sorts results based on the 194 * `creationTimestamp` field in reverse chronological order (newest result 195 * first). Use this to sort resources like operations so that the newest 196 * operation is returned first. Currently, only sorting by `name` or 197 * `creationTimestamp desc` is supported. 198 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to 199 * the `nextPageToken` returned by a previous list request to get the next page 200 * of results. 201 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior 202 * which provides partial results in case of failure. The default value is 203 * false. 204 * @return BackendBucketList 205 */ 206 public function listBackendBuckets($project, $optParams = []) 207 { 208 $params = ['project' => $project]; 209 $params = array_merge($params, $optParams); 210 return $this->call('list', [$params], BackendBucketList::class); 211 } 212 /** 213 * Updates the specified BackendBucket resource with the data included in the 214 * request. This method supports PATCH semantics and uses the JSON merge patch 215 * format and processing rules. (backendBuckets.patch) 216 * 217 * @param string $project Project ID for this request. 218 * @param string $backendBucket Name of the BackendBucket resource to patch. 219 * @param BackendBucket $postBody 220 * @param array $optParams Optional parameters. 221 * 222 * @opt_param string requestId An optional request ID to identify requests. 223 * Specify a unique request ID so that if you must retry your request, the 224 * server will know to ignore the request if it has already been completed. For 225 * example, consider a situation where you make an initial request and the 226 * request times out. If you make the request again with the same request ID, 227 * the server can check if original operation with the same request ID was 228 * received, and if so, will ignore the second request. This prevents clients 229 * from accidentally creating duplicate commitments. The request ID must be a 230 * valid UUID with the exception that zero UUID is not supported ( 231 * 00000000-0000-0000-0000-000000000000). 232 * @return Operation 233 */ 234 public function patch($project, $backendBucket, BackendBucket $postBody, $optParams = []) 235 { 236 $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody]; 237 $params = array_merge($params, $optParams); 238 return $this->call('patch', [$params], Operation::class); 239 } 240 /** 241 * Sets the edge security policy for the specified backend bucket. 242 * (backendBuckets.setEdgeSecurityPolicy) 243 * 244 * @param string $project Project ID for this request. 245 * @param string $backendBucket Name of the BackendService resource to which the 246 * security policy should be set. The name should conform to RFC1035. 247 * @param SecurityPolicyReference $postBody 248 * @param array $optParams Optional parameters. 249 * 250 * @opt_param string requestId An optional request ID to identify requests. 251 * Specify a unique request ID so that if you must retry your request, the 252 * server will know to ignore the request if it has already been completed. For 253 * example, consider a situation where you make an initial request and the 254 * request times out. If you make the request again with the same request ID, 255 * the server can check if original operation with the same request ID was 256 * received, and if so, will ignore the second request. This prevents clients 257 * from accidentally creating duplicate commitments. The request ID must be a 258 * valid UUID with the exception that zero UUID is not supported ( 259 * 00000000-0000-0000-0000-000000000000). 260 * @return Operation 261 */ 262 public function setEdgeSecurityPolicy($project, $backendBucket, SecurityPolicyReference $postBody, $optParams = []) 263 { 264 $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody]; 265 $params = array_merge($params, $optParams); 266 return $this->call('setEdgeSecurityPolicy', [$params], Operation::class); 267 } 268 /** 269 * Updates the specified BackendBucket resource with the data included in the 270 * request. (backendBuckets.update) 271 * 272 * @param string $project Project ID for this request. 273 * @param string $backendBucket Name of the BackendBucket resource to update. 274 * @param BackendBucket $postBody 275 * @param array $optParams Optional parameters. 276 * 277 * @opt_param string requestId An optional request ID to identify requests. 278 * Specify a unique request ID so that if you must retry your request, the 279 * server will know to ignore the request if it has already been completed. For 280 * example, consider a situation where you make an initial request and the 281 * request times out. If you make the request again with the same request ID, 282 * the server can check if original operation with the same request ID was 283 * received, and if so, will ignore the second request. This prevents clients 284 * from accidentally creating duplicate commitments. The request ID must be a 285 * valid UUID with the exception that zero UUID is not supported ( 286 * 00000000-0000-0000-0000-000000000000). 287 * @return Operation 288 */ 289 public function update($project, $backendBucket, BackendBucket $postBody, $optParams = []) 290 { 291 $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody]; 292 $params = array_merge($params, $optParams); 293 return $this->call('update', [$params], Operation::class); 294 } 295} 296 297// Adding a class alias for backwards compatibility with the previous class name. 298class_alias(BackendBuckets::class, 'Google_Service_Compute_Resource_BackendBuckets'); 299