[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\AccessContextManager\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\AccessContextManager\CommitServicePerimetersRequest;
|
---|
| 21 | use Google\Service\AccessContextManager\ListServicePerimetersResponse;
|
---|
| 22 | use Google\Service\AccessContextManager\Operation;
|
---|
| 23 | use Google\Service\AccessContextManager\ReplaceServicePerimetersRequest;
|
---|
| 24 | use Google\Service\AccessContextManager\ServicePerimeter;
|
---|
| 25 | use Google\Service\AccessContextManager\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\AccessContextManager\TestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "servicePerimeters" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $accesscontextmanagerService = new Google\Service\AccessContextManager(...);
|
---|
| 33 | * $servicePerimeters = $accesscontextmanagerService->accessPolicies_servicePerimeters;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class AccessPoliciesServicePerimeters extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Commits the dry-run specification for all the service perimeters in an access
|
---|
| 40 | * policy. A commit operation on a service perimeter involves copying its `spec`
|
---|
| 41 | * field to the `status` field of the service perimeter. Only service perimeters
|
---|
| 42 | * with `use_explicit_dry_run_spec` field set to true are affected by a commit
|
---|
| 43 | * operation. The long-running operation from this RPC has a successful status
|
---|
| 44 | * after the dry-run specifications for all the service perimeters have been
|
---|
| 45 | * committed. If a commit fails, it causes the long-running operation to return
|
---|
| 46 | * an error response and the entire commit operation is cancelled. When
|
---|
| 47 | * successful, the Operation.response field contains
|
---|
| 48 | * CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are
|
---|
| 49 | * cleared after a successful commit operation. (servicePerimeters.commit)
|
---|
| 50 | *
|
---|
| 51 | * @param string $parent Required. Resource name for the parent Access Policy
|
---|
| 52 | * which owns all Service Perimeters in scope for the commit operation. Format:
|
---|
| 53 | * `accessPolicies/{policy_id}`
|
---|
| 54 | * @param CommitServicePerimetersRequest $postBody
|
---|
| 55 | * @param array $optParams Optional parameters.
|
---|
| 56 | * @return Operation
|
---|
| 57 | * @throws \Google\Service\Exception
|
---|
| 58 | */
|
---|
| 59 | public function commit($parent, CommitServicePerimetersRequest $postBody, $optParams = [])
|
---|
| 60 | {
|
---|
| 61 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 62 | $params = array_merge($params, $optParams);
|
---|
| 63 | return $this->call('commit', [$params], Operation::class);
|
---|
| 64 | }
|
---|
| 65 | /**
|
---|
| 66 | * Creates a service perimeter. The long-running operation from this RPC has a
|
---|
| 67 | * successful status after the service perimeter propagates to long-lasting
|
---|
| 68 | * storage. If a service perimeter contains errors, an error response is
|
---|
| 69 | * returned for the first error encountered. (servicePerimeters.create)
|
---|
| 70 | *
|
---|
| 71 | * @param string $parent Required. Resource name for the access policy which
|
---|
| 72 | * owns this Service Perimeter. Format: `accessPolicies/{policy_id}`
|
---|
| 73 | * @param ServicePerimeter $postBody
|
---|
| 74 | * @param array $optParams Optional parameters.
|
---|
| 75 | * @return Operation
|
---|
| 76 | * @throws \Google\Service\Exception
|
---|
| 77 | */
|
---|
| 78 | public function create($parent, ServicePerimeter $postBody, $optParams = [])
|
---|
| 79 | {
|
---|
| 80 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 81 | $params = array_merge($params, $optParams);
|
---|
| 82 | return $this->call('create', [$params], Operation::class);
|
---|
| 83 | }
|
---|
| 84 | /**
|
---|
| 85 | * Deletes a service perimeter based on the resource name. The long-running
|
---|
| 86 | * operation from this RPC has a successful status after the service perimeter
|
---|
| 87 | * is removed from long-lasting storage. (servicePerimeters.delete)
|
---|
| 88 | *
|
---|
| 89 | * @param string $name Required. Resource name for the Service Perimeter.
|
---|
| 90 | * Format: `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}`
|
---|
| 91 | * @param array $optParams Optional parameters.
|
---|
| 92 | * @return Operation
|
---|
| 93 | * @throws \Google\Service\Exception
|
---|
| 94 | */
|
---|
| 95 | public function delete($name, $optParams = [])
|
---|
| 96 | {
|
---|
| 97 | $params = ['name' => $name];
|
---|
| 98 | $params = array_merge($params, $optParams);
|
---|
| 99 | return $this->call('delete', [$params], Operation::class);
|
---|
| 100 | }
|
---|
| 101 | /**
|
---|
| 102 | * Gets a service perimeter based on the resource name. (servicePerimeters.get)
|
---|
| 103 | *
|
---|
| 104 | * @param string $name Required. Resource name for the Service Perimeter.
|
---|
| 105 | * Format:
|
---|
| 106 | * `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}`
|
---|
| 107 | * @param array $optParams Optional parameters.
|
---|
| 108 | * @return ServicePerimeter
|
---|
| 109 | * @throws \Google\Service\Exception
|
---|
| 110 | */
|
---|
| 111 | public function get($name, $optParams = [])
|
---|
| 112 | {
|
---|
| 113 | $params = ['name' => $name];
|
---|
| 114 | $params = array_merge($params, $optParams);
|
---|
| 115 | return $this->call('get', [$params], ServicePerimeter::class);
|
---|
| 116 | }
|
---|
| 117 | /**
|
---|
| 118 | * Lists all service perimeters for an access policy.
|
---|
| 119 | * (servicePerimeters.listAccessPoliciesServicePerimeters)
|
---|
| 120 | *
|
---|
| 121 | * @param string $parent Required. Resource name for the access policy to list
|
---|
| 122 | * Service Perimeters from. Format: `accessPolicies/{policy_id}`
|
---|
| 123 | * @param array $optParams Optional parameters.
|
---|
| 124 | *
|
---|
| 125 | * @opt_param int pageSize Number of Service Perimeters to include in the list.
|
---|
| 126 | * Default 100.
|
---|
| 127 | * @opt_param string pageToken Next page token for the next batch of Service
|
---|
| 128 | * Perimeter instances. Defaults to the first page of results.
|
---|
| 129 | * @return ListServicePerimetersResponse
|
---|
| 130 | * @throws \Google\Service\Exception
|
---|
| 131 | */
|
---|
| 132 | public function listAccessPoliciesServicePerimeters($parent, $optParams = [])
|
---|
| 133 | {
|
---|
| 134 | $params = ['parent' => $parent];
|
---|
| 135 | $params = array_merge($params, $optParams);
|
---|
| 136 | return $this->call('list', [$params], ListServicePerimetersResponse::class);
|
---|
| 137 | }
|
---|
| 138 | /**
|
---|
| 139 | * Updates a service perimeter. The long-running operation from this RPC has a
|
---|
| 140 | * successful status after the service perimeter propagates to long-lasting
|
---|
| 141 | * storage. If a service perimeter contains errors, an error response is
|
---|
| 142 | * returned for the first error encountered. (servicePerimeters.patch)
|
---|
| 143 | *
|
---|
| 144 | * @param string $name Identifier. Resource name for the `ServicePerimeter`.
|
---|
| 145 | * Format:
|
---|
| 146 | * `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}`. The
|
---|
| 147 | * `service_perimeter` component must begin with a letter, followed by
|
---|
| 148 | * alphanumeric characters or `_`. After you create a `ServicePerimeter`, you
|
---|
| 149 | * cannot change its `name`.
|
---|
| 150 | * @param ServicePerimeter $postBody
|
---|
| 151 | * @param array $optParams Optional parameters.
|
---|
| 152 | *
|
---|
| 153 | * @opt_param string updateMask Required. Mask to control which fields get
|
---|
| 154 | * updated. Must be non-empty.
|
---|
| 155 | * @return Operation
|
---|
| 156 | * @throws \Google\Service\Exception
|
---|
| 157 | */
|
---|
| 158 | public function patch($name, ServicePerimeter $postBody, $optParams = [])
|
---|
| 159 | {
|
---|
| 160 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 161 | $params = array_merge($params, $optParams);
|
---|
| 162 | return $this->call('patch', [$params], Operation::class);
|
---|
| 163 | }
|
---|
| 164 | /**
|
---|
| 165 | * Replace all existing service perimeters in an access policy with the service
|
---|
| 166 | * perimeters provided. This is done atomically. The long-running operation from
|
---|
| 167 | * this RPC has a successful status after all replacements propagate to long-
|
---|
| 168 | * lasting storage. Replacements containing errors result in an error response
|
---|
| 169 | * for the first error encountered. Upon an error, replacement are cancelled and
|
---|
| 170 | * existing service perimeters are not affected. The Operation.response field
|
---|
| 171 | * contains ReplaceServicePerimetersResponse. (servicePerimeters.replaceAll)
|
---|
| 172 | *
|
---|
| 173 | * @param string $parent Required. Resource name for the access policy which
|
---|
| 174 | * owns these Service Perimeters. Format: `accessPolicies/{policy_id}`
|
---|
| 175 | * @param ReplaceServicePerimetersRequest $postBody
|
---|
| 176 | * @param array $optParams Optional parameters.
|
---|
| 177 | * @return Operation
|
---|
| 178 | * @throws \Google\Service\Exception
|
---|
| 179 | */
|
---|
| 180 | public function replaceAll($parent, ReplaceServicePerimetersRequest $postBody, $optParams = [])
|
---|
| 181 | {
|
---|
| 182 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 183 | $params = array_merge($params, $optParams);
|
---|
| 184 | return $this->call('replaceAll', [$params], Operation::class);
|
---|
| 185 | }
|
---|
| 186 | /**
|
---|
| 187 | * Returns the IAM permissions that the caller has on the specified Access
|
---|
| 188 | * Context Manager resource. The resource can be an AccessPolicy, AccessLevel,
|
---|
| 189 | * or ServicePerimeter. This method does not support other resources.
|
---|
| 190 | * (servicePerimeters.testIamPermissions)
|
---|
| 191 | *
|
---|
| 192 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 193 | * being requested. See [Resource
|
---|
| 194 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 195 | * appropriate value for this field.
|
---|
| 196 | * @param TestIamPermissionsRequest $postBody
|
---|
| 197 | * @param array $optParams Optional parameters.
|
---|
| 198 | * @return TestIamPermissionsResponse
|
---|
| 199 | * @throws \Google\Service\Exception
|
---|
| 200 | */
|
---|
| 201 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 202 | {
|
---|
| 203 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 204 | $params = array_merge($params, $optParams);
|
---|
| 205 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 206 | }
|
---|
| 207 | }
|
---|
| 208 |
|
---|
| 209 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 210 | class_alias(AccessPoliciesServicePerimeters::class, 'Google_Service_AccessContextManager_Resource_AccessPoliciesServicePerimeters');
|
---|