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