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\DataCatalog\Resource; 19 20use Google\Service\DataCatalog\DatacatalogEmpty; 21use Google\Service\DataCatalog\GoogleCloudDatacatalogV1ListTagsResponse; 22use Google\Service\DataCatalog\GoogleCloudDatacatalogV1Tag; 23 24/** 25 * The "tags" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $datacatalogService = new Google\Service\DataCatalog(...); 29 * $tags = $datacatalogService->tags; 30 * </code> 31 */ 32class ProjectsLocationsEntryGroupsEntriesTags extends \Google\Service\Resource 33{ 34 /** 35 * Creates a tag and assigns it to: * An Entry if the method name is 36 * `projects.locations.entryGroups.entries.tags.create`. * Or EntryGroupif the 37 * method name is `projects.locations.entryGroups.tags.create`. Note: The 38 * project identified by the `parent` parameter for the [tag] 39 * (https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locati 40 * ons.entryGroups.entries.tags/create#path-parameters) and the [tag template] 41 * (https://cloud.google.com/data- 42 * catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path- 43 * parameters) used to create the tag must be in the same organization. 44 * (tags.create) 45 * 46 * @param string $parent Required. The name of the resource to attach this tag 47 * to. Tags can be attached to entries or entry groups. An entry can have up to 48 * 1000 attached tags. Note: The tag and its child resources might not be stored 49 * in the location specified in its name. 50 * @param GoogleCloudDatacatalogV1Tag $postBody 51 * @param array $optParams Optional parameters. 52 * @return GoogleCloudDatacatalogV1Tag 53 */ 54 public function create($parent, GoogleCloudDatacatalogV1Tag $postBody, $optParams = []) 55 { 56 $params = ['parent' => $parent, 'postBody' => $postBody]; 57 $params = array_merge($params, $optParams); 58 return $this->call('create', [$params], GoogleCloudDatacatalogV1Tag::class); 59 } 60 /** 61 * Deletes a tag. (tags.delete) 62 * 63 * @param string $name Required. The name of the tag to delete. 64 * @param array $optParams Optional parameters. 65 * @return DatacatalogEmpty 66 */ 67 public function delete($name, $optParams = []) 68 { 69 $params = ['name' => $name]; 70 $params = array_merge($params, $optParams); 71 return $this->call('delete', [$params], DatacatalogEmpty::class); 72 } 73 /** 74 * Lists tags assigned to an Entry. The columns in the response are lowercased. 75 * (tags.listProjectsLocationsEntryGroupsEntriesTags) 76 * 77 * @param string $parent Required. The name of the Data Catalog resource to list 78 * the tags of. The resource can be an Entry or an EntryGroup (without 79 * `/entries/{entries}` at the end). 80 * @param array $optParams Optional parameters. 81 * 82 * @opt_param int pageSize The maximum number of tags to return. Default is 10. 83 * Maximum limit is 1000. 84 * @opt_param string pageToken Pagination token that specifies the next page to 85 * return. If empty, the first page is returned. 86 * @return GoogleCloudDatacatalogV1ListTagsResponse 87 */ 88 public function listProjectsLocationsEntryGroupsEntriesTags($parent, $optParams = []) 89 { 90 $params = ['parent' => $parent]; 91 $params = array_merge($params, $optParams); 92 return $this->call('list', [$params], GoogleCloudDatacatalogV1ListTagsResponse::class); 93 } 94 /** 95 * Updates an existing tag. (tags.patch) 96 * 97 * @param string $name The resource name of the tag in URL format where tag ID 98 * is a system-generated identifier. Note: The tag itself might not be stored in 99 * the location specified in its name. 100 * @param GoogleCloudDatacatalogV1Tag $postBody 101 * @param array $optParams Optional parameters. 102 * 103 * @opt_param string updateMask Names of fields whose values to overwrite on a 104 * tag. Currently, a tag has the only modifiable field with the name `fields`. 105 * In general, if this parameter is absent or empty, all modifiable fields are 106 * overwritten. If such fields are non-required and omitted in the request body, 107 * their values are emptied. 108 * @return GoogleCloudDatacatalogV1Tag 109 */ 110 public function patch($name, GoogleCloudDatacatalogV1Tag $postBody, $optParams = []) 111 { 112 $params = ['name' => $name, 'postBody' => $postBody]; 113 $params = array_merge($params, $optParams); 114 return $this->call('patch', [$params], GoogleCloudDatacatalogV1Tag::class); 115 } 116} 117 118// Adding a class alias for backwards compatibility with the previous class name. 119class_alias(ProjectsLocationsEntryGroupsEntriesTags::class, 'Google_Service_DataCatalog_Resource_ProjectsLocationsEntryGroupsEntriesTags'); 120