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