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\ListPackagesResponse;
|
---|
21 | use Google\Service\ArtifactRegistry\Operation;
|
---|
22 | use 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->projects_locations_repositories_packages;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class 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 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function delete($name, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['name' => $name];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('delete', [$params], Operation::class);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Gets a package. (packages.get)
|
---|
51 | *
|
---|
52 | * @param string $name Required. The name of the package to retrieve.
|
---|
53 | * @param array $optParams Optional parameters.
|
---|
54 | * @return Package
|
---|
55 | * @throws \Google\Service\Exception
|
---|
56 | */
|
---|
57 | public function get($name, $optParams = [])
|
---|
58 | {
|
---|
59 | $params = ['name' => $name];
|
---|
60 | $params = array_merge($params, $optParams);
|
---|
61 | return $this->call('get', [$params], Package::class);
|
---|
62 | }
|
---|
63 | /**
|
---|
64 | * Lists packages. (packages.listProjectsLocationsRepositoriesPackages)
|
---|
65 | *
|
---|
66 | * @param string $parent Required. The name of the parent resource whose
|
---|
67 | * packages will be listed.
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | *
|
---|
70 | * @opt_param string filter Optional. An expression for filtering the results of
|
---|
71 | * the request. Filter rules are case insensitive. The fields eligible for
|
---|
72 | * filtering are: * `name` * `annotations` Examples of using a filter: To filter
|
---|
73 | * the results of your request to packages with the name `my-package` in project
|
---|
74 | * `my-project` in the `us-central` region, in repository `my-repo`, append the
|
---|
75 | * following filter expression to your request: * `name="projects/my-
|
---|
76 | * project/locations/us-central1/repositories/my-repo/packages/my-package"` You
|
---|
77 | * can also use wildcards to match any number of characters before or after the
|
---|
78 | * value: * `name="projects/my-project/locations/us-central1/repositories/my-
|
---|
79 | * repo/packages/my-*"` * `name="projects/my-project/locations/us-
|
---|
80 | * central1/repositories/my-repo/packagespackage"` * `name="projects/my-
|
---|
81 | * project/locations/us-central1/repositories/my-repo/packagespack*"` To filter
|
---|
82 | * the results of your request to packages with the annotation key-value pair
|
---|
83 | * [`external_link`: `external_link_value`], append the following filter
|
---|
84 | * expression to your request": *
|
---|
85 | * `"annotations.external_link:external_link_value"` To filter the results just
|
---|
86 | * for a specific annotation key `external_link`, append the following filter
|
---|
87 | * expression to your request: * `"annotations.external_link"` If the annotation
|
---|
88 | * key or value contains special characters, you can escape them by surrounding
|
---|
89 | * the value with backticks. For example, to filter the results of your request
|
---|
90 | * to packages with the annotation key-value pair
|
---|
91 | * [`external.link`:`https://example.com/my-package`], append the following
|
---|
92 | * filter expression to your request: * ``
|
---|
93 | * "annotations.`external.link`:`https://example.com/my-package`" `` You can
|
---|
94 | * also filter with annotations with a wildcard to match any number of
|
---|
95 | * characters before or after the value: * ``
|
---|
96 | * "annotations.*_link:`*example.com*`" ``
|
---|
97 | * @opt_param string orderBy Optional. The field to order the results by.
|
---|
98 | * @opt_param int pageSize The maximum number of packages to return. Maximum
|
---|
99 | * page size is 1,000.
|
---|
100 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
101 | * previous list request, if any.
|
---|
102 | * @return ListPackagesResponse
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function listProjectsLocationsRepositoriesPackages($parent, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['parent' => $parent];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('list', [$params], ListPackagesResponse::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Updates a package. (packages.patch)
|
---|
113 | *
|
---|
114 | * @param string $name The name of the package, for example:
|
---|
115 | * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`. If the
|
---|
116 | * package ID part contains slashes, the slashes are escaped.
|
---|
117 | * @param Package $postBody
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | *
|
---|
120 | * @opt_param string updateMask The update mask applies to the resource. For the
|
---|
121 | * `FieldMask` definition, see https://developers.google.com/protocol-
|
---|
122 | * buffers/docs/reference/google.protobuf#fieldmask
|
---|
123 | * @return Package
|
---|
124 | * @throws \Google\Service\Exception
|
---|
125 | */
|
---|
126 | public function patch($name, Package $postBody, $optParams = [])
|
---|
127 | {
|
---|
128 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
129 | $params = array_merge($params, $optParams);
|
---|
130 | return $this->call('patch', [$params], Package::class);
|
---|
131 | }
|
---|
132 | }
|
---|
133 |
|
---|
134 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
135 | class_alias(ProjectsLocationsRepositoriesPackages::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesPackages');
|
---|