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\InterconnectAttachment;
21use Google\Service\Compute\InterconnectAttachmentAggregatedList;
22use Google\Service\Compute\InterconnectAttachmentList;
23use Google\Service\Compute\Operation;
24
25/**
26 * The "interconnectAttachments" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $computeService = new Google\Service\Compute(...);
30 *   $interconnectAttachments = $computeService->interconnectAttachments;
31 *  </code>
32 */
33class InterconnectAttachments extends \Google\Service\Resource
34{
35  /**
36   * Retrieves an aggregated list of interconnect attachments.
37   * (interconnectAttachments.aggregatedList)
38   *
39   * @param string $project Project ID for 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 InterconnectAttachmentAggregatedList
89   */
90  public function aggregatedList($project, $optParams = [])
91  {
92    $params = ['project' => $project];
93    $params = array_merge($params, $optParams);
94    return $this->call('aggregatedList', [$params], InterconnectAttachmentAggregatedList::class);
95  }
96  /**
97   * Deletes the specified interconnect attachment.
98   * (interconnectAttachments.delete)
99   *
100   * @param string $project Project ID for this request.
101   * @param string $region Name of the region for this request.
102   * @param string $interconnectAttachment Name of the interconnect attachment to
103   * 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, $interconnectAttachment, $optParams = [])
119  {
120    $params = ['project' => $project, 'region' => $region, 'interconnectAttachment' => $interconnectAttachment];
121    $params = array_merge($params, $optParams);
122    return $this->call('delete', [$params], Operation::class);
123  }
124  /**
125   * Returns the specified interconnect attachment. (interconnectAttachments.get)
126   *
127   * @param string $project Project ID for this request.
128   * @param string $region Name of the region for this request.
129   * @param string $interconnectAttachment Name of the interconnect attachment to
130   * return.
131   * @param array $optParams Optional parameters.
132   * @return InterconnectAttachment
133   */
134  public function get($project, $region, $interconnectAttachment, $optParams = [])
135  {
136    $params = ['project' => $project, 'region' => $region, 'interconnectAttachment' => $interconnectAttachment];
137    $params = array_merge($params, $optParams);
138    return $this->call('get', [$params], InterconnectAttachment::class);
139  }
140  /**
141   * Creates an InterconnectAttachment in the specified project using the data
142   * included in the request. (interconnectAttachments.insert)
143   *
144   * @param string $project Project ID for this request.
145   * @param string $region Name of the region for this request.
146   * @param InterconnectAttachment $postBody
147   * @param array $optParams Optional parameters.
148   *
149   * @opt_param string requestId An optional request ID to identify requests.
150   * Specify a unique request ID so that if you must retry your request, the
151   * server will know to ignore the request if it has already been completed. For
152   * example, consider a situation where you make an initial request and the
153   * request times out. If you make the request again with the same request ID,
154   * the server can check if original operation with the same request ID was
155   * received, and if so, will ignore the second request. This prevents clients
156   * from accidentally creating duplicate commitments. The request ID must be a
157   * valid UUID with the exception that zero UUID is not supported (
158   * 00000000-0000-0000-0000-000000000000).
159   * @opt_param bool validateOnly If true, the request will not be committed.
160   * @return Operation
161   */
162  public function insert($project, $region, InterconnectAttachment $postBody, $optParams = [])
163  {
164    $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
165    $params = array_merge($params, $optParams);
166    return $this->call('insert', [$params], Operation::class);
167  }
168  /**
169   * Retrieves the list of interconnect attachments contained within the specified
170   * region. (interconnectAttachments.listInterconnectAttachments)
171   *
172   * @param string $project Project ID for this request.
173   * @param string $region Name of the region for this request.
174   * @param array $optParams Optional parameters.
175   *
176   * @opt_param string filter A filter expression that filters resources listed in
177   * the response. The expression must specify the field name, an operator, and
178   * the value that you want to use for filtering. The value must be a string, a
179   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
180   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
181   * can exclude instances named `example-instance` by specifying `name !=
182   * example-instance`. The `:` operator can be used with string fields to match
183   * substrings. For non-string fields it is equivalent to the `=` operator. The
184   * `:*` comparison can be used to test whether a key has been defined. For
185   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
186   * You can also filter nested fields. For example, you could specify
187   * `scheduling.automaticRestart = false` to include instances only if they are
188   * not scheduled for automatic restarts. You can use filtering on nested fields
189   * to filter based on resource labels. To filter on multiple expressions,
190   * provide each separate expression within parentheses. For example: ```
191   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
192   * default, each expression is an `AND` expression. However, you can include
193   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
194   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
195   * (scheduling.automaticRestart = true) ```
196   * @opt_param string maxResults The maximum number of results per page that
197   * should be returned. If the number of available results is larger than
198   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
199   * get the next page of results in subsequent list requests. Acceptable values
200   * are `0` to `500`, inclusive. (Default: `500`)
201   * @opt_param string orderBy Sorts list results by a certain order. By default,
202   * results are returned in alphanumerical order based on the resource name. You
203   * can also sort results in descending order based on the creation timestamp
204   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
205   * `creationTimestamp` field in reverse chronological order (newest result
206   * first). Use this to sort resources like operations so that the newest
207   * operation is returned first. Currently, only sorting by `name` or
208   * `creationTimestamp desc` is supported.
209   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
210   * the `nextPageToken` returned by a previous list request to get the next page
211   * of results.
212   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
213   * which provides partial results in case of failure. The default value is
214   * false.
215   * @return InterconnectAttachmentList
216   */
217  public function listInterconnectAttachments($project, $region, $optParams = [])
218  {
219    $params = ['project' => $project, 'region' => $region];
220    $params = array_merge($params, $optParams);
221    return $this->call('list', [$params], InterconnectAttachmentList::class);
222  }
223  /**
224   * Updates the specified interconnect attachment with the data included in the
225   * request. This method supports PATCH semantics and uses the JSON merge patch
226   * format and processing rules. (interconnectAttachments.patch)
227   *
228   * @param string $project Project ID for this request.
229   * @param string $region Name of the region scoping this request.
230   * @param string $interconnectAttachment Name of the interconnect attachment to
231   * patch.
232   * @param InterconnectAttachment $postBody
233   * @param array $optParams Optional parameters.
234   *
235   * @opt_param string requestId An optional request ID to identify requests.
236   * Specify a unique request ID so that if you must retry your request, the
237   * server will know to ignore the request if it has already been completed. For
238   * example, consider a situation where you make an initial request and the
239   * request times out. If you make the request again with the same request ID,
240   * the server can check if original operation with the same request ID was
241   * received, and if so, will ignore the second request. This prevents clients
242   * from accidentally creating duplicate commitments. The request ID must be a
243   * valid UUID with the exception that zero UUID is not supported (
244   * 00000000-0000-0000-0000-000000000000).
245   * @return Operation
246   */
247  public function patch($project, $region, $interconnectAttachment, InterconnectAttachment $postBody, $optParams = [])
248  {
249    $params = ['project' => $project, 'region' => $region, 'interconnectAttachment' => $interconnectAttachment, 'postBody' => $postBody];
250    $params = array_merge($params, $optParams);
251    return $this->call('patch', [$params], Operation::class);
252  }
253}
254
255// Adding a class alias for backwards compatibility with the previous class name.
256class_alias(InterconnectAttachments::class, 'Google_Service_Compute_Resource_InterconnectAttachments');
257