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