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\ImportGoogetArtifactsRequest;
|
---|
21 | use Google\Service\ArtifactRegistry\Operation;
|
---|
22 | use Google\Service\ArtifactRegistry\UploadGoogetArtifactMediaResponse;
|
---|
23 | use Google\Service\ArtifactRegistry\UploadGoogetArtifactRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "googetArtifacts" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $artifactregistryService = new Google\Service\ArtifactRegistry(...);
|
---|
30 | * $googetArtifacts = $artifactregistryService->projects_locations_repositories_googetArtifacts;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsRepositoriesGoogetArtifacts extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Imports GooGet artifacts. The returned Operation will complete once the
|
---|
37 | * resources are imported. Package, Version, and File resources are created
|
---|
38 | * based on the imported artifacts. Imported artifacts that conflict with
|
---|
39 | * existing resources are ignored. (googetArtifacts.import)
|
---|
40 | *
|
---|
41 | * @param string $parent The name of the parent resource where the artifacts
|
---|
42 | * will be imported.
|
---|
43 | * @param ImportGoogetArtifactsRequest $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return Operation
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function import($parent, ImportGoogetArtifactsRequest $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('import', [$params], Operation::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Directly uploads a GooGet artifact. The returned Operation will complete once
|
---|
56 | * the resources are uploaded. Package, Version, and File resources are created
|
---|
57 | * based on the imported artifact. Imported artifacts that conflict with
|
---|
58 | * existing resources are ignored. (googetArtifacts.upload)
|
---|
59 | *
|
---|
60 | * @param string $parent The name of the parent resource where the artifacts
|
---|
61 | * will be uploaded.
|
---|
62 | * @param UploadGoogetArtifactRequest $postBody
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return UploadGoogetArtifactMediaResponse
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function upload($parent, UploadGoogetArtifactRequest $postBody, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('upload', [$params], UploadGoogetArtifactMediaResponse::class);
|
---|
72 | }
|
---|
73 | }
|
---|
74 |
|
---|
75 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
76 | class_alias(ProjectsLocationsRepositoriesGoogetArtifacts::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesGoogetArtifacts');
|
---|