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\ImportAptArtifactsRequest;
21use Google\Service\ArtifactRegistry\Operation;
22use Google\Service\ArtifactRegistry\UploadAptArtifactMediaResponse;
23use 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->aptArtifacts;
31 *  </code>
32 */
33class 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   */
47  public function import($parent, ImportAptArtifactsRequest $postBody, $optParams = [])
48  {
49    $params = ['parent' => $parent, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('import', [$params], Operation::class);
52  }
53  /**
54   * Directly uploads an Apt artifact. The returned Operation will complete once
55   * the resources are uploaded. Package, Version, and File resources are created
56   * based on the imported artifact. Imported artifacts that conflict with
57   * existing resources are ignored. (aptArtifacts.upload)
58   *
59   * @param string $parent The name of the parent resource where the artifacts
60   * will be uploaded.
61   * @param UploadAptArtifactRequest $postBody
62   * @param array $optParams Optional parameters.
63   * @return UploadAptArtifactMediaResponse
64   */
65  public function upload($parent, UploadAptArtifactRequest $postBody, $optParams = [])
66  {
67    $params = ['parent' => $parent, 'postBody' => $postBody];
68    $params = array_merge($params, $optParams);
69    return $this->call('upload', [$params], UploadAptArtifactMediaResponse::class);
70  }
71}
72
73// Adding a class alias for backwards compatibility with the previous class name.
74class_alias(ProjectsLocationsRepositoriesAptArtifacts::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesAptArtifacts');
75