windmill_api/apis/
job_api.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.576.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`batch_re_run_jobs`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum BatchReRunJobsError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`cancel_persistent_queued_jobs`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum CancelPersistentQueuedJobsError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`cancel_queued_job`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum CancelQueuedJobError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`cancel_selection`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum CancelSelectionError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`cancel_suspended_job_get`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum CancelSuspendedJobGetError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`cancel_suspended_job_post`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum CancelSuspendedJobPostError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`count_completed_jobs`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum CountCompletedJobsError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`count_jobs_by_tag`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CountJobsByTagError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`create_job_signature`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum CreateJobSignatureError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`delete_completed_job`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteCompletedJobError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`force_cancel_queued_job`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ForceCancelQueuedJobError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_completed_count`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetCompletedCountError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_completed_job`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetCompletedJobError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_completed_job_logs_tail`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetCompletedJobLogsTailError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_completed_job_result`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetCompletedJobResultError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_completed_job_result_maybe`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetCompletedJobResultMaybeError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_db_clock`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetDbClockError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_flow_debug_info`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetFlowDebugInfoError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_flow_user_state`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetFlowUserStateError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_job`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetJobError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_job_args`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetJobArgsError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`get_job_logs`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetJobLogsError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`get_job_updates`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetJobUpdatesError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`get_job_updates_sse`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetJobUpdatesSseError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`get_log_file_from_store`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetLogFileFromStoreError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`get_queue_count`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetQueueCountError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`get_queue_position`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetQueuePositionError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`get_resume_urls`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetResumeUrlsError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`get_root_job_id`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetRootJobIdError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`get_scheduled_for`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetScheduledForError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`get_slack_approval_payload`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetSlackApprovalPayloadError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`get_started_at_by_ids`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum GetStartedAtByIdsError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`get_suspended_job_flow`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum GetSuspendedJobFlowError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`get_teams_approval_payload`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum GetTeamsApprovalPayloadError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`list_completed_jobs`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum ListCompletedJobsError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`list_extended_jobs`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum ListExtendedJobsError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`list_filtered_jobs_uuids`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum ListFilteredJobsUuidsError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`list_filtered_queue_uuids`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum ListFilteredQueueUuidsError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`list_jobs`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum ListJobsError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`list_queue`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum ListQueueError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`list_selected_job_groups`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum ListSelectedJobGroupsError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`restart_flow_at_step`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum RestartFlowAtStepError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`result_by_id`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum ResultByIdError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`resume_suspended_flow_as_owner`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum ResumeSuspendedFlowAsOwnerError {
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`resume_suspended_job_get`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum ResumeSuspendedJobGetError {
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`resume_suspended_job_post`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum ResumeSuspendedJobPostError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`run_and_stream_flow_by_path`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum RunAndStreamFlowByPathError {
344    UnknownValue(serde_json::Value),
345}
346
347/// struct for typed errors of method [`run_and_stream_flow_by_path_get`]
348#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum RunAndStreamFlowByPathGetError {
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`run_and_stream_flow_by_version`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum RunAndStreamFlowByVersionError {
358    UnknownValue(serde_json::Value),
359}
360
361/// struct for typed errors of method [`run_and_stream_flow_by_version_get`]
362#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum RunAndStreamFlowByVersionGetError {
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`run_and_stream_script_by_hash`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum RunAndStreamScriptByHashError {
372    UnknownValue(serde_json::Value),
373}
374
375/// struct for typed errors of method [`run_and_stream_script_by_hash_get`]
376#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum RunAndStreamScriptByHashGetError {
379    UnknownValue(serde_json::Value),
380}
381
382/// struct for typed errors of method [`run_and_stream_script_by_path`]
383#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum RunAndStreamScriptByPathError {
386    UnknownValue(serde_json::Value),
387}
388
389/// struct for typed errors of method [`run_and_stream_script_by_path_get`]
390#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum RunAndStreamScriptByPathGetError {
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`run_code_workflow_task`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum RunCodeWorkflowTaskError {
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`run_dynamic_select`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum RunDynamicSelectError {
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`run_flow_by_path`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum RunFlowByPathError {
414    UnknownValue(serde_json::Value),
415}
416
417/// struct for typed errors of method [`run_flow_by_version`]
418#[derive(Debug, Clone, Serialize, Deserialize)]
419#[serde(untagged)]
420pub enum RunFlowByVersionError {
421    UnknownValue(serde_json::Value),
422}
423
424/// struct for typed errors of method [`run_flow_preview`]
425#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum RunFlowPreviewError {
428    UnknownValue(serde_json::Value),
429}
430
431/// struct for typed errors of method [`run_flow_preview_and_wait_result`]
432#[derive(Debug, Clone, Serialize, Deserialize)]
433#[serde(untagged)]
434pub enum RunFlowPreviewAndWaitResultError {
435    UnknownValue(serde_json::Value),
436}
437
438/// struct for typed errors of method [`run_raw_script_dependencies`]
439#[derive(Debug, Clone, Serialize, Deserialize)]
440#[serde(untagged)]
441pub enum RunRawScriptDependenciesError {
442    UnknownValue(serde_json::Value),
443}
444
445/// struct for typed errors of method [`run_script_by_hash`]
446#[derive(Debug, Clone, Serialize, Deserialize)]
447#[serde(untagged)]
448pub enum RunScriptByHashError {
449    UnknownValue(serde_json::Value),
450}
451
452/// struct for typed errors of method [`run_script_by_path`]
453#[derive(Debug, Clone, Serialize, Deserialize)]
454#[serde(untagged)]
455pub enum RunScriptByPathError {
456    UnknownValue(serde_json::Value),
457}
458
459/// struct for typed errors of method [`run_script_preview`]
460#[derive(Debug, Clone, Serialize, Deserialize)]
461#[serde(untagged)]
462pub enum RunScriptPreviewError {
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`run_script_preview_and_wait_result`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum RunScriptPreviewAndWaitResultError {
470    UnknownValue(serde_json::Value),
471}
472
473/// struct for typed errors of method [`run_wait_result_flow_by_path`]
474#[derive(Debug, Clone, Serialize, Deserialize)]
475#[serde(untagged)]
476pub enum RunWaitResultFlowByPathError {
477    UnknownValue(serde_json::Value),
478}
479
480/// struct for typed errors of method [`run_wait_result_flow_by_version`]
481#[derive(Debug, Clone, Serialize, Deserialize)]
482#[serde(untagged)]
483pub enum RunWaitResultFlowByVersionError {
484    UnknownValue(serde_json::Value),
485}
486
487/// struct for typed errors of method [`run_wait_result_flow_by_version_get`]
488#[derive(Debug, Clone, Serialize, Deserialize)]
489#[serde(untagged)]
490pub enum RunWaitResultFlowByVersionGetError {
491    UnknownValue(serde_json::Value),
492}
493
494/// struct for typed errors of method [`run_wait_result_script_by_path`]
495#[derive(Debug, Clone, Serialize, Deserialize)]
496#[serde(untagged)]
497pub enum RunWaitResultScriptByPathError {
498    UnknownValue(serde_json::Value),
499}
500
501/// struct for typed errors of method [`run_wait_result_script_by_path_get`]
502#[derive(Debug, Clone, Serialize, Deserialize)]
503#[serde(untagged)]
504pub enum RunWaitResultScriptByPathGetError {
505    UnknownValue(serde_json::Value),
506}
507
508/// struct for typed errors of method [`set_flow_user_state`]
509#[derive(Debug, Clone, Serialize, Deserialize)]
510#[serde(untagged)]
511pub enum SetFlowUserStateError {
512    UnknownValue(serde_json::Value),
513}
514
515
516pub async fn batch_re_run_jobs(configuration: &configuration::Configuration, workspace: &str, batch_re_run_jobs_request: models::BatchReRunJobsRequest) -> Result<String, Error<BatchReRunJobsError>> {
517    let local_var_configuration = configuration;
518
519    let local_var_client = &local_var_configuration.client;
520
521    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/batch_rerun_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
522    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
523
524    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
525        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
526    }
527    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
528        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
529    };
530    local_var_req_builder = local_var_req_builder.json(&batch_re_run_jobs_request);
531
532    let local_var_req = local_var_req_builder.build()?;
533    let local_var_resp = local_var_client.execute(local_var_req).await?;
534
535    let local_var_status = local_var_resp.status();
536    let local_var_content = local_var_resp.text().await?;
537
538    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
539        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
540    } else {
541        let local_var_entity: Option<BatchReRunJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
542        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
543        Err(Error::ResponseError(local_var_error))
544    }
545}
546
547pub async fn cancel_persistent_queued_jobs(configuration: &configuration::Configuration, workspace: &str, path: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelPersistentQueuedJobsError>> {
548    let local_var_configuration = configuration;
549
550    let local_var_client = &local_var_configuration.client;
551
552    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/queue/cancel_persistent/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
553    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
554
555    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
556        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
557    }
558    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
559        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
560    };
561    local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
562
563    let local_var_req = local_var_req_builder.build()?;
564    let local_var_resp = local_var_client.execute(local_var_req).await?;
565
566    let local_var_status = local_var_resp.status();
567    let local_var_content = local_var_resp.text().await?;
568
569    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
570        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
571    } else {
572        let local_var_entity: Option<CancelPersistentQueuedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
573        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
574        Err(Error::ResponseError(local_var_error))
575    }
576}
577
578pub async fn cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelQueuedJobError>> {
579    let local_var_configuration = configuration;
580
581    let local_var_client = &local_var_configuration.client;
582
583    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/queue/cancel/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
584    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
585
586    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
587        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
588    }
589    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
590        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
591    };
592    local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
593
594    let local_var_req = local_var_req_builder.build()?;
595    let local_var_resp = local_var_client.execute(local_var_req).await?;
596
597    let local_var_status = local_var_resp.status();
598    let local_var_content = local_var_resp.text().await?;
599
600    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
601        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
602    } else {
603        let local_var_entity: Option<CancelQueuedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
604        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
605        Err(Error::ResponseError(local_var_error))
606    }
607}
608
609pub async fn cancel_selection(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>, force_cancel: Option<bool>) -> Result<Vec<String>, Error<CancelSelectionError>> {
610    let local_var_configuration = configuration;
611
612    let local_var_client = &local_var_configuration.client;
613
614    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/cancel_selection", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
615    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
616
617    if let Some(ref local_var_str) = force_cancel {
618        local_var_req_builder = local_var_req_builder.query(&[("force_cancel", &local_var_str.to_string())]);
619    }
620    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
621        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
622    }
623    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
624        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
625    };
626    local_var_req_builder = local_var_req_builder.json(&request_body);
627
628    let local_var_req = local_var_req_builder.build()?;
629    let local_var_resp = local_var_client.execute(local_var_req).await?;
630
631    let local_var_status = local_var_resp.status();
632    let local_var_content = local_var_resp.text().await?;
633
634    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
635        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
636    } else {
637        let local_var_entity: Option<CancelSelectionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
638        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
639        Err(Error::ResponseError(local_var_error))
640    }
641}
642
643pub async fn cancel_suspended_job_get(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, signature: &str, approver: Option<&str>) -> Result<String, Error<CancelSuspendedJobGetError>> {
644    let local_var_configuration = configuration;
645
646    let local_var_client = &local_var_configuration.client;
647
648    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), resume_id=resume_id, signature=crate::apis::urlencode(signature));
649    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
650
651    if let Some(ref local_var_str) = approver {
652        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
653    }
654    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
655        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
656    }
657    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
658        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
659    };
660
661    let local_var_req = local_var_req_builder.build()?;
662    let local_var_resp = local_var_client.execute(local_var_req).await?;
663
664    let local_var_status = local_var_resp.status();
665    let local_var_content = local_var_resp.text().await?;
666
667    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
668        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
669    } else {
670        let local_var_entity: Option<CancelSuspendedJobGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
671        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
672        Err(Error::ResponseError(local_var_error))
673    }
674}
675
676pub async fn cancel_suspended_job_post(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, signature: &str, body: serde_json::Value, approver: Option<&str>) -> Result<String, Error<CancelSuspendedJobPostError>> {
677    let local_var_configuration = configuration;
678
679    let local_var_client = &local_var_configuration.client;
680
681    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), resume_id=resume_id, signature=crate::apis::urlencode(signature));
682    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
683
684    if let Some(ref local_var_str) = approver {
685        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
686    }
687    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
688        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
689    }
690    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
691        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
692    };
693    local_var_req_builder = local_var_req_builder.json(&body);
694
695    let local_var_req = local_var_req_builder.build()?;
696    let local_var_resp = local_var_client.execute(local_var_req).await?;
697
698    let local_var_status = local_var_resp.status();
699    let local_var_content = local_var_resp.text().await?;
700
701    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
702        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
703    } else {
704        let local_var_entity: Option<CancelSuspendedJobPostError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
705        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
706        Err(Error::ResponseError(local_var_error))
707    }
708}
709
710pub async fn count_completed_jobs(configuration: &configuration::Configuration, workspace: &str, completed_after_s_ago: Option<i32>, success: Option<bool>, tags: Option<&str>, all_workspaces: Option<bool>) -> Result<i32, Error<CountCompletedJobsError>> {
711    let local_var_configuration = configuration;
712
713    let local_var_client = &local_var_configuration.client;
714
715    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
716    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
717
718    if let Some(ref local_var_str) = completed_after_s_ago {
719        local_var_req_builder = local_var_req_builder.query(&[("completed_after_s_ago", &local_var_str.to_string())]);
720    }
721    if let Some(ref local_var_str) = success {
722        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
723    }
724    if let Some(ref local_var_str) = tags {
725        local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]);
726    }
727    if let Some(ref local_var_str) = all_workspaces {
728        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
729    }
730    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
731        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
732    }
733    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
734        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
735    };
736
737    let local_var_req = local_var_req_builder.build()?;
738    let local_var_resp = local_var_client.execute(local_var_req).await?;
739
740    let local_var_status = local_var_resp.status();
741    let local_var_content = local_var_resp.text().await?;
742
743    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
744        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
745    } else {
746        let local_var_entity: Option<CountCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
747        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
748        Err(Error::ResponseError(local_var_error))
749    }
750}
751
752pub async fn count_jobs_by_tag(configuration: &configuration::Configuration, horizon_secs: Option<i32>, workspace_id: Option<&str>) -> Result<Vec<models::CountJobsByTag200ResponseInner>, Error<CountJobsByTagError>> {
753    let local_var_configuration = configuration;
754
755    let local_var_client = &local_var_configuration.client;
756
757    let local_var_uri_str = format!("{}/jobs/completed/count_by_tag", local_var_configuration.base_path);
758    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
759
760    if let Some(ref local_var_str) = horizon_secs {
761        local_var_req_builder = local_var_req_builder.query(&[("horizon_secs", &local_var_str.to_string())]);
762    }
763    if let Some(ref local_var_str) = workspace_id {
764        local_var_req_builder = local_var_req_builder.query(&[("workspace_id", &local_var_str.to_string())]);
765    }
766    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
767        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
768    }
769    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
770        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
771    };
772
773    let local_var_req = local_var_req_builder.build()?;
774    let local_var_resp = local_var_client.execute(local_var_req).await?;
775
776    let local_var_status = local_var_resp.status();
777    let local_var_content = local_var_resp.text().await?;
778
779    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
780        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
781    } else {
782        let local_var_entity: Option<CountJobsByTagError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
783        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
784        Err(Error::ResponseError(local_var_error))
785    }
786}
787
788pub async fn create_job_signature(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, approver: Option<&str>) -> Result<String, Error<CreateJobSignatureError>> {
789    let local_var_configuration = configuration;
790
791    let local_var_client = &local_var_configuration.client;
792
793    let local_var_uri_str = format!("{}/w/{workspace}/jobs/job_signature/{id}/{resume_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), resume_id=resume_id);
794    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
795
796    if let Some(ref local_var_str) = approver {
797        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
798    }
799    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
800        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
801    }
802    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
803        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
804    };
805
806    let local_var_req = local_var_req_builder.build()?;
807    let local_var_resp = local_var_client.execute(local_var_req).await?;
808
809    let local_var_status = local_var_resp.status();
810    let local_var_content = local_var_resp.text().await?;
811
812    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
813        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
814    } else {
815        let local_var_entity: Option<CreateJobSignatureError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
816        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
817        Err(Error::ResponseError(local_var_error))
818    }
819}
820
821pub async fn delete_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<DeleteCompletedJobError>> {
822    let local_var_configuration = configuration;
823
824    let local_var_client = &local_var_configuration.client;
825
826    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/delete/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
827    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
828
829    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
830        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
831    }
832    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
833        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
834    };
835
836    let local_var_req = local_var_req_builder.build()?;
837    let local_var_resp = local_var_client.execute(local_var_req).await?;
838
839    let local_var_status = local_var_resp.status();
840    let local_var_content = local_var_resp.text().await?;
841
842    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
843        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
844    } else {
845        let local_var_entity: Option<DeleteCompletedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
846        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
847        Err(Error::ResponseError(local_var_error))
848    }
849}
850
851pub async fn force_cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<ForceCancelQueuedJobError>> {
852    let local_var_configuration = configuration;
853
854    let local_var_client = &local_var_configuration.client;
855
856    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/queue/force_cancel/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
857    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
858
859    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
860        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
861    }
862    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
863        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
864    };
865    local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
866
867    let local_var_req = local_var_req_builder.build()?;
868    let local_var_resp = local_var_client.execute(local_var_req).await?;
869
870    let local_var_status = local_var_resp.status();
871    let local_var_content = local_var_resp.text().await?;
872
873    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
874        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
875    } else {
876        let local_var_entity: Option<ForceCancelQueuedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
877        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
878        Err(Error::ResponseError(local_var_error))
879    }
880}
881
882pub async fn get_completed_count(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCompletedCount200Response, Error<GetCompletedCountError>> {
883    let local_var_configuration = configuration;
884
885    let local_var_client = &local_var_configuration.client;
886
887    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
888    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
889
890    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
891        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
892    }
893    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
894        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
895    };
896
897    let local_var_req = local_var_req_builder.build()?;
898    let local_var_resp = local_var_client.execute(local_var_req).await?;
899
900    let local_var_status = local_var_resp.status();
901    let local_var_content = local_var_resp.text().await?;
902
903    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
904        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
905    } else {
906        let local_var_entity: Option<GetCompletedCountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
907        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
908        Err(Error::ResponseError(local_var_error))
909    }
910}
911
912pub async fn get_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<GetCompletedJobError>> {
913    let local_var_configuration = configuration;
914
915    let local_var_client = &local_var_configuration.client;
916
917    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/completed/get/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
918    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
919
920    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
921        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
922    }
923    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
924        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
925    };
926
927    let local_var_req = local_var_req_builder.build()?;
928    let local_var_resp = local_var_client.execute(local_var_req).await?;
929
930    let local_var_status = local_var_resp.status();
931    let local_var_content = local_var_resp.text().await?;
932
933    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
934        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
935    } else {
936        let local_var_entity: Option<GetCompletedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
937        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
938        Err(Error::ResponseError(local_var_error))
939    }
940}
941
942pub async fn get_completed_job_logs_tail(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetCompletedJobLogsTailError>> {
943    let local_var_configuration = configuration;
944
945    let local_var_client = &local_var_configuration.client;
946
947    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_completed_logs_tail/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
948    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
949
950    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
951        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
952    }
953    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
954        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
955    };
956
957    let local_var_req = local_var_req_builder.build()?;
958    let local_var_resp = local_var_client.execute(local_var_req).await?;
959
960    let local_var_status = local_var_resp.status();
961    let local_var_content = local_var_resp.text().await?;
962
963    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
964        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
965    } else {
966        let local_var_entity: Option<GetCompletedJobLogsTailError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
967        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
968        Err(Error::ResponseError(local_var_error))
969    }
970}
971
972pub async fn get_completed_job_result(configuration: &configuration::Configuration, workspace: &str, id: &str, suspended_job: Option<&str>, resume_id: Option<i32>, secret: Option<&str>, approver: Option<&str>) -> Result<serde_json::Value, Error<GetCompletedJobResultError>> {
973    let local_var_configuration = configuration;
974
975    let local_var_client = &local_var_configuration.client;
976
977    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/completed/get_result/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
978    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
979
980    if let Some(ref local_var_str) = suspended_job {
981        local_var_req_builder = local_var_req_builder.query(&[("suspended_job", &local_var_str.to_string())]);
982    }
983    if let Some(ref local_var_str) = resume_id {
984        local_var_req_builder = local_var_req_builder.query(&[("resume_id", &local_var_str.to_string())]);
985    }
986    if let Some(ref local_var_str) = secret {
987        local_var_req_builder = local_var_req_builder.query(&[("secret", &local_var_str.to_string())]);
988    }
989    if let Some(ref local_var_str) = approver {
990        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
991    }
992    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
993        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
994    }
995    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
996        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
997    };
998
999    let local_var_req = local_var_req_builder.build()?;
1000    let local_var_resp = local_var_client.execute(local_var_req).await?;
1001
1002    let local_var_status = local_var_resp.status();
1003    let local_var_content = local_var_resp.text().await?;
1004
1005    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1006        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1007    } else {
1008        let local_var_entity: Option<GetCompletedJobResultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1009        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1010        Err(Error::ResponseError(local_var_error))
1011    }
1012}
1013
1014pub async fn get_completed_job_result_maybe(configuration: &configuration::Configuration, workspace: &str, id: &str, get_started: Option<bool>) -> Result<models::GetCompletedJobResultMaybe200Response, Error<GetCompletedJobResultMaybeError>> {
1015    let local_var_configuration = configuration;
1016
1017    let local_var_client = &local_var_configuration.client;
1018
1019    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/completed/get_result_maybe/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1020    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1021
1022    if let Some(ref local_var_str) = get_started {
1023        local_var_req_builder = local_var_req_builder.query(&[("get_started", &local_var_str.to_string())]);
1024    }
1025    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1026        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1027    }
1028    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1029        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1030    };
1031
1032    let local_var_req = local_var_req_builder.build()?;
1033    let local_var_resp = local_var_client.execute(local_var_req).await?;
1034
1035    let local_var_status = local_var_resp.status();
1036    let local_var_content = local_var_resp.text().await?;
1037
1038    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1039        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1040    } else {
1041        let local_var_entity: Option<GetCompletedJobResultMaybeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1042        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1043        Err(Error::ResponseError(local_var_error))
1044    }
1045}
1046
1047pub async fn get_db_clock(configuration: &configuration::Configuration, ) -> Result<i32, Error<GetDbClockError>> {
1048    let local_var_configuration = configuration;
1049
1050    let local_var_client = &local_var_configuration.client;
1051
1052    let local_var_uri_str = format!("{}/jobs/db_clock", local_var_configuration.base_path);
1053    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1054
1055    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1056        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1057    }
1058    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1059        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1060    };
1061
1062    let local_var_req = local_var_req_builder.build()?;
1063    let local_var_resp = local_var_client.execute(local_var_req).await?;
1064
1065    let local_var_status = local_var_resp.status();
1066    let local_var_content = local_var_resp.text().await?;
1067
1068    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1069        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1070    } else {
1071        let local_var_entity: Option<GetDbClockError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1072        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1073        Err(Error::ResponseError(local_var_error))
1074    }
1075}
1076
1077pub async fn get_flow_debug_info(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetFlowDebugInfoError>> {
1078    let local_var_configuration = configuration;
1079
1080    let local_var_client = &local_var_configuration.client;
1081
1082    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_flow_debug_info/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1083    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1084
1085    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1086        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1087    }
1088    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1089        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1090    };
1091
1092    let local_var_req = local_var_req_builder.build()?;
1093    let local_var_resp = local_var_client.execute(local_var_req).await?;
1094
1095    let local_var_status = local_var_resp.status();
1096    let local_var_content = local_var_resp.text().await?;
1097
1098    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1099        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1100    } else {
1101        let local_var_entity: Option<GetFlowDebugInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1102        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1103        Err(Error::ResponseError(local_var_error))
1104    }
1105}
1106
1107pub async fn get_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str) -> Result<serde_json::Value, Error<GetFlowUserStateError>> {
1108    let local_var_configuration = configuration;
1109
1110    let local_var_client = &local_var_configuration.client;
1111
1112    let local_var_uri_str = format!("{}/w/{workspace}/jobs/flow/user_states/{id}/{key}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), key=crate::apis::urlencode(key));
1113    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1114
1115    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1116        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1117    }
1118    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1119        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1120    };
1121
1122    let local_var_req = local_var_req_builder.build()?;
1123    let local_var_resp = local_var_client.execute(local_var_req).await?;
1124
1125    let local_var_status = local_var_resp.status();
1126    let local_var_content = local_var_resp.text().await?;
1127
1128    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1129        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1130    } else {
1131        let local_var_entity: Option<GetFlowUserStateError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1132        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1133        Err(Error::ResponseError(local_var_error))
1134    }
1135}
1136
1137pub async fn get_job(configuration: &configuration::Configuration, workspace: &str, id: &str, no_logs: Option<bool>, no_code: Option<bool>) -> Result<models::Job, Error<GetJobError>> {
1138    let local_var_configuration = configuration;
1139
1140    let local_var_client = &local_var_configuration.client;
1141
1142    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1143    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1144
1145    if let Some(ref local_var_str) = no_logs {
1146        local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1147    }
1148    if let Some(ref local_var_str) = no_code {
1149        local_var_req_builder = local_var_req_builder.query(&[("no_code", &local_var_str.to_string())]);
1150    }
1151    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1152        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1153    }
1154    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1155        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1156    };
1157
1158    let local_var_req = local_var_req_builder.build()?;
1159    let local_var_resp = local_var_client.execute(local_var_req).await?;
1160
1161    let local_var_status = local_var_resp.status();
1162    let local_var_content = local_var_resp.text().await?;
1163
1164    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1165        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1166    } else {
1167        let local_var_entity: Option<GetJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1168        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1169        Err(Error::ResponseError(local_var_error))
1170    }
1171}
1172
1173pub async fn get_job_args(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetJobArgsError>> {
1174    let local_var_configuration = configuration;
1175
1176    let local_var_client = &local_var_configuration.client;
1177
1178    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_args/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1179    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1180
1181    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1182        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1183    }
1184    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1185        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1186    };
1187
1188    let local_var_req = local_var_req_builder.build()?;
1189    let local_var_resp = local_var_client.execute(local_var_req).await?;
1190
1191    let local_var_status = local_var_resp.status();
1192    let local_var_content = local_var_resp.text().await?;
1193
1194    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1195        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1196    } else {
1197        let local_var_entity: Option<GetJobArgsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1198        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1199        Err(Error::ResponseError(local_var_error))
1200    }
1201}
1202
1203pub async fn get_job_logs(configuration: &configuration::Configuration, workspace: &str, id: &str, remove_ansi_warnings: Option<bool>) -> Result<String, Error<GetJobLogsError>> {
1204    let local_var_configuration = configuration;
1205
1206    let local_var_client = &local_var_configuration.client;
1207
1208    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_logs/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1209    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1210
1211    if let Some(ref local_var_str) = remove_ansi_warnings {
1212        local_var_req_builder = local_var_req_builder.query(&[("remove_ansi_warnings", &local_var_str.to_string())]);
1213    }
1214    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1215        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1216    }
1217    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1218        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1219    };
1220
1221    let local_var_req = local_var_req_builder.build()?;
1222    let local_var_resp = local_var_client.execute(local_var_req).await?;
1223
1224    let local_var_status = local_var_resp.status();
1225    let local_var_content = local_var_resp.text().await?;
1226
1227    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1228        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1229    } else {
1230        let local_var_entity: Option<GetJobLogsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1231        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1232        Err(Error::ResponseError(local_var_error))
1233    }
1234}
1235
1236pub async fn get_job_updates(configuration: &configuration::Configuration, workspace: &str, id: &str, running: Option<bool>, log_offset: Option<i32>, stream_offset: Option<i32>, get_progress: Option<bool>, no_logs: Option<bool>) -> Result<models::GetJobUpdates200Response, Error<GetJobUpdatesError>> {
1237    let local_var_configuration = configuration;
1238
1239    let local_var_client = &local_var_configuration.client;
1240
1241    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/getupdate/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1242    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1243
1244    if let Some(ref local_var_str) = running {
1245        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1246    }
1247    if let Some(ref local_var_str) = log_offset {
1248        local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1249    }
1250    if let Some(ref local_var_str) = stream_offset {
1251        local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1252    }
1253    if let Some(ref local_var_str) = get_progress {
1254        local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
1255    }
1256    if let Some(ref local_var_str) = no_logs {
1257        local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1258    }
1259    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1260        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1261    }
1262    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1263        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1264    };
1265
1266    let local_var_req = local_var_req_builder.build()?;
1267    let local_var_resp = local_var_client.execute(local_var_req).await?;
1268
1269    let local_var_status = local_var_resp.status();
1270    let local_var_content = local_var_resp.text().await?;
1271
1272    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1273        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1274    } else {
1275        let local_var_entity: Option<GetJobUpdatesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1276        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1277        Err(Error::ResponseError(local_var_error))
1278    }
1279}
1280
1281pub async fn get_job_updates_sse(configuration: &configuration::Configuration, workspace: &str, id: &str, running: Option<bool>, log_offset: Option<i32>, stream_offset: Option<i32>, get_progress: Option<bool>, only_result: Option<bool>, no_logs: Option<bool>) -> Result<String, Error<GetJobUpdatesSseError>> {
1282    let local_var_configuration = configuration;
1283
1284    let local_var_client = &local_var_configuration.client;
1285
1286    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/getupdate_sse/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1287    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1288
1289    if let Some(ref local_var_str) = running {
1290        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1291    }
1292    if let Some(ref local_var_str) = log_offset {
1293        local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1294    }
1295    if let Some(ref local_var_str) = stream_offset {
1296        local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1297    }
1298    if let Some(ref local_var_str) = get_progress {
1299        local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
1300    }
1301    if let Some(ref local_var_str) = only_result {
1302        local_var_req_builder = local_var_req_builder.query(&[("only_result", &local_var_str.to_string())]);
1303    }
1304    if let Some(ref local_var_str) = no_logs {
1305        local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1306    }
1307    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1308        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1309    }
1310    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1311        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1312    };
1313
1314    let local_var_req = local_var_req_builder.build()?;
1315    let local_var_resp = local_var_client.execute(local_var_req).await?;
1316
1317    let local_var_status = local_var_resp.status();
1318    let local_var_content = local_var_resp.text().await?;
1319
1320    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1321        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1322    } else {
1323        let local_var_entity: Option<GetJobUpdatesSseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1324        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1325        Err(Error::ResponseError(local_var_error))
1326    }
1327}
1328
1329pub async fn get_log_file_from_store(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetLogFileFromStoreError>> {
1330    let local_var_configuration = configuration;
1331
1332    let local_var_client = &local_var_configuration.client;
1333
1334    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_log_file/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
1335    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1336
1337    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1338        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1339    }
1340    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1341        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1342    };
1343
1344    let local_var_req = local_var_req_builder.build()?;
1345    let local_var_resp = local_var_client.execute(local_var_req).await?;
1346
1347    let local_var_status = local_var_resp.status();
1348    let local_var_content = local_var_resp.text().await?;
1349
1350    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1351        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1352    } else {
1353        let local_var_entity: Option<GetLogFileFromStoreError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1354        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1355        Err(Error::ResponseError(local_var_error))
1356    }
1357}
1358
1359pub async fn get_queue_count(configuration: &configuration::Configuration, workspace: &str, all_workspaces: Option<bool>) -> Result<models::GetQueueCount200Response, Error<GetQueueCountError>> {
1360    let local_var_configuration = configuration;
1361
1362    let local_var_client = &local_var_configuration.client;
1363
1364    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1365    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1366
1367    if let Some(ref local_var_str) = all_workspaces {
1368        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1369    }
1370    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1371        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1372    }
1373    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1374        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1375    };
1376
1377    let local_var_req = local_var_req_builder.build()?;
1378    let local_var_resp = local_var_client.execute(local_var_req).await?;
1379
1380    let local_var_status = local_var_resp.status();
1381    let local_var_content = local_var_resp.text().await?;
1382
1383    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1384        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1385    } else {
1386        let local_var_entity: Option<GetQueueCountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1387        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1388        Err(Error::ResponseError(local_var_error))
1389    }
1390}
1391
1392pub async fn get_queue_position(configuration: &configuration::Configuration, workspace: &str, scheduled_for: i32) -> Result<models::GetQueuePosition200Response, Error<GetQueuePositionError>> {
1393    let local_var_configuration = configuration;
1394
1395    let local_var_client = &local_var_configuration.client;
1396
1397    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/position/{scheduled_for}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), scheduled_for=scheduled_for);
1398    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1399
1400    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1401        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1402    }
1403    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1404        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1405    };
1406
1407    let local_var_req = local_var_req_builder.build()?;
1408    let local_var_resp = local_var_client.execute(local_var_req).await?;
1409
1410    let local_var_status = local_var_resp.status();
1411    let local_var_content = local_var_resp.text().await?;
1412
1413    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1414        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1415    } else {
1416        let local_var_entity: Option<GetQueuePositionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1417        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1418        Err(Error::ResponseError(local_var_error))
1419    }
1420}
1421
1422pub async fn get_resume_urls(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, approver: Option<&str>) -> Result<models::GetResumeUrls200Response, Error<GetResumeUrlsError>> {
1423    let local_var_configuration = configuration;
1424
1425    let local_var_client = &local_var_configuration.client;
1426
1427    let local_var_uri_str = format!("{}/w/{workspace}/jobs/resume_urls/{id}/{resume_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), resume_id=resume_id);
1428    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1429
1430    if let Some(ref local_var_str) = approver {
1431        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1432    }
1433    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1434        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1435    }
1436    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1437        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1438    };
1439
1440    let local_var_req = local_var_req_builder.build()?;
1441    let local_var_resp = local_var_client.execute(local_var_req).await?;
1442
1443    let local_var_status = local_var_resp.status();
1444    let local_var_content = local_var_resp.text().await?;
1445
1446    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1447        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1448    } else {
1449        let local_var_entity: Option<GetResumeUrlsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1450        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1451        Err(Error::ResponseError(local_var_error))
1452    }
1453}
1454
1455pub async fn get_root_job_id(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetRootJobIdError>> {
1456    let local_var_configuration = configuration;
1457
1458    let local_var_client = &local_var_configuration.client;
1459
1460    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_root_job_id/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1461    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1462
1463    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1464        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1465    }
1466    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1467        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1468    };
1469
1470    let local_var_req = local_var_req_builder.build()?;
1471    let local_var_resp = local_var_client.execute(local_var_req).await?;
1472
1473    let local_var_status = local_var_resp.status();
1474    let local_var_content = local_var_resp.text().await?;
1475
1476    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1477        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1478    } else {
1479        let local_var_entity: Option<GetRootJobIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1480        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1481        Err(Error::ResponseError(local_var_error))
1482    }
1483}
1484
1485pub async fn get_scheduled_for(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<i32, Error<GetScheduledForError>> {
1486    let local_var_configuration = configuration;
1487
1488    let local_var_client = &local_var_configuration.client;
1489
1490    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/scheduled_for/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1491    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1492
1493    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1494        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1495    }
1496    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1497        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1498    };
1499
1500    let local_var_req = local_var_req_builder.build()?;
1501    let local_var_resp = local_var_client.execute(local_var_req).await?;
1502
1503    let local_var_status = local_var_resp.status();
1504    let local_var_content = local_var_resp.text().await?;
1505
1506    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1507        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1508    } else {
1509        let local_var_entity: Option<GetScheduledForError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1510        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1511        Err(Error::ResponseError(local_var_error))
1512    }
1513}
1514
1515pub async fn get_slack_approval_payload(configuration: &configuration::Configuration, workspace: &str, id: &str, slack_resource_path: &str, channel_id: &str, flow_step_id: &str, approver: Option<&str>, message: Option<&str>, default_args_json: Option<&str>, dynamic_enums_json: Option<&str>) -> Result<(), Error<GetSlackApprovalPayloadError>> {
1516    let local_var_configuration = configuration;
1517
1518    let local_var_client = &local_var_configuration.client;
1519
1520    let local_var_uri_str = format!("{}/w/{workspace}/jobs/slack_approval/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1521    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1522
1523    if let Some(ref local_var_str) = approver {
1524        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1525    }
1526    if let Some(ref local_var_str) = message {
1527        local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
1528    }
1529    local_var_req_builder = local_var_req_builder.query(&[("slack_resource_path", &slack_resource_path.to_string())]);
1530    local_var_req_builder = local_var_req_builder.query(&[("channel_id", &channel_id.to_string())]);
1531    local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
1532    if let Some(ref local_var_str) = default_args_json {
1533        local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
1534    }
1535    if let Some(ref local_var_str) = dynamic_enums_json {
1536        local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
1537    }
1538    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1539        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1540    }
1541    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1542        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1543    };
1544
1545    let local_var_req = local_var_req_builder.build()?;
1546    let local_var_resp = local_var_client.execute(local_var_req).await?;
1547
1548    let local_var_status = local_var_resp.status();
1549    let local_var_content = local_var_resp.text().await?;
1550
1551    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1552        Ok(())
1553    } else {
1554        let local_var_entity: Option<GetSlackApprovalPayloadError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1555        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1556        Err(Error::ResponseError(local_var_error))
1557    }
1558}
1559
1560pub async fn get_started_at_by_ids(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<String>, Error<GetStartedAtByIdsError>> {
1561    let local_var_configuration = configuration;
1562
1563    let local_var_client = &local_var_configuration.client;
1564
1565    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/queue/get_started_at_by_ids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1566    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1567
1568    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1569        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1570    }
1571    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1572        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1573    };
1574    local_var_req_builder = local_var_req_builder.json(&request_body);
1575
1576    let local_var_req = local_var_req_builder.build()?;
1577    let local_var_resp = local_var_client.execute(local_var_req).await?;
1578
1579    let local_var_status = local_var_resp.status();
1580    let local_var_content = local_var_resp.text().await?;
1581
1582    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1583        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1584    } else {
1585        let local_var_entity: Option<GetStartedAtByIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1586        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1587        Err(Error::ResponseError(local_var_error))
1588    }
1589}
1590
1591pub async fn get_suspended_job_flow(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, signature: &str, approver: Option<&str>) -> Result<models::GetSuspendedJobFlow200Response, Error<GetSuspendedJobFlowError>> {
1592    let local_var_configuration = configuration;
1593
1594    let local_var_client = &local_var_configuration.client;
1595
1596    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_flow/{id}/{resume_id}/{signature}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), resume_id=resume_id, signature=crate::apis::urlencode(signature));
1597    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1598
1599    if let Some(ref local_var_str) = approver {
1600        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1601    }
1602    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1603        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1604    }
1605    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1606        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1607    };
1608
1609    let local_var_req = local_var_req_builder.build()?;
1610    let local_var_resp = local_var_client.execute(local_var_req).await?;
1611
1612    let local_var_status = local_var_resp.status();
1613    let local_var_content = local_var_resp.text().await?;
1614
1615    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1616        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1617    } else {
1618        let local_var_entity: Option<GetSuspendedJobFlowError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1619        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1620        Err(Error::ResponseError(local_var_error))
1621    }
1622}
1623
1624pub async fn get_teams_approval_payload(configuration: &configuration::Configuration, workspace: &str, id: &str, team_name: &str, channel_name: &str, flow_step_id: &str, approver: Option<&str>, message: Option<&str>, default_args_json: Option<&str>, dynamic_enums_json: Option<&str>) -> Result<(), Error<GetTeamsApprovalPayloadError>> {
1625    let local_var_configuration = configuration;
1626
1627    let local_var_client = &local_var_configuration.client;
1628
1629    let local_var_uri_str = format!("{}/w/{workspace}/jobs/teams_approval/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1630    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1631
1632    if let Some(ref local_var_str) = approver {
1633        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1634    }
1635    if let Some(ref local_var_str) = message {
1636        local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
1637    }
1638    local_var_req_builder = local_var_req_builder.query(&[("team_name", &team_name.to_string())]);
1639    local_var_req_builder = local_var_req_builder.query(&[("channel_name", &channel_name.to_string())]);
1640    local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
1641    if let Some(ref local_var_str) = default_args_json {
1642        local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
1643    }
1644    if let Some(ref local_var_str) = dynamic_enums_json {
1645        local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
1646    }
1647    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1648        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1649    }
1650    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1651        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1652    };
1653
1654    let local_var_req = local_var_req_builder.build()?;
1655    let local_var_resp = local_var_client.execute(local_var_req).await?;
1656
1657    let local_var_status = local_var_resp.status();
1658    let local_var_content = local_var_resp.text().await?;
1659
1660    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1661        Ok(())
1662    } else {
1663        let local_var_entity: Option<GetTeamsApprovalPayloadError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1664        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1665        Err(Error::ResponseError(local_var_error))
1666    }
1667}
1668
1669pub async fn list_completed_jobs(configuration: &configuration::Configuration, workspace: &str, order_desc: Option<bool>, created_by: Option<&str>, label: Option<&str>, worker: Option<&str>, parent_job: Option<&str>, script_path_exact: Option<&str>, script_path_start: Option<&str>, schedule_path: Option<&str>, script_hash: Option<&str>, started_before: Option<String>, started_after: Option<String>, success: Option<bool>, job_kinds: Option<&str>, args: Option<&str>, result: Option<&str>, allow_wildcards: Option<bool>, tag: Option<&str>, page: Option<i32>, per_page: Option<i32>, is_skipped: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<models::CompletedJob>, Error<ListCompletedJobsError>> {
1670    let local_var_configuration = configuration;
1671
1672    let local_var_client = &local_var_configuration.client;
1673
1674    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1675    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1676
1677    if let Some(ref local_var_str) = order_desc {
1678        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
1679    }
1680    if let Some(ref local_var_str) = created_by {
1681        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1682    }
1683    if let Some(ref local_var_str) = label {
1684        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1685    }
1686    if let Some(ref local_var_str) = worker {
1687        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
1688    }
1689    if let Some(ref local_var_str) = parent_job {
1690        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1691    }
1692    if let Some(ref local_var_str) = script_path_exact {
1693        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1694    }
1695    if let Some(ref local_var_str) = script_path_start {
1696        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1697    }
1698    if let Some(ref local_var_str) = schedule_path {
1699        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1700    }
1701    if let Some(ref local_var_str) = script_hash {
1702        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1703    }
1704    if let Some(ref local_var_str) = started_before {
1705        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1706    }
1707    if let Some(ref local_var_str) = started_after {
1708        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1709    }
1710    if let Some(ref local_var_str) = success {
1711        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1712    }
1713    if let Some(ref local_var_str) = job_kinds {
1714        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1715    }
1716    if let Some(ref local_var_str) = args {
1717        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1718    }
1719    if let Some(ref local_var_str) = result {
1720        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1721    }
1722    if let Some(ref local_var_str) = allow_wildcards {
1723        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
1724    }
1725    if let Some(ref local_var_str) = tag {
1726        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1727    }
1728    if let Some(ref local_var_str) = page {
1729        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1730    }
1731    if let Some(ref local_var_str) = per_page {
1732        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1733    }
1734    if let Some(ref local_var_str) = is_skipped {
1735        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
1736    }
1737    if let Some(ref local_var_str) = is_flow_step {
1738        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
1739    }
1740    if let Some(ref local_var_str) = has_null_parent {
1741        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
1742    }
1743    if let Some(ref local_var_str) = is_not_schedule {
1744        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1745    }
1746    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1747        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1748    }
1749    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1750        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1751    };
1752
1753    let local_var_req = local_var_req_builder.build()?;
1754    let local_var_resp = local_var_client.execute(local_var_req).await?;
1755
1756    let local_var_status = local_var_resp.status();
1757    let local_var_content = local_var_resp.text().await?;
1758
1759    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1760        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1761    } else {
1762        let local_var_entity: Option<ListCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1763        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1764        Err(Error::ResponseError(local_var_error))
1765    }
1766}
1767
1768pub async fn list_extended_jobs(configuration: &configuration::Configuration, workspace: &str, concurrency_key: Option<&str>, row_limit: Option<f64>, created_by: Option<&str>, label: Option<&str>, parent_job: Option<&str>, script_path_exact: Option<&str>, script_path_start: Option<&str>, schedule_path: Option<&str>, script_hash: Option<&str>, started_before: Option<String>, started_after: Option<String>, running: Option<bool>, scheduled_for_before_now: Option<bool>, completed_before: Option<String>, completed_after: Option<String>, created_before_queue: Option<String>, created_after_queue: Option<String>, job_kinds: Option<&str>, args: Option<&str>, tag: Option<&str>, result: Option<&str>, allow_wildcards: Option<bool>, page: Option<i32>, per_page: Option<i32>, trigger_kind: Option<&str>, is_skipped: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<models::ExtendedJobs, Error<ListExtendedJobsError>> {
1769    let local_var_configuration = configuration;
1770
1771    let local_var_client = &local_var_configuration.client;
1772
1773    let local_var_uri_str = format!("{}/w/{workspace}/concurrency_groups/list_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1774    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1775
1776    if let Some(ref local_var_str) = concurrency_key {
1777        local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
1778    }
1779    if let Some(ref local_var_str) = row_limit {
1780        local_var_req_builder = local_var_req_builder.query(&[("row_limit", &local_var_str.to_string())]);
1781    }
1782    if let Some(ref local_var_str) = created_by {
1783        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1784    }
1785    if let Some(ref local_var_str) = label {
1786        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1787    }
1788    if let Some(ref local_var_str) = parent_job {
1789        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1790    }
1791    if let Some(ref local_var_str) = script_path_exact {
1792        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1793    }
1794    if let Some(ref local_var_str) = script_path_start {
1795        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1796    }
1797    if let Some(ref local_var_str) = schedule_path {
1798        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1799    }
1800    if let Some(ref local_var_str) = script_hash {
1801        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1802    }
1803    if let Some(ref local_var_str) = started_before {
1804        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1805    }
1806    if let Some(ref local_var_str) = started_after {
1807        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1808    }
1809    if let Some(ref local_var_str) = running {
1810        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1811    }
1812    if let Some(ref local_var_str) = scheduled_for_before_now {
1813        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
1814    }
1815    if let Some(ref local_var_str) = completed_before {
1816        local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
1817    }
1818    if let Some(ref local_var_str) = completed_after {
1819        local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
1820    }
1821    if let Some(ref local_var_str) = created_before_queue {
1822        local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
1823    }
1824    if let Some(ref local_var_str) = created_after_queue {
1825        local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
1826    }
1827    if let Some(ref local_var_str) = job_kinds {
1828        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1829    }
1830    if let Some(ref local_var_str) = args {
1831        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1832    }
1833    if let Some(ref local_var_str) = tag {
1834        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1835    }
1836    if let Some(ref local_var_str) = result {
1837        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1838    }
1839    if let Some(ref local_var_str) = allow_wildcards {
1840        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
1841    }
1842    if let Some(ref local_var_str) = page {
1843        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1844    }
1845    if let Some(ref local_var_str) = per_page {
1846        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1847    }
1848    if let Some(ref local_var_str) = trigger_kind {
1849        local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
1850    }
1851    if let Some(ref local_var_str) = is_skipped {
1852        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
1853    }
1854    if let Some(ref local_var_str) = is_flow_step {
1855        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
1856    }
1857    if let Some(ref local_var_str) = has_null_parent {
1858        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
1859    }
1860    if let Some(ref local_var_str) = success {
1861        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1862    }
1863    if let Some(ref local_var_str) = all_workspaces {
1864        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1865    }
1866    if let Some(ref local_var_str) = is_not_schedule {
1867        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1868    }
1869    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1870        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1871    }
1872    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1873        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1874    };
1875
1876    let local_var_req = local_var_req_builder.build()?;
1877    let local_var_resp = local_var_client.execute(local_var_req).await?;
1878
1879    let local_var_status = local_var_resp.status();
1880    let local_var_content = local_var_resp.text().await?;
1881
1882    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1883        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1884    } else {
1885        let local_var_entity: Option<ListExtendedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1886        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1887        Err(Error::ResponseError(local_var_error))
1888    }
1889}
1890
1891pub async fn list_filtered_jobs_uuids(configuration: &configuration::Configuration, workspace: &str, created_by: Option<&str>, label: Option<&str>, worker: Option<&str>, parent_job: Option<&str>, script_path_exact: Option<&str>, script_path_start: Option<&str>, schedule_path: Option<&str>, script_hash: Option<&str>, started_before: Option<String>, started_after: Option<String>, created_before: Option<String>, created_after: Option<String>, completed_before: Option<String>, completed_after: Option<String>, created_before_queue: Option<String>, created_after_queue: Option<String>, running: Option<bool>, scheduled_for_before_now: Option<bool>, job_kinds: Option<&str>, suspended: Option<bool>, args: Option<&str>, tag: Option<&str>, result: Option<&str>, page: Option<i32>, per_page: Option<i32>, is_skipped: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<String>, Error<ListFilteredJobsUuidsError>> {
1892    let local_var_configuration = configuration;
1893
1894    let local_var_client = &local_var_configuration.client;
1895
1896    let local_var_uri_str = format!("{}/w/{workspace}/jobs/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1897    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1898
1899    if let Some(ref local_var_str) = created_by {
1900        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1901    }
1902    if let Some(ref local_var_str) = label {
1903        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1904    }
1905    if let Some(ref local_var_str) = worker {
1906        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
1907    }
1908    if let Some(ref local_var_str) = parent_job {
1909        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1910    }
1911    if let Some(ref local_var_str) = script_path_exact {
1912        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1913    }
1914    if let Some(ref local_var_str) = script_path_start {
1915        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1916    }
1917    if let Some(ref local_var_str) = schedule_path {
1918        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1919    }
1920    if let Some(ref local_var_str) = script_hash {
1921        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1922    }
1923    if let Some(ref local_var_str) = started_before {
1924        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1925    }
1926    if let Some(ref local_var_str) = started_after {
1927        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1928    }
1929    if let Some(ref local_var_str) = created_before {
1930        local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
1931    }
1932    if let Some(ref local_var_str) = created_after {
1933        local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
1934    }
1935    if let Some(ref local_var_str) = completed_before {
1936        local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
1937    }
1938    if let Some(ref local_var_str) = completed_after {
1939        local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
1940    }
1941    if let Some(ref local_var_str) = created_before_queue {
1942        local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
1943    }
1944    if let Some(ref local_var_str) = created_after_queue {
1945        local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
1946    }
1947    if let Some(ref local_var_str) = running {
1948        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1949    }
1950    if let Some(ref local_var_str) = scheduled_for_before_now {
1951        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
1952    }
1953    if let Some(ref local_var_str) = job_kinds {
1954        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1955    }
1956    if let Some(ref local_var_str) = suspended {
1957        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
1958    }
1959    if let Some(ref local_var_str) = args {
1960        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1961    }
1962    if let Some(ref local_var_str) = tag {
1963        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1964    }
1965    if let Some(ref local_var_str) = result {
1966        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1967    }
1968    if let Some(ref local_var_str) = page {
1969        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1970    }
1971    if let Some(ref local_var_str) = per_page {
1972        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1973    }
1974    if let Some(ref local_var_str) = is_skipped {
1975        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
1976    }
1977    if let Some(ref local_var_str) = is_flow_step {
1978        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
1979    }
1980    if let Some(ref local_var_str) = has_null_parent {
1981        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
1982    }
1983    if let Some(ref local_var_str) = success {
1984        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1985    }
1986    if let Some(ref local_var_str) = all_workspaces {
1987        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1988    }
1989    if let Some(ref local_var_str) = is_not_schedule {
1990        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1991    }
1992    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1993        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1994    }
1995    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1996        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1997    };
1998
1999    let local_var_req = local_var_req_builder.build()?;
2000    let local_var_resp = local_var_client.execute(local_var_req).await?;
2001
2002    let local_var_status = local_var_resp.status();
2003    let local_var_content = local_var_resp.text().await?;
2004
2005    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2006        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2007    } else {
2008        let local_var_entity: Option<ListFilteredJobsUuidsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2009        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2010        Err(Error::ResponseError(local_var_error))
2011    }
2012}
2013
2014pub async fn list_filtered_queue_uuids(configuration: &configuration::Configuration, workspace: &str, order_desc: Option<bool>, created_by: Option<&str>, parent_job: Option<&str>, script_path_exact: Option<&str>, script_path_start: Option<&str>, schedule_path: Option<&str>, script_hash: Option<&str>, started_before: Option<String>, started_after: Option<String>, success: Option<bool>, scheduled_for_before_now: Option<bool>, job_kinds: Option<&str>, suspended: Option<bool>, running: Option<bool>, args: Option<&str>, result: Option<&str>, allow_wildcards: Option<bool>, tag: Option<&str>, page: Option<i32>, per_page: Option<i32>, concurrency_key: Option<&str>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<String>, Error<ListFilteredQueueUuidsError>> {
2015    let local_var_configuration = configuration;
2016
2017    let local_var_client = &local_var_configuration.client;
2018
2019    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2020    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2021
2022    if let Some(ref local_var_str) = order_desc {
2023        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
2024    }
2025    if let Some(ref local_var_str) = created_by {
2026        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2027    }
2028    if let Some(ref local_var_str) = parent_job {
2029        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2030    }
2031    if let Some(ref local_var_str) = script_path_exact {
2032        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2033    }
2034    if let Some(ref local_var_str) = script_path_start {
2035        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2036    }
2037    if let Some(ref local_var_str) = schedule_path {
2038        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2039    }
2040    if let Some(ref local_var_str) = script_hash {
2041        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2042    }
2043    if let Some(ref local_var_str) = started_before {
2044        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2045    }
2046    if let Some(ref local_var_str) = started_after {
2047        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2048    }
2049    if let Some(ref local_var_str) = success {
2050        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2051    }
2052    if let Some(ref local_var_str) = scheduled_for_before_now {
2053        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2054    }
2055    if let Some(ref local_var_str) = job_kinds {
2056        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2057    }
2058    if let Some(ref local_var_str) = suspended {
2059        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2060    }
2061    if let Some(ref local_var_str) = running {
2062        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2063    }
2064    if let Some(ref local_var_str) = args {
2065        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2066    }
2067    if let Some(ref local_var_str) = result {
2068        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2069    }
2070    if let Some(ref local_var_str) = allow_wildcards {
2071        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2072    }
2073    if let Some(ref local_var_str) = tag {
2074        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2075    }
2076    if let Some(ref local_var_str) = page {
2077        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2078    }
2079    if let Some(ref local_var_str) = per_page {
2080        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2081    }
2082    if let Some(ref local_var_str) = concurrency_key {
2083        local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
2084    }
2085    if let Some(ref local_var_str) = all_workspaces {
2086        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2087    }
2088    if let Some(ref local_var_str) = is_not_schedule {
2089        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2090    }
2091    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2092        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2093    }
2094    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2095        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2096    };
2097
2098    let local_var_req = local_var_req_builder.build()?;
2099    let local_var_resp = local_var_client.execute(local_var_req).await?;
2100
2101    let local_var_status = local_var_resp.status();
2102    let local_var_content = local_var_resp.text().await?;
2103
2104    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2105        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2106    } else {
2107        let local_var_entity: Option<ListFilteredQueueUuidsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2108        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2109        Err(Error::ResponseError(local_var_error))
2110    }
2111}
2112
2113pub async fn list_jobs(configuration: &configuration::Configuration, workspace: &str, created_by: Option<&str>, label: Option<&str>, worker: Option<&str>, parent_job: Option<&str>, script_path_exact: Option<&str>, script_path_start: Option<&str>, schedule_path: Option<&str>, script_hash: Option<&str>, started_before: Option<String>, started_after: Option<String>, created_before: Option<String>, created_after: Option<String>, completed_before: Option<String>, completed_after: Option<String>, created_before_queue: Option<String>, created_after_queue: Option<String>, running: Option<bool>, scheduled_for_before_now: Option<bool>, job_kinds: Option<&str>, suspended: Option<bool>, args: Option<&str>, tag: Option<&str>, result: Option<&str>, allow_wildcards: Option<bool>, per_page: Option<i32>, trigger_kind: Option<&str>, is_skipped: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<models::Job>, Error<ListJobsError>> {
2114    let local_var_configuration = configuration;
2115
2116    let local_var_client = &local_var_configuration.client;
2117
2118    let local_var_uri_str = format!("{}/w/{workspace}/jobs/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2119    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2120
2121    if let Some(ref local_var_str) = created_by {
2122        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2123    }
2124    if let Some(ref local_var_str) = label {
2125        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
2126    }
2127    if let Some(ref local_var_str) = worker {
2128        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2129    }
2130    if let Some(ref local_var_str) = parent_job {
2131        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2132    }
2133    if let Some(ref local_var_str) = script_path_exact {
2134        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2135    }
2136    if let Some(ref local_var_str) = script_path_start {
2137        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2138    }
2139    if let Some(ref local_var_str) = schedule_path {
2140        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2141    }
2142    if let Some(ref local_var_str) = script_hash {
2143        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2144    }
2145    if let Some(ref local_var_str) = started_before {
2146        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2147    }
2148    if let Some(ref local_var_str) = started_after {
2149        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2150    }
2151    if let Some(ref local_var_str) = created_before {
2152        local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
2153    }
2154    if let Some(ref local_var_str) = created_after {
2155        local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
2156    }
2157    if let Some(ref local_var_str) = completed_before {
2158        local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
2159    }
2160    if let Some(ref local_var_str) = completed_after {
2161        local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
2162    }
2163    if let Some(ref local_var_str) = created_before_queue {
2164        local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
2165    }
2166    if let Some(ref local_var_str) = created_after_queue {
2167        local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
2168    }
2169    if let Some(ref local_var_str) = running {
2170        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2171    }
2172    if let Some(ref local_var_str) = scheduled_for_before_now {
2173        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2174    }
2175    if let Some(ref local_var_str) = job_kinds {
2176        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2177    }
2178    if let Some(ref local_var_str) = suspended {
2179        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2180    }
2181    if let Some(ref local_var_str) = args {
2182        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2183    }
2184    if let Some(ref local_var_str) = tag {
2185        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2186    }
2187    if let Some(ref local_var_str) = result {
2188        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2189    }
2190    if let Some(ref local_var_str) = allow_wildcards {
2191        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2192    }
2193    if let Some(ref local_var_str) = per_page {
2194        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2195    }
2196    if let Some(ref local_var_str) = trigger_kind {
2197        local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
2198    }
2199    if let Some(ref local_var_str) = is_skipped {
2200        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2201    }
2202    if let Some(ref local_var_str) = is_flow_step {
2203        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2204    }
2205    if let Some(ref local_var_str) = has_null_parent {
2206        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2207    }
2208    if let Some(ref local_var_str) = success {
2209        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2210    }
2211    if let Some(ref local_var_str) = all_workspaces {
2212        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2213    }
2214    if let Some(ref local_var_str) = is_not_schedule {
2215        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2216    }
2217    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2218        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2219    }
2220    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2221        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2222    };
2223
2224    let local_var_req = local_var_req_builder.build()?;
2225    let local_var_resp = local_var_client.execute(local_var_req).await?;
2226
2227    let local_var_status = local_var_resp.status();
2228    let local_var_content = local_var_resp.text().await?;
2229
2230    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2231        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2232    } else {
2233        let local_var_entity: Option<ListJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2234        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2235        Err(Error::ResponseError(local_var_error))
2236    }
2237}
2238
2239pub async fn list_queue(configuration: &configuration::Configuration, workspace: &str, order_desc: Option<bool>, created_by: Option<&str>, parent_job: Option<&str>, worker: Option<&str>, script_path_exact: Option<&str>, script_path_start: Option<&str>, schedule_path: Option<&str>, script_hash: Option<&str>, started_before: Option<String>, started_after: Option<String>, success: Option<bool>, scheduled_for_before_now: Option<bool>, job_kinds: Option<&str>, suspended: Option<bool>, running: Option<bool>, args: Option<&str>, result: Option<&str>, allow_wildcards: Option<bool>, tag: Option<&str>, page: Option<i32>, per_page: Option<i32>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<models::QueuedJob>, Error<ListQueueError>> {
2240    let local_var_configuration = configuration;
2241
2242    let local_var_client = &local_var_configuration.client;
2243
2244    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2245    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2246
2247    if let Some(ref local_var_str) = order_desc {
2248        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
2249    }
2250    if let Some(ref local_var_str) = created_by {
2251        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2252    }
2253    if let Some(ref local_var_str) = parent_job {
2254        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2255    }
2256    if let Some(ref local_var_str) = worker {
2257        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2258    }
2259    if let Some(ref local_var_str) = script_path_exact {
2260        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2261    }
2262    if let Some(ref local_var_str) = script_path_start {
2263        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2264    }
2265    if let Some(ref local_var_str) = schedule_path {
2266        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2267    }
2268    if let Some(ref local_var_str) = script_hash {
2269        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2270    }
2271    if let Some(ref local_var_str) = started_before {
2272        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2273    }
2274    if let Some(ref local_var_str) = started_after {
2275        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2276    }
2277    if let Some(ref local_var_str) = success {
2278        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2279    }
2280    if let Some(ref local_var_str) = scheduled_for_before_now {
2281        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2282    }
2283    if let Some(ref local_var_str) = job_kinds {
2284        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2285    }
2286    if let Some(ref local_var_str) = suspended {
2287        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2288    }
2289    if let Some(ref local_var_str) = running {
2290        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2291    }
2292    if let Some(ref local_var_str) = args {
2293        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2294    }
2295    if let Some(ref local_var_str) = result {
2296        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2297    }
2298    if let Some(ref local_var_str) = allow_wildcards {
2299        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2300    }
2301    if let Some(ref local_var_str) = tag {
2302        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2303    }
2304    if let Some(ref local_var_str) = page {
2305        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2306    }
2307    if let Some(ref local_var_str) = per_page {
2308        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2309    }
2310    if let Some(ref local_var_str) = all_workspaces {
2311        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2312    }
2313    if let Some(ref local_var_str) = is_not_schedule {
2314        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2315    }
2316    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2317        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2318    }
2319    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2320        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2321    };
2322
2323    let local_var_req = local_var_req_builder.build()?;
2324    let local_var_resp = local_var_client.execute(local_var_req).await?;
2325
2326    let local_var_status = local_var_resp.status();
2327    let local_var_content = local_var_resp.text().await?;
2328
2329    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2330        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2331    } else {
2332        let local_var_entity: Option<ListQueueError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2333        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2334        Err(Error::ResponseError(local_var_error))
2335    }
2336}
2337
2338pub async fn list_selected_job_groups(configuration: &configuration::Configuration, workspace: &str, uuid_colon_colon_uuid: Vec<uuid::Uuid>) -> Result<Vec<models::ListSelectedJobGroups200ResponseInner>, Error<ListSelectedJobGroupsError>> {
2339    let local_var_configuration = configuration;
2340
2341    let local_var_client = &local_var_configuration.client;
2342
2343    let local_var_uri_str = format!("{}/w/{workspace}/jobs/list_selected_job_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2344    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2345
2346    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2347        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2348    }
2349    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2350        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2351    };
2352    local_var_req_builder = local_var_req_builder.json(&uuid_colon_colon_uuid);
2353
2354    let local_var_req = local_var_req_builder.build()?;
2355    let local_var_resp = local_var_client.execute(local_var_req).await?;
2356
2357    let local_var_status = local_var_resp.status();
2358    let local_var_content = local_var_resp.text().await?;
2359
2360    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2361        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2362    } else {
2363        let local_var_entity: Option<ListSelectedJobGroupsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2364        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2365        Err(Error::ResponseError(local_var_error))
2366    }
2367}
2368
2369pub async fn restart_flow_at_step(configuration: &configuration::Configuration, workspace: &str, id: &str, step_id: &str, branch_or_iteration_n: i32, request_body: std::collections::HashMap<String, serde_json::Value>, scheduled_for: Option<String>, scheduled_in_secs: Option<i32>, parent_job: Option<&str>, tag: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, invisible_to_owner: Option<bool>) -> Result<uuid::Uuid, Error<RestartFlowAtStepError>> {
2370    let local_var_configuration = configuration;
2371
2372    let local_var_client = &local_var_configuration.client;
2373
2374    let local_var_uri_str = format!("{}/w/{workspace}/jobs/restart/f/{id}/from/{step_id}/{branch_or_iteration_n}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), step_id=crate::apis::urlencode(step_id), branch_or_iteration_n=branch_or_iteration_n);
2375    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2376
2377    if let Some(ref local_var_str) = scheduled_for {
2378        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
2379    }
2380    if let Some(ref local_var_str) = scheduled_in_secs {
2381        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
2382    }
2383    if let Some(ref local_var_str) = parent_job {
2384        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2385    }
2386    if let Some(ref local_var_str) = tag {
2387        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2388    }
2389    if let Some(ref local_var_str) = job_id {
2390        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2391    }
2392    if let Some(ref local_var_str) = include_header {
2393        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2394    }
2395    if let Some(ref local_var_str) = invisible_to_owner {
2396        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2397    }
2398    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2399        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2400    }
2401    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2402        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2403    };
2404    local_var_req_builder = local_var_req_builder.json(&request_body);
2405
2406    let local_var_req = local_var_req_builder.build()?;
2407    let local_var_resp = local_var_client.execute(local_var_req).await?;
2408
2409    let local_var_status = local_var_resp.status();
2410    let local_var_content = local_var_resp.text().await?;
2411
2412    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2413        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2414    } else {
2415        let local_var_entity: Option<RestartFlowAtStepError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2416        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2417        Err(Error::ResponseError(local_var_error))
2418    }
2419}
2420
2421pub async fn result_by_id(configuration: &configuration::Configuration, workspace: &str, flow_job_id: &str, node_id: &str) -> Result<serde_json::Value, Error<ResultByIdError>> {
2422    let local_var_configuration = configuration;
2423
2424    let local_var_client = &local_var_configuration.client;
2425
2426    let local_var_uri_str = format!("{}/w/{workspace}/jobs/result_by_id/{flow_job_id}/{node_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), flow_job_id=crate::apis::urlencode(flow_job_id), node_id=crate::apis::urlencode(node_id));
2427    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2428
2429    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2430        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2431    }
2432    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2433        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2434    };
2435
2436    let local_var_req = local_var_req_builder.build()?;
2437    let local_var_resp = local_var_client.execute(local_var_req).await?;
2438
2439    let local_var_status = local_var_resp.status();
2440    let local_var_content = local_var_resp.text().await?;
2441
2442    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2443        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2444    } else {
2445        let local_var_entity: Option<ResultByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2446        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2447        Err(Error::ResponseError(local_var_error))
2448    }
2449}
2450
2451pub async fn resume_suspended_flow_as_owner(configuration: &configuration::Configuration, workspace: &str, id: &str, body: serde_json::Value) -> Result<String, Error<ResumeSuspendedFlowAsOwnerError>> {
2452    let local_var_configuration = configuration;
2453
2454    let local_var_client = &local_var_configuration.client;
2455
2456    let local_var_uri_str = format!("{}/w/{workspace}/jobs/flow/resume/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
2457    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2458
2459    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2460        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2461    }
2462    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2463        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2464    };
2465    local_var_req_builder = local_var_req_builder.json(&body);
2466
2467    let local_var_req = local_var_req_builder.build()?;
2468    let local_var_resp = local_var_client.execute(local_var_req).await?;
2469
2470    let local_var_status = local_var_resp.status();
2471    let local_var_content = local_var_resp.text().await?;
2472
2473    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2474        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2475    } else {
2476        let local_var_entity: Option<ResumeSuspendedFlowAsOwnerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2477        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2478        Err(Error::ResponseError(local_var_error))
2479    }
2480}
2481
2482pub async fn resume_suspended_job_get(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, signature: &str, payload: Option<&str>, approver: Option<&str>) -> Result<String, Error<ResumeSuspendedJobGetError>> {
2483    let local_var_configuration = configuration;
2484
2485    let local_var_client = &local_var_configuration.client;
2486
2487    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), resume_id=resume_id, signature=crate::apis::urlencode(signature));
2488    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2489
2490    if let Some(ref local_var_str) = payload {
2491        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2492    }
2493    if let Some(ref local_var_str) = approver {
2494        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2495    }
2496    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2497        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2498    }
2499    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2500        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2501    };
2502
2503    let local_var_req = local_var_req_builder.build()?;
2504    let local_var_resp = local_var_client.execute(local_var_req).await?;
2505
2506    let local_var_status = local_var_resp.status();
2507    let local_var_content = local_var_resp.text().await?;
2508
2509    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2510        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2511    } else {
2512        let local_var_entity: Option<ResumeSuspendedJobGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2513        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2514        Err(Error::ResponseError(local_var_error))
2515    }
2516}
2517
2518pub async fn resume_suspended_job_post(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, signature: &str, body: serde_json::Value, approver: Option<&str>) -> Result<String, Error<ResumeSuspendedJobPostError>> {
2519    let local_var_configuration = configuration;
2520
2521    let local_var_client = &local_var_configuration.client;
2522
2523    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), resume_id=resume_id, signature=crate::apis::urlencode(signature));
2524    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2525
2526    if let Some(ref local_var_str) = approver {
2527        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2528    }
2529    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2530        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2531    }
2532    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2533        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2534    };
2535    local_var_req_builder = local_var_req_builder.json(&body);
2536
2537    let local_var_req = local_var_req_builder.build()?;
2538    let local_var_resp = local_var_client.execute(local_var_req).await?;
2539
2540    let local_var_status = local_var_resp.status();
2541    let local_var_content = local_var_resp.text().await?;
2542
2543    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2544        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2545    } else {
2546        let local_var_entity: Option<ResumeSuspendedJobPostError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2547        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2548        Err(Error::ResponseError(local_var_error))
2549    }
2550}
2551
2552pub async fn run_and_stream_flow_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, request_body: std::collections::HashMap<String, serde_json::Value>, include_header: Option<&str>, queue_limit: Option<&str>, job_id: Option<&str>, skip_preprocessor: Option<bool>, memory_id: Option<&str>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByPathError>> {
2553    let local_var_configuration = configuration;
2554
2555    let local_var_client = &local_var_configuration.client;
2556
2557    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/f/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
2558    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2559
2560    if let Some(ref local_var_str) = include_header {
2561        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2562    }
2563    if let Some(ref local_var_str) = queue_limit {
2564        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2565    }
2566    if let Some(ref local_var_str) = job_id {
2567        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2568    }
2569    if let Some(ref local_var_str) = skip_preprocessor {
2570        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2571    }
2572    if let Some(ref local_var_str) = memory_id {
2573        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2574    }
2575    if let Some(ref local_var_str) = poll_delay_ms {
2576        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2577    }
2578    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2579        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2580    }
2581    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2582        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2583    };
2584    local_var_req_builder = local_var_req_builder.json(&request_body);
2585
2586    let local_var_req = local_var_req_builder.build()?;
2587    let local_var_resp = local_var_client.execute(local_var_req).await?;
2588
2589    let local_var_status = local_var_resp.status();
2590    let local_var_content = local_var_resp.text().await?;
2591
2592    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2593        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2594    } else {
2595        let local_var_entity: Option<RunAndStreamFlowByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2596        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2597        Err(Error::ResponseError(local_var_error))
2598    }
2599}
2600
2601pub async fn run_and_stream_flow_by_path_get(configuration: &configuration::Configuration, workspace: &str, path: &str, include_header: Option<&str>, queue_limit: Option<&str>, payload: Option<&str>, job_id: Option<&str>, skip_preprocessor: Option<bool>, memory_id: Option<&str>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByPathGetError>> {
2602    let local_var_configuration = configuration;
2603
2604    let local_var_client = &local_var_configuration.client;
2605
2606    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/f/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
2607    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2608
2609    if let Some(ref local_var_str) = include_header {
2610        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2611    }
2612    if let Some(ref local_var_str) = queue_limit {
2613        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2614    }
2615    if let Some(ref local_var_str) = payload {
2616        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2617    }
2618    if let Some(ref local_var_str) = job_id {
2619        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2620    }
2621    if let Some(ref local_var_str) = skip_preprocessor {
2622        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2623    }
2624    if let Some(ref local_var_str) = memory_id {
2625        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2626    }
2627    if let Some(ref local_var_str) = poll_delay_ms {
2628        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2629    }
2630    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2631        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2632    }
2633    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2634        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2635    };
2636
2637    let local_var_req = local_var_req_builder.build()?;
2638    let local_var_resp = local_var_client.execute(local_var_req).await?;
2639
2640    let local_var_status = local_var_resp.status();
2641    let local_var_content = local_var_resp.text().await?;
2642
2643    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2644        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2645    } else {
2646        let local_var_entity: Option<RunAndStreamFlowByPathGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2647        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2648        Err(Error::ResponseError(local_var_error))
2649    }
2650}
2651
2652pub async fn run_and_stream_flow_by_version(configuration: &configuration::Configuration, workspace: &str, version: i64, request_body: std::collections::HashMap<String, serde_json::Value>, include_header: Option<&str>, queue_limit: Option<&str>, job_id: Option<&str>, skip_preprocessor: Option<bool>, memory_id: Option<&str>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByVersionError>> {
2653    let local_var_configuration = configuration;
2654
2655    let local_var_client = &local_var_configuration.client;
2656
2657    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/fv/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version);
2658    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2659
2660    if let Some(ref local_var_str) = include_header {
2661        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2662    }
2663    if let Some(ref local_var_str) = queue_limit {
2664        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2665    }
2666    if let Some(ref local_var_str) = job_id {
2667        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2668    }
2669    if let Some(ref local_var_str) = skip_preprocessor {
2670        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2671    }
2672    if let Some(ref local_var_str) = memory_id {
2673        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2674    }
2675    if let Some(ref local_var_str) = poll_delay_ms {
2676        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2677    }
2678    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2679        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2680    }
2681    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2682        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2683    };
2684    local_var_req_builder = local_var_req_builder.json(&request_body);
2685
2686    let local_var_req = local_var_req_builder.build()?;
2687    let local_var_resp = local_var_client.execute(local_var_req).await?;
2688
2689    let local_var_status = local_var_resp.status();
2690    let local_var_content = local_var_resp.text().await?;
2691
2692    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2693        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2694    } else {
2695        let local_var_entity: Option<RunAndStreamFlowByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2696        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2697        Err(Error::ResponseError(local_var_error))
2698    }
2699}
2700
2701pub async fn run_and_stream_flow_by_version_get(configuration: &configuration::Configuration, workspace: &str, version: i64, include_header: Option<&str>, queue_limit: Option<&str>, payload: Option<&str>, job_id: Option<&str>, skip_preprocessor: Option<bool>, memory_id: Option<&str>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByVersionGetError>> {
2702    let local_var_configuration = configuration;
2703
2704    let local_var_client = &local_var_configuration.client;
2705
2706    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/fv/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version);
2707    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2708
2709    if let Some(ref local_var_str) = include_header {
2710        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2711    }
2712    if let Some(ref local_var_str) = queue_limit {
2713        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2714    }
2715    if let Some(ref local_var_str) = payload {
2716        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2717    }
2718    if let Some(ref local_var_str) = job_id {
2719        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2720    }
2721    if let Some(ref local_var_str) = skip_preprocessor {
2722        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2723    }
2724    if let Some(ref local_var_str) = memory_id {
2725        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2726    }
2727    if let Some(ref local_var_str) = poll_delay_ms {
2728        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2729    }
2730    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2731        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2732    }
2733    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2734        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2735    };
2736
2737    let local_var_req = local_var_req_builder.build()?;
2738    let local_var_resp = local_var_client.execute(local_var_req).await?;
2739
2740    let local_var_status = local_var_resp.status();
2741    let local_var_content = local_var_resp.text().await?;
2742
2743    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2744        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2745    } else {
2746        let local_var_entity: Option<RunAndStreamFlowByVersionGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2747        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2748        Err(Error::ResponseError(local_var_error))
2749    }
2750}
2751
2752pub async fn run_and_stream_script_by_hash(configuration: &configuration::Configuration, workspace: &str, hash: &str, request_body: std::collections::HashMap<String, serde_json::Value>, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, queue_limit: Option<&str>, skip_preprocessor: Option<bool>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamScriptByHashError>> {
2753    let local_var_configuration = configuration;
2754
2755    let local_var_client = &local_var_configuration.client;
2756
2757    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/h/{hash}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), hash=crate::apis::urlencode(hash));
2758    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2759
2760    if let Some(ref local_var_str) = parent_job {
2761        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2762    }
2763    if let Some(ref local_var_str) = tag {
2764        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2765    }
2766    if let Some(ref local_var_str) = cache_ttl {
2767        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2768    }
2769    if let Some(ref local_var_str) = job_id {
2770        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2771    }
2772    if let Some(ref local_var_str) = include_header {
2773        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2774    }
2775    if let Some(ref local_var_str) = queue_limit {
2776        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2777    }
2778    if let Some(ref local_var_str) = skip_preprocessor {
2779        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2780    }
2781    if let Some(ref local_var_str) = poll_delay_ms {
2782        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2783    }
2784    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2785        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2786    }
2787    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2788        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2789    };
2790    local_var_req_builder = local_var_req_builder.json(&request_body);
2791
2792    let local_var_req = local_var_req_builder.build()?;
2793    let local_var_resp = local_var_client.execute(local_var_req).await?;
2794
2795    let local_var_status = local_var_resp.status();
2796    let local_var_content = local_var_resp.text().await?;
2797
2798    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2799        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2800    } else {
2801        let local_var_entity: Option<RunAndStreamScriptByHashError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2802        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2803        Err(Error::ResponseError(local_var_error))
2804    }
2805}
2806
2807pub async fn run_and_stream_script_by_hash_get(configuration: &configuration::Configuration, workspace: &str, hash: &str, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, queue_limit: Option<&str>, payload: Option<&str>, skip_preprocessor: Option<bool>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamScriptByHashGetError>> {
2808    let local_var_configuration = configuration;
2809
2810    let local_var_client = &local_var_configuration.client;
2811
2812    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/h/{hash}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), hash=crate::apis::urlencode(hash));
2813    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2814
2815    if let Some(ref local_var_str) = parent_job {
2816        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2817    }
2818    if let Some(ref local_var_str) = tag {
2819        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2820    }
2821    if let Some(ref local_var_str) = cache_ttl {
2822        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2823    }
2824    if let Some(ref local_var_str) = job_id {
2825        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2826    }
2827    if let Some(ref local_var_str) = include_header {
2828        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2829    }
2830    if let Some(ref local_var_str) = queue_limit {
2831        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2832    }
2833    if let Some(ref local_var_str) = payload {
2834        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2835    }
2836    if let Some(ref local_var_str) = skip_preprocessor {
2837        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2838    }
2839    if let Some(ref local_var_str) = poll_delay_ms {
2840        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2841    }
2842    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2843        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2844    }
2845    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2846        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2847    };
2848
2849    let local_var_req = local_var_req_builder.build()?;
2850    let local_var_resp = local_var_client.execute(local_var_req).await?;
2851
2852    let local_var_status = local_var_resp.status();
2853    let local_var_content = local_var_resp.text().await?;
2854
2855    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2856        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2857    } else {
2858        let local_var_entity: Option<RunAndStreamScriptByHashGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2859        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2860        Err(Error::ResponseError(local_var_error))
2861    }
2862}
2863
2864pub async fn run_and_stream_script_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, request_body: std::collections::HashMap<String, serde_json::Value>, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, queue_limit: Option<&str>, skip_preprocessor: Option<bool>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamScriptByPathError>> {
2865    let local_var_configuration = configuration;
2866
2867    let local_var_client = &local_var_configuration.client;
2868
2869    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
2870    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2871
2872    if let Some(ref local_var_str) = parent_job {
2873        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2874    }
2875    if let Some(ref local_var_str) = tag {
2876        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2877    }
2878    if let Some(ref local_var_str) = cache_ttl {
2879        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2880    }
2881    if let Some(ref local_var_str) = job_id {
2882        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2883    }
2884    if let Some(ref local_var_str) = include_header {
2885        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2886    }
2887    if let Some(ref local_var_str) = queue_limit {
2888        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2889    }
2890    if let Some(ref local_var_str) = skip_preprocessor {
2891        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2892    }
2893    if let Some(ref local_var_str) = poll_delay_ms {
2894        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2895    }
2896    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2897        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2898    }
2899    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2900        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2901    };
2902    local_var_req_builder = local_var_req_builder.json(&request_body);
2903
2904    let local_var_req = local_var_req_builder.build()?;
2905    let local_var_resp = local_var_client.execute(local_var_req).await?;
2906
2907    let local_var_status = local_var_resp.status();
2908    let local_var_content = local_var_resp.text().await?;
2909
2910    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2911        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2912    } else {
2913        let local_var_entity: Option<RunAndStreamScriptByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2914        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2915        Err(Error::ResponseError(local_var_error))
2916    }
2917}
2918
2919pub async fn run_and_stream_script_by_path_get(configuration: &configuration::Configuration, workspace: &str, path: &str, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, queue_limit: Option<&str>, payload: Option<&str>, skip_preprocessor: Option<bool>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamScriptByPathGetError>> {
2920    let local_var_configuration = configuration;
2921
2922    let local_var_client = &local_var_configuration.client;
2923
2924    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_and_stream/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
2925    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2926
2927    if let Some(ref local_var_str) = parent_job {
2928        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2929    }
2930    if let Some(ref local_var_str) = tag {
2931        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2932    }
2933    if let Some(ref local_var_str) = cache_ttl {
2934        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2935    }
2936    if let Some(ref local_var_str) = job_id {
2937        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2938    }
2939    if let Some(ref local_var_str) = include_header {
2940        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2941    }
2942    if let Some(ref local_var_str) = queue_limit {
2943        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2944    }
2945    if let Some(ref local_var_str) = payload {
2946        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2947    }
2948    if let Some(ref local_var_str) = skip_preprocessor {
2949        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2950    }
2951    if let Some(ref local_var_str) = poll_delay_ms {
2952        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2953    }
2954    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2955        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2956    }
2957    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2958        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2959    };
2960
2961    let local_var_req = local_var_req_builder.build()?;
2962    let local_var_resp = local_var_client.execute(local_var_req).await?;
2963
2964    let local_var_status = local_var_resp.status();
2965    let local_var_content = local_var_resp.text().await?;
2966
2967    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2968        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2969    } else {
2970        let local_var_entity: Option<RunAndStreamScriptByPathGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2971        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2972        Err(Error::ResponseError(local_var_error))
2973    }
2974}
2975
2976pub async fn run_code_workflow_task(configuration: &configuration::Configuration, workspace: &str, job_id: &str, entrypoint: &str, workflow_task: models::WorkflowTask) -> Result<uuid::Uuid, Error<RunCodeWorkflowTaskError>> {
2977    let local_var_configuration = configuration;
2978
2979    let local_var_client = &local_var_configuration.client;
2980
2981    let local_var_uri_str = format!("{}/w/{workspace}/jobs/workflow_as_code/{job_id}/{entrypoint}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), job_id=crate::apis::urlencode(job_id), entrypoint=crate::apis::urlencode(entrypoint));
2982    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2983
2984    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2985        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2986    }
2987    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2988        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2989    };
2990    local_var_req_builder = local_var_req_builder.json(&workflow_task);
2991
2992    let local_var_req = local_var_req_builder.build()?;
2993    let local_var_resp = local_var_client.execute(local_var_req).await?;
2994
2995    let local_var_status = local_var_resp.status();
2996    let local_var_content = local_var_resp.text().await?;
2997
2998    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2999        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3000    } else {
3001        let local_var_entity: Option<RunCodeWorkflowTaskError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3002        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3003        Err(Error::ResponseError(local_var_error))
3004    }
3005}
3006
3007pub async fn run_dynamic_select(configuration: &configuration::Configuration, workspace: &str, dynamic_input_data: models::DynamicInputData) -> Result<uuid::Uuid, Error<RunDynamicSelectError>> {
3008    let local_var_configuration = configuration;
3009
3010    let local_var_client = &local_var_configuration.client;
3011
3012    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dynamic_select", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3013    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3014
3015    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3016        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3017    }
3018    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3019        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3020    };
3021    local_var_req_builder = local_var_req_builder.json(&dynamic_input_data);
3022
3023    let local_var_req = local_var_req_builder.build()?;
3024    let local_var_resp = local_var_client.execute(local_var_req).await?;
3025
3026    let local_var_status = local_var_resp.status();
3027    let local_var_content = local_var_resp.text().await?;
3028
3029    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3030        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3031    } else {
3032        let local_var_entity: Option<RunDynamicSelectError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3033        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3034        Err(Error::ResponseError(local_var_error))
3035    }
3036}
3037
3038pub async fn run_flow_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, request_body: std::collections::HashMap<String, serde_json::Value>, scheduled_for: Option<String>, scheduled_in_secs: Option<i32>, skip_preprocessor: Option<bool>, parent_job: Option<&str>, tag: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, invisible_to_owner: Option<bool>, memory_id: Option<&str>) -> Result<uuid::Uuid, Error<RunFlowByPathError>> {
3039    let local_var_configuration = configuration;
3040
3041    let local_var_client = &local_var_configuration.client;
3042
3043    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/f/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3044    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3045
3046    if let Some(ref local_var_str) = scheduled_for {
3047        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3048    }
3049    if let Some(ref local_var_str) = scheduled_in_secs {
3050        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3051    }
3052    if let Some(ref local_var_str) = skip_preprocessor {
3053        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3054    }
3055    if let Some(ref local_var_str) = parent_job {
3056        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3057    }
3058    if let Some(ref local_var_str) = tag {
3059        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3060    }
3061    if let Some(ref local_var_str) = job_id {
3062        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3063    }
3064    if let Some(ref local_var_str) = include_header {
3065        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3066    }
3067    if let Some(ref local_var_str) = invisible_to_owner {
3068        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3069    }
3070    if let Some(ref local_var_str) = memory_id {
3071        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3072    }
3073    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3074        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3075    }
3076    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3077        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3078    };
3079    local_var_req_builder = local_var_req_builder.json(&request_body);
3080
3081    let local_var_req = local_var_req_builder.build()?;
3082    let local_var_resp = local_var_client.execute(local_var_req).await?;
3083
3084    let local_var_status = local_var_resp.status();
3085    let local_var_content = local_var_resp.text().await?;
3086
3087    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3088        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3089    } else {
3090        let local_var_entity: Option<RunFlowByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3091        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3092        Err(Error::ResponseError(local_var_error))
3093    }
3094}
3095
3096pub async fn run_flow_by_version(configuration: &configuration::Configuration, workspace: &str, version: i64, request_body: std::collections::HashMap<String, serde_json::Value>, scheduled_for: Option<String>, scheduled_in_secs: Option<i32>, skip_preprocessor: Option<bool>, parent_job: Option<&str>, tag: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, invisible_to_owner: Option<bool>, memory_id: Option<&str>) -> Result<uuid::Uuid, Error<RunFlowByVersionError>> {
3097    let local_var_configuration = configuration;
3098
3099    let local_var_client = &local_var_configuration.client;
3100
3101    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/fv/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version);
3102    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3103
3104    if let Some(ref local_var_str) = scheduled_for {
3105        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3106    }
3107    if let Some(ref local_var_str) = scheduled_in_secs {
3108        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3109    }
3110    if let Some(ref local_var_str) = skip_preprocessor {
3111        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3112    }
3113    if let Some(ref local_var_str) = parent_job {
3114        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3115    }
3116    if let Some(ref local_var_str) = tag {
3117        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3118    }
3119    if let Some(ref local_var_str) = job_id {
3120        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3121    }
3122    if let Some(ref local_var_str) = include_header {
3123        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3124    }
3125    if let Some(ref local_var_str) = invisible_to_owner {
3126        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3127    }
3128    if let Some(ref local_var_str) = memory_id {
3129        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3130    }
3131    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3132        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3133    }
3134    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3135        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3136    };
3137    local_var_req_builder = local_var_req_builder.json(&request_body);
3138
3139    let local_var_req = local_var_req_builder.build()?;
3140    let local_var_resp = local_var_client.execute(local_var_req).await?;
3141
3142    let local_var_status = local_var_resp.status();
3143    let local_var_content = local_var_resp.text().await?;
3144
3145    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3146        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3147    } else {
3148        let local_var_entity: Option<RunFlowByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3149        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3150        Err(Error::ResponseError(local_var_error))
3151    }
3152}
3153
3154pub async fn run_flow_preview(configuration: &configuration::Configuration, workspace: &str, flow_preview: models::FlowPreview, include_header: Option<&str>, invisible_to_owner: Option<bool>, job_id: Option<&str>, memory_id: Option<&str>) -> Result<uuid::Uuid, Error<RunFlowPreviewError>> {
3155    let local_var_configuration = configuration;
3156
3157    let local_var_client = &local_var_configuration.client;
3158
3159    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3160    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3161
3162    if let Some(ref local_var_str) = include_header {
3163        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3164    }
3165    if let Some(ref local_var_str) = invisible_to_owner {
3166        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3167    }
3168    if let Some(ref local_var_str) = job_id {
3169        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3170    }
3171    if let Some(ref local_var_str) = memory_id {
3172        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3173    }
3174    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3175        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3176    }
3177    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3178        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3179    };
3180    local_var_req_builder = local_var_req_builder.json(&flow_preview);
3181
3182    let local_var_req = local_var_req_builder.build()?;
3183    let local_var_resp = local_var_client.execute(local_var_req).await?;
3184
3185    let local_var_status = local_var_resp.status();
3186    let local_var_content = local_var_resp.text().await?;
3187
3188    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3189        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3190    } else {
3191        let local_var_entity: Option<RunFlowPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3192        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3193        Err(Error::ResponseError(local_var_error))
3194    }
3195}
3196
3197pub async fn run_flow_preview_and_wait_result(configuration: &configuration::Configuration, workspace: &str, flow_preview: models::FlowPreview, memory_id: Option<&str>) -> Result<serde_json::Value, Error<RunFlowPreviewAndWaitResultError>> {
3198    let local_var_configuration = configuration;
3199
3200    let local_var_client = &local_var_configuration.client;
3201
3202    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3203    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3204
3205    if let Some(ref local_var_str) = memory_id {
3206        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3207    }
3208    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3209        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3210    }
3211    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3212        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3213    };
3214    local_var_req_builder = local_var_req_builder.json(&flow_preview);
3215
3216    let local_var_req = local_var_req_builder.build()?;
3217    let local_var_resp = local_var_client.execute(local_var_req).await?;
3218
3219    let local_var_status = local_var_resp.status();
3220    let local_var_content = local_var_resp.text().await?;
3221
3222    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3223        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3224    } else {
3225        let local_var_entity: Option<RunFlowPreviewAndWaitResultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3226        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3227        Err(Error::ResponseError(local_var_error))
3228    }
3229}
3230
3231pub async fn run_raw_script_dependencies(configuration: &configuration::Configuration, workspace: &str, run_raw_script_dependencies_request: models::RunRawScriptDependenciesRequest) -> Result<models::RunRawScriptDependencies201Response, Error<RunRawScriptDependenciesError>> {
3232    let local_var_configuration = configuration;
3233
3234    let local_var_client = &local_var_configuration.client;
3235
3236    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dependencies", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3237    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3238
3239    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3240        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3241    }
3242    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3243        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3244    };
3245    local_var_req_builder = local_var_req_builder.json(&run_raw_script_dependencies_request);
3246
3247    let local_var_req = local_var_req_builder.build()?;
3248    let local_var_resp = local_var_client.execute(local_var_req).await?;
3249
3250    let local_var_status = local_var_resp.status();
3251    let local_var_content = local_var_resp.text().await?;
3252
3253    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3254        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3255    } else {
3256        let local_var_entity: Option<RunRawScriptDependenciesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3257        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3258        Err(Error::ResponseError(local_var_error))
3259    }
3260}
3261
3262pub async fn run_script_by_hash(configuration: &configuration::Configuration, workspace: &str, hash: &str, body: serde_json::Value, scheduled_for: Option<String>, scheduled_in_secs: Option<i32>, skip_preprocessor: Option<bool>, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, invisible_to_owner: Option<bool>) -> Result<uuid::Uuid, Error<RunScriptByHashError>> {
3263    let local_var_configuration = configuration;
3264
3265    let local_var_client = &local_var_configuration.client;
3266
3267    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/h/{hash}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), hash=crate::apis::urlencode(hash));
3268    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3269
3270    if let Some(ref local_var_str) = scheduled_for {
3271        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3272    }
3273    if let Some(ref local_var_str) = scheduled_in_secs {
3274        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3275    }
3276    if let Some(ref local_var_str) = skip_preprocessor {
3277        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3278    }
3279    if let Some(ref local_var_str) = parent_job {
3280        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3281    }
3282    if let Some(ref local_var_str) = tag {
3283        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3284    }
3285    if let Some(ref local_var_str) = cache_ttl {
3286        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3287    }
3288    if let Some(ref local_var_str) = job_id {
3289        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3290    }
3291    if let Some(ref local_var_str) = include_header {
3292        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3293    }
3294    if let Some(ref local_var_str) = invisible_to_owner {
3295        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3296    }
3297    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3298        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3299    }
3300    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3301        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3302    };
3303    local_var_req_builder = local_var_req_builder.json(&body);
3304
3305    let local_var_req = local_var_req_builder.build()?;
3306    let local_var_resp = local_var_client.execute(local_var_req).await?;
3307
3308    let local_var_status = local_var_resp.status();
3309    let local_var_content = local_var_resp.text().await?;
3310
3311    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3312        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3313    } else {
3314        let local_var_entity: Option<RunScriptByHashError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3315        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3316        Err(Error::ResponseError(local_var_error))
3317    }
3318}
3319
3320pub async fn run_script_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, request_body: std::collections::HashMap<String, serde_json::Value>, scheduled_for: Option<String>, scheduled_in_secs: Option<i32>, skip_preprocessor: Option<bool>, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, invisible_to_owner: Option<bool>) -> Result<uuid::Uuid, Error<RunScriptByPathError>> {
3321    let local_var_configuration = configuration;
3322
3323    let local_var_client = &local_var_configuration.client;
3324
3325    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3326    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3327
3328    if let Some(ref local_var_str) = scheduled_for {
3329        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3330    }
3331    if let Some(ref local_var_str) = scheduled_in_secs {
3332        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3333    }
3334    if let Some(ref local_var_str) = skip_preprocessor {
3335        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3336    }
3337    if let Some(ref local_var_str) = parent_job {
3338        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3339    }
3340    if let Some(ref local_var_str) = tag {
3341        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3342    }
3343    if let Some(ref local_var_str) = cache_ttl {
3344        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3345    }
3346    if let Some(ref local_var_str) = job_id {
3347        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3348    }
3349    if let Some(ref local_var_str) = invisible_to_owner {
3350        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3351    }
3352    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3353        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3354    }
3355    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3356        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3357    };
3358    local_var_req_builder = local_var_req_builder.json(&request_body);
3359
3360    let local_var_req = local_var_req_builder.build()?;
3361    let local_var_resp = local_var_client.execute(local_var_req).await?;
3362
3363    let local_var_status = local_var_resp.status();
3364    let local_var_content = local_var_resp.text().await?;
3365
3366    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3367        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3368    } else {
3369        let local_var_entity: Option<RunScriptByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3370        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3371        Err(Error::ResponseError(local_var_error))
3372    }
3373}
3374
3375pub async fn run_script_preview(configuration: &configuration::Configuration, workspace: &str, preview: models::Preview, include_header: Option<&str>, invisible_to_owner: Option<bool>, job_id: Option<&str>) -> Result<uuid::Uuid, Error<RunScriptPreviewError>> {
3376    let local_var_configuration = configuration;
3377
3378    let local_var_client = &local_var_configuration.client;
3379
3380    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3381    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3382
3383    if let Some(ref local_var_str) = include_header {
3384        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3385    }
3386    if let Some(ref local_var_str) = invisible_to_owner {
3387        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3388    }
3389    if let Some(ref local_var_str) = job_id {
3390        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3391    }
3392    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3393        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3394    }
3395    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3396        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3397    };
3398    local_var_req_builder = local_var_req_builder.json(&preview);
3399
3400    let local_var_req = local_var_req_builder.build()?;
3401    let local_var_resp = local_var_client.execute(local_var_req).await?;
3402
3403    let local_var_status = local_var_resp.status();
3404    let local_var_content = local_var_resp.text().await?;
3405
3406    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3407        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3408    } else {
3409        let local_var_entity: Option<RunScriptPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3410        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3411        Err(Error::ResponseError(local_var_error))
3412    }
3413}
3414
3415pub async fn run_script_preview_and_wait_result(configuration: &configuration::Configuration, workspace: &str, preview: models::Preview) -> Result<serde_json::Value, Error<RunScriptPreviewAndWaitResultError>> {
3416    let local_var_configuration = configuration;
3417
3418    let local_var_client = &local_var_configuration.client;
3419
3420    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3421    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3422
3423    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3424        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3425    }
3426    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3427        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3428    };
3429    local_var_req_builder = local_var_req_builder.json(&preview);
3430
3431    let local_var_req = local_var_req_builder.build()?;
3432    let local_var_resp = local_var_client.execute(local_var_req).await?;
3433
3434    let local_var_status = local_var_resp.status();
3435    let local_var_content = local_var_resp.text().await?;
3436
3437    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3438        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3439    } else {
3440        let local_var_entity: Option<RunScriptPreviewAndWaitResultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3441        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3442        Err(Error::ResponseError(local_var_error))
3443    }
3444}
3445
3446pub async fn run_wait_result_flow_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, request_body: std::collections::HashMap<String, serde_json::Value>, include_header: Option<&str>, queue_limit: Option<&str>, job_id: Option<&str>, skip_preprocessor: Option<bool>, memory_id: Option<&str>) -> Result<serde_json::Value, Error<RunWaitResultFlowByPathError>> {
3447    let local_var_configuration = configuration;
3448
3449    let local_var_client = &local_var_configuration.client;
3450
3451    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/f/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3452    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3453
3454    if let Some(ref local_var_str) = include_header {
3455        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3456    }
3457    if let Some(ref local_var_str) = queue_limit {
3458        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3459    }
3460    if let Some(ref local_var_str) = job_id {
3461        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3462    }
3463    if let Some(ref local_var_str) = skip_preprocessor {
3464        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3465    }
3466    if let Some(ref local_var_str) = memory_id {
3467        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3468    }
3469    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3470        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3471    }
3472    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3473        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3474    };
3475    local_var_req_builder = local_var_req_builder.json(&request_body);
3476
3477    let local_var_req = local_var_req_builder.build()?;
3478    let local_var_resp = local_var_client.execute(local_var_req).await?;
3479
3480    let local_var_status = local_var_resp.status();
3481    let local_var_content = local_var_resp.text().await?;
3482
3483    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3484        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3485    } else {
3486        let local_var_entity: Option<RunWaitResultFlowByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3487        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3488        Err(Error::ResponseError(local_var_error))
3489    }
3490}
3491
3492pub async fn run_wait_result_flow_by_version(configuration: &configuration::Configuration, workspace: &str, version: i64, request_body: std::collections::HashMap<String, serde_json::Value>, include_header: Option<&str>, queue_limit: Option<&str>, job_id: Option<&str>, skip_preprocessor: Option<bool>, memory_id: Option<&str>) -> Result<serde_json::Value, Error<RunWaitResultFlowByVersionError>> {
3493    let local_var_configuration = configuration;
3494
3495    let local_var_client = &local_var_configuration.client;
3496
3497    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/fv/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version);
3498    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3499
3500    if let Some(ref local_var_str) = include_header {
3501        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3502    }
3503    if let Some(ref local_var_str) = queue_limit {
3504        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3505    }
3506    if let Some(ref local_var_str) = job_id {
3507        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3508    }
3509    if let Some(ref local_var_str) = skip_preprocessor {
3510        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3511    }
3512    if let Some(ref local_var_str) = memory_id {
3513        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3514    }
3515    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3516        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3517    }
3518    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3519        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3520    };
3521    local_var_req_builder = local_var_req_builder.json(&request_body);
3522
3523    let local_var_req = local_var_req_builder.build()?;
3524    let local_var_resp = local_var_client.execute(local_var_req).await?;
3525
3526    let local_var_status = local_var_resp.status();
3527    let local_var_content = local_var_resp.text().await?;
3528
3529    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3530        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3531    } else {
3532        let local_var_entity: Option<RunWaitResultFlowByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3533        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3534        Err(Error::ResponseError(local_var_error))
3535    }
3536}
3537
3538pub async fn run_wait_result_flow_by_version_get(configuration: &configuration::Configuration, workspace: &str, version: i64, include_header: Option<&str>, queue_limit: Option<&str>, payload: Option<&str>, job_id: Option<&str>, skip_preprocessor: Option<bool>, memory_id: Option<&str>) -> Result<serde_json::Value, Error<RunWaitResultFlowByVersionGetError>> {
3539    let local_var_configuration = configuration;
3540
3541    let local_var_client = &local_var_configuration.client;
3542
3543    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/fv/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version);
3544    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3545
3546    if let Some(ref local_var_str) = include_header {
3547        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3548    }
3549    if let Some(ref local_var_str) = queue_limit {
3550        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3551    }
3552    if let Some(ref local_var_str) = payload {
3553        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3554    }
3555    if let Some(ref local_var_str) = job_id {
3556        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3557    }
3558    if let Some(ref local_var_str) = skip_preprocessor {
3559        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3560    }
3561    if let Some(ref local_var_str) = memory_id {
3562        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3563    }
3564    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3565        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3566    }
3567    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3568        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3569    };
3570
3571    let local_var_req = local_var_req_builder.build()?;
3572    let local_var_resp = local_var_client.execute(local_var_req).await?;
3573
3574    let local_var_status = local_var_resp.status();
3575    let local_var_content = local_var_resp.text().await?;
3576
3577    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3578        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3579    } else {
3580        let local_var_entity: Option<RunWaitResultFlowByVersionGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3581        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3582        Err(Error::ResponseError(local_var_error))
3583    }
3584}
3585
3586pub async fn run_wait_result_script_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, request_body: std::collections::HashMap<String, serde_json::Value>, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, queue_limit: Option<&str>, skip_preprocessor: Option<bool>) -> Result<serde_json::Value, Error<RunWaitResultScriptByPathError>> {
3587    let local_var_configuration = configuration;
3588
3589    let local_var_client = &local_var_configuration.client;
3590
3591    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3592    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3593
3594    if let Some(ref local_var_str) = parent_job {
3595        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3596    }
3597    if let Some(ref local_var_str) = tag {
3598        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3599    }
3600    if let Some(ref local_var_str) = cache_ttl {
3601        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3602    }
3603    if let Some(ref local_var_str) = job_id {
3604        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3605    }
3606    if let Some(ref local_var_str) = include_header {
3607        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3608    }
3609    if let Some(ref local_var_str) = queue_limit {
3610        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3611    }
3612    if let Some(ref local_var_str) = skip_preprocessor {
3613        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3614    }
3615    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3616        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3617    }
3618    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3619        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3620    };
3621    local_var_req_builder = local_var_req_builder.json(&request_body);
3622
3623    let local_var_req = local_var_req_builder.build()?;
3624    let local_var_resp = local_var_client.execute(local_var_req).await?;
3625
3626    let local_var_status = local_var_resp.status();
3627    let local_var_content = local_var_resp.text().await?;
3628
3629    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3630        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3631    } else {
3632        let local_var_entity: Option<RunWaitResultScriptByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3633        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3634        Err(Error::ResponseError(local_var_error))
3635    }
3636}
3637
3638pub async fn run_wait_result_script_by_path_get(configuration: &configuration::Configuration, workspace: &str, path: &str, parent_job: Option<&str>, tag: Option<&str>, cache_ttl: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, queue_limit: Option<&str>, payload: Option<&str>, skip_preprocessor: Option<bool>) -> Result<serde_json::Value, Error<RunWaitResultScriptByPathGetError>> {
3639    let local_var_configuration = configuration;
3640
3641    let local_var_client = &local_var_configuration.client;
3642
3643    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3644    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3645
3646    if let Some(ref local_var_str) = parent_job {
3647        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3648    }
3649    if let Some(ref local_var_str) = tag {
3650        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3651    }
3652    if let Some(ref local_var_str) = cache_ttl {
3653        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3654    }
3655    if let Some(ref local_var_str) = job_id {
3656        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3657    }
3658    if let Some(ref local_var_str) = include_header {
3659        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3660    }
3661    if let Some(ref local_var_str) = queue_limit {
3662        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3663    }
3664    if let Some(ref local_var_str) = payload {
3665        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3666    }
3667    if let Some(ref local_var_str) = skip_preprocessor {
3668        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3669    }
3670    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3671        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3672    }
3673    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3674        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3675    };
3676
3677    let local_var_req = local_var_req_builder.build()?;
3678    let local_var_resp = local_var_client.execute(local_var_req).await?;
3679
3680    let local_var_status = local_var_resp.status();
3681    let local_var_content = local_var_resp.text().await?;
3682
3683    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3684        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3685    } else {
3686        let local_var_entity: Option<RunWaitResultScriptByPathGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3687        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3688        Err(Error::ResponseError(local_var_error))
3689    }
3690}
3691
3692pub async fn set_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str, body: Option<serde_json::Value>) -> Result<String, Error<SetFlowUserStateError>> {
3693    let local_var_configuration = configuration;
3694
3695    let local_var_client = &local_var_configuration.client;
3696
3697    let local_var_uri_str = format!("{}/w/{workspace}/jobs/flow/user_states/{id}/{key}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), key=crate::apis::urlencode(key));
3698    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3699
3700    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3701        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3702    }
3703    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3704        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3705    };
3706    local_var_req_builder = local_var_req_builder.json(&body);
3707
3708    let local_var_req = local_var_req_builder.build()?;
3709    let local_var_resp = local_var_client.execute(local_var_req).await?;
3710
3711    let local_var_status = local_var_resp.status();
3712    let local_var_content = local_var_resp.text().await?;
3713
3714    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3715        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3716    } else {
3717        let local_var_entity: Option<SetFlowUserStateError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3718        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3719        Err(Error::ResponseError(local_var_error))
3720    }
3721}
3722