[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\CloudIAP\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudIAP\GetIamPolicyRequest;
|
---|
| 21 | use Google\Service\CloudIAP\IapSettings;
|
---|
| 22 | use Google\Service\CloudIAP\Policy;
|
---|
| 23 | use Google\Service\CloudIAP\SetIamPolicyRequest;
|
---|
| 24 | use Google\Service\CloudIAP\TestIamPermissionsRequest;
|
---|
| 25 | use Google\Service\CloudIAP\TestIamPermissionsResponse;
|
---|
| 26 | use Google\Service\CloudIAP\ValidateIapAttributeExpressionResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "v1" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $iapService = new Google\Service\CloudIAP(...);
|
---|
| 33 | * $v1 = $iapService->v1;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class V1 extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Gets the access control policy for an Identity-Aware Proxy protected
|
---|
| 40 | * resource. More information about managing access via IAP can be found at:
|
---|
| 41 | * https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api
|
---|
| 42 | * (v1.getIamPolicy)
|
---|
| 43 | *
|
---|
| 44 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 45 | * requested. See [Resource
|
---|
| 46 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 47 | * appropriate value for this field.
|
---|
| 48 | * @param GetIamPolicyRequest $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return Policy
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Gets the IAP settings on a particular IAP protected resource.
|
---|
| 61 | * (v1.getIapSettings)
|
---|
| 62 | *
|
---|
| 63 | * @param string $name Required. The resource name for which to retrieve the
|
---|
| 64 | * settings. Authorization: Requires the `getSettings` permission for the
|
---|
| 65 | * associated resource.
|
---|
| 66 | * @param array $optParams Optional parameters.
|
---|
| 67 | * @return IapSettings
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function getIapSettings($name, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['name' => $name];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('getIapSettings', [$params], IapSettings::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Sets the access control policy for an Identity-Aware Proxy protected
|
---|
| 78 | * resource. Replaces any existing policy. More information about managing
|
---|
| 79 | * access via IAP can be found at: https://cloud.google.com/iap/docs/managing-
|
---|
| 80 | * access#managing_access_via_the_api (v1.setIamPolicy)
|
---|
| 81 | *
|
---|
| 82 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 83 | * specified. See [Resource
|
---|
| 84 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 85 | * appropriate value for this field.
|
---|
| 86 | * @param SetIamPolicyRequest $postBody
|
---|
| 87 | * @param array $optParams Optional parameters.
|
---|
| 88 | * @return Policy
|
---|
| 89 | * @throws \Google\Service\Exception
|
---|
| 90 | */
|
---|
| 91 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 92 | {
|
---|
| 93 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 94 | $params = array_merge($params, $optParams);
|
---|
| 95 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 96 | }
|
---|
| 97 | /**
|
---|
| 98 | * Returns permissions that a caller has on the Identity-Aware Proxy protected
|
---|
| 99 | * resource. More information about managing access via IAP can be found at:
|
---|
| 100 | * https://cloud.google.com/iap/docs/managing-access#managing_access_via_the_api
|
---|
| 101 | * (v1.testIamPermissions)
|
---|
| 102 | *
|
---|
| 103 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 104 | * being requested. See [Resource
|
---|
| 105 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 106 | * appropriate value for this field.
|
---|
| 107 | * @param TestIamPermissionsRequest $postBody
|
---|
| 108 | * @param array $optParams Optional parameters.
|
---|
| 109 | * @return TestIamPermissionsResponse
|
---|
| 110 | * @throws \Google\Service\Exception
|
---|
| 111 | */
|
---|
| 112 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 113 | {
|
---|
| 114 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 115 | $params = array_merge($params, $optParams);
|
---|
| 116 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 117 | }
|
---|
| 118 | /**
|
---|
| 119 | * Updates the IAP settings on a particular IAP protected resource. It replaces
|
---|
| 120 | * all fields unless the `update_mask` is set. (v1.updateIapSettings)
|
---|
| 121 | *
|
---|
| 122 | * @param string $name Required. The resource name of the IAP protected
|
---|
| 123 | * resource.
|
---|
| 124 | * @param IapSettings $postBody
|
---|
| 125 | * @param array $optParams Optional parameters.
|
---|
| 126 | *
|
---|
| 127 | * @opt_param string updateMask The field mask specifying which IAP settings
|
---|
| 128 | * should be updated. If omitted, then all of the settings are updated. See
|
---|
| 129 | * https://developers.google.com/protocol-
|
---|
| 130 | * buffers/docs/reference/google.protobuf#fieldmask. Note: All IAP reauth
|
---|
| 131 | * settings must always be set together, using the field mask:
|
---|
| 132 | * `iapSettings.accessSettings.reauthSettings`.
|
---|
| 133 | * @return IapSettings
|
---|
| 134 | * @throws \Google\Service\Exception
|
---|
| 135 | */
|
---|
| 136 | public function updateIapSettings($name, IapSettings $postBody, $optParams = [])
|
---|
| 137 | {
|
---|
| 138 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 139 | $params = array_merge($params, $optParams);
|
---|
| 140 | return $this->call('updateIapSettings', [$params], IapSettings::class);
|
---|
| 141 | }
|
---|
| 142 | /**
|
---|
| 143 | * Validates that a given CEL expression conforms to IAP restrictions.
|
---|
| 144 | * (v1.validateAttributeExpression)
|
---|
| 145 | *
|
---|
| 146 | * @param string $name Required. The resource name of the IAP protected
|
---|
| 147 | * resource.
|
---|
| 148 | * @param array $optParams Optional parameters.
|
---|
| 149 | *
|
---|
| 150 | * @opt_param string expression Required. User input string expression. Should
|
---|
| 151 | * be of the form `attributes.saml_attributes.filter(attribute, attribute.name
|
---|
| 152 | * in ['{attribute_name}', '{attribute_name}'])`
|
---|
| 153 | * @return ValidateIapAttributeExpressionResponse
|
---|
| 154 | * @throws \Google\Service\Exception
|
---|
| 155 | */
|
---|
| 156 | public function validateAttributeExpression($name, $optParams = [])
|
---|
| 157 | {
|
---|
| 158 | $params = ['name' => $name];
|
---|
| 159 | $params = array_merge($params, $optParams);
|
---|
| 160 | return $this->call('validateAttributeExpression', [$params], ValidateIapAttributeExpressionResponse::class);
|
---|
| 161 | }
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 165 | class_alias(V1::class, 'Google_Service_CloudIAP_Resource_V1');
|
---|