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\ArtifactRegistry\Resource; 19 20use Google\Service\ArtifactRegistry\ArtifactregistryEmpty; 21use Google\Service\ArtifactRegistry\ListTagsResponse; 22use Google\Service\ArtifactRegistry\Tag; 23 24/** 25 * The "tags" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $artifactregistryService = new Google\Service\ArtifactRegistry(...); 29 * $tags = $artifactregistryService->tags; 30 * </code> 31 */ 32class ProjectsLocationsRepositoriesPackagesTags extends \Google\Service\Resource 33{ 34 /** 35 * Creates a tag. (tags.create) 36 * 37 * @param string $parent The name of the parent resource where the tag will be 38 * created. 39 * @param Tag $postBody 40 * @param array $optParams Optional parameters. 41 * 42 * @opt_param string tagId The tag id to use for this repository. 43 * @return Tag 44 */ 45 public function create($parent, Tag $postBody, $optParams = []) 46 { 47 $params = ['parent' => $parent, 'postBody' => $postBody]; 48 $params = array_merge($params, $optParams); 49 return $this->call('create', [$params], Tag::class); 50 } 51 /** 52 * Deletes a tag. (tags.delete) 53 * 54 * @param string $name The name of the tag to delete. 55 * @param array $optParams Optional parameters. 56 * @return ArtifactregistryEmpty 57 */ 58 public function delete($name, $optParams = []) 59 { 60 $params = ['name' => $name]; 61 $params = array_merge($params, $optParams); 62 return $this->call('delete', [$params], ArtifactregistryEmpty::class); 63 } 64 /** 65 * Gets a tag. (tags.get) 66 * 67 * @param string $name The name of the tag to retrieve. 68 * @param array $optParams Optional parameters. 69 * @return Tag 70 */ 71 public function get($name, $optParams = []) 72 { 73 $params = ['name' => $name]; 74 $params = array_merge($params, $optParams); 75 return $this->call('get', [$params], Tag::class); 76 } 77 /** 78 * Lists tags. (tags.listProjectsLocationsRepositoriesPackagesTags) 79 * 80 * @param string $parent The name of the parent resource whose tags will be 81 * listed. 82 * @param array $optParams Optional parameters. 83 * 84 * @opt_param string filter An expression for filtering the results of the 85 * request. Filter rules are case insensitive. The fields eligible for filtering 86 * are: * `version` An example of using a filter: * 87 * `version="projects/p1/locations/us- 88 * central1/repositories/repo1/packages/pkg1/versions/1.0"` --> Tags that are 89 * applied to the version `1.0` in package `pkg1`. 90 * @opt_param int pageSize The maximum number of tags to return. Maximum page 91 * size is 10,000. 92 * @opt_param string pageToken The next_page_token value returned from a 93 * previous list request, if any. 94 * @return ListTagsResponse 95 */ 96 public function listProjectsLocationsRepositoriesPackagesTags($parent, $optParams = []) 97 { 98 $params = ['parent' => $parent]; 99 $params = array_merge($params, $optParams); 100 return $this->call('list', [$params], ListTagsResponse::class); 101 } 102 /** 103 * Updates a tag. (tags.patch) 104 * 105 * @param string $name The name of the tag, for example: "projects/p1/locations 106 * /us-central1/repositories/repo1/packages/pkg1/tags/tag1". If the package part 107 * contains slashes, the slashes are escaped. The tag part can only have 108 * characters in [a-zA-Z0-9\-._~:@], anything else must be URL encoded. 109 * @param Tag $postBody 110 * @param array $optParams Optional parameters. 111 * 112 * @opt_param string updateMask The update mask applies to the resource. For the 113 * `FieldMask` definition, see https://developers.google.com/protocol- 114 * buffers/docs/reference/google.protobuf#fieldmask 115 * @return Tag 116 */ 117 public function patch($name, Tag $postBody, $optParams = []) 118 { 119 $params = ['name' => $name, 'postBody' => $postBody]; 120 $params = array_merge($params, $optParams); 121 return $this->call('patch', [$params], Tag::class); 122 } 123} 124 125// Adding a class alias for backwards compatibility with the previous class name. 126class_alias(ProjectsLocationsRepositoriesPackagesTags::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesPackagesTags'); 127