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\DLP\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DLP\GooglePrivacyDlpV2CancelDlpJobRequest;
|
---|
21 | use Google\Service\DLP\GooglePrivacyDlpV2CreateDlpJobRequest;
|
---|
22 | use Google\Service\DLP\GooglePrivacyDlpV2DlpJob;
|
---|
23 | use Google\Service\DLP\GooglePrivacyDlpV2ListDlpJobsResponse;
|
---|
24 | use Google\Service\DLP\GoogleProtobufEmpty;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "dlpJobs" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $dlpService = new Google\Service\DLP(...);
|
---|
31 | * $dlpJobs = $dlpService->projects_dlpJobs;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsDlpJobs extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Starts asynchronous cancellation on a long-running DlpJob. The server makes a
|
---|
38 | * best effort to cancel the DlpJob, but success is not guaranteed. See
|
---|
39 | * https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage
|
---|
40 | * and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-
|
---|
41 | * analysis to learn more. (dlpJobs.cancel)
|
---|
42 | *
|
---|
43 | * @param string $name Required. The name of the DlpJob resource to be
|
---|
44 | * cancelled.
|
---|
45 | * @param GooglePrivacyDlpV2CancelDlpJobRequest $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | * @return GoogleProtobufEmpty
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function cancel($name, GooglePrivacyDlpV2CancelDlpJobRequest $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('cancel', [$params], GoogleProtobufEmpty::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Creates a new job to inspect storage or calculate risk metrics. See
|
---|
58 | * https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage
|
---|
59 | * and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-
|
---|
60 | * analysis to learn more. When no InfoTypes or CustomInfoTypes are specified in
|
---|
61 | * inspect jobs, the system will automatically choose what detectors to run. By
|
---|
62 | * default this may be all types, but may change over time as detectors are
|
---|
63 | * updated. (dlpJobs.create)
|
---|
64 | *
|
---|
65 | * @param string $parent Required. Parent resource name. The format of this
|
---|
66 | * value varies depending on whether you have [specified a processing
|
---|
67 | * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-
|
---|
68 | * location): + Projects scope, location specified:
|
---|
69 | * `projects/{project_id}/locations/{location_id}` + Projects scope, no location
|
---|
70 | * specified (defaults to global): `projects/{project_id}` The following example
|
---|
71 | * `parent` string specifies a parent project with the identifier `example-
|
---|
72 | * project`, and specifies the `europe-west3` location for processing data:
|
---|
73 | * parent=projects/example-project/locations/europe-west3
|
---|
74 | * @param GooglePrivacyDlpV2CreateDlpJobRequest $postBody
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | * @return GooglePrivacyDlpV2DlpJob
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function create($parent, GooglePrivacyDlpV2CreateDlpJobRequest $postBody, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('create', [$params], GooglePrivacyDlpV2DlpJob::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * Deletes a long-running DlpJob. This method indicates that the client is no
|
---|
87 | * longer interested in the DlpJob result. The job will be canceled if possible.
|
---|
88 | * See https://cloud.google.com/sensitive-data-protection/docs/inspecting-
|
---|
89 | * storage and https://cloud.google.com/sensitive-data-protection/docs/compute-
|
---|
90 | * risk-analysis to learn more. (dlpJobs.delete)
|
---|
91 | *
|
---|
92 | * @param string $name Required. The name of the DlpJob resource to be deleted.
|
---|
93 | * @param array $optParams Optional parameters.
|
---|
94 | * @return GoogleProtobufEmpty
|
---|
95 | * @throws \Google\Service\Exception
|
---|
96 | */
|
---|
97 | public function delete($name, $optParams = [])
|
---|
98 | {
|
---|
99 | $params = ['name' => $name];
|
---|
100 | $params = array_merge($params, $optParams);
|
---|
101 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
102 | }
|
---|
103 | /**
|
---|
104 | * Gets the latest state of a long-running DlpJob. See
|
---|
105 | * https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage
|
---|
106 | * and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-
|
---|
107 | * analysis to learn more. (dlpJobs.get)
|
---|
108 | *
|
---|
109 | * @param string $name Required. The name of the DlpJob resource.
|
---|
110 | * @param array $optParams Optional parameters.
|
---|
111 | * @return GooglePrivacyDlpV2DlpJob
|
---|
112 | * @throws \Google\Service\Exception
|
---|
113 | */
|
---|
114 | public function get($name, $optParams = [])
|
---|
115 | {
|
---|
116 | $params = ['name' => $name];
|
---|
117 | $params = array_merge($params, $optParams);
|
---|
118 | return $this->call('get', [$params], GooglePrivacyDlpV2DlpJob::class);
|
---|
119 | }
|
---|
120 | /**
|
---|
121 | * Lists DlpJobs that match the specified filter in the request. See
|
---|
122 | * https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage
|
---|
123 | * and https://cloud.google.com/sensitive-data-protection/docs/compute-risk-
|
---|
124 | * analysis to learn more. (dlpJobs.listProjectsDlpJobs)
|
---|
125 | *
|
---|
126 | * @param string $parent Required. Parent resource name. The format of this
|
---|
127 | * value varies depending on whether you have [specified a processing
|
---|
128 | * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-
|
---|
129 | * location): + Projects scope, location specified:
|
---|
130 | * `projects/{project_id}/locations/{location_id}` + Projects scope, no location
|
---|
131 | * specified (defaults to global): `projects/{project_id}` The following example
|
---|
132 | * `parent` string specifies a parent project with the identifier `example-
|
---|
133 | * project`, and specifies the `europe-west3` location for processing data:
|
---|
134 | * parent=projects/example-project/locations/europe-west3
|
---|
135 | * @param array $optParams Optional parameters.
|
---|
136 | *
|
---|
137 | * @opt_param string filter Allows filtering. Supported syntax: * Filter
|
---|
138 | * expressions are made up of one or more restrictions. * Restrictions can be
|
---|
139 | * combined by `AND` or `OR` logical operators. A sequence of restrictions
|
---|
140 | * implicitly uses `AND`. * A restriction has the form of `{field} {operator}
|
---|
141 | * {value}`. * Supported fields/values for inspect jobs: - `state` -
|
---|
142 | * PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` -
|
---|
143 | * DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The name of the trigger
|
---|
144 | * that created the job. - 'end_time` - Corresponds to the time the job
|
---|
145 | * finished. - 'start_time` - Corresponds to the time the job finished. *
|
---|
146 | * Supported fields for risk analysis jobs: - `state` -
|
---|
147 | * RUNNING|CANCELED|FINISHED|FAILED - 'end_time` - Corresponds to the time the
|
---|
148 | * job finished. - 'start_time` - Corresponds to the time the job finished. *
|
---|
149 | * The operator must be `=` or `!=`. Examples: * inspected_storage =
|
---|
150 | * cloud_storage AND state = done * inspected_storage = cloud_storage OR
|
---|
151 | * inspected_storage = bigquery * inspected_storage = cloud_storage AND (state =
|
---|
152 | * done OR state = canceled) * end_time > \"2017-12-12T00:00:00+00:00\" The
|
---|
153 | * length of this field should be no more than 500 characters.
|
---|
154 | * @opt_param string locationId Deprecated. This field has no effect.
|
---|
155 | * @opt_param string orderBy Comma-separated list of fields to order by,
|
---|
156 | * followed by `asc` or `desc` postfix. This list is case insensitive. The
|
---|
157 | * default sorting order is ascending. Redundant space characters are
|
---|
158 | * insignificant. Example: `name asc, end_time asc, create_time desc` Supported
|
---|
159 | * fields are: - `create_time`: corresponds to the time the job was created. -
|
---|
160 | * `end_time`: corresponds to the time the job ended. - `name`: corresponds to
|
---|
161 | * the job's name. - `state`: corresponds to `state`
|
---|
162 | * @opt_param int pageSize The standard list page size.
|
---|
163 | * @opt_param string pageToken The standard list page token.
|
---|
164 | * @opt_param string type The type of job. Defaults to `DlpJobType.INSPECT`
|
---|
165 | * @return GooglePrivacyDlpV2ListDlpJobsResponse
|
---|
166 | * @throws \Google\Service\Exception
|
---|
167 | */
|
---|
168 | public function listProjectsDlpJobs($parent, $optParams = [])
|
---|
169 | {
|
---|
170 | $params = ['parent' => $parent];
|
---|
171 | $params = array_merge($params, $optParams);
|
---|
172 | return $this->call('list', [$params], GooglePrivacyDlpV2ListDlpJobsResponse::class);
|
---|
173 | }
|
---|
174 | }
|
---|
175 |
|
---|
176 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
177 | class_alias(ProjectsDlpJobs::class, 'Google_Service_DLP_Resource_ProjectsDlpJobs');
|
---|