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\ListVersionsResponse;
21use Google\Service\ArtifactRegistry\Operation;
22use Google\Service\ArtifactRegistry\Version;
23
24/**
25 * The "versions" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $artifactregistryService = new Google\Service\ArtifactRegistry(...);
29 *   $versions = $artifactregistryService->versions;
30 *  </code>
31 */
32class ProjectsLocationsRepositoriesPackagesVersions extends \Google\Service\Resource
33{
34  /**
35   * Deletes a version and all of its content. The returned operation will
36   * complete once the version has been deleted. (versions.delete)
37   *
38   * @param string $name The name of the version to delete.
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param bool force By default, a version that is tagged may not be
42   * deleted. If force=true, the version and any tags pointing to the version are
43   * deleted.
44   * @return Operation
45   */
46  public function delete($name, $optParams = [])
47  {
48    $params = ['name' => $name];
49    $params = array_merge($params, $optParams);
50    return $this->call('delete', [$params], Operation::class);
51  }
52  /**
53   * Gets a version (versions.get)
54   *
55   * @param string $name The name of the version to retrieve.
56   * @param array $optParams Optional parameters.
57   *
58   * @opt_param string view The view that should be returned in the response.
59   * @return Version
60   */
61  public function get($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('get', [$params], Version::class);
66  }
67  /**
68   * Lists versions. (versions.listProjectsLocationsRepositoriesPackagesVersions)
69   *
70   * @param string $parent The name of the parent resource whose versions will be
71   * listed.
72   * @param array $optParams Optional parameters.
73   *
74   * @opt_param string orderBy Optional. The field to order the results by.
75   * @opt_param int pageSize The maximum number of versions to return. Maximum
76   * page size is 1,000.
77   * @opt_param string pageToken The next_page_token value returned from a
78   * previous list request, if any.
79   * @opt_param string view The view that should be returned in the response.
80   * @return ListVersionsResponse
81   */
82  public function listProjectsLocationsRepositoriesPackagesVersions($parent, $optParams = [])
83  {
84    $params = ['parent' => $parent];
85    $params = array_merge($params, $optParams);
86    return $this->call('list', [$params], ListVersionsResponse::class);
87  }
88}
89
90// Adding a class alias for backwards compatibility with the previous class name.
91class_alias(ProjectsLocationsRepositoriesPackagesVersions::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesPackagesVersions');
92