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\CloudRun\Resource;
19
20use Google\Service\CloudRun\GoogleCloudRunV2ListRevisionsResponse;
21use Google\Service\CloudRun\GoogleCloudRunV2Revision;
22use Google\Service\CloudRun\GoogleLongrunningOperation;
23
24/**
25 * The "revisions" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $runService = new Google\Service\CloudRun(...);
29 *   $revisions = $runService->revisions;
30 *  </code>
31 */
32class ProjectsLocationsServicesRevisions extends \Google\Service\Resource
33{
34  /**
35   * Delete a Revision. (revisions.delete)
36   *
37   * @param string $name Required. The name of the Revision to delete. Format: pro
38   * jects/{project}/locations/{location}/services/{service}/revisions/{revision}
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string etag A system-generated fingerprint for this version of the
42   * resource. This may be used to detect modification conflict during updates.
43   * @opt_param bool validateOnly Indicates that the request should be validated
44   * without actually deleting any resources.
45   * @return GoogleLongrunningOperation
46   */
47  public function delete($name, $optParams = [])
48  {
49    $params = ['name' => $name];
50    $params = array_merge($params, $optParams);
51    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
52  }
53  /**
54   * Gets information about a Revision. (revisions.get)
55   *
56   * @param string $name Required. The full name of the Revision. Format: projects
57   * /{project}/locations/{location}/services/{service}/revisions/{revision}
58   * @param array $optParams Optional parameters.
59   * @return GoogleCloudRunV2Revision
60   */
61  public function get($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('get', [$params], GoogleCloudRunV2Revision::class);
66  }
67  /**
68   * List Revisions from a given Service, or from a given location.
69   * (revisions.listProjectsLocationsServicesRevisions)
70   *
71   * @param string $parent Required. The Service from which the Revisions should
72   * be listed. To list all Revisions across Services, use "-" instead of Service
73   * name. Format: projects/{project}/locations/{location}/services/{service}
74   * @param array $optParams Optional parameters.
75   *
76   * @opt_param int pageSize Maximum number of revisions to return in this call.
77   * @opt_param string pageToken A page token received from a previous call to
78   * ListRevisions. All other parameters must match.
79   * @opt_param bool showDeleted If true, returns deleted (but unexpired)
80   * resources along with active ones.
81   * @return GoogleCloudRunV2ListRevisionsResponse
82   */
83  public function listProjectsLocationsServicesRevisions($parent, $optParams = [])
84  {
85    $params = ['parent' => $parent];
86    $params = array_merge($params, $optParams);
87    return $this->call('list', [$params], GoogleCloudRunV2ListRevisionsResponse::class);
88  }
89}
90
91// Adding a class alias for backwards compatibility with the previous class name.
92class_alias(ProjectsLocationsServicesRevisions::class, 'Google_Service_CloudRun_Resource_ProjectsLocationsServicesRevisions');
93