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