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\GooglePrivacyDlpV2CreateInspectTemplateRequest;
21use Google\Service\DLP\GooglePrivacyDlpV2InspectTemplate;
22use Google\Service\DLP\GooglePrivacyDlpV2ListInspectTemplatesResponse;
23use Google\Service\DLP\GooglePrivacyDlpV2UpdateInspectTemplateRequest;
24use Google\Service\DLP\GoogleProtobufEmpty;
25
26/**
27 * The "inspectTemplates" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $dlpService = new Google\Service\DLP(...);
31 *   $inspectTemplates = $dlpService->inspectTemplates;
32 *  </code>
33 */
34class OrganizationsInspectTemplates extends \Google\Service\Resource
35{
36  /**
37   * Creates an InspectTemplate for re-using frequently used configuration for
38   * inspecting content, images, and storage. See
39   * https://cloud.google.com/dlp/docs/creating-templates to learn more.
40   * (inspectTemplates.create)
41   *
42   * @param string $parent Required. Parent resource name. The format of this
43   * value varies depending on the scope of the request (project or organization)
44   * and whether you have [specified a processing
45   * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects
46   * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID +
47   * Projects scope, no location specified (defaults to global):
48   * `projects/`PROJECT_ID + Organizations scope, location specified:
49   * `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no
50   * location specified (defaults to global): `organizations/`ORG_ID The following
51   * example `parent` string specifies a parent project with the identifier
52   * `example-project`, and specifies the `europe-west3` location for processing
53   * data: parent=projects/example-project/locations/europe-west3
54   * @param GooglePrivacyDlpV2CreateInspectTemplateRequest $postBody
55   * @param array $optParams Optional parameters.
56   * @return GooglePrivacyDlpV2InspectTemplate
57   */
58  public function create($parent, GooglePrivacyDlpV2CreateInspectTemplateRequest $postBody, $optParams = [])
59  {
60    $params = ['parent' => $parent, 'postBody' => $postBody];
61    $params = array_merge($params, $optParams);
62    return $this->call('create', [$params], GooglePrivacyDlpV2InspectTemplate::class);
63  }
64  /**
65   * Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-
66   * templates to learn more. (inspectTemplates.delete)
67   *
68   * @param string $name Required. Resource name of the organization and
69   * inspectTemplate to be deleted, for example
70   * `organizations/433245324/inspectTemplates/432452342` or projects/project-
71   * id/inspectTemplates/432452342.
72   * @param array $optParams Optional parameters.
73   * @return GoogleProtobufEmpty
74   */
75  public function delete($name, $optParams = [])
76  {
77    $params = ['name' => $name];
78    $params = array_merge($params, $optParams);
79    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
80  }
81  /**
82   * Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-
83   * templates to learn more. (inspectTemplates.get)
84   *
85   * @param string $name Required. Resource name of the organization and
86   * inspectTemplate to be read, for example
87   * `organizations/433245324/inspectTemplates/432452342` or projects/project-
88   * id/inspectTemplates/432452342.
89   * @param array $optParams Optional parameters.
90   * @return GooglePrivacyDlpV2InspectTemplate
91   */
92  public function get($name, $optParams = [])
93  {
94    $params = ['name' => $name];
95    $params = array_merge($params, $optParams);
96    return $this->call('get', [$params], GooglePrivacyDlpV2InspectTemplate::class);
97  }
98  /**
99   * Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-
100   * templates to learn more. (inspectTemplates.listOrganizationsInspectTemplates)
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,update_time, create_time desc` Supported fields are: -
121   * `create_time`: corresponds to time the template was created. - `update_time`:
122   * corresponds to time the template was last updated. - `name`: corresponds to
123   * template's name. - `display_name`: corresponds to template's 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 `ListInspectTemplates`.
128   * @return GooglePrivacyDlpV2ListInspectTemplatesResponse
129   */
130  public function listOrganizationsInspectTemplates($parent, $optParams = [])
131  {
132    $params = ['parent' => $parent];
133    $params = array_merge($params, $optParams);
134    return $this->call('list', [$params], GooglePrivacyDlpV2ListInspectTemplatesResponse::class);
135  }
136  /**
137   * Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-
138   * templates to learn more. (inspectTemplates.patch)
139   *
140   * @param string $name Required. Resource name of organization and
141   * inspectTemplate to be updated, for example
142   * `organizations/433245324/inspectTemplates/432452342` or projects/project-
143   * id/inspectTemplates/432452342.
144   * @param GooglePrivacyDlpV2UpdateInspectTemplateRequest $postBody
145   * @param array $optParams Optional parameters.
146   * @return GooglePrivacyDlpV2InspectTemplate
147   */
148  public function patch($name, GooglePrivacyDlpV2UpdateInspectTemplateRequest $postBody, $optParams = [])
149  {
150    $params = ['name' => $name, 'postBody' => $postBody];
151    $params = array_merge($params, $optParams);
152    return $this->call('patch', [$params], GooglePrivacyDlpV2InspectTemplate::class);
153  }
154}
155
156// Adding a class alias for backwards compatibility with the previous class name.
157class_alias(OrganizationsInspectTemplates::class, 'Google_Service_DLP_Resource_OrganizationsInspectTemplates');
158