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 OrganizationsStoredInfoTypes 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.
100   * (storedInfoTypes.listOrganizationsStoredInfoTypes)
101   *
102   * @param string $parent Required. Parent resource name. The format of this
103   * value varies depending on the scope of the request (project or organization)
104   * and whether you have [specified a processing
105   * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects
106   * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID +
107   * Projects scope, no location specified (defaults to global):
108   * `projects/`PROJECT_ID + Organizations scope, location specified:
109   * `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no
110   * location specified (defaults to global): `organizations/`ORG_ID The following
111   * example `parent` string specifies a parent project with the identifier
112   * `example-project`, and specifies the `europe-west3` location for processing
113   * data: parent=projects/example-project/locations/europe-west3
114   * @param array $optParams Optional parameters.
115   *
116   * @opt_param string locationId Deprecated. This field has no effect.
117   * @opt_param string orderBy Comma separated list of fields to order by,
118   * followed by `asc` or `desc` postfix. This list is case-insensitive, default
119   * sorting order is ascending, redundant space characters are insignificant.
120   * Example: `name asc, display_name, create_time desc` Supported fields are: -
121   * `create_time`: corresponds to time the most recent version of the resource
122   * was created. - `state`: corresponds to the state of the resource. - `name`:
123   * corresponds to resource name. - `display_name`: corresponds to info type's
124   * display name.
125   * @opt_param int pageSize Size of the page, can be limited by server. If zero
126   * server returns a page of max size 100.
127   * @opt_param string pageToken Page token to continue retrieval. Comes from
128   * previous call to `ListStoredInfoTypes`.
129   * @return GooglePrivacyDlpV2ListStoredInfoTypesResponse
130   */
131  public function listOrganizationsStoredInfoTypes($parent, $optParams = [])
132  {
133    $params = ['parent' => $parent];
134    $params = array_merge($params, $optParams);
135    return $this->call('list', [$params], GooglePrivacyDlpV2ListStoredInfoTypesResponse::class);
136  }
137  /**
138   * Updates the stored infoType by creating a new version. The existing version
139   * will continue to be used until the new version is ready. See
140   * https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.
141   * (storedInfoTypes.patch)
142   *
143   * @param string $name Required. Resource name of organization and
144   * storedInfoType to be updated, for example
145   * `organizations/433245324/storedInfoTypes/432452342` or projects/project-
146   * id/storedInfoTypes/432452342.
147   * @param GooglePrivacyDlpV2UpdateStoredInfoTypeRequest $postBody
148   * @param array $optParams Optional parameters.
149   * @return GooglePrivacyDlpV2StoredInfoType
150   */
151  public function patch($name, GooglePrivacyDlpV2UpdateStoredInfoTypeRequest $postBody, $optParams = [])
152  {
153    $params = ['name' => $name, 'postBody' => $postBody];
154    $params = array_merge($params, $optParams);
155    return $this->call('patch', [$params], GooglePrivacyDlpV2StoredInfoType::class);
156  }
157}
158
159// Adding a class alias for backwards compatibility with the previous class name.
160class_alias(OrganizationsStoredInfoTypes::class, 'Google_Service_DLP_Resource_OrganizationsStoredInfoTypes');
161