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\AutomationRun;
|
---|
21 | use Google\Service\CloudDeploy\CancelAutomationRunRequest;
|
---|
22 | use Google\Service\CloudDeploy\CancelAutomationRunResponse;
|
---|
23 | use Google\Service\CloudDeploy\ListAutomationRunsResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "automationRuns" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $clouddeployService = new Google\Service\CloudDeploy(...);
|
---|
30 | * $automationRuns = $clouddeployService->projects_locations_deliveryPipelines_automationRuns;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsDeliveryPipelinesAutomationRuns extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Cancels an AutomationRun. The `state` of the `AutomationRun` after cancelling
|
---|
37 | * is `CANCELLED`. `CancelAutomationRun` can be called on AutomationRun in the
|
---|
38 | * state `IN_PROGRESS` and `PENDING`; AutomationRun in a different state returns
|
---|
39 | * an `FAILED_PRECONDITION` error. (automationRuns.cancel)
|
---|
40 | *
|
---|
41 | * @param string $name Required. Name of the `AutomationRun`. Format is `project
|
---|
42 | * s/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automa
|
---|
43 | * tionRuns/{automation_run}`.
|
---|
44 | * @param CancelAutomationRunRequest $postBody
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | * @return CancelAutomationRunResponse
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function cancel($name, CancelAutomationRunRequest $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('cancel', [$params], CancelAutomationRunResponse::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Gets details of a single AutomationRun. (automationRuns.get)
|
---|
57 | *
|
---|
58 | * @param string $name Required. Name of the `AutomationRun`. Format must be `pr
|
---|
59 | * ojects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/a
|
---|
60 | * utomationRuns/{automation_run}`.
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return AutomationRun
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function get($name, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('get', [$params], AutomationRun::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Lists AutomationRuns in a given project and location.
|
---|
73 | * (automationRuns.listProjectsLocationsDeliveryPipelinesAutomationRuns)
|
---|
74 | *
|
---|
75 | * @param string $parent Required. The parent `Delivery Pipeline`, which owns
|
---|
76 | * this collection of automationRuns. Format must be `projects/{project}/locatio
|
---|
77 | * ns/{location}/deliveryPipelines/{delivery_pipeline}`.
|
---|
78 | * @param array $optParams Optional parameters.
|
---|
79 | *
|
---|
80 | * @opt_param string filter Filter automationRuns to be returned. All fields can
|
---|
81 | * be used in the filter.
|
---|
82 | * @opt_param string orderBy Field to sort by.
|
---|
83 | * @opt_param int pageSize The maximum number of automationRuns to return. The
|
---|
84 | * service may return fewer than this value. If unspecified, at most 50
|
---|
85 | * automationRuns will be returned. The maximum value is 1000; values above 1000
|
---|
86 | * will be set to 1000.
|
---|
87 | * @opt_param string pageToken A page token, received from a previous
|
---|
88 | * `ListAutomationRuns` call. Provide this to retrieve the subsequent page. When
|
---|
89 | * paginating, all other provided parameters match the call that provided the
|
---|
90 | * page token.
|
---|
91 | * @return ListAutomationRunsResponse
|
---|
92 | * @throws \Google\Service\Exception
|
---|
93 | */
|
---|
94 | public function listProjectsLocationsDeliveryPipelinesAutomationRuns($parent, $optParams = [])
|
---|
95 | {
|
---|
96 | $params = ['parent' => $parent];
|
---|
97 | $params = array_merge($params, $optParams);
|
---|
98 | return $this->call('list', [$params], ListAutomationRunsResponse::class);
|
---|
99 | }
|
---|
100 | }
|
---|
101 |
|
---|
102 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
103 | class_alias(ProjectsLocationsDeliveryPipelinesAutomationRuns::class, 'Google_Service_CloudDeploy_Resource_ProjectsLocationsDeliveryPipelinesAutomationRuns');
|
---|