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\CloudDeploy\Resource;
19
20use Google\Service\CloudDeploy\ListReleasesResponse;
21use Google\Service\CloudDeploy\Operation;
22use Google\Service\CloudDeploy\Release;
23
24/**
25 * The "releases" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $clouddeployService = new Google\Service\CloudDeploy(...);
29 *   $releases = $clouddeployService->releases;
30 *  </code>
31 */
32class ProjectsLocationsDeliveryPipelinesReleases extends \Google\Service\Resource
33{
34  /**
35   * Creates a new Release in a given project and location. (releases.create)
36   *
37   * @param string $parent Required. The parent collection in which the `Release`
38   * should be created. Format should be projects/{project_id}/locations/{location
39   * _name}/deliveryPipelines/{pipeline_name}.
40   * @param Release $postBody
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string releaseId Required. ID of the `Release`.
44   * @opt_param string requestId Optional. A request ID to identify requests.
45   * Specify a unique request ID so that if you must retry your request, the
46   * server will know to ignore the request if it has already been completed. The
47   * server will guarantee that for at least 60 minutes since the first request.
48   * For example, consider a situation where you make an initial request and the
49   * request times out. If you make the request again with the same request ID,
50   * the server can check if original operation with the same request ID was
51   * received, and if so, will ignore the second request. This prevents clients
52   * from accidentally creating duplicate commitments. The request ID must be a
53   * valid UUID with the exception that zero UUID is not supported
54   * (00000000-0000-0000-0000-000000000000).
55   * @opt_param bool validateOnly Optional. If set to true, the request is
56   * validated and the user is provided with an expected result, but no actual
57   * change is made.
58   * @return Operation
59   */
60  public function create($parent, Release $postBody, $optParams = [])
61  {
62    $params = ['parent' => $parent, 'postBody' => $postBody];
63    $params = array_merge($params, $optParams);
64    return $this->call('create', [$params], Operation::class);
65  }
66  /**
67   * Gets details of a single Release. (releases.get)
68   *
69   * @param string $name Required. Name of the `Release`. Format must be projects/
70   * {project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/rele
71   * ases/{release_name}.
72   * @param array $optParams Optional parameters.
73   * @return Release
74   */
75  public function get($name, $optParams = [])
76  {
77    $params = ['name' => $name];
78    $params = array_merge($params, $optParams);
79    return $this->call('get', [$params], Release::class);
80  }
81  /**
82   * Lists Releases in a given project and location.
83   * (releases.listProjectsLocationsDeliveryPipelinesReleases)
84   *
85   * @param string $parent Required. The `DeliveryPipeline` which owns this
86   * collection of `Release` objects.
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param string filter Optional. Filter releases to be returned. See
90   * https://google.aip.dev/160 for more details.
91   * @opt_param string orderBy Optional. Field to sort by. See
92   * https://google.aip.dev/132#ordering for more details.
93   * @opt_param int pageSize Optional. The maximum number of `Release` objects to
94   * return. The service may return fewer than this value. If unspecified, at most
95   * 50 `Release` objects will be returned. The maximum value is 1000; values
96   * above 1000 will be set to 1000.
97   * @opt_param string pageToken Optional. A page token, received from a previous
98   * `ListReleases` call. Provide this to retrieve the subsequent page. When
99   * paginating, all other provided parameters match the call that provided the
100   * page token.
101   * @return ListReleasesResponse
102   */
103  public function listProjectsLocationsDeliveryPipelinesReleases($parent, $optParams = [])
104  {
105    $params = ['parent' => $parent];
106    $params = array_merge($params, $optParams);
107    return $this->call('list', [$params], ListReleasesResponse::class);
108  }
109}
110
111// Adding a class alias for backwards compatibility with the previous class name.
112class_alias(ProjectsLocationsDeliveryPipelinesReleases::class, 'Google_Service_CloudDeploy_Resource_ProjectsLocationsDeliveryPipelinesReleases');
113