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\CloudDataplex\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudDataplex\GoogleCloudDataplexV1DataScan;
|
---|
21 | use Google\Service\CloudDataplex\GoogleCloudDataplexV1GenerateDataQualityRulesRequest;
|
---|
22 | use Google\Service\CloudDataplex\GoogleCloudDataplexV1GenerateDataQualityRulesResponse;
|
---|
23 | use Google\Service\CloudDataplex\GoogleCloudDataplexV1ListDataScansResponse;
|
---|
24 | use Google\Service\CloudDataplex\GoogleCloudDataplexV1RunDataScanRequest;
|
---|
25 | use Google\Service\CloudDataplex\GoogleCloudDataplexV1RunDataScanResponse;
|
---|
26 | use Google\Service\CloudDataplex\GoogleIamV1Policy;
|
---|
27 | use Google\Service\CloudDataplex\GoogleIamV1SetIamPolicyRequest;
|
---|
28 | use Google\Service\CloudDataplex\GoogleIamV1TestIamPermissionsRequest;
|
---|
29 | use Google\Service\CloudDataplex\GoogleIamV1TestIamPermissionsResponse;
|
---|
30 | use Google\Service\CloudDataplex\GoogleLongrunningOperation;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The "dataScans" collection of methods.
|
---|
34 | * Typical usage is:
|
---|
35 | * <code>
|
---|
36 | * $dataplexService = new Google\Service\CloudDataplex(...);
|
---|
37 | * $dataScans = $dataplexService->projects_locations_dataScans;
|
---|
38 | * </code>
|
---|
39 | */
|
---|
40 | class ProjectsLocationsDataScans extends \Google\Service\Resource
|
---|
41 | {
|
---|
42 | /**
|
---|
43 | * Creates a DataScan resource. (dataScans.create)
|
---|
44 | *
|
---|
45 | * @param string $parent Required. The resource name of the parent location:
|
---|
46 | * projects/{project}/locations/{location_id} where project refers to a
|
---|
47 | * project_id or project_number and location_id refers to a GCP region.
|
---|
48 | * @param GoogleCloudDataplexV1DataScan $postBody
|
---|
49 | * @param array $optParams Optional parameters.
|
---|
50 | *
|
---|
51 | * @opt_param string dataScanId Required. DataScan identifier. Must contain only
|
---|
52 | * lowercase letters, numbers and hyphens. Must start with a letter. Must end
|
---|
53 | * with a number or a letter. Must be between 1-63 characters. Must be unique
|
---|
54 | * within the customer project / location.
|
---|
55 | * @opt_param bool validateOnly Optional. Only validate the request, but do not
|
---|
56 | * perform mutations. The default is false.
|
---|
57 | * @return GoogleLongrunningOperation
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function create($parent, GoogleCloudDataplexV1DataScan $postBody, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Deletes a DataScan resource. (dataScans.delete)
|
---|
68 | *
|
---|
69 | * @param string $name Required. The resource name of the dataScan:
|
---|
70 | * projects/{project}/locations/{location_id}/dataScans/{data_scan_id} where
|
---|
71 | * project refers to a project_id or project_number and location_id refers to a
|
---|
72 | * GCP region.
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return GoogleLongrunningOperation
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function delete($name, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['name' => $name];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Generates recommended data quality rules based on the results of a data
|
---|
85 | * profiling scan.Use the recommendations to build rules for a data quality
|
---|
86 | * scan. (dataScans.generateDataQualityRules)
|
---|
87 | *
|
---|
88 | * @param string $name Required. The name must be one of the following: The name
|
---|
89 | * of a data scan with at least one successful, completed data profiling job The
|
---|
90 | * name of a successful, completed data profiling job (a data scan job where the
|
---|
91 | * job type is data profiling)
|
---|
92 | * @param GoogleCloudDataplexV1GenerateDataQualityRulesRequest $postBody
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | * @return GoogleCloudDataplexV1GenerateDataQualityRulesResponse
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function generateDataQualityRules($name, GoogleCloudDataplexV1GenerateDataQualityRulesRequest $postBody, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('generateDataQualityRules', [$params], GoogleCloudDataplexV1GenerateDataQualityRulesResponse::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Gets a DataScan resource. (dataScans.get)
|
---|
105 | *
|
---|
106 | * @param string $name Required. The resource name of the dataScan:
|
---|
107 | * projects/{project}/locations/{location_id}/dataScans/{data_scan_id} where
|
---|
108 | * project refers to a project_id or project_number and location_id refers to a
|
---|
109 | * GCP region.
|
---|
110 | * @param array $optParams Optional parameters.
|
---|
111 | *
|
---|
112 | * @opt_param string view Optional. Select the DataScan view to return. Defaults
|
---|
113 | * to BASIC.
|
---|
114 | * @return GoogleCloudDataplexV1DataScan
|
---|
115 | * @throws \Google\Service\Exception
|
---|
116 | */
|
---|
117 | public function get($name, $optParams = [])
|
---|
118 | {
|
---|
119 | $params = ['name' => $name];
|
---|
120 | $params = array_merge($params, $optParams);
|
---|
121 | return $this->call('get', [$params], GoogleCloudDataplexV1DataScan::class);
|
---|
122 | }
|
---|
123 | /**
|
---|
124 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
125 | * resource exists and does not have a policy set. (dataScans.getIamPolicy)
|
---|
126 | *
|
---|
127 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
128 | * requested. See Resource names
|
---|
129 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
130 | * value for this field.
|
---|
131 | * @param array $optParams Optional parameters.
|
---|
132 | *
|
---|
133 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
134 | * version that will be used to format the policy.Valid values are 0, 1, and 3.
|
---|
135 | * Requests specifying an invalid value will be rejected.Requests for policies
|
---|
136 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
137 | * conditional role bindings may specify any valid value or leave the field
|
---|
138 | * unset.The policy in the response might use the policy version that you
|
---|
139 | * specified, or it might use a lower policy version. For example, if you
|
---|
140 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
141 | * response uses version 1.To learn which resources support conditions in their
|
---|
142 | * IAM policies, see the IAM documentation
|
---|
143 | * (https://cloud.google.com/iam/help/conditions/resource-policies).
|
---|
144 | * @return GoogleIamV1Policy
|
---|
145 | * @throws \Google\Service\Exception
|
---|
146 | */
|
---|
147 | public function getIamPolicy($resource, $optParams = [])
|
---|
148 | {
|
---|
149 | $params = ['resource' => $resource];
|
---|
150 | $params = array_merge($params, $optParams);
|
---|
151 | return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
152 | }
|
---|
153 | /**
|
---|
154 | * Lists DataScans. (dataScans.listProjectsLocationsDataScans)
|
---|
155 | *
|
---|
156 | * @param string $parent Required. The resource name of the parent location:
|
---|
157 | * projects/{project}/locations/{location_id} where project refers to a
|
---|
158 | * project_id or project_number and location_id refers to a GCP region.
|
---|
159 | * @param array $optParams Optional parameters.
|
---|
160 | *
|
---|
161 | * @opt_param string filter Optional. Filter request.
|
---|
162 | * @opt_param string orderBy Optional. Order by fields (name or create_time) for
|
---|
163 | * the result. If not specified, the ordering is undefined.
|
---|
164 | * @opt_param int pageSize Optional. Maximum number of dataScans to return. The
|
---|
165 | * service may return fewer than this value. If unspecified, at most 500 scans
|
---|
166 | * will be returned. The maximum value is 1000; values above 1000 will be
|
---|
167 | * coerced to 1000.
|
---|
168 | * @opt_param string pageToken Optional. Page token received from a previous
|
---|
169 | * ListDataScans call. Provide this to retrieve the subsequent page. When
|
---|
170 | * paginating, all other parameters provided to ListDataScans must match the
|
---|
171 | * call that provided the page token.
|
---|
172 | * @return GoogleCloudDataplexV1ListDataScansResponse
|
---|
173 | * @throws \Google\Service\Exception
|
---|
174 | */
|
---|
175 | public function listProjectsLocationsDataScans($parent, $optParams = [])
|
---|
176 | {
|
---|
177 | $params = ['parent' => $parent];
|
---|
178 | $params = array_merge($params, $optParams);
|
---|
179 | return $this->call('list', [$params], GoogleCloudDataplexV1ListDataScansResponse::class);
|
---|
180 | }
|
---|
181 | /**
|
---|
182 | * Updates a DataScan resource. (dataScans.patch)
|
---|
183 | *
|
---|
184 | * @param string $name Output only. The relative resource name of the scan, of
|
---|
185 | * the form: projects/{project}/locations/{location_id}/dataScans/{datascan_id},
|
---|
186 | * where project refers to a project_id or project_number and location_id refers
|
---|
187 | * to a GCP region.
|
---|
188 | * @param GoogleCloudDataplexV1DataScan $postBody
|
---|
189 | * @param array $optParams Optional parameters.
|
---|
190 | *
|
---|
191 | * @opt_param string updateMask Required. Mask of fields to update.
|
---|
192 | * @opt_param bool validateOnly Optional. Only validate the request, but do not
|
---|
193 | * perform mutations. The default is false.
|
---|
194 | * @return GoogleLongrunningOperation
|
---|
195 | * @throws \Google\Service\Exception
|
---|
196 | */
|
---|
197 | public function patch($name, GoogleCloudDataplexV1DataScan $postBody, $optParams = [])
|
---|
198 | {
|
---|
199 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
200 | $params = array_merge($params, $optParams);
|
---|
201 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
---|
202 | }
|
---|
203 | /**
|
---|
204 | * Runs an on-demand execution of a DataScan (dataScans.run)
|
---|
205 | *
|
---|
206 | * @param string $name Required. The resource name of the DataScan:
|
---|
207 | * projects/{project}/locations/{location_id}/dataScans/{data_scan_id}. where
|
---|
208 | * project refers to a project_id or project_number and location_id refers to a
|
---|
209 | * GCP region.Only OnDemand data scans are allowed.
|
---|
210 | * @param GoogleCloudDataplexV1RunDataScanRequest $postBody
|
---|
211 | * @param array $optParams Optional parameters.
|
---|
212 | * @return GoogleCloudDataplexV1RunDataScanResponse
|
---|
213 | * @throws \Google\Service\Exception
|
---|
214 | */
|
---|
215 | public function run($name, GoogleCloudDataplexV1RunDataScanRequest $postBody, $optParams = [])
|
---|
216 | {
|
---|
217 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
218 | $params = array_merge($params, $optParams);
|
---|
219 | return $this->call('run', [$params], GoogleCloudDataplexV1RunDataScanResponse::class);
|
---|
220 | }
|
---|
221 | /**
|
---|
222 | * Sets the access control policy on the specified resource. Replaces any
|
---|
223 | * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
|
---|
224 | * errors. (dataScans.setIamPolicy)
|
---|
225 | *
|
---|
226 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
227 | * specified. See Resource names
|
---|
228 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
229 | * value for this field.
|
---|
230 | * @param GoogleIamV1SetIamPolicyRequest $postBody
|
---|
231 | * @param array $optParams Optional parameters.
|
---|
232 | * @return GoogleIamV1Policy
|
---|
233 | * @throws \Google\Service\Exception
|
---|
234 | */
|
---|
235 | public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
|
---|
236 | {
|
---|
237 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
238 | $params = array_merge($params, $optParams);
|
---|
239 | return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
240 | }
|
---|
241 | /**
|
---|
242 | * Returns permissions that a caller has on the specified resource. If the
|
---|
243 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
244 | * NOT_FOUND error.Note: This operation is designed to be used for building
|
---|
245 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
246 | * This operation may "fail open" without warning.
|
---|
247 | * (dataScans.testIamPermissions)
|
---|
248 | *
|
---|
249 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
250 | * being requested. See Resource names
|
---|
251 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
252 | * value for this field.
|
---|
253 | * @param GoogleIamV1TestIamPermissionsRequest $postBody
|
---|
254 | * @param array $optParams Optional parameters.
|
---|
255 | * @return GoogleIamV1TestIamPermissionsResponse
|
---|
256 | * @throws \Google\Service\Exception
|
---|
257 | */
|
---|
258 | public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
259 | {
|
---|
260 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
261 | $params = array_merge($params, $optParams);
|
---|
262 | return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
|
---|
263 | }
|
---|
264 | }
|
---|
265 |
|
---|
266 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
267 | class_alias(ProjectsLocationsDataScans::class, 'Google_Service_CloudDataplex_Resource_ProjectsLocationsDataScans');
|
---|