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