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\GooglePrivacyDlpV2ActivateJobTriggerRequest;
|
---|
21 | use Google\Service\DLP\GooglePrivacyDlpV2CreateJobTriggerRequest;
|
---|
22 | use Google\Service\DLP\GooglePrivacyDlpV2DlpJob;
|
---|
23 | use Google\Service\DLP\GooglePrivacyDlpV2JobTrigger;
|
---|
24 | use Google\Service\DLP\GooglePrivacyDlpV2ListJobTriggersResponse;
|
---|
25 | use Google\Service\DLP\GooglePrivacyDlpV2UpdateJobTriggerRequest;
|
---|
26 | use Google\Service\DLP\GoogleProtobufEmpty;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "jobTriggers" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $dlpService = new Google\Service\DLP(...);
|
---|
33 | * $jobTriggers = $dlpService->projects_jobTriggers;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsJobTriggers extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Activate a job trigger. Causes the immediate execute of a trigger instead of
|
---|
40 | * waiting on the trigger event to occur. (jobTriggers.activate)
|
---|
41 | *
|
---|
42 | * @param string $name Required. Resource name of the trigger to activate, for
|
---|
43 | * example `projects/dlp-test-project/jobTriggers/53234423`.
|
---|
44 | * @param GooglePrivacyDlpV2ActivateJobTriggerRequest $postBody
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | * @return GooglePrivacyDlpV2DlpJob
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function activate($name, GooglePrivacyDlpV2ActivateJobTriggerRequest $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('activate', [$params], GooglePrivacyDlpV2DlpJob::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Creates a job trigger to run DLP actions such as scanning storage for
|
---|
57 | * sensitive information on a set schedule. See
|
---|
58 | * https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers
|
---|
59 | * to learn more. (jobTriggers.create)
|
---|
60 | *
|
---|
61 | * @param string $parent Required. Parent resource name. The format of this
|
---|
62 | * value varies depending on whether you have [specified a processing
|
---|
63 | * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-
|
---|
64 | * location): + Projects scope, location specified:
|
---|
65 | * `projects/{project_id}/locations/{location_id}` + Projects scope, no location
|
---|
66 | * specified (defaults to global): `projects/{project_id}` The following example
|
---|
67 | * `parent` string specifies a parent project with the identifier `example-
|
---|
68 | * project`, and specifies the `europe-west3` location for processing data:
|
---|
69 | * parent=projects/example-project/locations/europe-west3
|
---|
70 | * @param GooglePrivacyDlpV2CreateJobTriggerRequest $postBody
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | * @return GooglePrivacyDlpV2JobTrigger
|
---|
73 | * @throws \Google\Service\Exception
|
---|
74 | */
|
---|
75 | public function create($parent, GooglePrivacyDlpV2CreateJobTriggerRequest $postBody, $optParams = [])
|
---|
76 | {
|
---|
77 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
78 | $params = array_merge($params, $optParams);
|
---|
79 | return $this->call('create', [$params], GooglePrivacyDlpV2JobTrigger::class);
|
---|
80 | }
|
---|
81 | /**
|
---|
82 | * Deletes a job trigger. See https://cloud.google.com/sensitive-data-
|
---|
83 | * protection/docs/creating-job-triggers to learn more. (jobTriggers.delete)
|
---|
84 | *
|
---|
85 | * @param string $name Required. Resource name of the project and the
|
---|
86 | * triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`.
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @return GoogleProtobufEmpty
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function delete($name, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['name' => $name];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Gets a job trigger. See https://cloud.google.com/sensitive-data-
|
---|
99 | * protection/docs/creating-job-triggers to learn more. (jobTriggers.get)
|
---|
100 | *
|
---|
101 | * @param string $name Required. Resource name of the project and the
|
---|
102 | * triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`.
|
---|
103 | * @param array $optParams Optional parameters.
|
---|
104 | * @return GooglePrivacyDlpV2JobTrigger
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function get($name, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['name' => $name];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('get', [$params], GooglePrivacyDlpV2JobTrigger::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Lists job triggers. See https://cloud.google.com/sensitive-data-
|
---|
115 | * protection/docs/creating-job-triggers to learn more.
|
---|
116 | * (jobTriggers.listProjectsJobTriggers)
|
---|
117 | *
|
---|
118 | * @param string $parent Required. Parent resource name. The format of this
|
---|
119 | * value varies depending on whether you have [specified a processing
|
---|
120 | * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-
|
---|
121 | * location): + Projects scope, location specified:
|
---|
122 | * `projects/{project_id}/locations/{location_id}` + Projects scope, no location
|
---|
123 | * specified (defaults to global): `projects/{project_id}` The following example
|
---|
124 | * `parent` string specifies a parent project with the identifier `example-
|
---|
125 | * project`, and specifies the `europe-west3` location for processing data:
|
---|
126 | * parent=projects/example-project/locations/europe-west3
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | *
|
---|
129 | * @opt_param string filter Allows filtering. Supported syntax: * Filter
|
---|
130 | * expressions are made up of one or more restrictions. * Restrictions can be
|
---|
131 | * combined by `AND` or `OR` logical operators. A sequence of restrictions
|
---|
132 | * implicitly uses `AND`. * A restriction has the form of `{field} {operator}
|
---|
133 | * {value}`. * Supported fields/values for inspect triggers: - `status` -
|
---|
134 | * HEALTHY|PAUSED|CANCELLED - `inspected_storage` -
|
---|
135 | * DATASTORE|CLOUD_STORAGE|BIGQUERY - 'last_run_time` - RFC 3339 formatted
|
---|
136 | * timestamp, surrounded by quotation marks. Nanoseconds are ignored. -
|
---|
137 | * 'error_count' - Number of errors that have occurred while running. * The
|
---|
138 | * operator must be `=` or `!=` for status and inspected_storage. Examples: *
|
---|
139 | * inspected_storage = cloud_storage AND status = HEALTHY * inspected_storage =
|
---|
140 | * cloud_storage OR inspected_storage = bigquery * inspected_storage =
|
---|
141 | * cloud_storage AND (state = PAUSED OR state = HEALTHY) * last_run_time >
|
---|
142 | * \"2017-12-12T00:00:00+00:00\" The length of this field should be no more than
|
---|
143 | * 500 characters.
|
---|
144 | * @opt_param string locationId Deprecated. This field has no effect.
|
---|
145 | * @opt_param string orderBy Comma-separated list of triggeredJob fields to
|
---|
146 | * order by, followed by `asc` or `desc` postfix. This list is case insensitive.
|
---|
147 | * The default sorting order is ascending. Redundant space characters are
|
---|
148 | * insignificant. Example: `name asc,update_time, create_time desc` Supported
|
---|
149 | * fields are: - `create_time`: corresponds to the time the JobTrigger was
|
---|
150 | * created. - `update_time`: corresponds to the time the JobTrigger was last
|
---|
151 | * updated. - `last_run_time`: corresponds to the last time the JobTrigger ran.
|
---|
152 | * - `name`: corresponds to the JobTrigger's name. - `display_name`: corresponds
|
---|
153 | * to the JobTrigger's display name. - `status`: corresponds to JobTrigger's
|
---|
154 | * status.
|
---|
155 | * @opt_param int pageSize Size of the page. This value can be limited by a
|
---|
156 | * server.
|
---|
157 | * @opt_param string pageToken Page token to continue retrieval. Comes from the
|
---|
158 | * previous call to ListJobTriggers. `order_by` field must not change for
|
---|
159 | * subsequent calls.
|
---|
160 | * @opt_param string type The type of jobs. Will use `DlpJobType.INSPECT` if not
|
---|
161 | * set.
|
---|
162 | * @return GooglePrivacyDlpV2ListJobTriggersResponse
|
---|
163 | * @throws \Google\Service\Exception
|
---|
164 | */
|
---|
165 | public function listProjectsJobTriggers($parent, $optParams = [])
|
---|
166 | {
|
---|
167 | $params = ['parent' => $parent];
|
---|
168 | $params = array_merge($params, $optParams);
|
---|
169 | return $this->call('list', [$params], GooglePrivacyDlpV2ListJobTriggersResponse::class);
|
---|
170 | }
|
---|
171 | /**
|
---|
172 | * Updates a job trigger. See https://cloud.google.com/sensitive-data-
|
---|
173 | * protection/docs/creating-job-triggers to learn more. (jobTriggers.patch)
|
---|
174 | *
|
---|
175 | * @param string $name Required. Resource name of the project and the
|
---|
176 | * triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`.
|
---|
177 | * @param GooglePrivacyDlpV2UpdateJobTriggerRequest $postBody
|
---|
178 | * @param array $optParams Optional parameters.
|
---|
179 | * @return GooglePrivacyDlpV2JobTrigger
|
---|
180 | * @throws \Google\Service\Exception
|
---|
181 | */
|
---|
182 | public function patch($name, GooglePrivacyDlpV2UpdateJobTriggerRequest $postBody, $optParams = [])
|
---|
183 | {
|
---|
184 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
185 | $params = array_merge($params, $optParams);
|
---|
186 | return $this->call('patch', [$params], GooglePrivacyDlpV2JobTrigger::class);
|
---|
187 | }
|
---|
188 | }
|
---|
189 |
|
---|
190 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
191 | class_alias(ProjectsJobTriggers::class, 'Google_Service_DLP_Resource_ProjectsJobTriggers');
|
---|