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