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