[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\ImportAptArtifactsRequest;
|
---|
| 21 | use Google\Service\ArtifactRegistry\Operation;
|
---|
| 22 | use Google\Service\ArtifactRegistry\UploadAptArtifactMediaResponse;
|
---|
| 23 | use Google\Service\ArtifactRegistry\UploadAptArtifactRequest;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "aptArtifacts" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $artifactregistryService = new Google\Service\ArtifactRegistry(...);
|
---|
| 30 | * $aptArtifacts = $artifactregistryService->projects_locations_repositories_aptArtifacts;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class ProjectsLocationsRepositoriesAptArtifacts extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Imports Apt 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. (aptArtifacts.import)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent The name of the parent resource where the artifacts
|
---|
| 42 | * will be imported.
|
---|
| 43 | * @param ImportAptArtifactsRequest $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | * @return Operation
|
---|
| 46 | * @throws \Google\Service\Exception
|
---|
| 47 | */
|
---|
| 48 | public function import($parent, ImportAptArtifactsRequest $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 an Apt 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. (aptArtifacts.upload)
|
---|
| 59 | *
|
---|
| 60 | * @param string $parent The name of the parent resource where the artifacts
|
---|
| 61 | * will be uploaded.
|
---|
| 62 | * @param UploadAptArtifactRequest $postBody
|
---|
| 63 | * @param array $optParams Optional parameters.
|
---|
| 64 | * @return UploadAptArtifactMediaResponse
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function upload($parent, UploadAptArtifactRequest $postBody, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('upload', [$params], UploadAptArtifactMediaResponse::class);
|
---|
| 72 | }
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 76 | class_alias(ProjectsLocationsRepositoriesAptArtifacts::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesAptArtifacts');
|
---|