1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | /** |
6: | * SPDX-License-Identifier: Apache-2.0 |
7: | * |
8: | * The OpenSearch Contributors require contributions made to |
9: | * this file be licensed under the Apache-2.0 license or a |
10: | * compatible open source license. |
11: | * |
12: | * Modifications Copyright OpenSearch Contributors. See |
13: | * GitHub history for details. |
14: | */ |
15: | |
16: | namespace OpenSearch\Namespaces; |
17: | |
18: | use OpenSearch\Endpoints\FlowFramework\Create; |
19: | use OpenSearch\Endpoints\FlowFramework\Delete; |
20: | use OpenSearch\Endpoints\FlowFramework\Deprovision; |
21: | use OpenSearch\Endpoints\FlowFramework\Get; |
22: | use OpenSearch\Endpoints\FlowFramework\GetStatus; |
23: | use OpenSearch\Endpoints\FlowFramework\GetSteps; |
24: | use OpenSearch\Endpoints\FlowFramework\Provision; |
25: | use OpenSearch\Endpoints\FlowFramework\Search; |
26: | use OpenSearch\Endpoints\FlowFramework\SearchState; |
27: | use OpenSearch\Endpoints\FlowFramework\Update; |
28: | |
29: | /** |
30: | * Class FlowFrameworkNamespace |
31: | * |
32: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
33: | */ |
34: | class FlowFrameworkNamespace extends AbstractNamespace |
35: | { |
36: | /** |
37: | * Create a workflow. |
38: | * |
39: | * $params['provision'] = (boolean) (Default = false) |
40: | * $params['reprovision'] = (boolean) (Default = false) |
41: | * $params['update_fields'] = (boolean) (Default = false) |
42: | * $params['use_case'] = (string) To use a workflow template, specify it in the `use_case` query parameter when creating a workflow. |
43: | * $params['validation'] = (string) (Default = all) |
44: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
45: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
46: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
47: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
48: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
49: | * |
50: | * @param array $params Associative array of parameters |
51: | * @return array |
52: | */ |
53: | public function create(array $params = []) |
54: | { |
55: | $body = $this->extractArgument($params, 'body'); |
56: | |
57: | $endpoint = $this->endpointFactory->getEndpoint(Create::class); |
58: | $endpoint->setParams($params); |
59: | $endpoint->setBody($body); |
60: | |
61: | return $this->performRequest($endpoint); |
62: | } |
63: | |
64: | /** |
65: | * Delete a workflow. |
66: | * |
67: | * $params['workflow_id'] = (string) |
68: | * $params['clear_status'] = (boolean) (Default = false) |
69: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
70: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
71: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
72: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
73: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
74: | * |
75: | * @param array $params Associative array of parameters |
76: | * @return array |
77: | */ |
78: | public function delete(array $params = []) |
79: | { |
80: | $workflow_id = $this->extractArgument($params, 'workflow_id'); |
81: | |
82: | $endpoint = $this->endpointFactory->getEndpoint(Delete::class); |
83: | $endpoint->setParams($params); |
84: | $endpoint->setWorkflowId($workflow_id); |
85: | |
86: | return $this->performRequest($endpoint); |
87: | } |
88: | |
89: | /** |
90: | * Deprovision workflow's resources when you no longer need it. |
91: | * |
92: | * $params['workflow_id'] = (string) |
93: | * $params['allow_delete'] = (string) |
94: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
95: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
96: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
97: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
98: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
99: | * |
100: | * @param array $params Associative array of parameters |
101: | * @return array |
102: | */ |
103: | public function deprovision(array $params = []) |
104: | { |
105: | $workflow_id = $this->extractArgument($params, 'workflow_id'); |
106: | |
107: | $endpoint = $this->endpointFactory->getEndpoint(Deprovision::class); |
108: | $endpoint->setParams($params); |
109: | $endpoint->setWorkflowId($workflow_id); |
110: | |
111: | return $this->performRequest($endpoint); |
112: | } |
113: | |
114: | /** |
115: | * Get a workflow. |
116: | * |
117: | * $params['workflow_id'] = (string) |
118: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
119: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
120: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
121: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
122: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
123: | * |
124: | * @param array $params Associative array of parameters |
125: | * @return array |
126: | */ |
127: | public function get(array $params = []) |
128: | { |
129: | $workflow_id = $this->extractArgument($params, 'workflow_id'); |
130: | |
131: | $endpoint = $this->endpointFactory->getEndpoint(Get::class); |
132: | $endpoint->setParams($params); |
133: | $endpoint->setWorkflowId($workflow_id); |
134: | |
135: | return $this->performRequest($endpoint); |
136: | } |
137: | |
138: | /** |
139: | * Get the provisioning deployment status until it is complete. |
140: | * |
141: | * $params['workflow_id'] = (string) |
142: | * $params['all'] = (boolean) The all parameter specifies whether the response should return all fields. (Default = false) |
143: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
144: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
145: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
146: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
147: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
148: | * |
149: | * @param array $params Associative array of parameters |
150: | * @return array |
151: | */ |
152: | public function getStatus(array $params = []) |
153: | { |
154: | $workflow_id = $this->extractArgument($params, 'workflow_id'); |
155: | |
156: | $endpoint = $this->endpointFactory->getEndpoint(GetStatus::class); |
157: | $endpoint->setParams($params); |
158: | $endpoint->setWorkflowId($workflow_id); |
159: | |
160: | return $this->performRequest($endpoint); |
161: | } |
162: | |
163: | /** |
164: | * Get a list of workflow steps. |
165: | * |
166: | * $params['workflow_step'] = (string) |
167: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
168: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
169: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
170: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
171: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
172: | * |
173: | * @param array $params Associative array of parameters |
174: | * @return array |
175: | */ |
176: | public function getSteps(array $params = []) |
177: | { |
178: | $endpoint = $this->endpointFactory->getEndpoint(GetSteps::class); |
179: | $endpoint->setParams($params); |
180: | |
181: | return $this->performRequest($endpoint); |
182: | } |
183: | |
184: | /** |
185: | * Provisioning a workflow. This API is also executed when the Create or Update Workflow API is called with the provision parameter set to true. |
186: | * |
187: | * $params['workflow_id'] = (string) |
188: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
189: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
190: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
191: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
192: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
193: | * |
194: | * @param array $params Associative array of parameters |
195: | * @return array |
196: | */ |
197: | public function provision(array $params = []) |
198: | { |
199: | $workflow_id = $this->extractArgument($params, 'workflow_id'); |
200: | $body = $this->extractArgument($params, 'body'); |
201: | |
202: | $endpoint = $this->endpointFactory->getEndpoint(Provision::class); |
203: | $endpoint->setParams($params); |
204: | $endpoint->setWorkflowId($workflow_id); |
205: | $endpoint->setBody($body); |
206: | |
207: | return $this->performRequest($endpoint); |
208: | } |
209: | |
210: | /** |
211: | * Search for workflows by using a query matching a field. |
212: | * |
213: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
214: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
215: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
216: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
217: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
218: | * |
219: | * @param array $params Associative array of parameters |
220: | * @return array |
221: | */ |
222: | public function search(array $params = []) |
223: | { |
224: | $body = $this->extractArgument($params, 'body'); |
225: | |
226: | $endpoint = $this->endpointFactory->getEndpoint(Search::class); |
227: | $endpoint->setParams($params); |
228: | $endpoint->setBody($body); |
229: | |
230: | return $this->performRequest($endpoint); |
231: | } |
232: | |
233: | /** |
234: | * Search for workflows by using a query matching a field. |
235: | * |
236: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
237: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
238: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
239: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
240: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
241: | * |
242: | * @param array $params Associative array of parameters |
243: | * @return array |
244: | */ |
245: | public function searchState(array $params = []) |
246: | { |
247: | $body = $this->extractArgument($params, 'body'); |
248: | |
249: | $endpoint = $this->endpointFactory->getEndpoint(SearchState::class); |
250: | $endpoint->setParams($params); |
251: | $endpoint->setBody($body); |
252: | |
253: | return $this->performRequest($endpoint); |
254: | } |
255: | |
256: | /** |
257: | * Update a workflow. You can only update a complete workflow if it has not yet been provisioned. |
258: | * |
259: | * $params['workflow_id'] = (string) |
260: | * $params['provision'] = (boolean) (Default = false) |
261: | * $params['reprovision'] = (boolean) (Default = false) |
262: | * $params['update_fields'] = (boolean) (Default = false) |
263: | * $params['use_case'] = (string) To use a workflow template, specify it in the `use_case` query parameter when creating a workflow. |
264: | * $params['validation'] = (string) (Default = all) |
265: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
266: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
267: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
268: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
269: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
270: | * |
271: | * @param array $params Associative array of parameters |
272: | * @return array |
273: | */ |
274: | public function update(array $params = []) |
275: | { |
276: | $workflow_id = $this->extractArgument($params, 'workflow_id'); |
277: | $body = $this->extractArgument($params, 'body'); |
278: | |
279: | $endpoint = $this->endpointFactory->getEndpoint(Update::class); |
280: | $endpoint->setParams($params); |
281: | $endpoint->setWorkflowId($workflow_id); |
282: | $endpoint->setBody($body); |
283: | |
284: | return $this->performRequest($endpoint); |
285: | } |
286: | |
287: | } |
288: |