[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\GKEHub\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\GKEHub\ListBoundMembershipsResponse;
|
---|
| 21 | use Google\Service\GKEHub\ListPermittedScopesResponse;
|
---|
| 22 | use Google\Service\GKEHub\ListScopesResponse;
|
---|
| 23 | use Google\Service\GKEHub\Operation;
|
---|
| 24 | use Google\Service\GKEHub\Policy;
|
---|
| 25 | use Google\Service\GKEHub\Scope;
|
---|
| 26 | use Google\Service\GKEHub\SetIamPolicyRequest;
|
---|
| 27 | use Google\Service\GKEHub\TestIamPermissionsRequest;
|
---|
| 28 | use Google\Service\GKEHub\TestIamPermissionsResponse;
|
---|
| 29 |
|
---|
| 30 | /**
|
---|
| 31 | * The "scopes" collection of methods.
|
---|
| 32 | * Typical usage is:
|
---|
| 33 | * <code>
|
---|
| 34 | * $gkehubService = new Google\Service\GKEHub(...);
|
---|
| 35 | * $scopes = $gkehubService->projects_locations_scopes;
|
---|
| 36 | * </code>
|
---|
| 37 | */
|
---|
| 38 | class ProjectsLocationsScopes extends \Google\Service\Resource
|
---|
| 39 | {
|
---|
| 40 | /**
|
---|
| 41 | * Creates a Scope. (scopes.create)
|
---|
| 42 | *
|
---|
| 43 | * @param string $parent Required. The parent (project and location) where the
|
---|
| 44 | * Scope will be created. Specified in the format `projects/locations`.
|
---|
| 45 | * @param Scope $postBody
|
---|
| 46 | * @param array $optParams Optional parameters.
|
---|
| 47 | *
|
---|
| 48 | * @opt_param string scopeId Required. Client chosen ID for the Scope.
|
---|
| 49 | * `scope_id` must be a ????
|
---|
| 50 | * @return Operation
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function create($parent, Scope $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('create', [$params], Operation::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Deletes a Scope. (scopes.delete)
|
---|
| 61 | *
|
---|
| 62 | * @param string $name Required. The Scope resource name in the format
|
---|
| 63 | * `projects/locations/scopes`.
|
---|
| 64 | * @param array $optParams Optional parameters.
|
---|
| 65 | * @return Operation
|
---|
| 66 | * @throws \Google\Service\Exception
|
---|
| 67 | */
|
---|
| 68 | public function delete($name, $optParams = [])
|
---|
| 69 | {
|
---|
| 70 | $params = ['name' => $name];
|
---|
| 71 | $params = array_merge($params, $optParams);
|
---|
| 72 | return $this->call('delete', [$params], Operation::class);
|
---|
| 73 | }
|
---|
| 74 | /**
|
---|
| 75 | * Returns the details of a Scope. (scopes.get)
|
---|
| 76 | *
|
---|
| 77 | * @param string $name Required. The Scope resource name in the format
|
---|
| 78 | * `projects/locations/scopes`.
|
---|
| 79 | * @param array $optParams Optional parameters.
|
---|
| 80 | * @return Scope
|
---|
| 81 | * @throws \Google\Service\Exception
|
---|
| 82 | */
|
---|
| 83 | public function get($name, $optParams = [])
|
---|
| 84 | {
|
---|
| 85 | $params = ['name' => $name];
|
---|
| 86 | $params = array_merge($params, $optParams);
|
---|
| 87 | return $this->call('get', [$params], Scope::class);
|
---|
| 88 | }
|
---|
| 89 | /**
|
---|
| 90 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 91 | * resource exists and does not have a policy set. (scopes.getIamPolicy)
|
---|
| 92 | *
|
---|
| 93 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 94 | * requested. See [Resource
|
---|
| 95 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 96 | * appropriate value for this field.
|
---|
| 97 | * @param array $optParams Optional parameters.
|
---|
| 98 | *
|
---|
| 99 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 100 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 101 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 102 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 103 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 104 | * unset. The policy in the response might use the policy version that you
|
---|
| 105 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 106 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 107 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 108 | * IAM policies, see the [IAM
|
---|
| 109 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 110 | * policies).
|
---|
| 111 | * @return Policy
|
---|
| 112 | * @throws \Google\Service\Exception
|
---|
| 113 | */
|
---|
| 114 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 115 | {
|
---|
| 116 | $params = ['resource' => $resource];
|
---|
| 117 | $params = array_merge($params, $optParams);
|
---|
| 118 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 119 | }
|
---|
| 120 | /**
|
---|
| 121 | * Lists Scopes. (scopes.listProjectsLocationsScopes)
|
---|
| 122 | *
|
---|
| 123 | * @param string $parent Required. The parent (project and location) where the
|
---|
| 124 | * Scope will be listed. Specified in the format `projects/locations`.
|
---|
| 125 | * @param array $optParams Optional parameters.
|
---|
| 126 | *
|
---|
| 127 | * @opt_param int pageSize Optional. When requesting a 'page' of resources,
|
---|
| 128 | * `page_size` specifies number of resources to return. If unspecified or set to
|
---|
| 129 | * 0, all resources will be returned.
|
---|
| 130 | * @opt_param string pageToken Optional. Token returned by previous call to
|
---|
| 131 | * `ListScopes` which specifies the position in the list from where to continue
|
---|
| 132 | * listing the resources.
|
---|
| 133 | * @return ListScopesResponse
|
---|
| 134 | * @throws \Google\Service\Exception
|
---|
| 135 | */
|
---|
| 136 | public function listProjectsLocationsScopes($parent, $optParams = [])
|
---|
| 137 | {
|
---|
| 138 | $params = ['parent' => $parent];
|
---|
| 139 | $params = array_merge($params, $optParams);
|
---|
| 140 | return $this->call('list', [$params], ListScopesResponse::class);
|
---|
| 141 | }
|
---|
| 142 | /**
|
---|
| 143 | * Lists Memberships bound to a Scope. The response includes relevant
|
---|
| 144 | * Memberships from all regions. (scopes.listMemberships)
|
---|
| 145 | *
|
---|
| 146 | * @param string $scopeName Required. Name of the Scope, in the format
|
---|
| 147 | * `projects/locations/global/scopes`, to which the Memberships are bound.
|
---|
| 148 | * @param array $optParams Optional parameters.
|
---|
| 149 | *
|
---|
| 150 | * @opt_param string filter Optional. Lists Memberships that match the filter
|
---|
| 151 | * expression, following the syntax outlined in https://google.aip.dev/160.
|
---|
| 152 | * Currently, filtering can be done only based on Memberships's `name`,
|
---|
| 153 | * `labels`, `create_time`, `update_time`, and `unique_id`.
|
---|
| 154 | * @opt_param int pageSize Optional. When requesting a 'page' of resources,
|
---|
| 155 | * `page_size` specifies number of resources to return. If unspecified or set to
|
---|
| 156 | * 0, all resources will be returned. Pagination is currently not supported;
|
---|
| 157 | * therefore, setting this field does not have any impact for now.
|
---|
| 158 | * @opt_param string pageToken Optional. Token returned by previous call to
|
---|
| 159 | * `ListBoundMemberships` which specifies the position in the list from where to
|
---|
| 160 | * continue listing the resources.
|
---|
| 161 | * @return ListBoundMembershipsResponse
|
---|
| 162 | * @throws \Google\Service\Exception
|
---|
| 163 | */
|
---|
| 164 | public function listMemberships($scopeName, $optParams = [])
|
---|
| 165 | {
|
---|
| 166 | $params = ['scopeName' => $scopeName];
|
---|
| 167 | $params = array_merge($params, $optParams);
|
---|
| 168 | return $this->call('listMemberships', [$params], ListBoundMembershipsResponse::class);
|
---|
| 169 | }
|
---|
| 170 | /**
|
---|
| 171 | * Lists permitted Scopes. (scopes.listPermitted)
|
---|
| 172 | *
|
---|
| 173 | * @param string $parent Required. The parent (project and location) where the
|
---|
| 174 | * Scope will be listed. Specified in the format `projects/locations`.
|
---|
| 175 | * @param array $optParams Optional parameters.
|
---|
| 176 | *
|
---|
| 177 | * @opt_param int pageSize Optional. When requesting a 'page' of resources,
|
---|
| 178 | * `page_size` specifies number of resources to return. If unspecified or set to
|
---|
| 179 | * 0, all resources will be returned.
|
---|
| 180 | * @opt_param string pageToken Optional. Token returned by previous call to
|
---|
| 181 | * `ListPermittedScopes` which specifies the position in the list from where to
|
---|
| 182 | * continue listing the resources.
|
---|
| 183 | * @return ListPermittedScopesResponse
|
---|
| 184 | * @throws \Google\Service\Exception
|
---|
| 185 | */
|
---|
| 186 | public function listPermitted($parent, $optParams = [])
|
---|
| 187 | {
|
---|
| 188 | $params = ['parent' => $parent];
|
---|
| 189 | $params = array_merge($params, $optParams);
|
---|
| 190 | return $this->call('listPermitted', [$params], ListPermittedScopesResponse::class);
|
---|
| 191 | }
|
---|
| 192 | /**
|
---|
| 193 | * Updates a scopes. (scopes.patch)
|
---|
| 194 | *
|
---|
| 195 | * @param string $name The resource name for the scope
|
---|
| 196 | * `projects/{project}/locations/{location}/scopes/{scope}`
|
---|
| 197 | * @param Scope $postBody
|
---|
| 198 | * @param array $optParams Optional parameters.
|
---|
| 199 | *
|
---|
| 200 | * @opt_param string updateMask Required. The fields to be updated.
|
---|
| 201 | * @return Operation
|
---|
| 202 | * @throws \Google\Service\Exception
|
---|
| 203 | */
|
---|
| 204 | public function patch($name, Scope $postBody, $optParams = [])
|
---|
| 205 | {
|
---|
| 206 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 207 | $params = array_merge($params, $optParams);
|
---|
| 208 | return $this->call('patch', [$params], Operation::class);
|
---|
| 209 | }
|
---|
| 210 | /**
|
---|
| 211 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 212 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 213 | * `PERMISSION_DENIED` errors. (scopes.setIamPolicy)
|
---|
| 214 | *
|
---|
| 215 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 216 | * specified. See [Resource
|
---|
| 217 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 218 | * appropriate value for this field.
|
---|
| 219 | * @param SetIamPolicyRequest $postBody
|
---|
| 220 | * @param array $optParams Optional parameters.
|
---|
| 221 | * @return Policy
|
---|
| 222 | * @throws \Google\Service\Exception
|
---|
| 223 | */
|
---|
| 224 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 225 | {
|
---|
| 226 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 227 | $params = array_merge($params, $optParams);
|
---|
| 228 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 229 | }
|
---|
| 230 | /**
|
---|
| 231 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 232 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 233 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 234 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 235 | * This operation may "fail open" without warning. (scopes.testIamPermissions)
|
---|
| 236 | *
|
---|
| 237 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 238 | * being requested. See [Resource
|
---|
| 239 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 240 | * appropriate value for this field.
|
---|
| 241 | * @param TestIamPermissionsRequest $postBody
|
---|
| 242 | * @param array $optParams Optional parameters.
|
---|
| 243 | * @return TestIamPermissionsResponse
|
---|
| 244 | * @throws \Google\Service\Exception
|
---|
| 245 | */
|
---|
| 246 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 247 | {
|
---|
| 248 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 249 | $params = array_merge($params, $optParams);
|
---|
| 250 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 251 | }
|
---|
| 252 | }
|
---|
| 253 |
|
---|
| 254 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 255 | class_alias(ProjectsLocationsScopes::class, 'Google_Service_GKEHub_Resource_ProjectsLocationsScopes');
|
---|