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\GooglePrivacyDlpV2CreateStoredInfoTypeRequest;
21use Google\Service\DLP\GooglePrivacyDlpV2ListStoredInfoTypesResponse;
22use Google\Service\DLP\GooglePrivacyDlpV2StoredInfoType;
23use Google\Service\DLP\GooglePrivacyDlpV2UpdateStoredInfoTypeRequest;
24use Google\Service\DLP\GoogleProtobufEmpty;
25
26/**
27 * The "storedInfoTypes" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $dlpService = new Google\Service\DLP(...);
31 *   $storedInfoTypes = $dlpService->storedInfoTypes;
32 *  </code>
33 */
34class ProjectsStoredInfoTypes extends \Google\Service\Resource
35{
36  /**
37   * Creates a pre-built stored infoType to be used for inspection. See
38   * https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.
39   * (storedInfoTypes.create)
40   *
41   * @param string $parent Required. Parent resource name. The format of this
42   * value varies depending on the scope of the request (project or organization)
43   * and whether you have [specified a processing
44   * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects
45   * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID +
46   * Projects scope, no location specified (defaults to global):
47   * `projects/`PROJECT_ID + Organizations scope, location specified:
48   * `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no
49   * location specified (defaults to global): `organizations/`ORG_ID The following
50   * example `parent` string specifies a parent project with the identifier
51   * `example-project`, and specifies the `europe-west3` location for processing
52   * data: parent=projects/example-project/locations/europe-west3
53   * @param GooglePrivacyDlpV2CreateStoredInfoTypeRequest $postBody
54   * @param array $optParams Optional parameters.
55   * @return GooglePrivacyDlpV2StoredInfoType
56   */
57  public function create($parent, GooglePrivacyDlpV2CreateStoredInfoTypeRequest $postBody, $optParams = [])
58  {
59    $params = ['parent' => $parent, 'postBody' => $postBody];
60    $params = array_merge($params, $optParams);
61    return $this->call('create', [$params], GooglePrivacyDlpV2StoredInfoType::class);
62  }
63  /**
64   * Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-
65   * stored-infotypes to learn more. (storedInfoTypes.delete)
66   *
67   * @param string $name Required. Resource name of the organization and
68   * storedInfoType to be deleted, for example
69   * `organizations/433245324/storedInfoTypes/432452342` or projects/project-
70   * id/storedInfoTypes/432452342.
71   * @param array $optParams Optional parameters.
72   * @return GoogleProtobufEmpty
73   */
74  public function delete($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
79  }
80  /**
81   * Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-
82   * stored-infotypes to learn more. (storedInfoTypes.get)
83   *
84   * @param string $name Required. Resource name of the organization and
85   * storedInfoType to be read, for example
86   * `organizations/433245324/storedInfoTypes/432452342` or projects/project-
87   * id/storedInfoTypes/432452342.
88   * @param array $optParams Optional parameters.
89   * @return GooglePrivacyDlpV2StoredInfoType
90   */
91  public function get($name, $optParams = [])
92  {
93    $params = ['name' => $name];
94    $params = array_merge($params, $optParams);
95    return $this->call('get', [$params], GooglePrivacyDlpV2StoredInfoType::class);
96  }
97  /**
98   * Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-
99   * stored-infotypes to learn more. (storedInfoTypes.listProjectsStoredInfoTypes)
100   *
101   * @param string $parent Required. Parent resource name. The format of this
102   * value varies depending on the scope of the request (project or organization)
103   * and whether you have [specified a processing
104   * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects
105   * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID +
106   * Projects scope, no location specified (defaults to global):
107   * `projects/`PROJECT_ID + Organizations scope, location specified:
108   * `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no
109   * location specified (defaults to global): `organizations/`ORG_ID The following
110   * example `parent` string specifies a parent project with the identifier
111   * `example-project`, and specifies the `europe-west3` location for processing
112   * data: parent=projects/example-project/locations/europe-west3
113   * @param array $optParams Optional parameters.
114   *
115   * @opt_param string locationId Deprecated. This field has no effect.
116   * @opt_param string orderBy Comma separated list of fields to order by,
117   * followed by `asc` or `desc` postfix. This list is case-insensitive, default
118   * sorting order is ascending, redundant space characters are insignificant.
119   * Example: `name asc, display_name, create_time desc` Supported fields are: -
120   * `create_time`: corresponds to time the most recent version of the resource
121   * was created. - `state`: corresponds to the state of the resource. - `name`:
122   * corresponds to resource name. - `display_name`: corresponds to info type's
123   * display name.
124   * @opt_param int pageSize Size of the page, can be limited by server. If zero
125   * server returns a page of max size 100.
126   * @opt_param string pageToken Page token to continue retrieval. Comes from
127   * previous call to `ListStoredInfoTypes`.
128   * @return GooglePrivacyDlpV2ListStoredInfoTypesResponse
129   */
130  public function listProjectsStoredInfoTypes($parent, $optParams = [])
131  {
132    $params = ['parent' => $parent];
133    $params = array_merge($params, $optParams);
134    return $this->call('list', [$params], GooglePrivacyDlpV2ListStoredInfoTypesResponse::class);
135  }
136  /**
137   * Updates the stored infoType by creating a new version. The existing version
138   * will continue to be used until the new version is ready. See
139   * https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.
140   * (storedInfoTypes.patch)
141   *
142   * @param string $name Required. Resource name of organization and
143   * storedInfoType to be updated, for example
144   * `organizations/433245324/storedInfoTypes/432452342` or projects/project-
145   * id/storedInfoTypes/432452342.
146   * @param GooglePrivacyDlpV2UpdateStoredInfoTypeRequest $postBody
147   * @param array $optParams Optional parameters.
148   * @return GooglePrivacyDlpV2StoredInfoType
149   */
150  public function patch($name, GooglePrivacyDlpV2UpdateStoredInfoTypeRequest $postBody, $optParams = [])
151  {
152    $params = ['name' => $name, 'postBody' => $postBody];
153    $params = array_merge($params, $optParams);
154    return $this->call('patch', [$params], GooglePrivacyDlpV2StoredInfoType::class);
155  }
156}
157
158// Adding a class alias for backwards compatibility with the previous class name.
159class_alias(ProjectsStoredInfoTypes::class, 'Google_Service_DLP_Resource_ProjectsStoredInfoTypes');
160