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\Autoscaler;
21use Google\Service\Compute\Operation;
22use Google\Service\Compute\RegionAutoscalerList;
23
24/**
25 * The "regionAutoscalers" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $computeService = new Google\Service\Compute(...);
29 *   $regionAutoscalers = $computeService->regionAutoscalers;
30 *  </code>
31 */
32class RegionAutoscalers extends \Google\Service\Resource
33{
34  /**
35   * Deletes the specified autoscaler. (regionAutoscalers.delete)
36   *
37   * @param string $project Project ID for this request.
38   * @param string $region Name of the region scoping this request.
39   * @param string $autoscaler Name of the autoscaler to delete.
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string requestId An optional request ID to identify requests.
43   * Specify a unique request ID so that if you must retry your request, the
44   * server will know to ignore the request if it has already been completed. For
45   * example, consider a situation where you make an initial request and the
46   * request times out. If you make the request again with the same request ID,
47   * the server can check if original operation with the same request ID was
48   * received, and if so, will ignore the second request. This prevents clients
49   * from accidentally creating duplicate commitments. The request ID must be a
50   * valid UUID with the exception that zero UUID is not supported (
51   * 00000000-0000-0000-0000-000000000000).
52   * @return Operation
53   */
54  public function delete($project, $region, $autoscaler, $optParams = [])
55  {
56    $params = ['project' => $project, 'region' => $region, 'autoscaler' => $autoscaler];
57    $params = array_merge($params, $optParams);
58    return $this->call('delete', [$params], Operation::class);
59  }
60  /**
61   * Returns the specified autoscaler. (regionAutoscalers.get)
62   *
63   * @param string $project Project ID for this request.
64   * @param string $region Name of the region scoping this request.
65   * @param string $autoscaler Name of the autoscaler to return.
66   * @param array $optParams Optional parameters.
67   * @return Autoscaler
68   */
69  public function get($project, $region, $autoscaler, $optParams = [])
70  {
71    $params = ['project' => $project, 'region' => $region, 'autoscaler' => $autoscaler];
72    $params = array_merge($params, $optParams);
73    return $this->call('get', [$params], Autoscaler::class);
74  }
75  /**
76   * Creates an autoscaler in the specified project using the data included in the
77   * request. (regionAutoscalers.insert)
78   *
79   * @param string $project Project ID for this request.
80   * @param string $region Name of the region scoping this request.
81   * @param Autoscaler $postBody
82   * @param array $optParams Optional parameters.
83   *
84   * @opt_param string requestId An optional request ID to identify requests.
85   * Specify a unique request ID so that if you must retry your request, the
86   * server will know to ignore the request if it has already been completed. For
87   * example, consider a situation where you make an initial request and the
88   * request times out. If you make the request again with the same request ID,
89   * the server can check if original operation with the same request ID was
90   * received, and if so, will ignore the second request. This prevents clients
91   * from accidentally creating duplicate commitments. The request ID must be a
92   * valid UUID with the exception that zero UUID is not supported (
93   * 00000000-0000-0000-0000-000000000000).
94   * @return Operation
95   */
96  public function insert($project, $region, Autoscaler $postBody, $optParams = [])
97  {
98    $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
99    $params = array_merge($params, $optParams);
100    return $this->call('insert', [$params], Operation::class);
101  }
102  /**
103   * Retrieves a list of autoscalers contained within the specified region.
104   * (regionAutoscalers.listRegionAutoscalers)
105   *
106   * @param string $project Project ID for this request.
107   * @param string $region Name of the region scoping 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 RegionAutoscalerList
150   */
151  public function listRegionAutoscalers($project, $region, $optParams = [])
152  {
153    $params = ['project' => $project, 'region' => $region];
154    $params = array_merge($params, $optParams);
155    return $this->call('list', [$params], RegionAutoscalerList::class);
156  }
157  /**
158   * Updates an autoscaler in the specified project using the data included in the
159   * request. This method supports PATCH semantics and uses the JSON merge patch
160   * format and processing rules. (regionAutoscalers.patch)
161   *
162   * @param string $project Project ID for this request.
163   * @param string $region Name of the region scoping this request.
164   * @param Autoscaler $postBody
165   * @param array $optParams Optional parameters.
166   *
167   * @opt_param string autoscaler Name of the autoscaler to patch.
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 patch($project, $region, Autoscaler $postBody, $optParams = [])
181  {
182    $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
183    $params = array_merge($params, $optParams);
184    return $this->call('patch', [$params], Operation::class);
185  }
186  /**
187   * Updates an autoscaler in the specified project using the data included in the
188   * request. (regionAutoscalers.update)
189   *
190   * @param string $project Project ID for this request.
191   * @param string $region Name of the region scoping this request.
192   * @param Autoscaler $postBody
193   * @param array $optParams Optional parameters.
194   *
195   * @opt_param string autoscaler Name of the autoscaler to update.
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 update($project, $region, Autoscaler $postBody, $optParams = [])
209  {
210    $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
211    $params = array_merge($params, $optParams);
212    return $this->call('update', [$params], Operation::class);
213  }
214}
215
216// Adding a class alias for backwards compatibility with the previous class name.
217class_alias(RegionAutoscalers::class, 'Google_Service_Compute_Resource_RegionAutoscalers');
218