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\GooglePrivacyDlpV2CreateDeidentifyTemplateRequest; 21use Google\Service\DLP\GooglePrivacyDlpV2DeidentifyTemplate; 22use Google\Service\DLP\GooglePrivacyDlpV2ListDeidentifyTemplatesResponse; 23use Google\Service\DLP\GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest; 24use Google\Service\DLP\GoogleProtobufEmpty; 25 26/** 27 * The "deidentifyTemplates" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $dlpService = new Google\Service\DLP(...); 31 * $deidentifyTemplates = $dlpService->deidentifyTemplates; 32 * </code> 33 */ 34class OrganizationsDeidentifyTemplates extends \Google\Service\Resource 35{ 36 /** 37 * Creates a DeidentifyTemplate for re-using frequently used configuration for 38 * de-identifying content, images, and storage. See 39 * https://cloud.google.com/dlp/docs/creating-templates-deid to learn more. 40 * (deidentifyTemplates.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 GooglePrivacyDlpV2CreateDeidentifyTemplateRequest $postBody 55 * @param array $optParams Optional parameters. 56 * @return GooglePrivacyDlpV2DeidentifyTemplate 57 */ 58 public function create($parent, GooglePrivacyDlpV2CreateDeidentifyTemplateRequest $postBody, $optParams = []) 59 { 60 $params = ['parent' => $parent, 'postBody' => $postBody]; 61 $params = array_merge($params, $optParams); 62 return $this->call('create', [$params], GooglePrivacyDlpV2DeidentifyTemplate::class); 63 } 64 /** 65 * Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- 66 * templates-deid to learn more. (deidentifyTemplates.delete) 67 * 68 * @param string $name Required. Resource name of the organization and 69 * deidentify template to be deleted, for example 70 * `organizations/433245324/deidentifyTemplates/432452342` or projects/project- 71 * id/deidentifyTemplates/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 a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- 83 * templates-deid to learn more. (deidentifyTemplates.get) 84 * 85 * @param string $name Required. Resource name of the organization and 86 * deidentify template to be read, for example 87 * `organizations/433245324/deidentifyTemplates/432452342` or projects/project- 88 * id/deidentifyTemplates/432452342. 89 * @param array $optParams Optional parameters. 90 * @return GooglePrivacyDlpV2DeidentifyTemplate 91 */ 92 public function get($name, $optParams = []) 93 { 94 $params = ['name' => $name]; 95 $params = array_merge($params, $optParams); 96 return $this->call('get', [$params], GooglePrivacyDlpV2DeidentifyTemplate::class); 97 } 98 /** 99 * Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating- 100 * templates-deid to learn more. 101 * (deidentifyTemplates.listOrganizationsDeidentifyTemplates) 102 * 103 * @param string $parent Required. Parent resource name. The format of this 104 * value varies depending on the scope of the request (project or organization) 105 * and whether you have [specified a processing 106 * location](https://cloud.google.com/dlp/docs/specifying-location): + Projects 107 * scope, location specified: `projects/`PROJECT_ID`/locations/`LOCATION_ID + 108 * Projects scope, no location specified (defaults to global): 109 * `projects/`PROJECT_ID + Organizations scope, location specified: 110 * `organizations/`ORG_ID`/locations/`LOCATION_ID + Organizations scope, no 111 * location specified (defaults to global): `organizations/`ORG_ID The following 112 * example `parent` string specifies a parent project with the identifier 113 * `example-project`, and specifies the `europe-west3` location for processing 114 * data: parent=projects/example-project/locations/europe-west3 115 * @param array $optParams Optional parameters. 116 * 117 * @opt_param string locationId Deprecated. This field has no effect. 118 * @opt_param string orderBy Comma separated list of fields to order by, 119 * followed by `asc` or `desc` postfix. This list is case-insensitive, default 120 * sorting order is ascending, redundant space characters are insignificant. 121 * Example: `name asc,update_time, create_time desc` Supported fields are: - 122 * `create_time`: corresponds to time the template was created. - `update_time`: 123 * corresponds to time the template was last updated. - `name`: corresponds to 124 * template's name. - `display_name`: corresponds to template's 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 `ListDeidentifyTemplates`. 129 * @return GooglePrivacyDlpV2ListDeidentifyTemplatesResponse 130 */ 131 public function listOrganizationsDeidentifyTemplates($parent, $optParams = []) 132 { 133 $params = ['parent' => $parent]; 134 $params = array_merge($params, $optParams); 135 return $this->call('list', [$params], GooglePrivacyDlpV2ListDeidentifyTemplatesResponse::class); 136 } 137 /** 138 * Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs 139 * /creating-templates-deid to learn more. (deidentifyTemplates.patch) 140 * 141 * @param string $name Required. Resource name of organization and deidentify 142 * template to be updated, for example 143 * `organizations/433245324/deidentifyTemplates/432452342` or projects/project- 144 * id/deidentifyTemplates/432452342. 145 * @param GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest $postBody 146 * @param array $optParams Optional parameters. 147 * @return GooglePrivacyDlpV2DeidentifyTemplate 148 */ 149 public function patch($name, GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest $postBody, $optParams = []) 150 { 151 $params = ['name' => $name, 'postBody' => $postBody]; 152 $params = array_merge($params, $optParams); 153 return $this->call('patch', [$params], GooglePrivacyDlpV2DeidentifyTemplate::class); 154 } 155} 156 157// Adding a class alias for backwards compatibility with the previous class name. 158class_alias(OrganizationsDeidentifyTemplates::class, 'Google_Service_DLP_Resource_OrganizationsDeidentifyTemplates'); 159