[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\Spanner\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Spanner\ListDatabaseRolesResponse;
|
---|
| 21 | use Google\Service\Spanner\TestIamPermissionsRequest;
|
---|
| 22 | use Google\Service\Spanner\TestIamPermissionsResponse;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "databaseRoles" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $spannerService = new Google\Service\Spanner(...);
|
---|
| 29 | * $databaseRoles = $spannerService->projects_instances_databases_databaseRoles;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsInstancesDatabasesDatabaseRoles extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Lists Cloud Spanner database roles.
|
---|
| 36 | * (databaseRoles.listProjectsInstancesDatabasesDatabaseRoles)
|
---|
| 37 | *
|
---|
| 38 | * @param string $parent Required. The database whose roles should be listed.
|
---|
| 39 | * Values are of the form `projects//instances//databases/`.
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | *
|
---|
| 42 | * @opt_param int pageSize Number of database roles to be returned in the
|
---|
| 43 | * response. If 0 or less, defaults to the server's maximum allowed page size.
|
---|
| 44 | * @opt_param string pageToken If non-empty, `page_token` should contain a
|
---|
| 45 | * next_page_token from a previous ListDatabaseRolesResponse.
|
---|
| 46 | * @return ListDatabaseRolesResponse
|
---|
| 47 | * @throws \Google\Service\Exception
|
---|
| 48 | */
|
---|
| 49 | public function listProjectsInstancesDatabasesDatabaseRoles($parent, $optParams = [])
|
---|
| 50 | {
|
---|
| 51 | $params = ['parent' => $parent];
|
---|
| 52 | $params = array_merge($params, $optParams);
|
---|
| 53 | return $this->call('list', [$params], ListDatabaseRolesResponse::class);
|
---|
| 54 | }
|
---|
| 55 | /**
|
---|
| 56 | * Returns permissions that the caller has on the specified database or backup
|
---|
| 57 | * resource. Attempting this RPC on a non-existent Cloud Spanner database will
|
---|
| 58 | * result in a NOT_FOUND error if the user has `spanner.databases.list`
|
---|
| 59 | * permission on the containing Cloud Spanner instance. Otherwise returns an
|
---|
| 60 | * empty set of permissions. Calling this method on a backup that does not exist
|
---|
| 61 | * will result in a NOT_FOUND error if the user has `spanner.backups.list`
|
---|
| 62 | * permission on the containing instance. Calling this method on a backup
|
---|
| 63 | * schedule that does not exist will result in a NOT_FOUND error if the user has
|
---|
| 64 | * `spanner.backupSchedules.list` permission on the containing database.
|
---|
| 65 | * (databaseRoles.testIamPermissions)
|
---|
| 66 | *
|
---|
| 67 | * @param string $resource REQUIRED: The Cloud Spanner resource for which
|
---|
| 68 | * permissions are being tested. The format is `projects//instances/` for
|
---|
| 69 | * instance resources and `projects//instances//databases/` for database
|
---|
| 70 | * resources.
|
---|
| 71 | * @param TestIamPermissionsRequest $postBody
|
---|
| 72 | * @param array $optParams Optional parameters.
|
---|
| 73 | * @return TestIamPermissionsResponse
|
---|
| 74 | * @throws \Google\Service\Exception
|
---|
| 75 | */
|
---|
| 76 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 77 | {
|
---|
| 78 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 79 | $params = array_merge($params, $optParams);
|
---|
| 80 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 81 | }
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 85 | class_alias(ProjectsInstancesDatabasesDatabaseRoles::class, 'Google_Service_Spanner_Resource_ProjectsInstancesDatabasesDatabaseRoles');
|
---|