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\ListPackagesResponse; 21use Google\Service\ArtifactRegistry\Operation; 22use Google\Service\ArtifactRegistry\Package; 23 24/** 25 * The "packages" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $artifactregistryService = new Google\Service\ArtifactRegistry(...); 29 * $packages = $artifactregistryService->packages; 30 * </code> 31 */ 32class ProjectsLocationsRepositoriesPackages extends \Google\Service\Resource 33{ 34 /** 35 * Deletes a package and all of its versions and tags. The returned operation 36 * will complete once the package has been deleted. (packages.delete) 37 * 38 * @param string $name Required. The name of the package to delete. 39 * @param array $optParams Optional parameters. 40 * @return Operation 41 */ 42 public function delete($name, $optParams = []) 43 { 44 $params = ['name' => $name]; 45 $params = array_merge($params, $optParams); 46 return $this->call('delete', [$params], Operation::class); 47 } 48 /** 49 * Gets a package. (packages.get) 50 * 51 * @param string $name Required. The name of the package to retrieve. 52 * @param array $optParams Optional parameters. 53 * @return Package 54 */ 55 public function get($name, $optParams = []) 56 { 57 $params = ['name' => $name]; 58 $params = array_merge($params, $optParams); 59 return $this->call('get', [$params], Package::class); 60 } 61 /** 62 * Lists packages. (packages.listProjectsLocationsRepositoriesPackages) 63 * 64 * @param string $parent Required. The name of the parent resource whose 65 * packages will be listed. 66 * @param array $optParams Optional parameters. 67 * 68 * @opt_param int pageSize The maximum number of packages to return. Maximum 69 * page size is 1,000. 70 * @opt_param string pageToken The next_page_token value returned from a 71 * previous list request, if any. 72 * @return ListPackagesResponse 73 */ 74 public function listProjectsLocationsRepositoriesPackages($parent, $optParams = []) 75 { 76 $params = ['parent' => $parent]; 77 $params = array_merge($params, $optParams); 78 return $this->call('list', [$params], ListPackagesResponse::class); 79 } 80} 81 82// Adding a class alias for backwards compatibility with the previous class name. 83class_alias(ProjectsLocationsRepositoriesPackages::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesPackages'); 84