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