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