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\DataprocMetastore\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DataprocMetastore\Policy;
|
---|
21 | use Google\Service\DataprocMetastore\SetIamPolicyRequest;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "databases" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $metastoreService = new Google\Service\DataprocMetastore(...);
|
---|
28 | * $databases = $metastoreService->projects_locations_services_databases;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class ProjectsLocationsServicesDatabases extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
35 | * resource exists and does not have a policy set. (databases.getIamPolicy)
|
---|
36 | *
|
---|
37 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
38 | * requested. See Resource names
|
---|
39 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
40 | * value for this field.
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
44 | * version that will be used to format the policy.Valid values are 0, 1, and 3.
|
---|
45 | * Requests specifying an invalid value will be rejected.Requests for policies
|
---|
46 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
47 | * conditional role bindings may specify any valid value or leave the field
|
---|
48 | * unset.The policy in the response might use the policy version that you
|
---|
49 | * specified, or it might use a lower policy version. For example, if you
|
---|
50 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
51 | * response uses version 1.To learn which resources support conditions in their
|
---|
52 | * IAM policies, see the IAM documentation
|
---|
53 | * (https://cloud.google.com/iam/help/conditions/resource-policies).
|
---|
54 | * @return Policy
|
---|
55 | * @throws \Google\Service\Exception
|
---|
56 | */
|
---|
57 | public function getIamPolicy($resource, $optParams = [])
|
---|
58 | {
|
---|
59 | $params = ['resource' => $resource];
|
---|
60 | $params = array_merge($params, $optParams);
|
---|
61 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
62 | }
|
---|
63 | /**
|
---|
64 | * Sets the access control policy on the specified resource. Replaces any
|
---|
65 | * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
|
---|
66 | * errors. (databases.setIamPolicy)
|
---|
67 | *
|
---|
68 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
69 | * specified. See Resource names
|
---|
70 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
71 | * value for this field.
|
---|
72 | * @param SetIamPolicyRequest $postBody
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return Policy
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
82 | }
|
---|
83 | }
|
---|
84 |
|
---|
85 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
86 | class_alias(ProjectsLocationsServicesDatabases::class, 'Google_Service_DataprocMetastore_Resource_ProjectsLocationsServicesDatabases');
|
---|