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\GooglePrivacyDlpV2DeidentifyContentRequest;
21use Google\Service\DLP\GooglePrivacyDlpV2DeidentifyContentResponse;
22use Google\Service\DLP\GooglePrivacyDlpV2InspectContentRequest;
23use Google\Service\DLP\GooglePrivacyDlpV2InspectContentResponse;
24use Google\Service\DLP\GooglePrivacyDlpV2ReidentifyContentRequest;
25use Google\Service\DLP\GooglePrivacyDlpV2ReidentifyContentResponse;
26
27/**
28 * The "content" collection of methods.
29 * Typical usage is:
30 *  <code>
31 *   $dlpService = new Google\Service\DLP(...);
32 *   $content = $dlpService->content;
33 *  </code>
34 */
35class ProjectsLocationsContent extends \Google\Service\Resource
36{
37  /**
38   * De-identifies potentially sensitive info from a ContentItem. This method has
39   * limits on input size and output size. See https://cloud.google.com/dlp/docs
40   * /deidentify-sensitive-data to learn more. When no InfoTypes or
41   * CustomInfoTypes are specified in this request, the system will automatically
42   * choose what detectors to run. By default this may be all types, but may
43   * change over time as detectors are updated. (content.deidentify)
44   *
45   * @param string $parent Parent resource name. The format of this value varies
46   * depending on whether you have [specified a processing
47   * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects
48   * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID +
49   * Projects scope, no location specified (defaults to global):
50   * `projects/`PROJECT_ID The following example `parent` string specifies a
51   * parent project with the identifier `example-project`, and specifies the
52   * `europe-west3` location for processing data: parent=projects/example-
53   * project/locations/europe-west3
54   * @param GooglePrivacyDlpV2DeidentifyContentRequest $postBody
55   * @param array $optParams Optional parameters.
56   * @return GooglePrivacyDlpV2DeidentifyContentResponse
57   */
58  public function deidentify($parent, GooglePrivacyDlpV2DeidentifyContentRequest $postBody, $optParams = [])
59  {
60    $params = ['parent' => $parent, 'postBody' => $postBody];
61    $params = array_merge($params, $optParams);
62    return $this->call('deidentify', [$params], GooglePrivacyDlpV2DeidentifyContentResponse::class);
63  }
64  /**
65   * Finds potentially sensitive info in content. This method has limits on input
66   * size, processing time, and output size. When no InfoTypes or CustomInfoTypes
67   * are specified in this request, the system will automatically choose what
68   * detectors to run. By default this may be all types, but may change over time
69   * as detectors are updated. For how to guides, see
70   * https://cloud.google.com/dlp/docs/inspecting-images and
71   * https://cloud.google.com/dlp/docs/inspecting-text, (content.inspect)
72   *
73   * @param string $parent Parent resource name. The format of this value varies
74   * depending on whether you have [specified a processing
75   * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects
76   * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID +
77   * Projects scope, no location specified (defaults to global):
78   * `projects/`PROJECT_ID The following example `parent` string specifies a
79   * parent project with the identifier `example-project`, and specifies the
80   * `europe-west3` location for processing data: parent=projects/example-
81   * project/locations/europe-west3
82   * @param GooglePrivacyDlpV2InspectContentRequest $postBody
83   * @param array $optParams Optional parameters.
84   * @return GooglePrivacyDlpV2InspectContentResponse
85   */
86  public function inspect($parent, GooglePrivacyDlpV2InspectContentRequest $postBody, $optParams = [])
87  {
88    $params = ['parent' => $parent, 'postBody' => $postBody];
89    $params = array_merge($params, $optParams);
90    return $this->call('inspect', [$params], GooglePrivacyDlpV2InspectContentResponse::class);
91  }
92  /**
93   * Re-identifies content that has been de-identified. See
94   * https://cloud.google.com/dlp/docs/pseudonymization#re-
95   * identification_in_free_text_code_example to learn more. (content.reidentify)
96   *
97   * @param string $parent Required. Parent resource name. The format of this
98   * value varies depending on whether you have [specified a processing
99   * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects
100   * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID +
101   * Projects scope, no location specified (defaults to global):
102   * `projects/`PROJECT_ID The following example `parent` string specifies a
103   * parent project with the identifier `example-project`, and specifies the
104   * `europe-west3` location for processing data: parent=projects/example-
105   * project/locations/europe-west3
106   * @param GooglePrivacyDlpV2ReidentifyContentRequest $postBody
107   * @param array $optParams Optional parameters.
108   * @return GooglePrivacyDlpV2ReidentifyContentResponse
109   */
110  public function reidentify($parent, GooglePrivacyDlpV2ReidentifyContentRequest $postBody, $optParams = [])
111  {
112    $params = ['parent' => $parent, 'postBody' => $postBody];
113    $params = array_merge($params, $optParams);
114    return $this->call('reidentify', [$params], GooglePrivacyDlpV2ReidentifyContentResponse::class);
115  }
116}
117
118// Adding a class alias for backwards compatibility with the previous class name.
119class_alias(ProjectsLocationsContent::class, 'Google_Service_DLP_Resource_ProjectsLocationsContent');
120