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