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