[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\ArtifactRegistry\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\ArtifactRegistry\BatchDeleteVersionsRequest;
|
---|
| 21 | use Google\Service\ArtifactRegistry\ListVersionsResponse;
|
---|
| 22 | use Google\Service\ArtifactRegistry\Operation;
|
---|
| 23 | use Google\Service\ArtifactRegistry\Version;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "versions" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $artifactregistryService = new Google\Service\ArtifactRegistry(...);
|
---|
| 30 | * $versions = $artifactregistryService->projects_locations_repositories_packages_versions;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class ProjectsLocationsRepositoriesPackagesVersions extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Deletes multiple versions across a repository. The returned operation will
|
---|
| 37 | * complete once the versions have been deleted. (versions.batchDelete)
|
---|
| 38 | *
|
---|
| 39 | * @param string $parent The name of the repository holding all requested
|
---|
| 40 | * versions.
|
---|
| 41 | * @param BatchDeleteVersionsRequest $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | * @return Operation
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function batchDelete($parent, BatchDeleteVersionsRequest $postBody, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('batchDelete', [$params], Operation::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Deletes a version and all of its content. The returned operation will
|
---|
| 54 | * complete once the version has been deleted. (versions.delete)
|
---|
| 55 | *
|
---|
| 56 | * @param string $name The name of the version to delete.
|
---|
| 57 | * @param array $optParams Optional parameters.
|
---|
| 58 | *
|
---|
| 59 | * @opt_param bool force By default, a version that is tagged may not be
|
---|
| 60 | * deleted. If force=true, the version and any tags pointing to the version are
|
---|
| 61 | * deleted.
|
---|
| 62 | * @return Operation
|
---|
| 63 | * @throws \Google\Service\Exception
|
---|
| 64 | */
|
---|
| 65 | public function delete($name, $optParams = [])
|
---|
| 66 | {
|
---|
| 67 | $params = ['name' => $name];
|
---|
| 68 | $params = array_merge($params, $optParams);
|
---|
| 69 | return $this->call('delete', [$params], Operation::class);
|
---|
| 70 | }
|
---|
| 71 | /**
|
---|
| 72 | * Gets a version (versions.get)
|
---|
| 73 | *
|
---|
| 74 | * @param string $name The name of the version to retrieve.
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | *
|
---|
| 77 | * @opt_param string view The view that should be returned in the response.
|
---|
| 78 | * @return Version
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function get($name, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['name' => $name];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('get', [$params], Version::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Lists versions. (versions.listProjectsLocationsRepositoriesPackagesVersions)
|
---|
| 89 | *
|
---|
| 90 | * @param string $parent The name of the parent resource whose versions will be
|
---|
| 91 | * listed.
|
---|
| 92 | * @param array $optParams Optional parameters.
|
---|
| 93 | *
|
---|
| 94 | * @opt_param string filter Optional. An expression for filtering the results of
|
---|
| 95 | * the request. Filter rules are case insensitive. The fields eligible for
|
---|
| 96 | * filtering are: * `name` * `annotations` Examples of using a filter: To filter
|
---|
| 97 | * the results of your request to versions with the name `my-version` in project
|
---|
| 98 | * `my-project` in the `us-central` region, in repository `my-repo`, append the
|
---|
| 99 | * following filter expression to your request: * `name="projects/my-
|
---|
| 100 | * project/locations/us-central1/repositories/my-repo/packages/my-
|
---|
| 101 | * package/versions/my-version"` You can also use wildcards to match any number
|
---|
| 102 | * of characters before or after the value: * `name="projects/my-
|
---|
| 103 | * project/locations/us-central1/repositories/my-repo/packages/my-
|
---|
| 104 | * package/versionsversion"` * `name="projects/my-project/locations/us-
|
---|
| 105 | * central1/repositories/my-repo/packages/my-package/versions/my*"` *
|
---|
| 106 | * `name="projects/my-project/locations/us-central1/repositories/my-
|
---|
| 107 | * repo/packages/my-package/versionsversion*"` To filter the results of your
|
---|
| 108 | * request to versions with the annotation key-value pair [`external_link`:
|
---|
| 109 | * `external_link_value`], append the following filter expression to your
|
---|
| 110 | * request: * `"annotations.external_link:external_link_value"` To filter just
|
---|
| 111 | * for a specific annotation key `external_link`, append the following filter
|
---|
| 112 | * expression to your request: * `"annotations.external_link"` If the annotation
|
---|
| 113 | * key or value contains special characters, you can escape them by surrounding
|
---|
| 114 | * the value with backticks. For example, to filter the results of your request
|
---|
| 115 | * to versions with the annotation key-value pair
|
---|
| 116 | * [`external.link`:`https://example.com/my-version`], append the following
|
---|
| 117 | * filter expression to your request: * ``
|
---|
| 118 | * "annotations.`external.link`:`https://example.com/my-version`" `` You can
|
---|
| 119 | * also filter with annotations with a wildcard to match any number of
|
---|
| 120 | * characters before or after the value: * ``
|
---|
| 121 | * "annotations.*_link:`*example.com*`" ``
|
---|
| 122 | * @opt_param string orderBy Optional. The field to order the results by.
|
---|
| 123 | * @opt_param int pageSize The maximum number of versions to return. Maximum
|
---|
| 124 | * page size is 1,000.
|
---|
| 125 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 126 | * previous list request, if any.
|
---|
| 127 | * @opt_param string view The view that should be returned in the response.
|
---|
| 128 | * @return ListVersionsResponse
|
---|
| 129 | * @throws \Google\Service\Exception
|
---|
| 130 | */
|
---|
| 131 | public function listProjectsLocationsRepositoriesPackagesVersions($parent, $optParams = [])
|
---|
| 132 | {
|
---|
| 133 | $params = ['parent' => $parent];
|
---|
| 134 | $params = array_merge($params, $optParams);
|
---|
| 135 | return $this->call('list', [$params], ListVersionsResponse::class);
|
---|
| 136 | }
|
---|
| 137 | /**
|
---|
| 138 | * Updates a version. (versions.patch)
|
---|
| 139 | *
|
---|
| 140 | * @param string $name The name of the version, for example:
|
---|
| 141 | * `projects/p1/locations/us-
|
---|
| 142 | * central1/repositories/repo1/packages/pkg1/versions/art1`. If the package or
|
---|
| 143 | * version ID parts contain slashes, the slashes are escaped.
|
---|
| 144 | * @param Version $postBody
|
---|
| 145 | * @param array $optParams Optional parameters.
|
---|
| 146 | *
|
---|
| 147 | * @opt_param string updateMask The update mask applies to the resource. For the
|
---|
| 148 | * `FieldMask` definition, see https://developers.google.com/protocol-
|
---|
| 149 | * buffers/docs/reference/google.protobuf#fieldmask
|
---|
| 150 | * @return Version
|
---|
| 151 | * @throws \Google\Service\Exception
|
---|
| 152 | */
|
---|
| 153 | public function patch($name, Version $postBody, $optParams = [])
|
---|
| 154 | {
|
---|
| 155 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 156 | $params = array_merge($params, $optParams);
|
---|
| 157 | return $this->call('patch', [$params], Version::class);
|
---|
| 158 | }
|
---|
| 159 | }
|
---|
| 160 |
|
---|
| 161 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 162 | class_alias(ProjectsLocationsRepositoriesPackagesVersions::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesPackagesVersions');
|
---|