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\BigQueryDataPolicyService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BigQueryDataPolicyService\BigquerydatapolicyEmpty;
|
---|
21 | use Google\Service\BigQueryDataPolicyService\DataPolicy;
|
---|
22 | use Google\Service\BigQueryDataPolicyService\GetIamPolicyRequest;
|
---|
23 | use Google\Service\BigQueryDataPolicyService\ListDataPoliciesResponse;
|
---|
24 | use Google\Service\BigQueryDataPolicyService\Policy;
|
---|
25 | use Google\Service\BigQueryDataPolicyService\RenameDataPolicyRequest;
|
---|
26 | use Google\Service\BigQueryDataPolicyService\SetIamPolicyRequest;
|
---|
27 | use Google\Service\BigQueryDataPolicyService\TestIamPermissionsRequest;
|
---|
28 | use Google\Service\BigQueryDataPolicyService\TestIamPermissionsResponse;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * The "dataPolicies" collection of methods.
|
---|
32 | * Typical usage is:
|
---|
33 | * <code>
|
---|
34 | * $bigquerydatapolicyService = new Google\Service\BigQueryDataPolicyService(...);
|
---|
35 | * $dataPolicies = $bigquerydatapolicyService->projects_locations_dataPolicies;
|
---|
36 | * </code>
|
---|
37 | */
|
---|
38 | class ProjectsLocationsDataPolicies extends \Google\Service\Resource
|
---|
39 | {
|
---|
40 | /**
|
---|
41 | * Creates a new data policy under a project with the given `dataPolicyId` (used
|
---|
42 | * as the display name), policy tag, and data policy type. (dataPolicies.create)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. Resource name of the project that the data
|
---|
45 | * policy will belong to. The format is
|
---|
46 | * `projects/{project_number}/locations/{location_id}`.
|
---|
47 | * @param DataPolicy $postBody
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | * @return DataPolicy
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function create($parent, DataPolicy $postBody, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('create', [$params], DataPolicy::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Deletes the data policy specified by its resource name. (dataPolicies.delete)
|
---|
60 | *
|
---|
61 | * @param string $name Required. Resource name of the data policy to delete.
|
---|
62 | * Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{da
|
---|
63 | * ta_policy_id}`.
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | *
|
---|
66 | * @opt_param bool force Optional. If true, the data policy will be deleted even
|
---|
67 | * when it is referenced by one or more table columns.
|
---|
68 | * @return BigquerydatapolicyEmpty
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function delete($name, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['name' => $name];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('delete', [$params], BigquerydatapolicyEmpty::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Gets the data policy specified by its resource name. (dataPolicies.get)
|
---|
79 | *
|
---|
80 | * @param string $name Required. Resource name of the requested data policy.
|
---|
81 | * Format is `projects/{project_number}/locations/{location_id}/dataPolicies/{da
|
---|
82 | * ta_policy_id}`.
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return DataPolicy
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function get($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('get', [$params], DataPolicy::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets the IAM policy for the specified data policy.
|
---|
95 | * (dataPolicies.getIamPolicy)
|
---|
96 | *
|
---|
97 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
98 | * requested. See [Resource
|
---|
99 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
100 | * appropriate value for this field.
|
---|
101 | * @param GetIamPolicyRequest $postBody
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return Policy
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * List all of the data policies in the specified parent project.
|
---|
114 | * (dataPolicies.listProjectsLocationsDataPolicies)
|
---|
115 | *
|
---|
116 | * @param string $parent Required. Resource name of the project for which to
|
---|
117 | * list data policies. Format is
|
---|
118 | * `projects/{project_number}/locations/{location_id}`.
|
---|
119 | * @param array $optParams Optional parameters.
|
---|
120 | *
|
---|
121 | * @opt_param string filter Filters the data policies by policy tags that they
|
---|
122 | * are associated with. Currently filter only supports "policy_tag" based
|
---|
123 | * filtering and OR based predicates. Sample filter can be "policy_tag:
|
---|
124 | * projects/1/locations/us/taxonomies/2/policyTags/3". You may also use wildcard
|
---|
125 | * such as "policy_tag: projects/1/locations/us/taxonomies/2*". Please note that
|
---|
126 | * OR predicates cannot be used with wildcard filters.
|
---|
127 | * @opt_param int pageSize The maximum number of data policies to return. Must
|
---|
128 | * be a value between 1 and 1000. If not set, defaults to 50.
|
---|
129 | * @opt_param string pageToken The `nextPageToken` value returned from a
|
---|
130 | * previous list request, if any. If not set, defaults to an empty string.
|
---|
131 | * @return ListDataPoliciesResponse
|
---|
132 | * @throws \Google\Service\Exception
|
---|
133 | */
|
---|
134 | public function listProjectsLocationsDataPolicies($parent, $optParams = [])
|
---|
135 | {
|
---|
136 | $params = ['parent' => $parent];
|
---|
137 | $params = array_merge($params, $optParams);
|
---|
138 | return $this->call('list', [$params], ListDataPoliciesResponse::class);
|
---|
139 | }
|
---|
140 | /**
|
---|
141 | * Updates the metadata for an existing data policy. The target data policy can
|
---|
142 | * be specified by the resource name. (dataPolicies.patch)
|
---|
143 | *
|
---|
144 | * @param string $name Output only. Resource name of this data policy, in the
|
---|
145 | * format of `projects/{project_number}/locations/{location_id}/dataPolicies/{da
|
---|
146 | * ta_policy_id}`.
|
---|
147 | * @param DataPolicy $postBody
|
---|
148 | * @param array $optParams Optional parameters.
|
---|
149 | *
|
---|
150 | * @opt_param bool allowMissing Optional. If set to true, and the data policy is
|
---|
151 | * not found, a new data policy will be created. In this situation, update_mask
|
---|
152 | * is ignored.
|
---|
153 | * @opt_param string updateMask The update mask applies to the resource. For the
|
---|
154 | * `FieldMask` definition, see https://developers.google.com/protocol-
|
---|
155 | * buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all
|
---|
156 | * of the fields that are allowed to update. Updates to the `name` and
|
---|
157 | * `dataPolicyId` fields are not allowed.
|
---|
158 | * @return DataPolicy
|
---|
159 | * @throws \Google\Service\Exception
|
---|
160 | */
|
---|
161 | public function patch($name, DataPolicy $postBody, $optParams = [])
|
---|
162 | {
|
---|
163 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
164 | $params = array_merge($params, $optParams);
|
---|
165 | return $this->call('patch', [$params], DataPolicy::class);
|
---|
166 | }
|
---|
167 | /**
|
---|
168 | * Renames the id (display name) of the specified data policy.
|
---|
169 | * (dataPolicies.rename)
|
---|
170 | *
|
---|
171 | * @param string $name Required. Resource name of the data policy to rename. The
|
---|
172 | * format is `projects/{project_number}/locations/{location_id}/dataPolicies/{da
|
---|
173 | * ta_policy_id}`
|
---|
174 | * @param RenameDataPolicyRequest $postBody
|
---|
175 | * @param array $optParams Optional parameters.
|
---|
176 | * @return DataPolicy
|
---|
177 | * @throws \Google\Service\Exception
|
---|
178 | */
|
---|
179 | public function rename($name, RenameDataPolicyRequest $postBody, $optParams = [])
|
---|
180 | {
|
---|
181 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
182 | $params = array_merge($params, $optParams);
|
---|
183 | return $this->call('rename', [$params], DataPolicy::class);
|
---|
184 | }
|
---|
185 | /**
|
---|
186 | * Sets the IAM policy for the specified data policy.
|
---|
187 | * (dataPolicies.setIamPolicy)
|
---|
188 | *
|
---|
189 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
190 | * specified. See [Resource
|
---|
191 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
192 | * appropriate value for this field.
|
---|
193 | * @param SetIamPolicyRequest $postBody
|
---|
194 | * @param array $optParams Optional parameters.
|
---|
195 | * @return Policy
|
---|
196 | * @throws \Google\Service\Exception
|
---|
197 | */
|
---|
198 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
199 | {
|
---|
200 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
201 | $params = array_merge($params, $optParams);
|
---|
202 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
203 | }
|
---|
204 | /**
|
---|
205 | * Returns the caller's permission on the specified data policy resource.
|
---|
206 | * (dataPolicies.testIamPermissions)
|
---|
207 | *
|
---|
208 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
209 | * being requested. See [Resource
|
---|
210 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
211 | * appropriate value for this field.
|
---|
212 | * @param TestIamPermissionsRequest $postBody
|
---|
213 | * @param array $optParams Optional parameters.
|
---|
214 | * @return TestIamPermissionsResponse
|
---|
215 | * @throws \Google\Service\Exception
|
---|
216 | */
|
---|
217 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
218 | {
|
---|
219 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
220 | $params = array_merge($params, $optParams);
|
---|
221 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
222 | }
|
---|
223 | }
|
---|
224 |
|
---|
225 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
226 | class_alias(ProjectsLocationsDataPolicies::class, 'Google_Service_BigQueryDataPolicyService_Resource_ProjectsLocationsDataPolicies');
|
---|