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