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