source: vendor/google/apiclient-services/src/Workflows/Resource/ProjectsLocationsWorkflows.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 8 weeks ago

Upload project files

  • Property mode set to 100644
File size: 7.7 KB
Line 
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\Workflows\Resource;
19
20use Google\Service\Workflows\ListWorkflowRevisionsResponse;
21use Google\Service\Workflows\ListWorkflowsResponse;
22use Google\Service\Workflows\Operation;
23use Google\Service\Workflows\Workflow;
24
25/**
26 * The "workflows" collection of methods.
27 * Typical usage is:
28 * <code>
29 * $workflowsService = new Google\Service\Workflows(...);
30 * $workflows = $workflowsService->projects_locations_workflows;
31 * </code>
32 */
33class ProjectsLocationsWorkflows extends \Google\Service\Resource
34{
35 /**
36 * Creates a new workflow. If a workflow with the specified name already exists
37 * in the specified project and location, the long running operation returns a
38 * ALREADY_EXISTS error. (workflows.create)
39 *
40 * @param string $parent Required. Project and location in which the workflow
41 * should be created. Format: projects/{project}/locations/{location}
42 * @param Workflow $postBody
43 * @param array $optParams Optional parameters.
44 *
45 * @opt_param string workflowId Required. The ID of the workflow to be created.
46 * It has to fulfill the following requirements: * Must contain only letters,
47 * numbers, underscores and hyphens. * Must start with a letter. * Must be
48 * between 1-64 characters. * Must end with a number or a letter. * Must be
49 * unique within the customer project and location.
50 * @return Operation
51 * @throws \Google\Service\Exception
52 */
53 public function create($parent, Workflow $postBody, $optParams = [])
54 {
55 $params = ['parent' => $parent, 'postBody' => $postBody];
56 $params = array_merge($params, $optParams);
57 return $this->call('create', [$params], Operation::class);
58 }
59 /**
60 * Deletes a workflow with the specified name. This method also cancels and
61 * deletes all running executions of the workflow. (workflows.delete)
62 *
63 * @param string $name Required. Name of the workflow to be deleted. Format:
64 * projects/{project}/locations/{location}/workflows/{workflow}
65 * @param array $optParams Optional parameters.
66 * @return Operation
67 * @throws \Google\Service\Exception
68 */
69 public function delete($name, $optParams = [])
70 {
71 $params = ['name' => $name];
72 $params = array_merge($params, $optParams);
73 return $this->call('delete', [$params], Operation::class);
74 }
75 /**
76 * Gets details of a single workflow. (workflows.get)
77 *
78 * @param string $name Required. Name of the workflow for which information
79 * should be retrieved. Format:
80 * projects/{project}/locations/{location}/workflows/{workflow}
81 * @param array $optParams Optional parameters.
82 *
83 * @opt_param string revisionId Optional. The revision of the workflow to
84 * retrieve. If the revision_id is empty, the latest revision is retrieved. The
85 * format is "000001-a4d", where the first six characters define the zero-padded
86 * decimal revision number. They are followed by a hyphen and three hexadecimal
87 * characters.
88 * @return Workflow
89 * @throws \Google\Service\Exception
90 */
91 public function get($name, $optParams = [])
92 {
93 $params = ['name' => $name];
94 $params = array_merge($params, $optParams);
95 return $this->call('get', [$params], Workflow::class);
96 }
97 /**
98 * Lists workflows in a given project and location. The default order is not
99 * specified. (workflows.listProjectsLocationsWorkflows)
100 *
101 * @param string $parent Required. Project and location from which the workflows
102 * should be listed. Format: projects/{project}/locations/{location}
103 * @param array $optParams Optional parameters.
104 *
105 * @opt_param string filter Filter to restrict results to specific workflows.
106 * For details, see AIP-160. For example, if you are using the Google APIs
107 * Explorer: `state="SUCCEEDED"` or `createTime>"2023-08-01" AND state="FAILED"`
108 * @opt_param string orderBy Comma-separated list of fields that specify the
109 * order of the results. Default sorting order for a field is ascending. To
110 * specify descending order for a field, append a "desc" suffix. If not
111 * specified, the results are returned in an unspecified order.
112 * @opt_param int pageSize Maximum number of workflows to return per call. The
113 * service might return fewer than this value even if not at the end of the
114 * collection. If a value is not specified, a default value of 500 is used. The
115 * maximum permitted value is 1000 and values greater than 1000 are coerced down
116 * to 1000.
117 * @opt_param string pageToken A page token, received from a previous
118 * `ListWorkflows` call. Provide this to retrieve the subsequent page. When
119 * paginating, all other parameters provided to `ListWorkflows` must match the
120 * call that provided the page token.
121 * @return ListWorkflowsResponse
122 * @throws \Google\Service\Exception
123 */
124 public function listProjectsLocationsWorkflows($parent, $optParams = [])
125 {
126 $params = ['parent' => $parent];
127 $params = array_merge($params, $optParams);
128 return $this->call('list', [$params], ListWorkflowsResponse::class);
129 }
130 /**
131 * Lists revisions for a given workflow. (workflows.listRevisions)
132 *
133 * @param string $name Required. Workflow for which the revisions should be
134 * listed. Format: projects/{project}/locations/{location}/workflows/{workflow}
135 * @param array $optParams Optional parameters.
136 *
137 * @opt_param int pageSize The maximum number of revisions to return per page.
138 * If a value is not specified, a default value of 20 is used. The maximum
139 * permitted value is 100. Values greater than 100 are coerced down to 100.
140 * @opt_param string pageToken The page token, received from a previous
141 * ListWorkflowRevisions call. Provide this to retrieve the subsequent page.
142 * @return ListWorkflowRevisionsResponse
143 * @throws \Google\Service\Exception
144 */
145 public function listRevisions($name, $optParams = [])
146 {
147 $params = ['name' => $name];
148 $params = array_merge($params, $optParams);
149 return $this->call('listRevisions', [$params], ListWorkflowRevisionsResponse::class);
150 }
151 /**
152 * Updates an existing workflow. Running this method has no impact on already
153 * running executions of the workflow. A new revision of the workflow might be
154 * created as a result of a successful update operation. In that case, the new
155 * revision is used in new workflow executions. (workflows.patch)
156 *
157 * @param string $name The resource name of the workflow. Format:
158 * projects/{project}/locations/{location}/workflows/{workflow}. This is a
159 * workflow-wide field and is not tied to a specific revision.
160 * @param Workflow $postBody
161 * @param array $optParams Optional parameters.
162 *
163 * @opt_param string updateMask List of fields to be updated. If not present,
164 * the entire workflow will be updated.
165 * @return Operation
166 * @throws \Google\Service\Exception
167 */
168 public function patch($name, Workflow $postBody, $optParams = [])
169 {
170 $params = ['name' => $name, 'postBody' => $postBody];
171 $params = array_merge($params, $optParams);
172 return $this->call('patch', [$params], Operation::class);
173 }
174}
175
176// Adding a class alias for backwards compatibility with the previous class name.
177class_alias(ProjectsLocationsWorkflows::class, 'Google_Service_Workflows_Resource_ProjectsLocationsWorkflows');
Note: See TracBrowser for help on using the repository browser.