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\GoogleDevtoolsArtifactregistryV1File;
21use Google\Service\ArtifactRegistry\ListFilesResponse;
22
23/**
24 * The "files" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $artifactregistryService = new Google\Service\ArtifactRegistry(...);
28 *   $files = $artifactregistryService->files;
29 *  </code>
30 */
31class ProjectsLocationsRepositoriesFiles extends \Google\Service\Resource
32{
33  /**
34   * Gets a file. (files.get)
35   *
36   * @param string $name The name of the file to retrieve.
37   * @param array $optParams Optional parameters.
38   * @return GoogleDevtoolsArtifactregistryV1File
39   */
40  public function get($name, $optParams = [])
41  {
42    $params = ['name' => $name];
43    $params = array_merge($params, $optParams);
44    return $this->call('get', [$params], GoogleDevtoolsArtifactregistryV1File::class);
45  }
46  /**
47   * Lists files. (files.listProjectsLocationsRepositoriesFiles)
48   *
49   * @param string $parent The name of the repository whose files will be listed.
50   * For example: "projects/p1/locations/us-central1/repositories/repo1
51   * @param array $optParams Optional parameters.
52   *
53   * @opt_param string filter An expression for filtering the results of the
54   * request. Filter rules are case insensitive. The fields eligible for filtering
55   * are: * `name` * `owner` An example of using a filter: *
56   * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b"` -->
57   * Files with an ID starting with "a/b/". * `owner="projects/p1/locations/us-
58   * central1/repositories/repo1/packages/pkg1/versions/1.0"` --> Files owned by
59   * the version `1.0` in package `pkg1`.
60   * @opt_param string orderBy The field to order the results by.
61   * @opt_param int pageSize The maximum number of files to return.
62   * @opt_param string pageToken The next_page_token value returned from a
63   * previous list request, if any.
64   * @return ListFilesResponse
65   */
66  public function listProjectsLocationsRepositoriesFiles($parent, $optParams = [])
67  {
68    $params = ['parent' => $parent];
69    $params = array_merge($params, $optParams);
70    return $this->call('list', [$params], ListFilesResponse::class);
71  }
72}
73
74// Adding a class alias for backwards compatibility with the previous class name.
75class_alias(ProjectsLocationsRepositoriesFiles::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesFiles');
76