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\TargetTcpProxiesSetBackendServiceRequest; 22use Google\Service\Compute\TargetTcpProxiesSetProxyHeaderRequest; 23use Google\Service\Compute\TargetTcpProxy; 24use Google\Service\Compute\TargetTcpProxyList; 25 26/** 27 * The "targetTcpProxies" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $computeService = new Google\Service\Compute(...); 31 * $targetTcpProxies = $computeService->targetTcpProxies; 32 * </code> 33 */ 34class TargetTcpProxies extends \Google\Service\Resource 35{ 36 /** 37 * Deletes the specified TargetTcpProxy resource. (targetTcpProxies.delete) 38 * 39 * @param string $project Project ID for this request. 40 * @param string $targetTcpProxy Name of the TargetTcpProxy resource to delete. 41 * @param array $optParams Optional parameters. 42 * 43 * @opt_param string requestId An optional request ID to identify requests. 44 * Specify a unique request ID so that if you must retry your request, the 45 * server will know to ignore the request if it has already been completed. For 46 * example, consider a situation where you make an initial request and the 47 * request times out. If you make the request again with the same request ID, 48 * the server can check if original operation with the same request ID was 49 * received, and if so, will ignore the second request. This prevents clients 50 * from accidentally creating duplicate commitments. The request ID must be a 51 * valid UUID with the exception that zero UUID is not supported ( 52 * 00000000-0000-0000-0000-000000000000). 53 * @return Operation 54 */ 55 public function delete($project, $targetTcpProxy, $optParams = []) 56 { 57 $params = ['project' => $project, 'targetTcpProxy' => $targetTcpProxy]; 58 $params = array_merge($params, $optParams); 59 return $this->call('delete', [$params], Operation::class); 60 } 61 /** 62 * Returns the specified TargetTcpProxy resource. Gets a list of available 63 * target TCP proxies by making a list() request. (targetTcpProxies.get) 64 * 65 * @param string $project Project ID for this request. 66 * @param string $targetTcpProxy Name of the TargetTcpProxy resource to return. 67 * @param array $optParams Optional parameters. 68 * @return TargetTcpProxy 69 */ 70 public function get($project, $targetTcpProxy, $optParams = []) 71 { 72 $params = ['project' => $project, 'targetTcpProxy' => $targetTcpProxy]; 73 $params = array_merge($params, $optParams); 74 return $this->call('get', [$params], TargetTcpProxy::class); 75 } 76 /** 77 * Creates a TargetTcpProxy resource in the specified project using the data 78 * included in the request. (targetTcpProxies.insert) 79 * 80 * @param string $project Project ID for this request. 81 * @param TargetTcpProxy $postBody 82 * @param array $optParams Optional parameters. 83 * 84 * @opt_param string requestId An optional request ID to identify requests. 85 * Specify a unique request ID so that if you must retry your request, the 86 * server will know to ignore the request if it has already been completed. For 87 * example, consider a situation where you make an initial request and the 88 * request times out. If you make the request again with the same request ID, 89 * the server can check if original operation with the same request ID was 90 * received, and if so, will ignore the second request. This prevents clients 91 * from accidentally creating duplicate commitments. The request ID must be a 92 * valid UUID with the exception that zero UUID is not supported ( 93 * 00000000-0000-0000-0000-000000000000). 94 * @return Operation 95 */ 96 public function insert($project, TargetTcpProxy $postBody, $optParams = []) 97 { 98 $params = ['project' => $project, 'postBody' => $postBody]; 99 $params = array_merge($params, $optParams); 100 return $this->call('insert', [$params], Operation::class); 101 } 102 /** 103 * Retrieves the list of TargetTcpProxy resources available to the specified 104 * project. (targetTcpProxies.listTargetTcpProxies) 105 * 106 * @param string $project Project ID for this request. 107 * @param array $optParams Optional parameters. 108 * 109 * @opt_param string filter A filter expression that filters resources listed in 110 * the response. The expression must specify the field name, an operator, and 111 * the value that you want to use for filtering. The value must be a string, a 112 * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 113 * `>=` or `:`. For example, if you are filtering Compute Engine instances, you 114 * can exclude instances named `example-instance` by specifying `name != 115 * example-instance`. The `:` operator can be used with string fields to match 116 * substrings. For non-string fields it is equivalent to the `=` operator. The 117 * `:*` comparison can be used to test whether a key has been defined. For 118 * example, to find all objects with `owner` label use: ``` labels.owner:* ``` 119 * You can also filter nested fields. For example, you could specify 120 * `scheduling.automaticRestart = false` to include instances only if they are 121 * not scheduled for automatic restarts. You can use filtering on nested fields 122 * to filter based on resource labels. To filter on multiple expressions, 123 * provide each separate expression within parentheses. For example: ``` 124 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By 125 * default, each expression is an `AND` expression. However, you can include 126 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel 127 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND 128 * (scheduling.automaticRestart = true) ``` 129 * @opt_param string maxResults The maximum number of results per page that 130 * should be returned. If the number of available results is larger than 131 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to 132 * get the next page of results in subsequent list requests. Acceptable values 133 * are `0` to `500`, inclusive. (Default: `500`) 134 * @opt_param string orderBy Sorts list results by a certain order. By default, 135 * results are returned in alphanumerical order based on the resource name. You 136 * can also sort results in descending order based on the creation timestamp 137 * using `orderBy="creationTimestamp desc"`. This sorts results based on the 138 * `creationTimestamp` field in reverse chronological order (newest result 139 * first). Use this to sort resources like operations so that the newest 140 * operation is returned first. Currently, only sorting by `name` or 141 * `creationTimestamp desc` is supported. 142 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to 143 * the `nextPageToken` returned by a previous list request to get the next page 144 * of results. 145 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior 146 * which provides partial results in case of failure. The default value is 147 * false. 148 * @return TargetTcpProxyList 149 */ 150 public function listTargetTcpProxies($project, $optParams = []) 151 { 152 $params = ['project' => $project]; 153 $params = array_merge($params, $optParams); 154 return $this->call('list', [$params], TargetTcpProxyList::class); 155 } 156 /** 157 * Changes the BackendService for TargetTcpProxy. 158 * (targetTcpProxies.setBackendService) 159 * 160 * @param string $project Project ID for this request. 161 * @param string $targetTcpProxy Name of the TargetTcpProxy resource whose 162 * BackendService resource is to be set. 163 * @param TargetTcpProxiesSetBackendServiceRequest $postBody 164 * @param array $optParams Optional parameters. 165 * 166 * @opt_param string requestId An optional request ID to identify requests. 167 * Specify a unique request ID so that if you must retry your request, the 168 * server will know to ignore the request if it has already been completed. For 169 * example, consider a situation where you make an initial request and the 170 * request times out. If you make the request again with the same request ID, 171 * the server can check if original operation with the same request ID was 172 * received, and if so, will ignore the second request. This prevents clients 173 * from accidentally creating duplicate commitments. The request ID must be a 174 * valid UUID with the exception that zero UUID is not supported ( 175 * 00000000-0000-0000-0000-000000000000). 176 * @return Operation 177 */ 178 public function setBackendService($project, $targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest $postBody, $optParams = []) 179 { 180 $params = ['project' => $project, 'targetTcpProxy' => $targetTcpProxy, 'postBody' => $postBody]; 181 $params = array_merge($params, $optParams); 182 return $this->call('setBackendService', [$params], Operation::class); 183 } 184 /** 185 * Changes the ProxyHeaderType for TargetTcpProxy. 186 * (targetTcpProxies.setProxyHeader) 187 * 188 * @param string $project Project ID for this request. 189 * @param string $targetTcpProxy Name of the TargetTcpProxy resource whose 190 * ProxyHeader is to be set. 191 * @param TargetTcpProxiesSetProxyHeaderRequest $postBody 192 * @param array $optParams Optional parameters. 193 * 194 * @opt_param string requestId An optional request ID to identify requests. 195 * Specify a unique request ID so that if you must retry your request, the 196 * server will know to ignore the request if it has already been completed. For 197 * 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 * @return Operation 205 */ 206 public function setProxyHeader($project, $targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest $postBody, $optParams = []) 207 { 208 $params = ['project' => $project, 'targetTcpProxy' => $targetTcpProxy, 'postBody' => $postBody]; 209 $params = array_merge($params, $optParams); 210 return $this->call('setProxyHeader', [$params], Operation::class); 211 } 212} 213 214// Adding a class alias for backwards compatibility with the previous class name. 215class_alias(TargetTcpProxies::class, 'Google_Service_Compute_Resource_TargetTcpProxies'); 216