[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\NetworkSecurity\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\NetworkSecurity\AddAddressGroupItemsRequest;
|
---|
| 21 | use Google\Service\NetworkSecurity\AddressGroup;
|
---|
| 22 | use Google\Service\NetworkSecurity\CloneAddressGroupItemsRequest;
|
---|
| 23 | use Google\Service\NetworkSecurity\GoogleIamV1Policy;
|
---|
| 24 | use Google\Service\NetworkSecurity\GoogleIamV1SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\NetworkSecurity\GoogleIamV1TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\NetworkSecurity\GoogleIamV1TestIamPermissionsResponse;
|
---|
| 27 | use Google\Service\NetworkSecurity\ListAddressGroupReferencesResponse;
|
---|
| 28 | use Google\Service\NetworkSecurity\ListAddressGroupsResponse;
|
---|
| 29 | use Google\Service\NetworkSecurity\Operation;
|
---|
| 30 | use Google\Service\NetworkSecurity\RemoveAddressGroupItemsRequest;
|
---|
| 31 |
|
---|
| 32 | /**
|
---|
| 33 | * The "addressGroups" collection of methods.
|
---|
| 34 | * Typical usage is:
|
---|
| 35 | * <code>
|
---|
| 36 | * $networksecurityService = new Google\Service\NetworkSecurity(...);
|
---|
| 37 | * $addressGroups = $networksecurityService->projects_locations_addressGroups;
|
---|
| 38 | * </code>
|
---|
| 39 | */
|
---|
| 40 | class ProjectsLocationsAddressGroups extends \Google\Service\Resource
|
---|
| 41 | {
|
---|
| 42 | /**
|
---|
| 43 | * Adds items to an address group. (addressGroups.addItems)
|
---|
| 44 | *
|
---|
| 45 | * @param string $addressGroup Required. A name of the AddressGroup to add items
|
---|
| 46 | * to. Must be in the format
|
---|
| 47 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 48 | * @param AddAddressGroupItemsRequest $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return Operation
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function addItems($addressGroup, AddAddressGroupItemsRequest $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['addressGroup' => $addressGroup, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('addItems', [$params], Operation::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Clones items from one address group to another. (addressGroups.cloneItems)
|
---|
| 61 | *
|
---|
| 62 | * @param string $addressGroup Required. A name of the AddressGroup to clone
|
---|
| 63 | * items to. Must be in the format
|
---|
| 64 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 65 | * @param CloneAddressGroupItemsRequest $postBody
|
---|
| 66 | * @param array $optParams Optional parameters.
|
---|
| 67 | * @return Operation
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function cloneItems($addressGroup, CloneAddressGroupItemsRequest $postBody, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['addressGroup' => $addressGroup, 'postBody' => $postBody];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('cloneItems', [$params], Operation::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Creates a new address group in a given project and location.
|
---|
| 78 | * (addressGroups.create)
|
---|
| 79 | *
|
---|
| 80 | * @param string $parent Required. The parent resource of the AddressGroup. Must
|
---|
| 81 | * be in the format `projects/locations/{location}`.
|
---|
| 82 | * @param AddressGroup $postBody
|
---|
| 83 | * @param array $optParams Optional parameters.
|
---|
| 84 | *
|
---|
| 85 | * @opt_param string addressGroupId Required. Short name of the AddressGroup
|
---|
| 86 | * resource to be created. This value should be 1-63 characters long, containing
|
---|
| 87 | * only letters, numbers, hyphens, and underscores, and should not start with a
|
---|
| 88 | * number. E.g. "authz_policy".
|
---|
| 89 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 90 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 91 | * the server will know to ignore the request if it has already been completed.
|
---|
| 92 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 93 | * request. For example, consider a situation where you make an initial request
|
---|
| 94 | * and the request times out. If you make the request again with the same
|
---|
| 95 | * request ID, the server can check if original operation with the same request
|
---|
| 96 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 97 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 98 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 99 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 100 | * @return Operation
|
---|
| 101 | * @throws \Google\Service\Exception
|
---|
| 102 | */
|
---|
| 103 | public function create($parent, AddressGroup $postBody, $optParams = [])
|
---|
| 104 | {
|
---|
| 105 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 106 | $params = array_merge($params, $optParams);
|
---|
| 107 | return $this->call('create', [$params], Operation::class);
|
---|
| 108 | }
|
---|
| 109 | /**
|
---|
| 110 | * Deletes a single address group. (addressGroups.delete)
|
---|
| 111 | *
|
---|
| 112 | * @param string $name Required. A name of the AddressGroup to delete. Must be
|
---|
| 113 | * in the format `projects/locations/{location}/addressGroups`.
|
---|
| 114 | * @param array $optParams Optional parameters.
|
---|
| 115 | *
|
---|
| 116 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 117 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 118 | * the server will know to ignore the request if it has already been completed.
|
---|
| 119 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 120 | * request. For example, consider a situation where you make an initial request
|
---|
| 121 | * and the request times out. If you make the request again with the same
|
---|
| 122 | * request ID, the server can check if original operation with the same request
|
---|
| 123 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 124 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 125 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 126 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 127 | * @return Operation
|
---|
| 128 | * @throws \Google\Service\Exception
|
---|
| 129 | */
|
---|
| 130 | public function delete($name, $optParams = [])
|
---|
| 131 | {
|
---|
| 132 | $params = ['name' => $name];
|
---|
| 133 | $params = array_merge($params, $optParams);
|
---|
| 134 | return $this->call('delete', [$params], Operation::class);
|
---|
| 135 | }
|
---|
| 136 | /**
|
---|
| 137 | * Gets details of a single address group. (addressGroups.get)
|
---|
| 138 | *
|
---|
| 139 | * @param string $name Required. A name of the AddressGroup to get. Must be in
|
---|
| 140 | * the format `projects/locations/{location}/addressGroups`.
|
---|
| 141 | * @param array $optParams Optional parameters.
|
---|
| 142 | * @return AddressGroup
|
---|
| 143 | * @throws \Google\Service\Exception
|
---|
| 144 | */
|
---|
| 145 | public function get($name, $optParams = [])
|
---|
| 146 | {
|
---|
| 147 | $params = ['name' => $name];
|
---|
| 148 | $params = array_merge($params, $optParams);
|
---|
| 149 | return $this->call('get', [$params], AddressGroup::class);
|
---|
| 150 | }
|
---|
| 151 | /**
|
---|
| 152 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 153 | * resource exists and does not have a policy set. (addressGroups.getIamPolicy)
|
---|
| 154 | *
|
---|
| 155 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 156 | * requested. See [Resource
|
---|
| 157 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 158 | * appropriate value for this field.
|
---|
| 159 | * @param array $optParams Optional parameters.
|
---|
| 160 | *
|
---|
| 161 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 162 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 163 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 164 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 165 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 166 | * unset. The policy in the response might use the policy version that you
|
---|
| 167 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 168 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 169 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 170 | * IAM policies, see the [IAM
|
---|
| 171 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 172 | * policies).
|
---|
| 173 | * @return GoogleIamV1Policy
|
---|
| 174 | * @throws \Google\Service\Exception
|
---|
| 175 | */
|
---|
| 176 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 177 | {
|
---|
| 178 | $params = ['resource' => $resource];
|
---|
| 179 | $params = array_merge($params, $optParams);
|
---|
| 180 | return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
| 181 | }
|
---|
| 182 | /**
|
---|
| 183 | * Lists address groups in a given project and location.
|
---|
| 184 | * (addressGroups.listProjectsLocationsAddressGroups)
|
---|
| 185 | *
|
---|
| 186 | * @param string $parent Required. The project and location from which the
|
---|
| 187 | * AddressGroups should be listed, specified in the format
|
---|
| 188 | * `projects/locations/{location}`.
|
---|
| 189 | * @param array $optParams Optional parameters.
|
---|
| 190 | *
|
---|
| 191 | * @opt_param int pageSize Maximum number of AddressGroups to return per call.
|
---|
| 192 | * @opt_param string pageToken The value returned by the last
|
---|
| 193 | * `ListAddressGroupsResponse` Indicates that this is a continuation of a prior
|
---|
| 194 | * `ListAddressGroups` call, and that the system should return the next page of
|
---|
| 195 | * data.
|
---|
| 196 | * @return ListAddressGroupsResponse
|
---|
| 197 | * @throws \Google\Service\Exception
|
---|
| 198 | */
|
---|
| 199 | public function listProjectsLocationsAddressGroups($parent, $optParams = [])
|
---|
| 200 | {
|
---|
| 201 | $params = ['parent' => $parent];
|
---|
| 202 | $params = array_merge($params, $optParams);
|
---|
| 203 | return $this->call('list', [$params], ListAddressGroupsResponse::class);
|
---|
| 204 | }
|
---|
| 205 | /**
|
---|
| 206 | * Lists references of an address group. (addressGroups.listReferences)
|
---|
| 207 | *
|
---|
| 208 | * @param string $addressGroup Required. A name of the AddressGroup to clone
|
---|
| 209 | * items to. Must be in the format
|
---|
| 210 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 211 | * @param array $optParams Optional parameters.
|
---|
| 212 | *
|
---|
| 213 | * @opt_param int pageSize The maximum number of references to return. If
|
---|
| 214 | * unspecified, server will pick an appropriate default. Server may return fewer
|
---|
| 215 | * items than requested. A caller should only rely on response's next_page_token
|
---|
| 216 | * to determine if there are more AddressGroupUsers left to be queried.
|
---|
| 217 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 218 | * previous List request, if any.
|
---|
| 219 | * @return ListAddressGroupReferencesResponse
|
---|
| 220 | * @throws \Google\Service\Exception
|
---|
| 221 | */
|
---|
| 222 | public function listReferences($addressGroup, $optParams = [])
|
---|
| 223 | {
|
---|
| 224 | $params = ['addressGroup' => $addressGroup];
|
---|
| 225 | $params = array_merge($params, $optParams);
|
---|
| 226 | return $this->call('listReferences', [$params], ListAddressGroupReferencesResponse::class);
|
---|
| 227 | }
|
---|
| 228 | /**
|
---|
| 229 | * Updates the parameters of a single address group. (addressGroups.patch)
|
---|
| 230 | *
|
---|
| 231 | * @param string $name Required. Name of the AddressGroup resource. It matches
|
---|
| 232 | * pattern `projects/locations/{location}/addressGroups/`.
|
---|
| 233 | * @param AddressGroup $postBody
|
---|
| 234 | * @param array $optParams Optional parameters.
|
---|
| 235 | *
|
---|
| 236 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 237 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 238 | * the server will know to ignore the request if it has already been completed.
|
---|
| 239 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 240 | * request. For example, consider a situation where you make an initial request
|
---|
| 241 | * and the request times out. If you make the request again with the same
|
---|
| 242 | * request ID, the server can check if original operation with the same request
|
---|
| 243 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 244 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 245 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 246 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 247 | * @opt_param string updateMask Optional. Field mask is used to specify the
|
---|
| 248 | * fields to be overwritten in the AddressGroup resource by the update. The
|
---|
| 249 | * fields specified in the update_mask are relative to the resource, not the
|
---|
| 250 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
| 251 | * does not provide a mask then all fields will be overwritten.
|
---|
| 252 | * @return Operation
|
---|
| 253 | * @throws \Google\Service\Exception
|
---|
| 254 | */
|
---|
| 255 | public function patch($name, AddressGroup $postBody, $optParams = [])
|
---|
| 256 | {
|
---|
| 257 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 258 | $params = array_merge($params, $optParams);
|
---|
| 259 | return $this->call('patch', [$params], Operation::class);
|
---|
| 260 | }
|
---|
| 261 | /**
|
---|
| 262 | * Removes items from an address group. (addressGroups.removeItems)
|
---|
| 263 | *
|
---|
| 264 | * @param string $addressGroup Required. A name of the AddressGroup to remove
|
---|
| 265 | * items from. Must be in the format
|
---|
| 266 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 267 | * @param RemoveAddressGroupItemsRequest $postBody
|
---|
| 268 | * @param array $optParams Optional parameters.
|
---|
| 269 | * @return Operation
|
---|
| 270 | * @throws \Google\Service\Exception
|
---|
| 271 | */
|
---|
| 272 | public function removeItems($addressGroup, RemoveAddressGroupItemsRequest $postBody, $optParams = [])
|
---|
| 273 | {
|
---|
| 274 | $params = ['addressGroup' => $addressGroup, 'postBody' => $postBody];
|
---|
| 275 | $params = array_merge($params, $optParams);
|
---|
| 276 | return $this->call('removeItems', [$params], Operation::class);
|
---|
| 277 | }
|
---|
| 278 | /**
|
---|
| 279 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 280 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 281 | * `PERMISSION_DENIED` errors. (addressGroups.setIamPolicy)
|
---|
| 282 | *
|
---|
| 283 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 284 | * specified. See [Resource
|
---|
| 285 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 286 | * appropriate value for this field.
|
---|
| 287 | * @param GoogleIamV1SetIamPolicyRequest $postBody
|
---|
| 288 | * @param array $optParams Optional parameters.
|
---|
| 289 | * @return GoogleIamV1Policy
|
---|
| 290 | * @throws \Google\Service\Exception
|
---|
| 291 | */
|
---|
| 292 | public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 293 | {
|
---|
| 294 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 295 | $params = array_merge($params, $optParams);
|
---|
| 296 | return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
| 297 | }
|
---|
| 298 | /**
|
---|
| 299 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 300 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 301 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 302 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 303 | * This operation may "fail open" without warning.
|
---|
| 304 | * (addressGroups.testIamPermissions)
|
---|
| 305 | *
|
---|
| 306 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 307 | * being requested. See [Resource
|
---|
| 308 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 309 | * appropriate value for this field.
|
---|
| 310 | * @param GoogleIamV1TestIamPermissionsRequest $postBody
|
---|
| 311 | * @param array $optParams Optional parameters.
|
---|
| 312 | * @return GoogleIamV1TestIamPermissionsResponse
|
---|
| 313 | * @throws \Google\Service\Exception
|
---|
| 314 | */
|
---|
| 315 | public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 316 | {
|
---|
| 317 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 318 | $params = array_merge($params, $optParams);
|
---|
| 319 | return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
|
---|
| 320 | }
|
---|
| 321 | }
|
---|
| 322 |
|
---|
| 323 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 324 | class_alias(ProjectsLocationsAddressGroups::class, 'Google_Service_NetworkSecurity_Resource_ProjectsLocationsAddressGroups');
|
---|