[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\ListAddressGroupReferencesResponse;
|
---|
| 24 | use Google\Service\NetworkSecurity\ListAddressGroupsResponse;
|
---|
| 25 | use Google\Service\NetworkSecurity\Operation;
|
---|
| 26 | use Google\Service\NetworkSecurity\RemoveAddressGroupItemsRequest;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "addressGroups" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $networksecurityService = new Google\Service\NetworkSecurity(...);
|
---|
| 33 | * $addressGroups = $networksecurityService->organizations_locations_addressGroups;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class OrganizationsLocationsAddressGroups extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Adds items to an address group. (addressGroups.addItems)
|
---|
| 40 | *
|
---|
| 41 | * @param string $addressGroup Required. A name of the AddressGroup to add items
|
---|
| 42 | * to. Must be in the format
|
---|
| 43 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 44 | * @param AddAddressGroupItemsRequest $postBody
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | * @return Operation
|
---|
| 47 | * @throws \Google\Service\Exception
|
---|
| 48 | */
|
---|
| 49 | public function addItems($addressGroup, AddAddressGroupItemsRequest $postBody, $optParams = [])
|
---|
| 50 | {
|
---|
| 51 | $params = ['addressGroup' => $addressGroup, 'postBody' => $postBody];
|
---|
| 52 | $params = array_merge($params, $optParams);
|
---|
| 53 | return $this->call('addItems', [$params], Operation::class);
|
---|
| 54 | }
|
---|
| 55 | /**
|
---|
| 56 | * Clones items from one address group to another. (addressGroups.cloneItems)
|
---|
| 57 | *
|
---|
| 58 | * @param string $addressGroup Required. A name of the AddressGroup to clone
|
---|
| 59 | * items to. Must be in the format
|
---|
| 60 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 61 | * @param CloneAddressGroupItemsRequest $postBody
|
---|
| 62 | * @param array $optParams Optional parameters.
|
---|
| 63 | * @return Operation
|
---|
| 64 | * @throws \Google\Service\Exception
|
---|
| 65 | */
|
---|
| 66 | public function cloneItems($addressGroup, CloneAddressGroupItemsRequest $postBody, $optParams = [])
|
---|
| 67 | {
|
---|
| 68 | $params = ['addressGroup' => $addressGroup, 'postBody' => $postBody];
|
---|
| 69 | $params = array_merge($params, $optParams);
|
---|
| 70 | return $this->call('cloneItems', [$params], Operation::class);
|
---|
| 71 | }
|
---|
| 72 | /**
|
---|
| 73 | * Creates a new address group in a given project and location.
|
---|
| 74 | * (addressGroups.create)
|
---|
| 75 | *
|
---|
| 76 | * @param string $parent Required. The parent resource of the AddressGroup. Must
|
---|
| 77 | * be in the format `projects/locations/{location}`.
|
---|
| 78 | * @param AddressGroup $postBody
|
---|
| 79 | * @param array $optParams Optional parameters.
|
---|
| 80 | *
|
---|
| 81 | * @opt_param string addressGroupId Required. Short name of the AddressGroup
|
---|
| 82 | * resource to be created. This value should be 1-63 characters long, containing
|
---|
| 83 | * only letters, numbers, hyphens, and underscores, and should not start with a
|
---|
| 84 | * number. E.g. "authz_policy".
|
---|
| 85 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 86 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 87 | * the server will know to ignore the request if it has already been completed.
|
---|
| 88 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 89 | * request. For example, consider a situation where you make an initial request
|
---|
| 90 | * and the request times out. If you make the request again with the same
|
---|
| 91 | * request ID, the server can check if original operation with the same request
|
---|
| 92 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 93 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 94 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 95 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 96 | * @return Operation
|
---|
| 97 | * @throws \Google\Service\Exception
|
---|
| 98 | */
|
---|
| 99 | public function create($parent, AddressGroup $postBody, $optParams = [])
|
---|
| 100 | {
|
---|
| 101 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 102 | $params = array_merge($params, $optParams);
|
---|
| 103 | return $this->call('create', [$params], Operation::class);
|
---|
| 104 | }
|
---|
| 105 | /**
|
---|
| 106 | * Deletes an address group. (addressGroups.delete)
|
---|
| 107 | *
|
---|
| 108 | * @param string $name Required. A name of the AddressGroup to delete. Must be
|
---|
| 109 | * in the format `projects/locations/{location}/addressGroups`.
|
---|
| 110 | * @param array $optParams Optional parameters.
|
---|
| 111 | *
|
---|
| 112 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 113 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 114 | * the server will know to ignore the request if it has already been completed.
|
---|
| 115 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 116 | * request. For example, consider a situation where you make an initial request
|
---|
| 117 | * and the request times out. If you make the request again with the same
|
---|
| 118 | * request ID, the server can check if original operation with the same request
|
---|
| 119 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 120 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 121 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 122 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 123 | * @return Operation
|
---|
| 124 | * @throws \Google\Service\Exception
|
---|
| 125 | */
|
---|
| 126 | public function delete($name, $optParams = [])
|
---|
| 127 | {
|
---|
| 128 | $params = ['name' => $name];
|
---|
| 129 | $params = array_merge($params, $optParams);
|
---|
| 130 | return $this->call('delete', [$params], Operation::class);
|
---|
| 131 | }
|
---|
| 132 | /**
|
---|
| 133 | * Gets details of a single address group. (addressGroups.get)
|
---|
| 134 | *
|
---|
| 135 | * @param string $name Required. A name of the AddressGroup to get. Must be in
|
---|
| 136 | * the format `projects/locations/{location}/addressGroups`.
|
---|
| 137 | * @param array $optParams Optional parameters.
|
---|
| 138 | * @return AddressGroup
|
---|
| 139 | * @throws \Google\Service\Exception
|
---|
| 140 | */
|
---|
| 141 | public function get($name, $optParams = [])
|
---|
| 142 | {
|
---|
| 143 | $params = ['name' => $name];
|
---|
| 144 | $params = array_merge($params, $optParams);
|
---|
| 145 | return $this->call('get', [$params], AddressGroup::class);
|
---|
| 146 | }
|
---|
| 147 | /**
|
---|
| 148 | * Lists address groups in a given project and location.
|
---|
| 149 | * (addressGroups.listOrganizationsLocationsAddressGroups)
|
---|
| 150 | *
|
---|
| 151 | * @param string $parent Required. The project and location from which the
|
---|
| 152 | * AddressGroups should be listed, specified in the format
|
---|
| 153 | * `projects/locations/{location}`.
|
---|
| 154 | * @param array $optParams Optional parameters.
|
---|
| 155 | *
|
---|
| 156 | * @opt_param int pageSize Maximum number of AddressGroups to return per call.
|
---|
| 157 | * @opt_param string pageToken The value returned by the last
|
---|
| 158 | * `ListAddressGroupsResponse` Indicates that this is a continuation of a prior
|
---|
| 159 | * `ListAddressGroups` call, and that the system should return the next page of
|
---|
| 160 | * data.
|
---|
| 161 | * @return ListAddressGroupsResponse
|
---|
| 162 | * @throws \Google\Service\Exception
|
---|
| 163 | */
|
---|
| 164 | public function listOrganizationsLocationsAddressGroups($parent, $optParams = [])
|
---|
| 165 | {
|
---|
| 166 | $params = ['parent' => $parent];
|
---|
| 167 | $params = array_merge($params, $optParams);
|
---|
| 168 | return $this->call('list', [$params], ListAddressGroupsResponse::class);
|
---|
| 169 | }
|
---|
| 170 | /**
|
---|
| 171 | * Lists references of an address group. (addressGroups.listReferences)
|
---|
| 172 | *
|
---|
| 173 | * @param string $addressGroup Required. A name of the AddressGroup to clone
|
---|
| 174 | * items to. Must be in the format
|
---|
| 175 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 176 | * @param array $optParams Optional parameters.
|
---|
| 177 | *
|
---|
| 178 | * @opt_param int pageSize The maximum number of references to return. If
|
---|
| 179 | * unspecified, server will pick an appropriate default. Server may return fewer
|
---|
| 180 | * items than requested. A caller should only rely on response's next_page_token
|
---|
| 181 | * to determine if there are more AddressGroupUsers left to be queried.
|
---|
| 182 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 183 | * previous List request, if any.
|
---|
| 184 | * @return ListAddressGroupReferencesResponse
|
---|
| 185 | * @throws \Google\Service\Exception
|
---|
| 186 | */
|
---|
| 187 | public function listReferences($addressGroup, $optParams = [])
|
---|
| 188 | {
|
---|
| 189 | $params = ['addressGroup' => $addressGroup];
|
---|
| 190 | $params = array_merge($params, $optParams);
|
---|
| 191 | return $this->call('listReferences', [$params], ListAddressGroupReferencesResponse::class);
|
---|
| 192 | }
|
---|
| 193 | /**
|
---|
| 194 | * Updates parameters of an address group. (addressGroups.patch)
|
---|
| 195 | *
|
---|
| 196 | * @param string $name Required. Name of the AddressGroup resource. It matches
|
---|
| 197 | * pattern `projects/locations/{location}/addressGroups/`.
|
---|
| 198 | * @param AddressGroup $postBody
|
---|
| 199 | * @param array $optParams Optional parameters.
|
---|
| 200 | *
|
---|
| 201 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 202 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 203 | * the server will know to ignore the request if it has already been completed.
|
---|
| 204 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 205 | * request. For example, consider a situation where you make an initial request
|
---|
| 206 | * and the request times out. If you make the request again with the same
|
---|
| 207 | * request ID, the server can check if original operation with the same request
|
---|
| 208 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 209 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 210 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 211 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 212 | * @opt_param string updateMask Optional. Field mask is used to specify the
|
---|
| 213 | * fields to be overwritten in the AddressGroup resource by the update. The
|
---|
| 214 | * fields specified in the update_mask are relative to the resource, not the
|
---|
| 215 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
| 216 | * does not provide a mask then all fields will be overwritten.
|
---|
| 217 | * @return Operation
|
---|
| 218 | * @throws \Google\Service\Exception
|
---|
| 219 | */
|
---|
| 220 | public function patch($name, AddressGroup $postBody, $optParams = [])
|
---|
| 221 | {
|
---|
| 222 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 223 | $params = array_merge($params, $optParams);
|
---|
| 224 | return $this->call('patch', [$params], Operation::class);
|
---|
| 225 | }
|
---|
| 226 | /**
|
---|
| 227 | * Removes items from an address group. (addressGroups.removeItems)
|
---|
| 228 | *
|
---|
| 229 | * @param string $addressGroup Required. A name of the AddressGroup to remove
|
---|
| 230 | * items from. Must be in the format
|
---|
| 231 | * `projects|organization/locations/{location}/addressGroups`.
|
---|
| 232 | * @param RemoveAddressGroupItemsRequest $postBody
|
---|
| 233 | * @param array $optParams Optional parameters.
|
---|
| 234 | * @return Operation
|
---|
| 235 | * @throws \Google\Service\Exception
|
---|
| 236 | */
|
---|
| 237 | public function removeItems($addressGroup, RemoveAddressGroupItemsRequest $postBody, $optParams = [])
|
---|
| 238 | {
|
---|
| 239 | $params = ['addressGroup' => $addressGroup, 'postBody' => $postBody];
|
---|
| 240 | $params = array_merge($params, $optParams);
|
---|
| 241 | return $this->call('removeItems', [$params], Operation::class);
|
---|
| 242 | }
|
---|
| 243 | }
|
---|
| 244 |
|
---|
| 245 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 246 | class_alias(OrganizationsLocationsAddressGroups::class, 'Google_Service_NetworkSecurity_Resource_OrganizationsLocationsAddressGroups');
|
---|