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