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\PublicDelegatedPrefix;
22use Google\Service\Compute\PublicDelegatedPrefixAggregatedList;
23use Google\Service\Compute\PublicDelegatedPrefixList;
24
25/**
26 * The "publicDelegatedPrefixes" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $computeService = new Google\Service\Compute(...);
30 *   $publicDelegatedPrefixes = $computeService->publicDelegatedPrefixes;
31 *  </code>
32 */
33class PublicDelegatedPrefixes extends \Google\Service\Resource
34{
35  /**
36   * Lists all PublicDelegatedPrefix resources owned by the specific project
37   * across all scopes. (publicDelegatedPrefixes.aggregatedList)
38   *
39   * @param string $project Name of the project scoping this request.
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string filter A filter expression that filters resources listed in
43   * the response. The expression must specify the field name, an operator, and
44   * the value that you want to use for filtering. The value must be a string, a
45   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
46   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
47   * can exclude instances named `example-instance` by specifying `name !=
48   * example-instance`. The `:` operator can be used with string fields to match
49   * substrings. For non-string fields it is equivalent to the `=` operator. The
50   * `:*` comparison can be used to test whether a key has been defined. For
51   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
52   * You can also filter nested fields. For example, you could specify
53   * `scheduling.automaticRestart = false` to include instances only if they are
54   * not scheduled for automatic restarts. You can use filtering on nested fields
55   * to filter based on resource labels. To filter on multiple expressions,
56   * provide each separate expression within parentheses. For example: ```
57   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
58   * default, each expression is an `AND` expression. However, you can include
59   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
60   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
61   * (scheduling.automaticRestart = true) ```
62   * @opt_param bool includeAllScopes Indicates whether every visible scope for
63   * each scope type (zone, region, global) should be included in the response.
64   * For new resource types added after this field, the flag has no effect as new
65   * resource types will always include every visible scope for each scope type in
66   * response. For resource types which predate this field, if this flag is
67   * omitted or false, only scopes of the scope types where the resource type is
68   * expected to be found will be included.
69   * @opt_param string maxResults The maximum number of results per page that
70   * should be returned. If the number of available results is larger than
71   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
72   * get the next page of results in subsequent list requests. Acceptable values
73   * are `0` to `500`, inclusive. (Default: `500`)
74   * @opt_param string orderBy Sorts list results by a certain order. By default,
75   * results are returned in alphanumerical order based on the resource name. You
76   * can also sort results in descending order based on the creation timestamp
77   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
78   * `creationTimestamp` field in reverse chronological order (newest result
79   * first). Use this to sort resources like operations so that the newest
80   * operation is returned first. Currently, only sorting by `name` or
81   * `creationTimestamp desc` is supported.
82   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
83   * the `nextPageToken` returned by a previous list request to get the next page
84   * of results.
85   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
86   * which provides partial results in case of failure. The default value is
87   * false.
88   * @return PublicDelegatedPrefixAggregatedList
89   */
90  public function aggregatedList($project, $optParams = [])
91  {
92    $params = ['project' => $project];
93    $params = array_merge($params, $optParams);
94    return $this->call('aggregatedList', [$params], PublicDelegatedPrefixAggregatedList::class);
95  }
96  /**
97   * Deletes the specified PublicDelegatedPrefix in the given region.
98   * (publicDelegatedPrefixes.delete)
99   *
100   * @param string $project Project ID for this request.
101   * @param string $region Name of the region of this request.
102   * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix
103   * resource to delete.
104   * @param array $optParams Optional parameters.
105   *
106   * @opt_param string requestId An optional request ID to identify requests.
107   * Specify a unique request ID so that if you must retry your request, the
108   * server will know to ignore the request if it has already been completed. For
109   * example, consider a situation where you make an initial request and the
110   * request times out. If you make the request again with the same request ID,
111   * the server can check if original operation with the same request ID was
112   * received, and if so, will ignore the second request. This prevents clients
113   * from accidentally creating duplicate commitments. The request ID must be a
114   * valid UUID with the exception that zero UUID is not supported (
115   * 00000000-0000-0000-0000-000000000000).
116   * @return Operation
117   */
118  public function delete($project, $region, $publicDelegatedPrefix, $optParams = [])
119  {
120    $params = ['project' => $project, 'region' => $region, 'publicDelegatedPrefix' => $publicDelegatedPrefix];
121    $params = array_merge($params, $optParams);
122    return $this->call('delete', [$params], Operation::class);
123  }
124  /**
125   * Returns the specified PublicDelegatedPrefix resource in the given region.
126   * (publicDelegatedPrefixes.get)
127   *
128   * @param string $project Project ID for this request.
129   * @param string $region Name of the region of this request.
130   * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix
131   * resource to return.
132   * @param array $optParams Optional parameters.
133   * @return PublicDelegatedPrefix
134   */
135  public function get($project, $region, $publicDelegatedPrefix, $optParams = [])
136  {
137    $params = ['project' => $project, 'region' => $region, 'publicDelegatedPrefix' => $publicDelegatedPrefix];
138    $params = array_merge($params, $optParams);
139    return $this->call('get', [$params], PublicDelegatedPrefix::class);
140  }
141  /**
142   * Creates a PublicDelegatedPrefix in the specified project in the given region
143   * using the parameters that are included in the request.
144   * (publicDelegatedPrefixes.insert)
145   *
146   * @param string $project Project ID for this request.
147   * @param string $region Name of the region of this request.
148   * @param PublicDelegatedPrefix $postBody
149   * @param array $optParams Optional parameters.
150   *
151   * @opt_param string requestId An optional request ID to identify requests.
152   * Specify a unique request ID so that if you must retry your request, the
153   * server will know to ignore the request if it has already been completed. For
154   * example, consider a situation where you make an initial request and the
155   * request times out. If you make the request again with the same request ID,
156   * the server can check if original operation with the same request ID was
157   * received, and if so, will ignore the second request. This prevents clients
158   * from accidentally creating duplicate commitments. The request ID must be a
159   * valid UUID with the exception that zero UUID is not supported (
160   * 00000000-0000-0000-0000-000000000000).
161   * @return Operation
162   */
163  public function insert($project, $region, PublicDelegatedPrefix $postBody, $optParams = [])
164  {
165    $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
166    $params = array_merge($params, $optParams);
167    return $this->call('insert', [$params], Operation::class);
168  }
169  /**
170   * Lists the PublicDelegatedPrefixes for a project in the given region.
171   * (publicDelegatedPrefixes.listPublicDelegatedPrefixes)
172   *
173   * @param string $project Project ID for this request.
174   * @param string $region Name of the region of this request.
175   * @param array $optParams Optional parameters.
176   *
177   * @opt_param string filter A filter expression that filters resources listed in
178   * the response. The expression must specify the field name, an operator, and
179   * the value that you want to use for filtering. The value must be a string, a
180   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
181   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
182   * can exclude instances named `example-instance` by specifying `name !=
183   * example-instance`. The `:` operator can be used with string fields to match
184   * substrings. For non-string fields it is equivalent to the `=` operator. The
185   * `:*` comparison can be used to test whether a key has been defined. For
186   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
187   * You can also filter nested fields. For example, you could specify
188   * `scheduling.automaticRestart = false` to include instances only if they are
189   * not scheduled for automatic restarts. You can use filtering on nested fields
190   * to filter based on resource labels. To filter on multiple expressions,
191   * provide each separate expression within parentheses. For example: ```
192   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
193   * default, each expression is an `AND` expression. However, you can include
194   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
195   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
196   * (scheduling.automaticRestart = true) ```
197   * @opt_param string maxResults The maximum number of results per page that
198   * should be returned. If the number of available results is larger than
199   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
200   * get the next page of results in subsequent list requests. Acceptable values
201   * are `0` to `500`, inclusive. (Default: `500`)
202   * @opt_param string orderBy Sorts list results by a certain order. By default,
203   * results are returned in alphanumerical order based on the resource name. You
204   * can also sort results in descending order based on the creation timestamp
205   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
206   * `creationTimestamp` field in reverse chronological order (newest result
207   * first). Use this to sort resources like operations so that the newest
208   * operation is returned first. Currently, only sorting by `name` or
209   * `creationTimestamp desc` is supported.
210   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
211   * the `nextPageToken` returned by a previous list request to get the next page
212   * of results.
213   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
214   * which provides partial results in case of failure. The default value is
215   * false.
216   * @return PublicDelegatedPrefixList
217   */
218  public function listPublicDelegatedPrefixes($project, $region, $optParams = [])
219  {
220    $params = ['project' => $project, 'region' => $region];
221    $params = array_merge($params, $optParams);
222    return $this->call('list', [$params], PublicDelegatedPrefixList::class);
223  }
224  /**
225   * Patches the specified PublicDelegatedPrefix resource with the data included
226   * in the request. This method supports PATCH semantics and uses JSON merge
227   * patch format and processing rules. (publicDelegatedPrefixes.patch)
228   *
229   * @param string $project Project ID for this request.
230   * @param string $region Name of the region for this request.
231   * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix
232   * resource to patch.
233   * @param PublicDelegatedPrefix $postBody
234   * @param array $optParams Optional parameters.
235   *
236   * @opt_param string requestId An optional request ID to identify requests.
237   * Specify a unique request ID so that if you must retry your request, the
238   * server will know to ignore the request if it has already been completed. For
239   * example, consider a situation where you make an initial request and the
240   * request times out. If you make the request again with the same request ID,
241   * the server can check if original operation with the same request ID was
242   * received, and if so, will ignore the second request. This prevents clients
243   * from accidentally creating duplicate commitments. The request ID must be a
244   * valid UUID with the exception that zero UUID is not supported (
245   * 00000000-0000-0000-0000-000000000000).
246   * @return Operation
247   */
248  public function patch($project, $region, $publicDelegatedPrefix, PublicDelegatedPrefix $postBody, $optParams = [])
249  {
250    $params = ['project' => $project, 'region' => $region, 'publicDelegatedPrefix' => $publicDelegatedPrefix, 'postBody' => $postBody];
251    $params = array_merge($params, $optParams);
252    return $this->call('patch', [$params], Operation::class);
253  }
254}
255
256// Adding a class alias for backwards compatibility with the previous class name.
257class_alias(PublicDelegatedPrefixes::class, 'Google_Service_Compute_Resource_PublicDelegatedPrefixes');
258