Skip to main content

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.824.1
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 [`delete_jobs`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum DeleteJobsError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`export_completed_jobs`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ExportCompletedJobsError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`export_queued_jobs`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ExportQueuedJobsError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`force_cancel_queued_job`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum ForceCancelQueuedJobError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_approval_info`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetApprovalInfoError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_completed_count`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetCompletedCountError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_completed_job`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetCompletedJobError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_completed_job_logs_tail`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetCompletedJobLogsTailError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_completed_job_result`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetCompletedJobResultError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_completed_job_result_maybe`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetCompletedJobResultMaybeError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_completed_job_timing`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetCompletedJobTimingError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`get_db_clock`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetDbClockError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`get_dbt_resumable`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetDbtResumableError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`get_dbt_resumable_for_script`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetDbtResumableForScriptError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`get_dbt_run_column_lineage`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetDbtRunColumnLineageError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`get_dbt_run_graph`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetDbtRunGraphError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`get_flow_all_logs`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetFlowAllLogsError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`get_flow_all_logs_structured`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetFlowAllLogsStructuredError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`get_flow_all_results`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetFlowAllResultsError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`get_flow_debug_info`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetFlowDebugInfoError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`get_flow_user_state`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetFlowUserStateError {
232    UnknownValue(serde_json::Value),
233}
234
235/// struct for typed errors of method [`get_job`]
236#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum GetJobError {
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`get_job_args`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum GetJobArgsError {
246    UnknownValue(serde_json::Value),
247}
248
249/// struct for typed errors of method [`get_job_logs`]
250#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum GetJobLogsError {
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`get_job_otel_traces`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum GetJobOtelTracesError {
260    UnknownValue(serde_json::Value),
261}
262
263/// struct for typed errors of method [`get_job_public_view_token`]
264#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum GetJobPublicViewTokenError {
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`get_job_updates`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum GetJobUpdatesError {
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`get_job_updates_sse`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum GetJobUpdatesSseError {
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`get_job_view_token`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum GetJobViewTokenError {
288    UnknownValue(serde_json::Value),
289}
290
291/// struct for typed errors of method [`get_log_file_from_store`]
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum GetLogFileFromStoreError {
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`get_queue_count`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum GetQueueCountError {
302    UnknownValue(serde_json::Value),
303}
304
305/// struct for typed errors of method [`get_queue_position`]
306#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum GetQueuePositionError {
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`get_resume_urls`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum GetResumeUrlsError {
316    UnknownValue(serde_json::Value),
317}
318
319/// struct for typed errors of method [`get_root_job_id`]
320#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum GetRootJobIdError {
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`get_run_progress`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum GetRunProgressError {
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`get_scheduled_for`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum GetScheduledForError {
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`get_slack_approval_payload`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum GetSlackApprovalPayloadError {
344    UnknownValue(serde_json::Value),
345}
346
347/// struct for typed errors of method [`get_started_at_by_ids`]
348#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum GetStartedAtByIdsError {
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`get_suspended_job_flow`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum GetSuspendedJobFlowError {
358    UnknownValue(serde_json::Value),
359}
360
361/// struct for typed errors of method [`get_teams_approval_payload`]
362#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum GetTeamsApprovalPayloadError {
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`get_wac_approval_urls`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum GetWacApprovalUrlsError {
372    UnknownValue(serde_json::Value),
373}
374
375/// struct for typed errors of method [`import_completed_jobs`]
376#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum ImportCompletedJobsError {
379    UnknownValue(serde_json::Value),
380}
381
382/// struct for typed errors of method [`import_queued_jobs`]
383#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum ImportQueuedJobsError {
386    UnknownValue(serde_json::Value),
387}
388
389/// struct for typed errors of method [`list_asset_dispatch_edges`]
390#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum ListAssetDispatchEdgesError {
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`list_completed_jobs`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum ListCompletedJobsError {
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`list_dispatch_events`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum ListDispatchEventsError {
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`list_extended_jobs`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum ListExtendedJobsError {
414    UnknownValue(serde_json::Value),
415}
416
417/// struct for typed errors of method [`list_filtered_jobs_uuids`]
418#[derive(Debug, Clone, Serialize, Deserialize)]
419#[serde(untagged)]
420pub enum ListFilteredJobsUuidsError {
421    UnknownValue(serde_json::Value),
422}
423
424/// struct for typed errors of method [`list_filtered_queue_uuids`]
425#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum ListFilteredQueueUuidsError {
428    UnknownValue(serde_json::Value),
429}
430
431/// struct for typed errors of method [`list_jobs`]
432#[derive(Debug, Clone, Serialize, Deserialize)]
433#[serde(untagged)]
434pub enum ListJobsError {
435    UnknownValue(serde_json::Value),
436}
437
438/// struct for typed errors of method [`list_queue`]
439#[derive(Debug, Clone, Serialize, Deserialize)]
440#[serde(untagged)]
441pub enum ListQueueError {
442    UnknownValue(serde_json::Value),
443}
444
445/// struct for typed errors of method [`list_run_assets`]
446#[derive(Debug, Clone, Serialize, Deserialize)]
447#[serde(untagged)]
448pub enum ListRunAssetsError {
449    UnknownValue(serde_json::Value),
450}
451
452/// struct for typed errors of method [`list_selected_job_groups`]
453#[derive(Debug, Clone, Serialize, Deserialize)]
454#[serde(untagged)]
455pub enum ListSelectedJobGroupsError {
456    UnknownValue(serde_json::Value),
457}
458
459/// struct for typed errors of method [`resolve_completed_jobs`]
460#[derive(Debug, Clone, Serialize, Deserialize)]
461#[serde(untagged)]
462pub enum ResolveCompletedJobsError {
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`restart_flow_at_step`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum RestartFlowAtStepError {
470    UnknownValue(serde_json::Value),
471}
472
473/// struct for typed errors of method [`result_by_id`]
474#[derive(Debug, Clone, Serialize, Deserialize)]
475#[serde(untagged)]
476pub enum ResultByIdError {
477    UnknownValue(serde_json::Value),
478}
479
480/// struct for typed errors of method [`resume_suspended`]
481#[derive(Debug, Clone, Serialize, Deserialize)]
482#[serde(untagged)]
483pub enum ResumeSuspendedError {
484    UnknownValue(serde_json::Value),
485}
486
487/// struct for typed errors of method [`resume_suspended_flow_as_owner`]
488#[derive(Debug, Clone, Serialize, Deserialize)]
489#[serde(untagged)]
490pub enum ResumeSuspendedFlowAsOwnerError {
491    UnknownValue(serde_json::Value),
492}
493
494/// struct for typed errors of method [`resume_suspended_job_get`]
495#[derive(Debug, Clone, Serialize, Deserialize)]
496#[serde(untagged)]
497pub enum ResumeSuspendedJobGetError {
498    UnknownValue(serde_json::Value),
499}
500
501/// struct for typed errors of method [`resume_suspended_job_post`]
502#[derive(Debug, Clone, Serialize, Deserialize)]
503#[serde(untagged)]
504pub enum ResumeSuspendedJobPostError {
505    UnknownValue(serde_json::Value),
506}
507
508/// struct for typed errors of method [`run_agent`]
509#[derive(Debug, Clone, Serialize, Deserialize)]
510#[serde(untagged)]
511pub enum RunAgentError {
512    UnknownValue(serde_json::Value),
513}
514
515/// struct for typed errors of method [`run_and_stream_flow_by_path`]
516#[derive(Debug, Clone, Serialize, Deserialize)]
517#[serde(untagged)]
518pub enum RunAndStreamFlowByPathError {
519    Status409(),
520    UnknownValue(serde_json::Value),
521}
522
523/// struct for typed errors of method [`run_and_stream_flow_by_path_get`]
524#[derive(Debug, Clone, Serialize, Deserialize)]
525#[serde(untagged)]
526pub enum RunAndStreamFlowByPathGetError {
527    Status409(),
528    UnknownValue(serde_json::Value),
529}
530
531/// struct for typed errors of method [`run_and_stream_flow_by_version`]
532#[derive(Debug, Clone, Serialize, Deserialize)]
533#[serde(untagged)]
534pub enum RunAndStreamFlowByVersionError {
535    Status409(),
536    UnknownValue(serde_json::Value),
537}
538
539/// struct for typed errors of method [`run_and_stream_flow_by_version_get`]
540#[derive(Debug, Clone, Serialize, Deserialize)]
541#[serde(untagged)]
542pub enum RunAndStreamFlowByVersionGetError {
543    Status409(),
544    UnknownValue(serde_json::Value),
545}
546
547/// struct for typed errors of method [`run_and_stream_script_by_hash`]
548#[derive(Debug, Clone, Serialize, Deserialize)]
549#[serde(untagged)]
550pub enum RunAndStreamScriptByHashError {
551    UnknownValue(serde_json::Value),
552}
553
554/// struct for typed errors of method [`run_and_stream_script_by_hash_get`]
555#[derive(Debug, Clone, Serialize, Deserialize)]
556#[serde(untagged)]
557pub enum RunAndStreamScriptByHashGetError {
558    UnknownValue(serde_json::Value),
559}
560
561/// struct for typed errors of method [`run_and_stream_script_by_path`]
562#[derive(Debug, Clone, Serialize, Deserialize)]
563#[serde(untagged)]
564pub enum RunAndStreamScriptByPathError {
565    UnknownValue(serde_json::Value),
566}
567
568/// struct for typed errors of method [`run_and_stream_script_by_path_get`]
569#[derive(Debug, Clone, Serialize, Deserialize)]
570#[serde(untagged)]
571pub enum RunAndStreamScriptByPathGetError {
572    UnknownValue(serde_json::Value),
573}
574
575/// struct for typed errors of method [`run_code_workflow_task`]
576#[derive(Debug, Clone, Serialize, Deserialize)]
577#[serde(untagged)]
578pub enum RunCodeWorkflowTaskError {
579    UnknownValue(serde_json::Value),
580}
581
582/// struct for typed errors of method [`run_dynamic_select`]
583#[derive(Debug, Clone, Serialize, Deserialize)]
584#[serde(untagged)]
585pub enum RunDynamicSelectError {
586    UnknownValue(serde_json::Value),
587}
588
589/// struct for typed errors of method [`run_flow_by_path`]
590#[derive(Debug, Clone, Serialize, Deserialize)]
591#[serde(untagged)]
592pub enum RunFlowByPathError {
593    Status409(),
594    UnknownValue(serde_json::Value),
595}
596
597/// struct for typed errors of method [`run_flow_by_version`]
598#[derive(Debug, Clone, Serialize, Deserialize)]
599#[serde(untagged)]
600pub enum RunFlowByVersionError {
601    Status409(),
602    UnknownValue(serde_json::Value),
603}
604
605/// struct for typed errors of method [`run_flow_dependencies_async`]
606#[derive(Debug, Clone, Serialize, Deserialize)]
607#[serde(untagged)]
608pub enum RunFlowDependenciesAsyncError {
609    UnknownValue(serde_json::Value),
610}
611
612/// struct for typed errors of method [`run_flow_preview`]
613#[derive(Debug, Clone, Serialize, Deserialize)]
614#[serde(untagged)]
615pub enum RunFlowPreviewError {
616    Status409(),
617    UnknownValue(serde_json::Value),
618}
619
620/// struct for typed errors of method [`run_flow_preview_and_wait_result`]
621#[derive(Debug, Clone, Serialize, Deserialize)]
622#[serde(untagged)]
623pub enum RunFlowPreviewAndWaitResultError {
624    Status409(),
625    UnknownValue(serde_json::Value),
626}
627
628/// struct for typed errors of method [`run_queued_job_now`]
629#[derive(Debug, Clone, Serialize, Deserialize)]
630#[serde(untagged)]
631pub enum RunQueuedJobNowError {
632    UnknownValue(serde_json::Value),
633}
634
635/// struct for typed errors of method [`run_raw_script_dependencies`]
636#[derive(Debug, Clone, Serialize, Deserialize)]
637#[serde(untagged)]
638pub enum RunRawScriptDependenciesError {
639    UnknownValue(serde_json::Value),
640}
641
642/// struct for typed errors of method [`run_raw_script_dependencies_async`]
643#[derive(Debug, Clone, Serialize, Deserialize)]
644#[serde(untagged)]
645pub enum RunRawScriptDependenciesAsyncError {
646    UnknownValue(serde_json::Value),
647}
648
649/// struct for typed errors of method [`run_script_by_hash`]
650#[derive(Debug, Clone, Serialize, Deserialize)]
651#[serde(untagged)]
652pub enum RunScriptByHashError {
653    UnknownValue(serde_json::Value),
654}
655
656/// struct for typed errors of method [`run_script_by_hash_inline`]
657#[derive(Debug, Clone, Serialize, Deserialize)]
658#[serde(untagged)]
659pub enum RunScriptByHashInlineError {
660    UnknownValue(serde_json::Value),
661}
662
663/// struct for typed errors of method [`run_script_by_path`]
664#[derive(Debug, Clone, Serialize, Deserialize)]
665#[serde(untagged)]
666pub enum RunScriptByPathError {
667    UnknownValue(serde_json::Value),
668}
669
670/// struct for typed errors of method [`run_script_by_path_inline`]
671#[derive(Debug, Clone, Serialize, Deserialize)]
672#[serde(untagged)]
673pub enum RunScriptByPathInlineError {
674    UnknownValue(serde_json::Value),
675}
676
677/// struct for typed errors of method [`run_script_preview`]
678#[derive(Debug, Clone, Serialize, Deserialize)]
679#[serde(untagged)]
680pub enum RunScriptPreviewError {
681    UnknownValue(serde_json::Value),
682}
683
684/// struct for typed errors of method [`run_script_preview_and_wait_result`]
685#[derive(Debug, Clone, Serialize, Deserialize)]
686#[serde(untagged)]
687pub enum RunScriptPreviewAndWaitResultError {
688    UnknownValue(serde_json::Value),
689}
690
691/// struct for typed errors of method [`run_script_preview_inline`]
692#[derive(Debug, Clone, Serialize, Deserialize)]
693#[serde(untagged)]
694pub enum RunScriptPreviewInlineError {
695    UnknownValue(serde_json::Value),
696}
697
698/// struct for typed errors of method [`run_wait_result_flow_by_path`]
699#[derive(Debug, Clone, Serialize, Deserialize)]
700#[serde(untagged)]
701pub enum RunWaitResultFlowByPathError {
702    Status409(),
703    UnknownValue(serde_json::Value),
704}
705
706/// struct for typed errors of method [`run_wait_result_flow_by_version`]
707#[derive(Debug, Clone, Serialize, Deserialize)]
708#[serde(untagged)]
709pub enum RunWaitResultFlowByVersionError {
710    Status409(),
711    UnknownValue(serde_json::Value),
712}
713
714/// struct for typed errors of method [`run_wait_result_flow_by_version_get`]
715#[derive(Debug, Clone, Serialize, Deserialize)]
716#[serde(untagged)]
717pub enum RunWaitResultFlowByVersionGetError {
718    Status409(),
719    UnknownValue(serde_json::Value),
720}
721
722/// struct for typed errors of method [`run_wait_result_script_by_path`]
723#[derive(Debug, Clone, Serialize, Deserialize)]
724#[serde(untagged)]
725pub enum RunWaitResultScriptByPathError {
726    UnknownValue(serde_json::Value),
727}
728
729/// struct for typed errors of method [`run_wait_result_script_by_path_get`]
730#[derive(Debug, Clone, Serialize, Deserialize)]
731#[serde(untagged)]
732pub enum RunWaitResultScriptByPathGetError {
733    UnknownValue(serde_json::Value),
734}
735
736/// struct for typed errors of method [`set_flow_user_state`]
737#[derive(Debug, Clone, Serialize, Deserialize)]
738#[serde(untagged)]
739pub enum SetFlowUserStateError {
740    UnknownValue(serde_json::Value),
741}
742
743/// struct for typed errors of method [`unresolve_completed_jobs`]
744#[derive(Debug, Clone, Serialize, Deserialize)]
745#[serde(untagged)]
746pub enum UnresolveCompletedJobsError {
747    UnknownValue(serde_json::Value),
748}
749
750
751pub async fn batch_re_run_jobs(configuration: &configuration::Configuration, workspace: &str, batch_re_run_jobs_request: models::BatchReRunJobsRequest) -> Result<String, Error<BatchReRunJobsError>> {
752    let local_var_configuration = configuration;
753
754    let local_var_client = &local_var_configuration.client;
755
756    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/batch_rerun_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
757    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
758
759    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
760        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
761    }
762    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
763        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
764    };
765    local_var_req_builder = local_var_req_builder.json(&batch_re_run_jobs_request);
766
767    let local_var_req = local_var_req_builder.build()?;
768    let local_var_resp = local_var_client.execute(local_var_req).await?;
769
770    let local_var_status = local_var_resp.status();
771    let local_var_content = local_var_resp.text().await?;
772
773    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
774        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
775    } else {
776        let local_var_entity: Option<BatchReRunJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
777        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
778        Err(Error::ResponseError(local_var_error))
779    }
780}
781
782pub async fn cancel_persistent_queued_jobs(configuration: &configuration::Configuration, workspace: &str, path: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelPersistentQueuedJobsError>> {
783    let local_var_configuration = configuration;
784
785    let local_var_client = &local_var_configuration.client;
786
787    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));
788    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
789
790    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
791        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
792    }
793    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
794        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
795    };
796    local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
797
798    let local_var_req = local_var_req_builder.build()?;
799    let local_var_resp = local_var_client.execute(local_var_req).await?;
800
801    let local_var_status = local_var_resp.status();
802    let local_var_content = local_var_resp.text().await?;
803
804    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
805        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
806    } else {
807        let local_var_entity: Option<CancelPersistentQueuedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
808        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
809        Err(Error::ResponseError(local_var_error))
810    }
811}
812
813pub async fn cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelQueuedJobError>> {
814    let local_var_configuration = configuration;
815
816    let local_var_client = &local_var_configuration.client;
817
818    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));
819    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
820
821    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
822        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
823    }
824    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
825        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
826    };
827    local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
828
829    let local_var_req = local_var_req_builder.build()?;
830    let local_var_resp = local_var_client.execute(local_var_req).await?;
831
832    let local_var_status = local_var_resp.status();
833    let local_var_content = local_var_resp.text().await?;
834
835    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
836        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
837    } else {
838        let local_var_entity: Option<CancelQueuedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
839        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
840        Err(Error::ResponseError(local_var_error))
841    }
842}
843
844pub async fn cancel_selection(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>, force_cancel: Option<bool>, all_workspaces: Option<bool>) -> Result<Vec<String>, Error<CancelSelectionError>> {
845    let local_var_configuration = configuration;
846
847    let local_var_client = &local_var_configuration.client;
848
849    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/cancel_selection", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
850    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
851
852    if let Some(ref local_var_str) = force_cancel {
853        local_var_req_builder = local_var_req_builder.query(&[("force_cancel", &local_var_str.to_string())]);
854    }
855    if let Some(ref local_var_str) = all_workspaces {
856        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
857    }
858    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
859        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
860    }
861    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
862        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
863    };
864    local_var_req_builder = local_var_req_builder.json(&request_body);
865
866    let local_var_req = local_var_req_builder.build()?;
867    let local_var_resp = local_var_client.execute(local_var_req).await?;
868
869    let local_var_status = local_var_resp.status();
870    let local_var_content = local_var_resp.text().await?;
871
872    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
873        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
874    } else {
875        let local_var_entity: Option<CancelSelectionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
876        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
877        Err(Error::ResponseError(local_var_error))
878    }
879}
880
881pub 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>> {
882    let local_var_configuration = configuration;
883
884    let local_var_client = &local_var_configuration.client;
885
886    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));
887    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
888
889    if let Some(ref local_var_str) = approver {
890        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
891    }
892    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
893        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
894    }
895    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
896        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
897    };
898
899    let local_var_req = local_var_req_builder.build()?;
900    let local_var_resp = local_var_client.execute(local_var_req).await?;
901
902    let local_var_status = local_var_resp.status();
903    let local_var_content = local_var_resp.text().await?;
904
905    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
906        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
907    } else {
908        let local_var_entity: Option<CancelSuspendedJobGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
909        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
910        Err(Error::ResponseError(local_var_error))
911    }
912}
913
914pub 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>> {
915    let local_var_configuration = configuration;
916
917    let local_var_client = &local_var_configuration.client;
918
919    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));
920    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
921
922    if let Some(ref local_var_str) = approver {
923        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
924    }
925    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
926        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
927    }
928    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
929        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
930    };
931    local_var_req_builder = local_var_req_builder.json(&body);
932
933    let local_var_req = local_var_req_builder.build()?;
934    let local_var_resp = local_var_client.execute(local_var_req).await?;
935
936    let local_var_status = local_var_resp.status();
937    let local_var_content = local_var_resp.text().await?;
938
939    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
940        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
941    } else {
942        let local_var_entity: Option<CancelSuspendedJobPostError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
943        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
944        Err(Error::ResponseError(local_var_error))
945    }
946}
947
948pub 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>> {
949    let local_var_configuration = configuration;
950
951    let local_var_client = &local_var_configuration.client;
952
953    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
954    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
955
956    if let Some(ref local_var_str) = completed_after_s_ago {
957        local_var_req_builder = local_var_req_builder.query(&[("completed_after_s_ago", &local_var_str.to_string())]);
958    }
959    if let Some(ref local_var_str) = success {
960        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
961    }
962    if let Some(ref local_var_str) = tags {
963        local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]);
964    }
965    if let Some(ref local_var_str) = all_workspaces {
966        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
967    }
968    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
969        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
970    }
971    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
972        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
973    };
974
975    let local_var_req = local_var_req_builder.build()?;
976    let local_var_resp = local_var_client.execute(local_var_req).await?;
977
978    let local_var_status = local_var_resp.status();
979    let local_var_content = local_var_resp.text().await?;
980
981    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
982        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
983    } else {
984        let local_var_entity: Option<CountCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
985        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
986        Err(Error::ResponseError(local_var_error))
987    }
988}
989
990pub async fn count_jobs_by_tag(configuration: &configuration::Configuration, horizon_secs: Option<i32>, workspace_id: Option<&str>) -> Result<Vec<models::CountJobsByTag200ResponseInner>, Error<CountJobsByTagError>> {
991    let local_var_configuration = configuration;
992
993    let local_var_client = &local_var_configuration.client;
994
995    let local_var_uri_str = format!("{}/jobs/completed/count_by_tag", local_var_configuration.base_path);
996    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
997
998    if let Some(ref local_var_str) = horizon_secs {
999        local_var_req_builder = local_var_req_builder.query(&[("horizon_secs", &local_var_str.to_string())]);
1000    }
1001    if let Some(ref local_var_str) = workspace_id {
1002        local_var_req_builder = local_var_req_builder.query(&[("workspace_id", &local_var_str.to_string())]);
1003    }
1004    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1005        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1006    }
1007    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1008        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1009    };
1010
1011    let local_var_req = local_var_req_builder.build()?;
1012    let local_var_resp = local_var_client.execute(local_var_req).await?;
1013
1014    let local_var_status = local_var_resp.status();
1015    let local_var_content = local_var_resp.text().await?;
1016
1017    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1018        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1019    } else {
1020        let local_var_entity: Option<CountJobsByTagError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1021        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1022        Err(Error::ResponseError(local_var_error))
1023    }
1024}
1025
1026pub async fn create_job_signature(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, approver: Option<&str>) -> Result<String, Error<CreateJobSignatureError>> {
1027    let local_var_configuration = configuration;
1028
1029    let local_var_client = &local_var_configuration.client;
1030
1031    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);
1032    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1033
1034    if let Some(ref local_var_str) = approver {
1035        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1036    }
1037    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1038        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1039    }
1040    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1041        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1042    };
1043
1044    let local_var_req = local_var_req_builder.build()?;
1045    let local_var_resp = local_var_client.execute(local_var_req).await?;
1046
1047    let local_var_status = local_var_resp.status();
1048    let local_var_content = local_var_resp.text().await?;
1049
1050    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1051        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1052    } else {
1053        let local_var_entity: Option<CreateJobSignatureError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1054        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1055        Err(Error::ResponseError(local_var_error))
1056    }
1057}
1058
1059pub async fn delete_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<DeleteCompletedJobError>> {
1060    let local_var_configuration = configuration;
1061
1062    let local_var_client = &local_var_configuration.client;
1063
1064    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));
1065    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1066
1067    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1068        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1069    }
1070    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1071        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1072    };
1073
1074    let local_var_req = local_var_req_builder.build()?;
1075    let local_var_resp = local_var_client.execute(local_var_req).await?;
1076
1077    let local_var_status = local_var_resp.status();
1078    let local_var_content = local_var_resp.text().await?;
1079
1080    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1081        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1082    } else {
1083        let local_var_entity: Option<DeleteCompletedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1084        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1085        Err(Error::ResponseError(local_var_error))
1086    }
1087}
1088
1089pub async fn delete_jobs(configuration: &configuration::Configuration, workspace: &str, uuid_colon_colon_uuid: Vec<uuid::Uuid>) -> Result<String, Error<DeleteJobsError>> {
1090    let local_var_configuration = configuration;
1091
1092    let local_var_client = &local_var_configuration.client;
1093
1094    let local_var_uri_str = format!("{}/w/{workspace}/jobs/delete", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1095    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1096
1097    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1098        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1099    }
1100    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1101        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1102    };
1103    local_var_req_builder = local_var_req_builder.json(&uuid_colon_colon_uuid);
1104
1105    let local_var_req = local_var_req_builder.build()?;
1106    let local_var_resp = local_var_client.execute(local_var_req).await?;
1107
1108    let local_var_status = local_var_resp.status();
1109    let local_var_content = local_var_resp.text().await?;
1110
1111    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1112        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1113    } else {
1114        let local_var_entity: Option<DeleteJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1115        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1116        Err(Error::ResponseError(local_var_error))
1117    }
1118}
1119
1120pub async fn export_completed_jobs(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::ExportableCompletedJob>, Error<ExportCompletedJobsError>> {
1121    let local_var_configuration = configuration;
1122
1123    let local_var_client = &local_var_configuration.client;
1124
1125    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/export", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1126    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1127
1128    if let Some(ref local_var_str) = page {
1129        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1130    }
1131    if let Some(ref local_var_str) = per_page {
1132        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1133    }
1134    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1135        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1136    }
1137    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1138        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1139    };
1140
1141    let local_var_req = local_var_req_builder.build()?;
1142    let local_var_resp = local_var_client.execute(local_var_req).await?;
1143
1144    let local_var_status = local_var_resp.status();
1145    let local_var_content = local_var_resp.text().await?;
1146
1147    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1148        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1149    } else {
1150        let local_var_entity: Option<ExportCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1151        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1152        Err(Error::ResponseError(local_var_error))
1153    }
1154}
1155
1156pub async fn export_queued_jobs(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::ExportableQueuedJob>, Error<ExportQueuedJobsError>> {
1157    let local_var_configuration = configuration;
1158
1159    let local_var_client = &local_var_configuration.client;
1160
1161    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/export", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1162    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1163
1164    if let Some(ref local_var_str) = page {
1165        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1166    }
1167    if let Some(ref local_var_str) = per_page {
1168        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1169    }
1170    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1171        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1172    }
1173    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1174        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1175    };
1176
1177    let local_var_req = local_var_req_builder.build()?;
1178    let local_var_resp = local_var_client.execute(local_var_req).await?;
1179
1180    let local_var_status = local_var_resp.status();
1181    let local_var_content = local_var_resp.text().await?;
1182
1183    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1184        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1185    } else {
1186        let local_var_entity: Option<ExportQueuedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1187        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1188        Err(Error::ResponseError(local_var_error))
1189    }
1190}
1191
1192pub async fn force_cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<ForceCancelQueuedJobError>> {
1193    let local_var_configuration = configuration;
1194
1195    let local_var_client = &local_var_configuration.client;
1196
1197    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));
1198    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1199
1200    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1201        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1202    }
1203    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1204        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1205    };
1206    local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
1207
1208    let local_var_req = local_var_req_builder.build()?;
1209    let local_var_resp = local_var_client.execute(local_var_req).await?;
1210
1211    let local_var_status = local_var_resp.status();
1212    let local_var_content = local_var_resp.text().await?;
1213
1214    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1215        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1216    } else {
1217        let local_var_entity: Option<ForceCancelQueuedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1218        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1219        Err(Error::ResponseError(local_var_error))
1220    }
1221}
1222
1223/// Get approval info for a suspended flow/WAC job. Returns form schema, approval rules, and whether the current user can approve. Either a valid token query parameter or an authenticated session is required. 
1224pub async fn get_approval_info(configuration: &configuration::Configuration, workspace: &str, job_id: &str, token: Option<&str>) -> Result<models::GetApprovalInfo200Response, Error<GetApprovalInfoError>> {
1225    let local_var_configuration = configuration;
1226
1227    let local_var_client = &local_var_configuration.client;
1228
1229    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/flow/approval_info/{job_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), job_id=crate::apis::urlencode(job_id));
1230    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1231
1232    if let Some(ref local_var_str) = token {
1233        local_var_req_builder = local_var_req_builder.query(&[("token", &local_var_str.to_string())]);
1234    }
1235    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1236        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1237    }
1238    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1239        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1240    };
1241
1242    let local_var_req = local_var_req_builder.build()?;
1243    let local_var_resp = local_var_client.execute(local_var_req).await?;
1244
1245    let local_var_status = local_var_resp.status();
1246    let local_var_content = local_var_resp.text().await?;
1247
1248    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1249        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1250    } else {
1251        let local_var_entity: Option<GetApprovalInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1252        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1253        Err(Error::ResponseError(local_var_error))
1254    }
1255}
1256
1257pub async fn get_completed_count(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCompletedCount200Response, Error<GetCompletedCountError>> {
1258    let local_var_configuration = configuration;
1259
1260    let local_var_client = &local_var_configuration.client;
1261
1262    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1263    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1264
1265    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1266        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1267    }
1268    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1269        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1270    };
1271
1272    let local_var_req = local_var_req_builder.build()?;
1273    let local_var_resp = local_var_client.execute(local_var_req).await?;
1274
1275    let local_var_status = local_var_resp.status();
1276    let local_var_content = local_var_resp.text().await?;
1277
1278    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1279        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1280    } else {
1281        let local_var_entity: Option<GetCompletedCountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1282        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1283        Err(Error::ResponseError(local_var_error))
1284    }
1285}
1286
1287pub async fn get_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<GetCompletedJobError>> {
1288    let local_var_configuration = configuration;
1289
1290    let local_var_client = &local_var_configuration.client;
1291
1292    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));
1293    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1294
1295    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1296        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1297    }
1298    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1299        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1300    };
1301
1302    let local_var_req = local_var_req_builder.build()?;
1303    let local_var_resp = local_var_client.execute(local_var_req).await?;
1304
1305    let local_var_status = local_var_resp.status();
1306    let local_var_content = local_var_resp.text().await?;
1307
1308    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1309        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1310    } else {
1311        let local_var_entity: Option<GetCompletedJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1312        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1313        Err(Error::ResponseError(local_var_error))
1314    }
1315}
1316
1317pub async fn get_completed_job_logs_tail(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetCompletedJobLogsTailError>> {
1318    let local_var_configuration = configuration;
1319
1320    let local_var_client = &local_var_configuration.client;
1321
1322    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));
1323    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1324
1325    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1326        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1327    }
1328    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1329        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1330    };
1331
1332    let local_var_req = local_var_req_builder.build()?;
1333    let local_var_resp = local_var_client.execute(local_var_req).await?;
1334
1335    let local_var_status = local_var_resp.status();
1336    let local_var_content = local_var_resp.text().await?;
1337
1338    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1339        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1340    } else {
1341        let local_var_entity: Option<GetCompletedJobLogsTailError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1342        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1343        Err(Error::ResponseError(local_var_error))
1344    }
1345}
1346
1347pub 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>> {
1348    let local_var_configuration = configuration;
1349
1350    let local_var_client = &local_var_configuration.client;
1351
1352    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));
1353    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1354
1355    if let Some(ref local_var_str) = suspended_job {
1356        local_var_req_builder = local_var_req_builder.query(&[("suspended_job", &local_var_str.to_string())]);
1357    }
1358    if let Some(ref local_var_str) = resume_id {
1359        local_var_req_builder = local_var_req_builder.query(&[("resume_id", &local_var_str.to_string())]);
1360    }
1361    if let Some(ref local_var_str) = secret {
1362        local_var_req_builder = local_var_req_builder.query(&[("secret", &local_var_str.to_string())]);
1363    }
1364    if let Some(ref local_var_str) = approver {
1365        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1366    }
1367    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1368        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1369    }
1370    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1371        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1372    };
1373
1374    let local_var_req = local_var_req_builder.build()?;
1375    let local_var_resp = local_var_client.execute(local_var_req).await?;
1376
1377    let local_var_status = local_var_resp.status();
1378    let local_var_content = local_var_resp.text().await?;
1379
1380    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1381        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1382    } else {
1383        let local_var_entity: Option<GetCompletedJobResultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1384        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1385        Err(Error::ResponseError(local_var_error))
1386    }
1387}
1388
1389pub async fn get_completed_job_result_maybe(configuration: &configuration::Configuration, workspace: &str, id: &str, get_started: Option<bool>) -> Result<models::GetCompletedJobResultMaybe200Response, Error<GetCompletedJobResultMaybeError>> {
1390    let local_var_configuration = configuration;
1391
1392    let local_var_client = &local_var_configuration.client;
1393
1394    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));
1395    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1396
1397    if let Some(ref local_var_str) = get_started {
1398        local_var_req_builder = local_var_req_builder.query(&[("get_started", &local_var_str.to_string())]);
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<GetCompletedJobResultMaybeError> = 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_completed_job_timing(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::GetCompletedJobTiming200Response, Error<GetCompletedJobTimingError>> {
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_u/completed/get_timing/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(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_user_agent) = local_var_configuration.user_agent {
1431        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1432    }
1433    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1434        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1435    };
1436
1437    let local_var_req = local_var_req_builder.build()?;
1438    let local_var_resp = local_var_client.execute(local_var_req).await?;
1439
1440    let local_var_status = local_var_resp.status();
1441    let local_var_content = local_var_resp.text().await?;
1442
1443    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1444        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1445    } else {
1446        let local_var_entity: Option<GetCompletedJobTimingError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1447        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1448        Err(Error::ResponseError(local_var_error))
1449    }
1450}
1451
1452pub async fn get_db_clock(configuration: &configuration::Configuration, ) -> Result<i32, Error<GetDbClockError>> {
1453    let local_var_configuration = configuration;
1454
1455    let local_var_client = &local_var_configuration.client;
1456
1457    let local_var_uri_str = format!("{}/jobs/db_clock", local_var_configuration.base_path);
1458    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1459
1460    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1461        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1462    }
1463    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1464        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1465    };
1466
1467    let local_var_req = local_var_req_builder.build()?;
1468    let local_var_resp = local_var_client.execute(local_var_req).await?;
1469
1470    let local_var_status = local_var_resp.status();
1471    let local_var_content = local_var_resp.text().await?;
1472
1473    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1474        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1475    } else {
1476        let local_var_entity: Option<GetDbClockError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1477        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1478        Err(Error::ResponseError(local_var_error))
1479    }
1480}
1481
1482/// One failed run is saved per script per execution principal, so a `retry` resumes that one — not necessarily the run being looked at. Answers about THIS run alone: its own id when a retry submitted by this caller would resume it, null otherwise (a later run holds the state, the run left nothing to rebuild, or the caller's runs execute as another principal). Authorized through the job, like `run_progress`. 
1483pub async fn get_dbt_resumable(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<uuid::Uuid, Error<GetDbtResumableError>> {
1484    let local_var_configuration = configuration;
1485
1486    let local_var_client = &local_var_configuration.client;
1487
1488    let local_var_uri_str = format!("{}/w/{workspace}/jobs/dbt_resumable/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1489    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1490
1491    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1492        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1493    }
1494    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1495        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1496    };
1497
1498    let local_var_req = local_var_req_builder.build()?;
1499    let local_var_resp = local_var_client.execute(local_var_req).await?;
1500
1501    let local_var_status = local_var_resp.status();
1502    let local_var_content = local_var_resp.text().await?;
1503
1504    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1505        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1506    } else {
1507        let local_var_entity: Option<GetDbtResumableError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1508        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1509        Err(Error::ResponseError(local_var_error))
1510    }
1511}
1512
1513/// A `retry` requires `dbt_retry_job`, and the run form has no job id to hand. Returns the one the caller's own retry would land on — the saved failure for the principal the run would execute as, which is the script's author for an `on_behalf_of` script and the caller otherwise — and only when that run is one the caller may read. Null when there is nothing to resume, or nothing this caller may be told about. 
1514pub async fn get_dbt_resumable_for_script(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<uuid::Uuid, Error<GetDbtResumableForScriptError>> {
1515    let local_var_configuration = configuration;
1516
1517    let local_var_client = &local_var_configuration.client;
1518
1519    let local_var_uri_str = format!("{}/w/{workspace}/jobs/dbt_resumable_script/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
1520    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1521
1522    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1523        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1524    }
1525    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1526        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1527    };
1528
1529    let local_var_req = local_var_req_builder.build()?;
1530    let local_var_resp = local_var_client.execute(local_var_req).await?;
1531
1532    let local_var_status = local_var_resp.status();
1533    let local_var_content = local_var_resp.text().await?;
1534
1535    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1536        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1537    } else {
1538        let local_var_entity: Option<GetDbtResumableForScriptError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1539        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1540        Err(Error::ResponseError(local_var_error))
1541    }
1542}
1543
1544/// The same answer as `assets/column_lineage`, for the project version a single job ran — including the dbt editor's parse of its own buffer, whose graph belongs to that job and is reachable no other way. One project answers here, the one the run is of, since the graph this annotates is that project's too. Authorized through the job, the same gate as `dbt_graph`. Reaching the run is not on its own enough to read the project: a caller with no access to the script gets its relations and `ref()` edges from `dbt_graph` and an empty answer here, exactly as that endpoint redacts the model's SQL. 
1545pub async fn get_dbt_run_column_lineage(configuration: &configuration::Configuration, workspace: &str, id: &str, asset_path: Vec<String>) -> Result<models::DbtColumnLineage, Error<GetDbtRunColumnLineageError>> {
1546    let local_var_configuration = configuration;
1547
1548    let local_var_client = &local_var_configuration.client;
1549
1550    let local_var_uri_str = format!("{}/w/{workspace}/jobs/dbt_column_lineage/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1551    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1552
1553    local_var_req_builder = match "multi" {
1554        "multi" => local_var_req_builder.query(&asset_path.into_iter().map(|p| ("asset_path".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
1555        _ => local_var_req_builder.query(&[("asset_path", &asset_path.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
1556    };
1557    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1558        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1559    }
1560    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1561        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1562    };
1563
1564    let local_var_req = local_var_req_builder.build()?;
1565    let local_var_resp = local_var_client.execute(local_var_req).await?;
1566
1567    let local_var_status = local_var_resp.status();
1568    let local_var_content = local_var_resp.text().await?;
1569
1570    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1571        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1572    } else {
1573        let local_var_entity: Option<GetDbtRunColumnLineageError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1574        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1575        Err(Error::ResponseError(local_var_error))
1576    }
1577}
1578
1579/// The workspace asset graph with its dbt half pinned to what a single run built. Only a dynamic descriptor (a `{{ }}` placeholder in `vars`) leaves a per-run snapshot; without one for this job the pinned version's own graph answers, so a run page may use this route unconditionally. Authorized through the job, the same gate as `run_progress` — pinning to a run is job-scoped, which is why `assets/graph` cannot do it. 
1580pub async fn get_dbt_run_graph(configuration: &configuration::Configuration, workspace: &str, id: &str, asset_kinds: Option<&str>, folder: Option<&str>, dbt_script_hash: Option<&str>) -> Result<models::AssetGraph, Error<GetDbtRunGraphError>> {
1581    let local_var_configuration = configuration;
1582
1583    let local_var_client = &local_var_configuration.client;
1584
1585    let local_var_uri_str = format!("{}/w/{workspace}/jobs/dbt_graph/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1586    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1587
1588    if let Some(ref local_var_str) = asset_kinds {
1589        local_var_req_builder = local_var_req_builder.query(&[("asset_kinds", &local_var_str.to_string())]);
1590    }
1591    if let Some(ref local_var_str) = folder {
1592        local_var_req_builder = local_var_req_builder.query(&[("folder", &local_var_str.to_string())]);
1593    }
1594    if let Some(ref local_var_str) = dbt_script_hash {
1595        local_var_req_builder = local_var_req_builder.query(&[("dbt_script_hash", &local_var_str.to_string())]);
1596    }
1597    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1598        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1599    }
1600    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1601        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1602    };
1603
1604    let local_var_req = local_var_req_builder.build()?;
1605    let local_var_resp = local_var_client.execute(local_var_req).await?;
1606
1607    let local_var_status = local_var_resp.status();
1608    let local_var_content = local_var_resp.text().await?;
1609
1610    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1611        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1612    } else {
1613        let local_var_entity: Option<GetDbtRunGraphError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1614        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1615        Err(Error::ResponseError(local_var_error))
1616    }
1617}
1618
1619pub async fn get_flow_all_logs(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetFlowAllLogsError>> {
1620    let local_var_configuration = configuration;
1621
1622    let local_var_client = &local_var_configuration.client;
1623
1624    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_flow_all_logs/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1625    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1626
1627    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1628        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1629    }
1630    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1631        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1632    };
1633
1634    let local_var_req = local_var_req_builder.build()?;
1635    let local_var_resp = local_var_client.execute(local_var_req).await?;
1636
1637    let local_var_status = local_var_resp.status();
1638    let local_var_content = local_var_resp.text().await?;
1639
1640    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1641        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1642    } else {
1643        let local_var_entity: Option<GetFlowAllLogsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1644        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1645        Err(Error::ResponseError(local_var_error))
1646    }
1647}
1648
1649pub async fn get_flow_all_logs_structured(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<Vec<models::GetFlowAllLogsStructured200ResponseInner>, Error<GetFlowAllLogsStructuredError>> {
1650    let local_var_configuration = configuration;
1651
1652    let local_var_client = &local_var_configuration.client;
1653
1654    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_flow_all_logs_structured/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1655    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1656
1657    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1658        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1659    }
1660    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1661        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1662    };
1663
1664    let local_var_req = local_var_req_builder.build()?;
1665    let local_var_resp = local_var_client.execute(local_var_req).await?;
1666
1667    let local_var_status = local_var_resp.status();
1668    let local_var_content = local_var_resp.text().await?;
1669
1670    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1671        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1672    } else {
1673        let local_var_entity: Option<GetFlowAllLogsStructuredError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1674        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1675        Err(Error::ResponseError(local_var_error))
1676    }
1677}
1678
1679pub async fn get_flow_all_results(configuration: &configuration::Configuration, workspace: &str, id: &str, max_result_len: Option<i32>, step: Option<&str>) -> Result<models::GetFlowAllResults200Response, Error<GetFlowAllResultsError>> {
1680    let local_var_configuration = configuration;
1681
1682    let local_var_client = &local_var_configuration.client;
1683
1684    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_flow_all_results/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1685    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1686
1687    if let Some(ref local_var_str) = max_result_len {
1688        local_var_req_builder = local_var_req_builder.query(&[("max_result_len", &local_var_str.to_string())]);
1689    }
1690    if let Some(ref local_var_str) = step {
1691        local_var_req_builder = local_var_req_builder.query(&[("step", &local_var_str.to_string())]);
1692    }
1693    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1694        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1695    }
1696    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1697        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1698    };
1699
1700    let local_var_req = local_var_req_builder.build()?;
1701    let local_var_resp = local_var_client.execute(local_var_req).await?;
1702
1703    let local_var_status = local_var_resp.status();
1704    let local_var_content = local_var_resp.text().await?;
1705
1706    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1707        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1708    } else {
1709        let local_var_entity: Option<GetFlowAllResultsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1710        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1711        Err(Error::ResponseError(local_var_error))
1712    }
1713}
1714
1715pub async fn get_flow_debug_info(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetFlowDebugInfoError>> {
1716    let local_var_configuration = configuration;
1717
1718    let local_var_client = &local_var_configuration.client;
1719
1720    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));
1721    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1722
1723    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1724        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1725    }
1726    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1727        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1728    };
1729
1730    let local_var_req = local_var_req_builder.build()?;
1731    let local_var_resp = local_var_client.execute(local_var_req).await?;
1732
1733    let local_var_status = local_var_resp.status();
1734    let local_var_content = local_var_resp.text().await?;
1735
1736    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1737        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1738    } else {
1739        let local_var_entity: Option<GetFlowDebugInfoError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1740        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1741        Err(Error::ResponseError(local_var_error))
1742    }
1743}
1744
1745pub async fn get_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str) -> Result<serde_json::Value, Error<GetFlowUserStateError>> {
1746    let local_var_configuration = configuration;
1747
1748    let local_var_client = &local_var_configuration.client;
1749
1750    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));
1751    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1752
1753    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1754        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1755    }
1756    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1757        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1758    };
1759
1760    let local_var_req = local_var_req_builder.build()?;
1761    let local_var_resp = local_var_client.execute(local_var_req).await?;
1762
1763    let local_var_status = local_var_resp.status();
1764    let local_var_content = local_var_resp.text().await?;
1765
1766    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1767        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1768    } else {
1769        let local_var_entity: Option<GetFlowUserStateError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1770        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1771        Err(Error::ResponseError(local_var_error))
1772    }
1773}
1774
1775pub async fn get_job(configuration: &configuration::Configuration, workspace: &str, id: &str, no_logs: Option<bool>, no_code: Option<bool>, approval_token: Option<&str>) -> Result<models::Job, Error<GetJobError>> {
1776    let local_var_configuration = configuration;
1777
1778    let local_var_client = &local_var_configuration.client;
1779
1780    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));
1781    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1782
1783    if let Some(ref local_var_str) = no_logs {
1784        local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1785    }
1786    if let Some(ref local_var_str) = no_code {
1787        local_var_req_builder = local_var_req_builder.query(&[("no_code", &local_var_str.to_string())]);
1788    }
1789    if let Some(ref local_var_str) = approval_token {
1790        local_var_req_builder = local_var_req_builder.query(&[("approval_token", &local_var_str.to_string())]);
1791    }
1792    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1793        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1794    }
1795    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1796        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1797    };
1798
1799    let local_var_req = local_var_req_builder.build()?;
1800    let local_var_resp = local_var_client.execute(local_var_req).await?;
1801
1802    let local_var_status = local_var_resp.status();
1803    let local_var_content = local_var_resp.text().await?;
1804
1805    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1806        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1807    } else {
1808        let local_var_entity: Option<GetJobError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1809        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1810        Err(Error::ResponseError(local_var_error))
1811    }
1812}
1813
1814pub async fn get_job_args(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetJobArgsError>> {
1815    let local_var_configuration = configuration;
1816
1817    let local_var_client = &local_var_configuration.client;
1818
1819    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));
1820    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1821
1822    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1823        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1824    }
1825    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1826        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1827    };
1828
1829    let local_var_req = local_var_req_builder.build()?;
1830    let local_var_resp = local_var_client.execute(local_var_req).await?;
1831
1832    let local_var_status = local_var_resp.status();
1833    let local_var_content = local_var_resp.text().await?;
1834
1835    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1836        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1837    } else {
1838        let local_var_entity: Option<GetJobArgsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1839        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1840        Err(Error::ResponseError(local_var_error))
1841    }
1842}
1843
1844pub async fn get_job_logs(configuration: &configuration::Configuration, workspace: &str, id: &str, remove_ansi_warnings: Option<bool>) -> Result<String, Error<GetJobLogsError>> {
1845    let local_var_configuration = configuration;
1846
1847    let local_var_client = &local_var_configuration.client;
1848
1849    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));
1850    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1851
1852    if let Some(ref local_var_str) = remove_ansi_warnings {
1853        local_var_req_builder = local_var_req_builder.query(&[("remove_ansi_warnings", &local_var_str.to_string())]);
1854    }
1855    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1856        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1857    }
1858    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1859        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1860    };
1861
1862    let local_var_req = local_var_req_builder.build()?;
1863    let local_var_resp = local_var_client.execute(local_var_req).await?;
1864
1865    let local_var_status = local_var_resp.status();
1866    let local_var_content = local_var_resp.text().await?;
1867
1868    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1869        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1870    } else {
1871        let local_var_entity: Option<GetJobLogsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1872        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1873        Err(Error::ResponseError(local_var_error))
1874    }
1875}
1876
1877pub async fn get_job_otel_traces(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<Vec<serde_json::Value>, Error<GetJobOtelTracesError>> {
1878    let local_var_configuration = configuration;
1879
1880    let local_var_client = &local_var_configuration.client;
1881
1882    let local_var_uri_str = format!("{}/w/{workspace}/jobs/get_otel_traces/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1883    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1884
1885    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1886        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1887    }
1888    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1889        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1890    };
1891
1892    let local_var_req = local_var_req_builder.build()?;
1893    let local_var_resp = local_var_client.execute(local_var_req).await?;
1894
1895    let local_var_status = local_var_resp.status();
1896    let local_var_content = local_var_resp.text().await?;
1897
1898    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1899        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1900    } else {
1901        let local_var_entity: Option<GetJobOtelTracesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1902        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1903        Err(Error::ResponseError(local_var_error))
1904    }
1905}
1906
1907/// Returns a stateless `{job_id}.{hmac}` token that grants anyone holding it — including logged-out visitors, who land on the minimal public run page — read access to this job (and its flow subtree) via a `view_token` query param or `X-View-Token` header. Only callable by a user who can already read the job. 
1908pub async fn get_job_public_view_token(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetJobPublicViewTokenError>> {
1909    let local_var_configuration = configuration;
1910
1911    let local_var_client = &local_var_configuration.client;
1912
1913    let local_var_uri_str = format!("{}/w/{workspace}/jobs/job_public_view_token/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1914    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1915
1916    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1917        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1918    }
1919    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1920        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1921    };
1922
1923    let local_var_req = local_var_req_builder.build()?;
1924    let local_var_resp = local_var_client.execute(local_var_req).await?;
1925
1926    let local_var_status = local_var_resp.status();
1927    let local_var_content = local_var_resp.text().await?;
1928
1929    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1930        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1931    } else {
1932        let local_var_entity: Option<GetJobPublicViewTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1933        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1934        Err(Error::ResponseError(local_var_error))
1935    }
1936}
1937
1938pub 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>> {
1939    let local_var_configuration = configuration;
1940
1941    let local_var_client = &local_var_configuration.client;
1942
1943    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));
1944    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1945
1946    if let Some(ref local_var_str) = running {
1947        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1948    }
1949    if let Some(ref local_var_str) = log_offset {
1950        local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1951    }
1952    if let Some(ref local_var_str) = stream_offset {
1953        local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1954    }
1955    if let Some(ref local_var_str) = get_progress {
1956        local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
1957    }
1958    if let Some(ref local_var_str) = no_logs {
1959        local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1960    }
1961    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1962        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1963    }
1964    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1965        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1966    };
1967
1968    let local_var_req = local_var_req_builder.build()?;
1969    let local_var_resp = local_var_client.execute(local_var_req).await?;
1970
1971    let local_var_status = local_var_resp.status();
1972    let local_var_content = local_var_resp.text().await?;
1973
1974    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1975        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
1976    } else {
1977        let local_var_entity: Option<GetJobUpdatesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
1978        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1979        Err(Error::ResponseError(local_var_error))
1980    }
1981}
1982
1983pub 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>, fast: Option<bool>) -> Result<String, Error<GetJobUpdatesSseError>> {
1984    let local_var_configuration = configuration;
1985
1986    let local_var_client = &local_var_configuration.client;
1987
1988    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));
1989    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1990
1991    if let Some(ref local_var_str) = running {
1992        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1993    }
1994    if let Some(ref local_var_str) = log_offset {
1995        local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1996    }
1997    if let Some(ref local_var_str) = stream_offset {
1998        local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1999    }
2000    if let Some(ref local_var_str) = get_progress {
2001        local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
2002    }
2003    if let Some(ref local_var_str) = only_result {
2004        local_var_req_builder = local_var_req_builder.query(&[("only_result", &local_var_str.to_string())]);
2005    }
2006    if let Some(ref local_var_str) = no_logs {
2007        local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
2008    }
2009    if let Some(ref local_var_str) = fast {
2010        local_var_req_builder = local_var_req_builder.query(&[("fast", &local_var_str.to_string())]);
2011    }
2012    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2013        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2014    }
2015    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2016        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2017    };
2018
2019    let local_var_req = local_var_req_builder.build()?;
2020    let local_var_resp = local_var_client.execute(local_var_req).await?;
2021
2022    let local_var_status = local_var_resp.status();
2023    let local_var_content = local_var_resp.text().await?;
2024
2025    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2026        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2027    } else {
2028        let local_var_entity: Option<GetJobUpdatesSseError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2029        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2030        Err(Error::ResponseError(local_var_error))
2031    }
2032}
2033
2034/// Returns a stateless `{job_id}.{hmac}` token that grants an authenticated workspace member read access to this job (and its flow subtree) via a `view_token` query param or `X-View-Token` header. Only callable by a user who can already read the job. 
2035pub async fn get_job_view_token(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetJobViewTokenError>> {
2036    let local_var_configuration = configuration;
2037
2038    let local_var_client = &local_var_configuration.client;
2039
2040    let local_var_uri_str = format!("{}/w/{workspace}/jobs/job_view_token/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
2041    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2042
2043    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2044        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2045    }
2046    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2047        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2048    };
2049
2050    let local_var_req = local_var_req_builder.build()?;
2051    let local_var_resp = local_var_client.execute(local_var_req).await?;
2052
2053    let local_var_status = local_var_resp.status();
2054    let local_var_content = local_var_resp.text().await?;
2055
2056    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2057        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2058    } else {
2059        let local_var_entity: Option<GetJobViewTokenError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2060        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2061        Err(Error::ResponseError(local_var_error))
2062    }
2063}
2064
2065pub async fn get_log_file_from_store(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetLogFileFromStoreError>> {
2066    let local_var_configuration = configuration;
2067
2068    let local_var_client = &local_var_configuration.client;
2069
2070    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));
2071    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2072
2073    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2074        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2075    }
2076    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2077        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2078    };
2079
2080    let local_var_req = local_var_req_builder.build()?;
2081    let local_var_resp = local_var_client.execute(local_var_req).await?;
2082
2083    let local_var_status = local_var_resp.status();
2084    let local_var_content = local_var_resp.text().await?;
2085
2086    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2087        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2088    } else {
2089        let local_var_entity: Option<GetLogFileFromStoreError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2090        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2091        Err(Error::ResponseError(local_var_error))
2092    }
2093}
2094
2095pub async fn get_queue_count(configuration: &configuration::Configuration, workspace: &str, all_workspaces: Option<bool>) -> Result<models::GetQueueCount200Response, Error<GetQueueCountError>> {
2096    let local_var_configuration = configuration;
2097
2098    let local_var_client = &local_var_configuration.client;
2099
2100    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2101    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2102
2103    if let Some(ref local_var_str) = all_workspaces {
2104        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2105    }
2106    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2107        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2108    }
2109    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2110        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2111    };
2112
2113    let local_var_req = local_var_req_builder.build()?;
2114    let local_var_resp = local_var_client.execute(local_var_req).await?;
2115
2116    let local_var_status = local_var_resp.status();
2117    let local_var_content = local_var_resp.text().await?;
2118
2119    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2120        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2121    } else {
2122        let local_var_entity: Option<GetQueueCountError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2123        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2124        Err(Error::ResponseError(local_var_error))
2125    }
2126}
2127
2128pub async fn get_queue_position(configuration: &configuration::Configuration, workspace: &str, scheduled_for: i32) -> Result<models::GetQueuePosition200Response, Error<GetQueuePositionError>> {
2129    let local_var_configuration = configuration;
2130
2131    let local_var_client = &local_var_configuration.client;
2132
2133    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);
2134    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2135
2136    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2137        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2138    }
2139    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2140        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2141    };
2142
2143    let local_var_req = local_var_req_builder.build()?;
2144    let local_var_resp = local_var_client.execute(local_var_req).await?;
2145
2146    let local_var_status = local_var_resp.status();
2147    let local_var_content = local_var_resp.text().await?;
2148
2149    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2150        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2151    } else {
2152        let local_var_entity: Option<GetQueuePositionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2153        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2154        Err(Error::ResponseError(local_var_error))
2155    }
2156}
2157
2158pub async fn get_resume_urls(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, approver: Option<&str>, flow_level: Option<bool>) -> Result<models::GetResumeUrls200Response, Error<GetResumeUrlsError>> {
2159    let local_var_configuration = configuration;
2160
2161    let local_var_client = &local_var_configuration.client;
2162
2163    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);
2164    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2165
2166    if let Some(ref local_var_str) = approver {
2167        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2168    }
2169    if let Some(ref local_var_str) = flow_level {
2170        local_var_req_builder = local_var_req_builder.query(&[("flow_level", &local_var_str.to_string())]);
2171    }
2172    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2173        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2174    }
2175    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2176        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2177    };
2178
2179    let local_var_req = local_var_req_builder.build()?;
2180    let local_var_resp = local_var_client.execute(local_var_req).await?;
2181
2182    let local_var_status = local_var_resp.status();
2183    let local_var_content = local_var_resp.text().await?;
2184
2185    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2186        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2187    } else {
2188        let local_var_entity: Option<GetResumeUrlsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2189        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2190        Err(Error::ResponseError(local_var_error))
2191    }
2192}
2193
2194pub async fn get_root_job_id(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetRootJobIdError>> {
2195    let local_var_configuration = configuration;
2196
2197    let local_var_client = &local_var_configuration.client;
2198
2199    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));
2200    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2201
2202    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2203        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2204    }
2205    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2206        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2207    };
2208
2209    let local_var_req = local_var_req_builder.build()?;
2210    let local_var_resp = local_var_client.execute(local_var_req).await?;
2211
2212    let local_var_status = local_var_resp.status();
2213    let local_var_content = local_var_resp.text().await?;
2214
2215    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2216        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2217    } else {
2218        let local_var_entity: Option<GetRootJobIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2219        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2220        Err(Error::ResponseError(local_var_error))
2221    }
2222}
2223
2224/// Live materialization state for the relations a single job writes, keyed by relation. Polled while a run is in flight so a graph can move a node as its model completes. Authorized through the job, so a caller who may not read it is refused rather than told the run has no progress. An empty list means the job exists and has recorded nothing yet, or is unknown to this workspace. 
2225pub async fn get_run_progress(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<Vec<models::AssetProgress>, Error<GetRunProgressError>> {
2226    let local_var_configuration = configuration;
2227
2228    let local_var_client = &local_var_configuration.client;
2229
2230    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_progress/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
2231    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2232
2233    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2234        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2235    }
2236    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2237        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2238    };
2239
2240    let local_var_req = local_var_req_builder.build()?;
2241    let local_var_resp = local_var_client.execute(local_var_req).await?;
2242
2243    let local_var_status = local_var_resp.status();
2244    let local_var_content = local_var_resp.text().await?;
2245
2246    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2247        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2248    } else {
2249        let local_var_entity: Option<GetRunProgressError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2250        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2251        Err(Error::ResponseError(local_var_error))
2252    }
2253}
2254
2255pub async fn get_scheduled_for(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<i32, Error<GetScheduledForError>> {
2256    let local_var_configuration = configuration;
2257
2258    let local_var_client = &local_var_configuration.client;
2259
2260    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));
2261    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2262
2263    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2264        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2265    }
2266    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2267        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2268    };
2269
2270    let local_var_req = local_var_req_builder.build()?;
2271    let local_var_resp = local_var_client.execute(local_var_req).await?;
2272
2273    let local_var_status = local_var_resp.status();
2274    let local_var_content = local_var_resp.text().await?;
2275
2276    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2277        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2278    } else {
2279        let local_var_entity: Option<GetScheduledForError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2280        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2281        Err(Error::ResponseError(local_var_error))
2282    }
2283}
2284
2285pub 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>, resume_button_text: Option<&str>, cancel_button_text: Option<&str>) -> Result<(), Error<GetSlackApprovalPayloadError>> {
2286    let local_var_configuration = configuration;
2287
2288    let local_var_client = &local_var_configuration.client;
2289
2290    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));
2291    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2292
2293    if let Some(ref local_var_str) = approver {
2294        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2295    }
2296    if let Some(ref local_var_str) = message {
2297        local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
2298    }
2299    local_var_req_builder = local_var_req_builder.query(&[("slack_resource_path", &slack_resource_path.to_string())]);
2300    local_var_req_builder = local_var_req_builder.query(&[("channel_id", &channel_id.to_string())]);
2301    local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
2302    if let Some(ref local_var_str) = default_args_json {
2303        local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
2304    }
2305    if let Some(ref local_var_str) = dynamic_enums_json {
2306        local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
2307    }
2308    if let Some(ref local_var_str) = resume_button_text {
2309        local_var_req_builder = local_var_req_builder.query(&[("resume_button_text", &local_var_str.to_string())]);
2310    }
2311    if let Some(ref local_var_str) = cancel_button_text {
2312        local_var_req_builder = local_var_req_builder.query(&[("cancel_button_text", &local_var_str.to_string())]);
2313    }
2314    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2315        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2316    }
2317    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2318        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2319    };
2320
2321    let local_var_req = local_var_req_builder.build()?;
2322    let local_var_resp = local_var_client.execute(local_var_req).await?;
2323
2324    let local_var_status = local_var_resp.status();
2325    let local_var_content = local_var_resp.text().await?;
2326
2327    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2328        Ok(())
2329    } else {
2330        let local_var_entity: Option<GetSlackApprovalPayloadError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2331        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2332        Err(Error::ResponseError(local_var_error))
2333    }
2334}
2335
2336pub async fn get_started_at_by_ids(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<String>, Error<GetStartedAtByIdsError>> {
2337    let local_var_configuration = configuration;
2338
2339    let local_var_client = &local_var_configuration.client;
2340
2341    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));
2342    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2343
2344    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2345        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2346    }
2347    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2348        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2349    };
2350    local_var_req_builder = local_var_req_builder.json(&request_body);
2351
2352    let local_var_req = local_var_req_builder.build()?;
2353    let local_var_resp = local_var_client.execute(local_var_req).await?;
2354
2355    let local_var_status = local_var_resp.status();
2356    let local_var_content = local_var_resp.text().await?;
2357
2358    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2359        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2360    } else {
2361        let local_var_entity: Option<GetStartedAtByIdsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2362        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2363        Err(Error::ResponseError(local_var_error))
2364    }
2365}
2366
2367pub 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>> {
2368    let local_var_configuration = configuration;
2369
2370    let local_var_client = &local_var_configuration.client;
2371
2372    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));
2373    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2374
2375    if let Some(ref local_var_str) = approver {
2376        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2377    }
2378    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2379        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2380    }
2381    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2382        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2383    };
2384
2385    let local_var_req = local_var_req_builder.build()?;
2386    let local_var_resp = local_var_client.execute(local_var_req).await?;
2387
2388    let local_var_status = local_var_resp.status();
2389    let local_var_content = local_var_resp.text().await?;
2390
2391    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2392        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2393    } else {
2394        let local_var_entity: Option<GetSuspendedJobFlowError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2395        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2396        Err(Error::ResponseError(local_var_error))
2397    }
2398}
2399
2400pub 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>, resume_button_text: Option<&str>, cancel_button_text: Option<&str>) -> Result<(), Error<GetTeamsApprovalPayloadError>> {
2401    let local_var_configuration = configuration;
2402
2403    let local_var_client = &local_var_configuration.client;
2404
2405    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));
2406    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2407
2408    if let Some(ref local_var_str) = approver {
2409        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2410    }
2411    if let Some(ref local_var_str) = message {
2412        local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
2413    }
2414    local_var_req_builder = local_var_req_builder.query(&[("team_name", &team_name.to_string())]);
2415    local_var_req_builder = local_var_req_builder.query(&[("channel_name", &channel_name.to_string())]);
2416    local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
2417    if let Some(ref local_var_str) = default_args_json {
2418        local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
2419    }
2420    if let Some(ref local_var_str) = dynamic_enums_json {
2421        local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
2422    }
2423    if let Some(ref local_var_str) = resume_button_text {
2424        local_var_req_builder = local_var_req_builder.query(&[("resume_button_text", &local_var_str.to_string())]);
2425    }
2426    if let Some(ref local_var_str) = cancel_button_text {
2427        local_var_req_builder = local_var_req_builder.query(&[("cancel_button_text", &local_var_str.to_string())]);
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        Ok(())
2444    } else {
2445        let local_var_entity: Option<GetTeamsApprovalPayloadError> = 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 get_wac_approval_urls(configuration: &configuration::Configuration, workspace: &str, id: &str, step_key: &str, approver: Option<&str>) -> Result<models::GetResumeUrls200Response, Error<GetWacApprovalUrlsError>> {
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/wac_approval_urls/{id}/{step_key}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), step_key=crate::apis::urlencode(step_key));
2457    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2458
2459    if let Some(ref local_var_str) = approver {
2460        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2461    }
2462    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2463        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2464    }
2465    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2466        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2467    };
2468
2469    let local_var_req = local_var_req_builder.build()?;
2470    let local_var_resp = local_var_client.execute(local_var_req).await?;
2471
2472    let local_var_status = local_var_resp.status();
2473    let local_var_content = local_var_resp.text().await?;
2474
2475    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2476        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2477    } else {
2478        let local_var_entity: Option<GetWacApprovalUrlsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2479        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2480        Err(Error::ResponseError(local_var_error))
2481    }
2482}
2483
2484pub async fn import_completed_jobs(configuration: &configuration::Configuration, workspace: &str, exportable_completed_job: Vec<models::ExportableCompletedJob>) -> Result<String, Error<ImportCompletedJobsError>> {
2485    let local_var_configuration = configuration;
2486
2487    let local_var_client = &local_var_configuration.client;
2488
2489    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/import", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2490    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2491
2492    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2493        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2494    }
2495    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2496        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2497    };
2498    local_var_req_builder = local_var_req_builder.json(&exportable_completed_job);
2499
2500    let local_var_req = local_var_req_builder.build()?;
2501    let local_var_resp = local_var_client.execute(local_var_req).await?;
2502
2503    let local_var_status = local_var_resp.status();
2504    let local_var_content = local_var_resp.text().await?;
2505
2506    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2507        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2508    } else {
2509        let local_var_entity: Option<ImportCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2510        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2511        Err(Error::ResponseError(local_var_error))
2512    }
2513}
2514
2515pub async fn import_queued_jobs(configuration: &configuration::Configuration, workspace: &str, exportable_queued_job: Vec<models::ExportableQueuedJob>) -> Result<String, Error<ImportQueuedJobsError>> {
2516    let local_var_configuration = configuration;
2517
2518    let local_var_client = &local_var_configuration.client;
2519
2520    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/import", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2521    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2522
2523    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2524        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2525    }
2526    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2527        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2528    };
2529    local_var_req_builder = local_var_req_builder.json(&exportable_queued_job);
2530
2531    let local_var_req = local_var_req_builder.build()?;
2532    let local_var_resp = local_var_client.execute(local_var_req).await?;
2533
2534    let local_var_status = local_var_resp.status();
2535    let local_var_content = local_var_resp.text().await?;
2536
2537    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2538        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2539    } else {
2540        let local_var_entity: Option<ImportQueuedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2541        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2542        Err(Error::ResponseError(local_var_error))
2543    }
2544}
2545
2546/// Returns the `dispatched` asset-trigger edges (producer job → child job) whose subscriber lives under `path_start`. Lets a pipeline view reconstruct the cascade tree of a folder by job id and group connected runs. Visibility follows the producer job's RLS. 
2547pub async fn list_asset_dispatch_edges(configuration: &configuration::Configuration, workspace: &str, path_start: &str, created_after: Option<String>) -> Result<Vec<models::ListAssetDispatchEdges200ResponseInner>, Error<ListAssetDispatchEdgesError>> {
2548    let local_var_configuration = configuration;
2549
2550    let local_var_client = &local_var_configuration.client;
2551
2552    let local_var_uri_str = format!("{}/w/{workspace}/jobs/asset_dispatch_edges", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2553    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2554
2555    local_var_req_builder = local_var_req_builder.query(&[("path_start", &path_start.to_string())]);
2556    if let Some(ref local_var_str) = created_after {
2557        local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
2558    }
2559    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2560        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2561    }
2562    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2563        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2564    };
2565
2566    let local_var_req = local_var_req_builder.build()?;
2567    let local_var_resp = local_var_client.execute(local_var_req).await?;
2568
2569    let local_var_status = local_var_resp.status();
2570    let local_var_content = local_var_resp.text().await?;
2571
2572    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2573        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2574    } else {
2575        let local_var_entity: Option<ListAssetDispatchEdgesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2576        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2577        Err(Error::ResponseError(local_var_error))
2578    }
2579}
2580
2581pub 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>, status: Option<&str>, 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>, resolved: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<models::CompletedJob>, Error<ListCompletedJobsError>> {
2582    let local_var_configuration = configuration;
2583
2584    let local_var_client = &local_var_configuration.client;
2585
2586    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2587    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2588
2589    if let Some(ref local_var_str) = order_desc {
2590        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
2591    }
2592    if let Some(ref local_var_str) = created_by {
2593        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2594    }
2595    if let Some(ref local_var_str) = label {
2596        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
2597    }
2598    if let Some(ref local_var_str) = worker {
2599        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2600    }
2601    if let Some(ref local_var_str) = parent_job {
2602        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2603    }
2604    if let Some(ref local_var_str) = script_path_exact {
2605        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2606    }
2607    if let Some(ref local_var_str) = script_path_start {
2608        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2609    }
2610    if let Some(ref local_var_str) = schedule_path {
2611        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2612    }
2613    if let Some(ref local_var_str) = script_hash {
2614        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2615    }
2616    if let Some(ref local_var_str) = started_before {
2617        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2618    }
2619    if let Some(ref local_var_str) = started_after {
2620        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2621    }
2622    if let Some(ref local_var_str) = success {
2623        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2624    }
2625    if let Some(ref local_var_str) = status {
2626        local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]);
2627    }
2628    if let Some(ref local_var_str) = job_kinds {
2629        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2630    }
2631    if let Some(ref local_var_str) = args {
2632        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2633    }
2634    if let Some(ref local_var_str) = result {
2635        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2636    }
2637    if let Some(ref local_var_str) = allow_wildcards {
2638        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2639    }
2640    if let Some(ref local_var_str) = tag {
2641        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2642    }
2643    if let Some(ref local_var_str) = page {
2644        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2645    }
2646    if let Some(ref local_var_str) = per_page {
2647        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2648    }
2649    if let Some(ref local_var_str) = is_skipped {
2650        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2651    }
2652    if let Some(ref local_var_str) = resolved {
2653        local_var_req_builder = local_var_req_builder.query(&[("resolved", &local_var_str.to_string())]);
2654    }
2655    if let Some(ref local_var_str) = is_flow_step {
2656        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2657    }
2658    if let Some(ref local_var_str) = has_null_parent {
2659        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2660    }
2661    if let Some(ref local_var_str) = is_not_schedule {
2662        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2663    }
2664    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2665        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2666    }
2667    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2668        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2669    };
2670
2671    let local_var_req = local_var_req_builder.build()?;
2672    let local_var_resp = local_var_client.execute(local_var_req).await?;
2673
2674    let local_var_status = local_var_resp.status();
2675    let local_var_content = local_var_resp.text().await?;
2676
2677    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2678        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2679    } else {
2680        let local_var_entity: Option<ListCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2681        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2682        Err(Error::ResponseError(local_var_error))
2683    }
2684}
2685
2686/// Returns the chronological log of decisions the asset-trigger dispatcher made after this producer job completed. Each row is one (subscriber, asset write) decision: `dispatched` (with `child_job_id`), `join_pending` (with `received_inputs` / `required_inputs` / `partition`), or `skipped` (with `reason`). Rows are reaped automatically when the producer's `v2_job` row is deleted by the retention sweep. 
2687pub async fn list_dispatch_events(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<Vec<models::ListDispatchEvents200ResponseInner>, Error<ListDispatchEventsError>> {
2688    let local_var_configuration = configuration;
2689
2690    let local_var_client = &local_var_configuration.client;
2691
2692    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/dispatch_events/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
2693    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2694
2695    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2696        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2697    }
2698    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2699        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2700    };
2701
2702    let local_var_req = local_var_req_builder.build()?;
2703    let local_var_resp = local_var_client.execute(local_var_req).await?;
2704
2705    let local_var_status = local_var_resp.status();
2706    let local_var_content = local_var_resp.text().await?;
2707
2708    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2709        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2710    } else {
2711        let local_var_entity: Option<ListDispatchEventsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2712        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2713        Err(Error::ResponseError(local_var_error))
2714    }
2715}
2716
2717pub 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>, resolved: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, status: Option<&str>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<models::ExtendedJobs, Error<ListExtendedJobsError>> {
2718    let local_var_configuration = configuration;
2719
2720    let local_var_client = &local_var_configuration.client;
2721
2722    let local_var_uri_str = format!("{}/w/{workspace}/concurrency_groups/list_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2723    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2724
2725    if let Some(ref local_var_str) = concurrency_key {
2726        local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
2727    }
2728    if let Some(ref local_var_str) = row_limit {
2729        local_var_req_builder = local_var_req_builder.query(&[("row_limit", &local_var_str.to_string())]);
2730    }
2731    if let Some(ref local_var_str) = created_by {
2732        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2733    }
2734    if let Some(ref local_var_str) = label {
2735        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
2736    }
2737    if let Some(ref local_var_str) = parent_job {
2738        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2739    }
2740    if let Some(ref local_var_str) = script_path_exact {
2741        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2742    }
2743    if let Some(ref local_var_str) = script_path_start {
2744        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2745    }
2746    if let Some(ref local_var_str) = schedule_path {
2747        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2748    }
2749    if let Some(ref local_var_str) = script_hash {
2750        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2751    }
2752    if let Some(ref local_var_str) = started_before {
2753        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2754    }
2755    if let Some(ref local_var_str) = started_after {
2756        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2757    }
2758    if let Some(ref local_var_str) = running {
2759        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2760    }
2761    if let Some(ref local_var_str) = scheduled_for_before_now {
2762        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2763    }
2764    if let Some(ref local_var_str) = completed_before {
2765        local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
2766    }
2767    if let Some(ref local_var_str) = completed_after {
2768        local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
2769    }
2770    if let Some(ref local_var_str) = created_before_queue {
2771        local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
2772    }
2773    if let Some(ref local_var_str) = created_after_queue {
2774        local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
2775    }
2776    if let Some(ref local_var_str) = job_kinds {
2777        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2778    }
2779    if let Some(ref local_var_str) = args {
2780        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2781    }
2782    if let Some(ref local_var_str) = tag {
2783        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2784    }
2785    if let Some(ref local_var_str) = result {
2786        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2787    }
2788    if let Some(ref local_var_str) = allow_wildcards {
2789        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2790    }
2791    if let Some(ref local_var_str) = page {
2792        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2793    }
2794    if let Some(ref local_var_str) = per_page {
2795        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2796    }
2797    if let Some(ref local_var_str) = trigger_kind {
2798        local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
2799    }
2800    if let Some(ref local_var_str) = is_skipped {
2801        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2802    }
2803    if let Some(ref local_var_str) = resolved {
2804        local_var_req_builder = local_var_req_builder.query(&[("resolved", &local_var_str.to_string())]);
2805    }
2806    if let Some(ref local_var_str) = is_flow_step {
2807        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2808    }
2809    if let Some(ref local_var_str) = has_null_parent {
2810        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2811    }
2812    if let Some(ref local_var_str) = success {
2813        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2814    }
2815    if let Some(ref local_var_str) = status {
2816        local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]);
2817    }
2818    if let Some(ref local_var_str) = all_workspaces {
2819        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2820    }
2821    if let Some(ref local_var_str) = is_not_schedule {
2822        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2823    }
2824    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2825        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2826    }
2827    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2828        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2829    };
2830
2831    let local_var_req = local_var_req_builder.build()?;
2832    let local_var_resp = local_var_client.execute(local_var_req).await?;
2833
2834    let local_var_status = local_var_resp.status();
2835    let local_var_content = local_var_resp.text().await?;
2836
2837    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2838        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2839    } else {
2840        let local_var_entity: Option<ListExtendedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2841        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2842        Err(Error::ResponseError(local_var_error))
2843    }
2844}
2845
2846pub 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>, resolved: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, status: Option<&str>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<String>, Error<ListFilteredJobsUuidsError>> {
2847    let local_var_configuration = configuration;
2848
2849    let local_var_client = &local_var_configuration.client;
2850
2851    let local_var_uri_str = format!("{}/w/{workspace}/jobs/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2852    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2853
2854    if let Some(ref local_var_str) = created_by {
2855        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2856    }
2857    if let Some(ref local_var_str) = label {
2858        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
2859    }
2860    if let Some(ref local_var_str) = worker {
2861        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2862    }
2863    if let Some(ref local_var_str) = parent_job {
2864        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2865    }
2866    if let Some(ref local_var_str) = script_path_exact {
2867        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2868    }
2869    if let Some(ref local_var_str) = script_path_start {
2870        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2871    }
2872    if let Some(ref local_var_str) = schedule_path {
2873        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2874    }
2875    if let Some(ref local_var_str) = script_hash {
2876        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2877    }
2878    if let Some(ref local_var_str) = started_before {
2879        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2880    }
2881    if let Some(ref local_var_str) = started_after {
2882        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2883    }
2884    if let Some(ref local_var_str) = created_before {
2885        local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
2886    }
2887    if let Some(ref local_var_str) = created_after {
2888        local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
2889    }
2890    if let Some(ref local_var_str) = completed_before {
2891        local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
2892    }
2893    if let Some(ref local_var_str) = completed_after {
2894        local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
2895    }
2896    if let Some(ref local_var_str) = created_before_queue {
2897        local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
2898    }
2899    if let Some(ref local_var_str) = created_after_queue {
2900        local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
2901    }
2902    if let Some(ref local_var_str) = running {
2903        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2904    }
2905    if let Some(ref local_var_str) = scheduled_for_before_now {
2906        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2907    }
2908    if let Some(ref local_var_str) = job_kinds {
2909        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2910    }
2911    if let Some(ref local_var_str) = suspended {
2912        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2913    }
2914    if let Some(ref local_var_str) = args {
2915        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2916    }
2917    if let Some(ref local_var_str) = tag {
2918        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2919    }
2920    if let Some(ref local_var_str) = result {
2921        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2922    }
2923    if let Some(ref local_var_str) = page {
2924        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2925    }
2926    if let Some(ref local_var_str) = per_page {
2927        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2928    }
2929    if let Some(ref local_var_str) = is_skipped {
2930        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2931    }
2932    if let Some(ref local_var_str) = resolved {
2933        local_var_req_builder = local_var_req_builder.query(&[("resolved", &local_var_str.to_string())]);
2934    }
2935    if let Some(ref local_var_str) = is_flow_step {
2936        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2937    }
2938    if let Some(ref local_var_str) = has_null_parent {
2939        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2940    }
2941    if let Some(ref local_var_str) = success {
2942        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2943    }
2944    if let Some(ref local_var_str) = status {
2945        local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]);
2946    }
2947    if let Some(ref local_var_str) = all_workspaces {
2948        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2949    }
2950    if let Some(ref local_var_str) = is_not_schedule {
2951        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2952    }
2953    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2954        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2955    }
2956    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2957        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2958    };
2959
2960    let local_var_req = local_var_req_builder.build()?;
2961    let local_var_resp = local_var_client.execute(local_var_req).await?;
2962
2963    let local_var_status = local_var_resp.status();
2964    let local_var_content = local_var_resp.text().await?;
2965
2966    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2967        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
2968    } else {
2969        let local_var_entity: Option<ListFilteredJobsUuidsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
2970        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2971        Err(Error::ResponseError(local_var_error))
2972    }
2973}
2974
2975pub 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>> {
2976    let local_var_configuration = configuration;
2977
2978    let local_var_client = &local_var_configuration.client;
2979
2980    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2981    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2982
2983    if let Some(ref local_var_str) = order_desc {
2984        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
2985    }
2986    if let Some(ref local_var_str) = created_by {
2987        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2988    }
2989    if let Some(ref local_var_str) = parent_job {
2990        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2991    }
2992    if let Some(ref local_var_str) = script_path_exact {
2993        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2994    }
2995    if let Some(ref local_var_str) = script_path_start {
2996        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2997    }
2998    if let Some(ref local_var_str) = schedule_path {
2999        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
3000    }
3001    if let Some(ref local_var_str) = script_hash {
3002        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
3003    }
3004    if let Some(ref local_var_str) = started_before {
3005        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
3006    }
3007    if let Some(ref local_var_str) = started_after {
3008        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
3009    }
3010    if let Some(ref local_var_str) = success {
3011        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
3012    }
3013    if let Some(ref local_var_str) = scheduled_for_before_now {
3014        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
3015    }
3016    if let Some(ref local_var_str) = job_kinds {
3017        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
3018    }
3019    if let Some(ref local_var_str) = suspended {
3020        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
3021    }
3022    if let Some(ref local_var_str) = running {
3023        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
3024    }
3025    if let Some(ref local_var_str) = args {
3026        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
3027    }
3028    if let Some(ref local_var_str) = result {
3029        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
3030    }
3031    if let Some(ref local_var_str) = allow_wildcards {
3032        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
3033    }
3034    if let Some(ref local_var_str) = tag {
3035        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3036    }
3037    if let Some(ref local_var_str) = page {
3038        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3039    }
3040    if let Some(ref local_var_str) = per_page {
3041        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3042    }
3043    if let Some(ref local_var_str) = concurrency_key {
3044        local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
3045    }
3046    if let Some(ref local_var_str) = all_workspaces {
3047        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
3048    }
3049    if let Some(ref local_var_str) = is_not_schedule {
3050        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
3051    }
3052    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3053        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3054    }
3055    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3056        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3057    };
3058
3059    let local_var_req = local_var_req_builder.build()?;
3060    let local_var_resp = local_var_client.execute(local_var_req).await?;
3061
3062    let local_var_status = local_var_resp.status();
3063    let local_var_content = local_var_resp.text().await?;
3064
3065    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3066        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3067    } else {
3068        let local_var_entity: Option<ListFilteredQueueUuidsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3069        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3070        Err(Error::ResponseError(local_var_error))
3071    }
3072}
3073
3074pub 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>, resolved: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, status: Option<&str>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>, excludes_entrypoint_override: Option<bool>, broad_filter: Option<&str>) -> Result<Vec<models::Job>, Error<ListJobsError>> {
3075    let local_var_configuration = configuration;
3076
3077    let local_var_client = &local_var_configuration.client;
3078
3079    let local_var_uri_str = format!("{}/w/{workspace}/jobs/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3080    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3081
3082    if let Some(ref local_var_str) = created_by {
3083        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
3084    }
3085    if let Some(ref local_var_str) = label {
3086        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
3087    }
3088    if let Some(ref local_var_str) = worker {
3089        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
3090    }
3091    if let Some(ref local_var_str) = parent_job {
3092        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3093    }
3094    if let Some(ref local_var_str) = script_path_exact {
3095        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
3096    }
3097    if let Some(ref local_var_str) = script_path_start {
3098        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
3099    }
3100    if let Some(ref local_var_str) = schedule_path {
3101        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
3102    }
3103    if let Some(ref local_var_str) = script_hash {
3104        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
3105    }
3106    if let Some(ref local_var_str) = started_before {
3107        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
3108    }
3109    if let Some(ref local_var_str) = started_after {
3110        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
3111    }
3112    if let Some(ref local_var_str) = created_before {
3113        local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
3114    }
3115    if let Some(ref local_var_str) = created_after {
3116        local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
3117    }
3118    if let Some(ref local_var_str) = completed_before {
3119        local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
3120    }
3121    if let Some(ref local_var_str) = completed_after {
3122        local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
3123    }
3124    if let Some(ref local_var_str) = created_before_queue {
3125        local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
3126    }
3127    if let Some(ref local_var_str) = created_after_queue {
3128        local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
3129    }
3130    if let Some(ref local_var_str) = running {
3131        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
3132    }
3133    if let Some(ref local_var_str) = scheduled_for_before_now {
3134        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
3135    }
3136    if let Some(ref local_var_str) = job_kinds {
3137        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
3138    }
3139    if let Some(ref local_var_str) = suspended {
3140        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
3141    }
3142    if let Some(ref local_var_str) = args {
3143        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
3144    }
3145    if let Some(ref local_var_str) = tag {
3146        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3147    }
3148    if let Some(ref local_var_str) = result {
3149        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
3150    }
3151    if let Some(ref local_var_str) = allow_wildcards {
3152        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
3153    }
3154    if let Some(ref local_var_str) = per_page {
3155        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3156    }
3157    if let Some(ref local_var_str) = trigger_kind {
3158        local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
3159    }
3160    if let Some(ref local_var_str) = is_skipped {
3161        local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
3162    }
3163    if let Some(ref local_var_str) = resolved {
3164        local_var_req_builder = local_var_req_builder.query(&[("resolved", &local_var_str.to_string())]);
3165    }
3166    if let Some(ref local_var_str) = is_flow_step {
3167        local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
3168    }
3169    if let Some(ref local_var_str) = has_null_parent {
3170        local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
3171    }
3172    if let Some(ref local_var_str) = success {
3173        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
3174    }
3175    if let Some(ref local_var_str) = status {
3176        local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]);
3177    }
3178    if let Some(ref local_var_str) = all_workspaces {
3179        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
3180    }
3181    if let Some(ref local_var_str) = is_not_schedule {
3182        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
3183    }
3184    if let Some(ref local_var_str) = excludes_entrypoint_override {
3185        local_var_req_builder = local_var_req_builder.query(&[("excludes_entrypoint_override", &local_var_str.to_string())]);
3186    }
3187    if let Some(ref local_var_str) = broad_filter {
3188        local_var_req_builder = local_var_req_builder.query(&[("broad_filter", &local_var_str.to_string())]);
3189    }
3190    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3191        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3192    }
3193    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3194        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3195    };
3196
3197    let local_var_req = local_var_req_builder.build()?;
3198    let local_var_resp = local_var_client.execute(local_var_req).await?;
3199
3200    let local_var_status = local_var_resp.status();
3201    let local_var_content = local_var_resp.text().await?;
3202
3203    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3204        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3205    } else {
3206        let local_var_entity: Option<ListJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3207        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3208        Err(Error::ResponseError(local_var_error))
3209    }
3210}
3211
3212pub 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>, trigger_path: Option<&str>, trigger_kind: 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>> {
3213    let local_var_configuration = configuration;
3214
3215    let local_var_client = &local_var_configuration.client;
3216
3217    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3218    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3219
3220    if let Some(ref local_var_str) = order_desc {
3221        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
3222    }
3223    if let Some(ref local_var_str) = created_by {
3224        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
3225    }
3226    if let Some(ref local_var_str) = parent_job {
3227        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3228    }
3229    if let Some(ref local_var_str) = worker {
3230        local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
3231    }
3232    if let Some(ref local_var_str) = script_path_exact {
3233        local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
3234    }
3235    if let Some(ref local_var_str) = script_path_start {
3236        local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
3237    }
3238    if let Some(ref local_var_str) = schedule_path {
3239        local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
3240    }
3241    if let Some(ref local_var_str) = trigger_path {
3242        local_var_req_builder = local_var_req_builder.query(&[("trigger_path", &local_var_str.to_string())]);
3243    }
3244    if let Some(ref local_var_str) = trigger_kind {
3245        local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
3246    }
3247    if let Some(ref local_var_str) = script_hash {
3248        local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
3249    }
3250    if let Some(ref local_var_str) = started_before {
3251        local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
3252    }
3253    if let Some(ref local_var_str) = started_after {
3254        local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
3255    }
3256    if let Some(ref local_var_str) = success {
3257        local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
3258    }
3259    if let Some(ref local_var_str) = scheduled_for_before_now {
3260        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
3261    }
3262    if let Some(ref local_var_str) = job_kinds {
3263        local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
3264    }
3265    if let Some(ref local_var_str) = suspended {
3266        local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
3267    }
3268    if let Some(ref local_var_str) = running {
3269        local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
3270    }
3271    if let Some(ref local_var_str) = args {
3272        local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
3273    }
3274    if let Some(ref local_var_str) = result {
3275        local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
3276    }
3277    if let Some(ref local_var_str) = allow_wildcards {
3278        local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
3279    }
3280    if let Some(ref local_var_str) = tag {
3281        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3282    }
3283    if let Some(ref local_var_str) = page {
3284        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
3285    }
3286    if let Some(ref local_var_str) = per_page {
3287        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
3288    }
3289    if let Some(ref local_var_str) = all_workspaces {
3290        local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
3291    }
3292    if let Some(ref local_var_str) = is_not_schedule {
3293        local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
3294    }
3295    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3296        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3297    }
3298    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3299        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3300    };
3301
3302    let local_var_req = local_var_req_builder.build()?;
3303    let local_var_resp = local_var_client.execute(local_var_req).await?;
3304
3305    let local_var_status = local_var_resp.status();
3306    let local_var_content = local_var_resp.text().await?;
3307
3308    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3309        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3310    } else {
3311        let local_var_entity: Option<ListQueueError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3312        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3313        Err(Error::ResponseError(local_var_error))
3314    }
3315}
3316
3317/// Assets detected while the run executed (SDK S3 calls, resources passed as arguments), aggregated over the job and all of its child jobs so a flow or workflow-as-code run reports what its steps and tasks touched. Authorized through the job, the same gate as `run_progress`. Recording is asynchronous, so an asset can take a few minutes after the run to appear, and only the most recent runs that touched an asset keep that record. A run that fans out can touch more assets than one response should carry, so the list is capped and `truncated` says when it was cut. 
3318pub async fn list_run_assets(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::ListRunAssets200Response, Error<ListRunAssetsError>> {
3319    let local_var_configuration = configuration;
3320
3321    let local_var_client = &local_var_configuration.client;
3322
3323    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_assets/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
3324    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3325
3326    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3327        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3328    }
3329    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3330        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3331    };
3332
3333    let local_var_req = local_var_req_builder.build()?;
3334    let local_var_resp = local_var_client.execute(local_var_req).await?;
3335
3336    let local_var_status = local_var_resp.status();
3337    let local_var_content = local_var_resp.text().await?;
3338
3339    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3340        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3341    } else {
3342        let local_var_entity: Option<ListRunAssetsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3343        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3344        Err(Error::ResponseError(local_var_error))
3345    }
3346}
3347
3348pub async fn list_selected_job_groups(configuration: &configuration::Configuration, workspace: &str, uuid_colon_colon_uuid: Vec<uuid::Uuid>) -> Result<Vec<models::ListSelectedJobGroups200ResponseInner>, Error<ListSelectedJobGroupsError>> {
3349    let local_var_configuration = configuration;
3350
3351    let local_var_client = &local_var_configuration.client;
3352
3353    let local_var_uri_str = format!("{}/w/{workspace}/jobs/list_selected_job_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3354    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3355
3356    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3357        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3358    }
3359    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3360        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3361    };
3362    local_var_req_builder = local_var_req_builder.json(&uuid_colon_colon_uuid);
3363
3364    let local_var_req = local_var_req_builder.build()?;
3365    let local_var_resp = local_var_client.execute(local_var_req).await?;
3366
3367    let local_var_status = local_var_resp.status();
3368    let local_var_content = local_var_resp.text().await?;
3369
3370    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3371        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3372    } else {
3373        let local_var_entity: Option<ListSelectedJobGroupsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3374        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3375        Err(Error::ResponseError(local_var_error))
3376    }
3377}
3378
3379/// Marks failed jobs as handled so triage surfaces stop showing them as failures. The job status itself is unchanged. Returns the ids actually resolved: ids that are not visible to the caller or did not fail are silently skipped.
3380pub async fn resolve_completed_jobs(configuration: &configuration::Configuration, workspace: &str, resolve_completed_jobs_request: models::ResolveCompletedJobsRequest) -> Result<Vec<uuid::Uuid>, Error<ResolveCompletedJobsError>> {
3381    let local_var_configuration = configuration;
3382
3383    let local_var_client = &local_var_configuration.client;
3384
3385    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/resolve", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3386    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3387
3388    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3389        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3390    }
3391    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3392        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3393    };
3394    local_var_req_builder = local_var_req_builder.json(&resolve_completed_jobs_request);
3395
3396    let local_var_req = local_var_req_builder.build()?;
3397    let local_var_resp = local_var_client.execute(local_var_req).await?;
3398
3399    let local_var_status = local_var_resp.status();
3400    let local_var_content = local_var_resp.text().await?;
3401
3402    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3403        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3404    } else {
3405        let local_var_entity: Option<ResolveCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3406        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3407        Err(Error::ResponseError(local_var_error))
3408    }
3409}
3410
3411pub async fn restart_flow_at_step(configuration: &configuration::Configuration, workspace: &str, id: &str, restart_flow_at_step_request: models::RestartFlowAtStepRequest, 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>> {
3412    let local_var_configuration = configuration;
3413
3414    let local_var_client = &local_var_configuration.client;
3415
3416    let local_var_uri_str = format!("{}/w/{workspace}/jobs/restart/f/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
3417    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3418
3419    if let Some(ref local_var_str) = scheduled_for {
3420        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3421    }
3422    if let Some(ref local_var_str) = scheduled_in_secs {
3423        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3424    }
3425    if let Some(ref local_var_str) = parent_job {
3426        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3427    }
3428    if let Some(ref local_var_str) = tag {
3429        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3430    }
3431    if let Some(ref local_var_str) = job_id {
3432        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3433    }
3434    if let Some(ref local_var_str) = include_header {
3435        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3436    }
3437    if let Some(ref local_var_str) = invisible_to_owner {
3438        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3439    }
3440    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3441        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3442    }
3443    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3444        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3445    };
3446    local_var_req_builder = local_var_req_builder.json(&restart_flow_at_step_request);
3447
3448    let local_var_req = local_var_req_builder.build()?;
3449    let local_var_resp = local_var_client.execute(local_var_req).await?;
3450
3451    let local_var_status = local_var_resp.status();
3452    let local_var_content = local_var_resp.text().await?;
3453
3454    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3455        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3456    } else {
3457        let local_var_entity: Option<RestartFlowAtStepError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3458        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3459        Err(Error::ResponseError(local_var_error))
3460    }
3461}
3462
3463pub async fn result_by_id(configuration: &configuration::Configuration, workspace: &str, flow_job_id: &str, node_id: &str) -> Result<serde_json::Value, Error<ResultByIdError>> {
3464    let local_var_configuration = configuration;
3465
3466    let local_var_client = &local_var_configuration.client;
3467
3468    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));
3469    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3470
3471    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3472        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3473    }
3474    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3475        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3476    };
3477
3478    let local_var_req = local_var_req_builder.build()?;
3479    let local_var_resp = local_var_client.execute(local_var_req).await?;
3480
3481    let local_var_status = local_var_resp.status();
3482    let local_var_content = local_var_resp.text().await?;
3483
3484    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3485        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3486    } else {
3487        let local_var_entity: Option<ResultByIdError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3488        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3489        Err(Error::ResponseError(local_var_error))
3490    }
3491}
3492
3493/// Resume or cancel a suspended flow/WAC job. Uses approval rules to determine authorization. Either a valid approval_token or an authenticated session is required. 
3494pub async fn resume_suspended(configuration: &configuration::Configuration, workspace: &str, job_id: &str, resume_suspended_request: models::ResumeSuspendedRequest) -> Result<String, Error<ResumeSuspendedError>> {
3495    let local_var_configuration = configuration;
3496
3497    let local_var_client = &local_var_configuration.client;
3498
3499    let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/flow/resume_suspended/{job_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), job_id=crate::apis::urlencode(job_id));
3500    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3501
3502    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3503        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3504    }
3505    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3506        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3507    };
3508    local_var_req_builder = local_var_req_builder.json(&resume_suspended_request);
3509
3510    let local_var_req = local_var_req_builder.build()?;
3511    let local_var_resp = local_var_client.execute(local_var_req).await?;
3512
3513    let local_var_status = local_var_resp.status();
3514    let local_var_content = local_var_resp.text().await?;
3515
3516    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3517        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3518    } else {
3519        let local_var_entity: Option<ResumeSuspendedError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3520        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3521        Err(Error::ResponseError(local_var_error))
3522    }
3523}
3524
3525pub async fn resume_suspended_flow_as_owner(configuration: &configuration::Configuration, workspace: &str, id: &str, body: serde_json::Value) -> Result<String, Error<ResumeSuspendedFlowAsOwnerError>> {
3526    let local_var_configuration = configuration;
3527
3528    let local_var_client = &local_var_configuration.client;
3529
3530    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));
3531    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3532
3533    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3534        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3535    }
3536    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3537        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3538    };
3539    local_var_req_builder = local_var_req_builder.json(&body);
3540
3541    let local_var_req = local_var_req_builder.build()?;
3542    let local_var_resp = local_var_client.execute(local_var_req).await?;
3543
3544    let local_var_status = local_var_resp.status();
3545    let local_var_content = local_var_resp.text().await?;
3546
3547    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3548        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3549    } else {
3550        let local_var_entity: Option<ResumeSuspendedFlowAsOwnerError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3551        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3552        Err(Error::ResponseError(local_var_error))
3553    }
3554}
3555
3556pub 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>> {
3557    let local_var_configuration = configuration;
3558
3559    let local_var_client = &local_var_configuration.client;
3560
3561    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));
3562    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3563
3564    if let Some(ref local_var_str) = payload {
3565        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3566    }
3567    if let Some(ref local_var_str) = approver {
3568        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
3569    }
3570    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3571        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3572    }
3573    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3574        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3575    };
3576
3577    let local_var_req = local_var_req_builder.build()?;
3578    let local_var_resp = local_var_client.execute(local_var_req).await?;
3579
3580    let local_var_status = local_var_resp.status();
3581    let local_var_content = local_var_resp.text().await?;
3582
3583    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3584        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3585    } else {
3586        let local_var_entity: Option<ResumeSuspendedJobGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3587        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3588        Err(Error::ResponseError(local_var_error))
3589    }
3590}
3591
3592pub 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>> {
3593    let local_var_configuration = configuration;
3594
3595    let local_var_client = &local_var_configuration.client;
3596
3597    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));
3598    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3599
3600    if let Some(ref local_var_str) = approver {
3601        local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
3602    }
3603    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3604        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3605    }
3606    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3607        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3608    };
3609    local_var_req_builder = local_var_req_builder.json(&body);
3610
3611    let local_var_req = local_var_req_builder.build()?;
3612    let local_var_resp = local_var_client.execute(local_var_req).await?;
3613
3614    let local_var_status = local_var_resp.status();
3615    let local_var_content = local_var_resp.text().await?;
3616
3617    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3618        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3619    } else {
3620        let local_var_entity: Option<ResumeSuspendedJobPostError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3621        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3622        Err(Error::ResponseError(local_var_error))
3623    }
3624}
3625
3626/// Runs the `ai_agent` resource at `path` as stored, for any caller who can read it (operators included), as the caller, who needs access to the agent's AI resource and to whatever its tools use. With `memory_id`, the run is a turn of the caller's conversation with the agent; without, a single run. 
3627pub async fn run_agent(configuration: &configuration::Configuration, workspace: &str, path: &str, run_agent_request: models::RunAgentRequest, memory_id: Option<&str>) -> Result<uuid::Uuid, Error<RunAgentError>> {
3628    let local_var_configuration = configuration;
3629
3630    let local_var_client = &local_var_configuration.client;
3631
3632    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/agent/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3633    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3634
3635    if let Some(ref local_var_str) = memory_id {
3636        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3637    }
3638    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3639        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3640    }
3641    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3642        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3643    };
3644    local_var_req_builder = local_var_req_builder.json(&run_agent_request);
3645
3646    let local_var_req = local_var_req_builder.build()?;
3647    let local_var_resp = local_var_client.execute(local_var_req).await?;
3648
3649    let local_var_status = local_var_resp.status();
3650    let local_var_content = local_var_resp.text().await?;
3651
3652    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3653        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3654    } else {
3655        let local_var_entity: Option<RunAgentError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3656        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3657        Err(Error::ResponseError(local_var_error))
3658    }
3659}
3660
3661pub 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>> {
3662    let local_var_configuration = configuration;
3663
3664    let local_var_client = &local_var_configuration.client;
3665
3666    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));
3667    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3668
3669    if let Some(ref local_var_str) = include_header {
3670        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3671    }
3672    if let Some(ref local_var_str) = queue_limit {
3673        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3674    }
3675    if let Some(ref local_var_str) = job_id {
3676        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3677    }
3678    if let Some(ref local_var_str) = skip_preprocessor {
3679        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3680    }
3681    if let Some(ref local_var_str) = memory_id {
3682        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3683    }
3684    if let Some(ref local_var_str) = poll_delay_ms {
3685        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3686    }
3687    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3688        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3689    }
3690    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3691        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3692    };
3693    local_var_req_builder = local_var_req_builder.json(&request_body);
3694
3695    let local_var_req = local_var_req_builder.build()?;
3696    let local_var_resp = local_var_client.execute(local_var_req).await?;
3697
3698    let local_var_status = local_var_resp.status();
3699    let local_var_content = local_var_resp.text().await?;
3700
3701    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3702        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3703    } else {
3704        let local_var_entity: Option<RunAndStreamFlowByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3705        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3706        Err(Error::ResponseError(local_var_error))
3707    }
3708}
3709
3710pub 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>> {
3711    let local_var_configuration = configuration;
3712
3713    let local_var_client = &local_var_configuration.client;
3714
3715    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));
3716    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3717
3718    if let Some(ref local_var_str) = include_header {
3719        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3720    }
3721    if let Some(ref local_var_str) = queue_limit {
3722        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3723    }
3724    if let Some(ref local_var_str) = payload {
3725        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3726    }
3727    if let Some(ref local_var_str) = job_id {
3728        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3729    }
3730    if let Some(ref local_var_str) = skip_preprocessor {
3731        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3732    }
3733    if let Some(ref local_var_str) = memory_id {
3734        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3735    }
3736    if let Some(ref local_var_str) = poll_delay_ms {
3737        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3738    }
3739    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3740        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3741    }
3742    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3743        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3744    };
3745
3746    let local_var_req = local_var_req_builder.build()?;
3747    let local_var_resp = local_var_client.execute(local_var_req).await?;
3748
3749    let local_var_status = local_var_resp.status();
3750    let local_var_content = local_var_resp.text().await?;
3751
3752    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3753        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3754    } else {
3755        let local_var_entity: Option<RunAndStreamFlowByPathGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3756        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3757        Err(Error::ResponseError(local_var_error))
3758    }
3759}
3760
3761pub 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>> {
3762    let local_var_configuration = configuration;
3763
3764    let local_var_client = &local_var_configuration.client;
3765
3766    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);
3767    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3768
3769    if let Some(ref local_var_str) = include_header {
3770        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3771    }
3772    if let Some(ref local_var_str) = queue_limit {
3773        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3774    }
3775    if let Some(ref local_var_str) = job_id {
3776        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3777    }
3778    if let Some(ref local_var_str) = skip_preprocessor {
3779        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3780    }
3781    if let Some(ref local_var_str) = memory_id {
3782        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3783    }
3784    if let Some(ref local_var_str) = poll_delay_ms {
3785        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3786    }
3787    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3788        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3789    }
3790    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3791        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3792    };
3793    local_var_req_builder = local_var_req_builder.json(&request_body);
3794
3795    let local_var_req = local_var_req_builder.build()?;
3796    let local_var_resp = local_var_client.execute(local_var_req).await?;
3797
3798    let local_var_status = local_var_resp.status();
3799    let local_var_content = local_var_resp.text().await?;
3800
3801    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3802        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3803    } else {
3804        let local_var_entity: Option<RunAndStreamFlowByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3805        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3806        Err(Error::ResponseError(local_var_error))
3807    }
3808}
3809
3810pub 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>> {
3811    let local_var_configuration = configuration;
3812
3813    let local_var_client = &local_var_configuration.client;
3814
3815    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);
3816    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3817
3818    if let Some(ref local_var_str) = include_header {
3819        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3820    }
3821    if let Some(ref local_var_str) = queue_limit {
3822        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3823    }
3824    if let Some(ref local_var_str) = payload {
3825        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3826    }
3827    if let Some(ref local_var_str) = job_id {
3828        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3829    }
3830    if let Some(ref local_var_str) = skip_preprocessor {
3831        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3832    }
3833    if let Some(ref local_var_str) = memory_id {
3834        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3835    }
3836    if let Some(ref local_var_str) = poll_delay_ms {
3837        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3838    }
3839    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3840        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3841    }
3842    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3843        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3844    };
3845
3846    let local_var_req = local_var_req_builder.build()?;
3847    let local_var_resp = local_var_client.execute(local_var_req).await?;
3848
3849    let local_var_status = local_var_resp.status();
3850    let local_var_content = local_var_resp.text().await?;
3851
3852    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3853        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3854    } else {
3855        let local_var_entity: Option<RunAndStreamFlowByVersionGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3856        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3857        Err(Error::ResponseError(local_var_error))
3858    }
3859}
3860
3861pub 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>> {
3862    let local_var_configuration = configuration;
3863
3864    let local_var_client = &local_var_configuration.client;
3865
3866    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));
3867    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3868
3869    if let Some(ref local_var_str) = parent_job {
3870        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3871    }
3872    if let Some(ref local_var_str) = tag {
3873        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3874    }
3875    if let Some(ref local_var_str) = cache_ttl {
3876        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3877    }
3878    if let Some(ref local_var_str) = job_id {
3879        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3880    }
3881    if let Some(ref local_var_str) = include_header {
3882        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3883    }
3884    if let Some(ref local_var_str) = queue_limit {
3885        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3886    }
3887    if let Some(ref local_var_str) = skip_preprocessor {
3888        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3889    }
3890    if let Some(ref local_var_str) = poll_delay_ms {
3891        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3892    }
3893    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3894        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3895    }
3896    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3897        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3898    };
3899    local_var_req_builder = local_var_req_builder.json(&request_body);
3900
3901    let local_var_req = local_var_req_builder.build()?;
3902    let local_var_resp = local_var_client.execute(local_var_req).await?;
3903
3904    let local_var_status = local_var_resp.status();
3905    let local_var_content = local_var_resp.text().await?;
3906
3907    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3908        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3909    } else {
3910        let local_var_entity: Option<RunAndStreamScriptByHashError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3911        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3912        Err(Error::ResponseError(local_var_error))
3913    }
3914}
3915
3916pub 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>> {
3917    let local_var_configuration = configuration;
3918
3919    let local_var_client = &local_var_configuration.client;
3920
3921    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));
3922    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3923
3924    if let Some(ref local_var_str) = parent_job {
3925        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3926    }
3927    if let Some(ref local_var_str) = tag {
3928        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3929    }
3930    if let Some(ref local_var_str) = cache_ttl {
3931        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3932    }
3933    if let Some(ref local_var_str) = job_id {
3934        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3935    }
3936    if let Some(ref local_var_str) = include_header {
3937        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3938    }
3939    if let Some(ref local_var_str) = queue_limit {
3940        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3941    }
3942    if let Some(ref local_var_str) = payload {
3943        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3944    }
3945    if let Some(ref local_var_str) = skip_preprocessor {
3946        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3947    }
3948    if let Some(ref local_var_str) = poll_delay_ms {
3949        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3950    }
3951    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3952        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3953    }
3954    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3955        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3956    };
3957
3958    let local_var_req = local_var_req_builder.build()?;
3959    let local_var_resp = local_var_client.execute(local_var_req).await?;
3960
3961    let local_var_status = local_var_resp.status();
3962    let local_var_content = local_var_resp.text().await?;
3963
3964    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3965        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
3966    } else {
3967        let local_var_entity: Option<RunAndStreamScriptByHashGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
3968        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3969        Err(Error::ResponseError(local_var_error))
3970    }
3971}
3972
3973pub 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>> {
3974    let local_var_configuration = configuration;
3975
3976    let local_var_client = &local_var_configuration.client;
3977
3978    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));
3979    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3980
3981    if let Some(ref local_var_str) = parent_job {
3982        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3983    }
3984    if let Some(ref local_var_str) = tag {
3985        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3986    }
3987    if let Some(ref local_var_str) = cache_ttl {
3988        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3989    }
3990    if let Some(ref local_var_str) = job_id {
3991        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3992    }
3993    if let Some(ref local_var_str) = include_header {
3994        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3995    }
3996    if let Some(ref local_var_str) = queue_limit {
3997        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3998    }
3999    if let Some(ref local_var_str) = skip_preprocessor {
4000        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4001    }
4002    if let Some(ref local_var_str) = poll_delay_ms {
4003        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
4004    }
4005    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4006        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4007    }
4008    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4009        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4010    };
4011    local_var_req_builder = local_var_req_builder.json(&request_body);
4012
4013    let local_var_req = local_var_req_builder.build()?;
4014    let local_var_resp = local_var_client.execute(local_var_req).await?;
4015
4016    let local_var_status = local_var_resp.status();
4017    let local_var_content = local_var_resp.text().await?;
4018
4019    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4020        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4021    } else {
4022        let local_var_entity: Option<RunAndStreamScriptByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4023        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4024        Err(Error::ResponseError(local_var_error))
4025    }
4026}
4027
4028pub 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>> {
4029    let local_var_configuration = configuration;
4030
4031    let local_var_client = &local_var_configuration.client;
4032
4033    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));
4034    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4035
4036    if let Some(ref local_var_str) = parent_job {
4037        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
4038    }
4039    if let Some(ref local_var_str) = tag {
4040        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
4041    }
4042    if let Some(ref local_var_str) = cache_ttl {
4043        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
4044    }
4045    if let Some(ref local_var_str) = job_id {
4046        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4047    }
4048    if let Some(ref local_var_str) = include_header {
4049        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4050    }
4051    if let Some(ref local_var_str) = queue_limit {
4052        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
4053    }
4054    if let Some(ref local_var_str) = payload {
4055        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
4056    }
4057    if let Some(ref local_var_str) = skip_preprocessor {
4058        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4059    }
4060    if let Some(ref local_var_str) = poll_delay_ms {
4061        local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
4062    }
4063    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4064        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4065    }
4066    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4067        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4068    };
4069
4070    let local_var_req = local_var_req_builder.build()?;
4071    let local_var_resp = local_var_client.execute(local_var_req).await?;
4072
4073    let local_var_status = local_var_resp.status();
4074    let local_var_content = local_var_resp.text().await?;
4075
4076    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4077        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4078    } else {
4079        let local_var_entity: Option<RunAndStreamScriptByPathGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4080        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4081        Err(Error::ResponseError(local_var_error))
4082    }
4083}
4084
4085pub 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>> {
4086    let local_var_configuration = configuration;
4087
4088    let local_var_client = &local_var_configuration.client;
4089
4090    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));
4091    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4092
4093    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4094        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4095    }
4096    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4097        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4098    };
4099    local_var_req_builder = local_var_req_builder.json(&workflow_task);
4100
4101    let local_var_req = local_var_req_builder.build()?;
4102    let local_var_resp = local_var_client.execute(local_var_req).await?;
4103
4104    let local_var_status = local_var_resp.status();
4105    let local_var_content = local_var_resp.text().await?;
4106
4107    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4108        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4109    } else {
4110        let local_var_entity: Option<RunCodeWorkflowTaskError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4111        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4112        Err(Error::ResponseError(local_var_error))
4113    }
4114}
4115
4116pub async fn run_dynamic_select(configuration: &configuration::Configuration, workspace: &str, dynamic_input_data: models::DynamicInputData) -> Result<uuid::Uuid, Error<RunDynamicSelectError>> {
4117    let local_var_configuration = configuration;
4118
4119    let local_var_client = &local_var_configuration.client;
4120
4121    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dynamic_select", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4122    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4123
4124    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4125        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4126    }
4127    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4128        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4129    };
4130    local_var_req_builder = local_var_req_builder.json(&dynamic_input_data);
4131
4132    let local_var_req = local_var_req_builder.build()?;
4133    let local_var_resp = local_var_client.execute(local_var_req).await?;
4134
4135    let local_var_status = local_var_resp.status();
4136    let local_var_content = local_var_resp.text().await?;
4137
4138    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4139        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4140    } else {
4141        let local_var_entity: Option<RunDynamicSelectError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4142        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4143        Err(Error::ResponseError(local_var_error))
4144    }
4145}
4146
4147pub 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>> {
4148    let local_var_configuration = configuration;
4149
4150    let local_var_client = &local_var_configuration.client;
4151
4152    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));
4153    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4154
4155    if let Some(ref local_var_str) = scheduled_for {
4156        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
4157    }
4158    if let Some(ref local_var_str) = scheduled_in_secs {
4159        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
4160    }
4161    if let Some(ref local_var_str) = skip_preprocessor {
4162        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4163    }
4164    if let Some(ref local_var_str) = parent_job {
4165        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
4166    }
4167    if let Some(ref local_var_str) = tag {
4168        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
4169    }
4170    if let Some(ref local_var_str) = job_id {
4171        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4172    }
4173    if let Some(ref local_var_str) = include_header {
4174        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4175    }
4176    if let Some(ref local_var_str) = invisible_to_owner {
4177        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
4178    }
4179    if let Some(ref local_var_str) = memory_id {
4180        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
4181    }
4182    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4183        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4184    }
4185    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4186        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4187    };
4188    local_var_req_builder = local_var_req_builder.json(&request_body);
4189
4190    let local_var_req = local_var_req_builder.build()?;
4191    let local_var_resp = local_var_client.execute(local_var_req).await?;
4192
4193    let local_var_status = local_var_resp.status();
4194    let local_var_content = local_var_resp.text().await?;
4195
4196    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4197        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4198    } else {
4199        let local_var_entity: Option<RunFlowByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4200        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4201        Err(Error::ResponseError(local_var_error))
4202    }
4203}
4204
4205pub 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>> {
4206    let local_var_configuration = configuration;
4207
4208    let local_var_client = &local_var_configuration.client;
4209
4210    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/fv/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version);
4211    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4212
4213    if let Some(ref local_var_str) = scheduled_for {
4214        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
4215    }
4216    if let Some(ref local_var_str) = scheduled_in_secs {
4217        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
4218    }
4219    if let Some(ref local_var_str) = skip_preprocessor {
4220        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4221    }
4222    if let Some(ref local_var_str) = parent_job {
4223        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
4224    }
4225    if let Some(ref local_var_str) = tag {
4226        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
4227    }
4228    if let Some(ref local_var_str) = job_id {
4229        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4230    }
4231    if let Some(ref local_var_str) = include_header {
4232        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4233    }
4234    if let Some(ref local_var_str) = invisible_to_owner {
4235        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
4236    }
4237    if let Some(ref local_var_str) = memory_id {
4238        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
4239    }
4240    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4241        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4242    }
4243    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4244        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4245    };
4246    local_var_req_builder = local_var_req_builder.json(&request_body);
4247
4248    let local_var_req = local_var_req_builder.build()?;
4249    let local_var_resp = local_var_client.execute(local_var_req).await?;
4250
4251    let local_var_status = local_var_resp.status();
4252    let local_var_content = local_var_resp.text().await?;
4253
4254    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4255        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4256    } else {
4257        let local_var_entity: Option<RunFlowByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4258        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4259        Err(Error::ResponseError(local_var_error))
4260    }
4261}
4262
4263pub async fn run_flow_dependencies_async(configuration: &configuration::Configuration, workspace: &str, run_flow_dependencies_async_request: models::RunFlowDependenciesAsyncRequest) -> Result<uuid::Uuid, Error<RunFlowDependenciesAsyncError>> {
4264    let local_var_configuration = configuration;
4265
4266    let local_var_client = &local_var_configuration.client;
4267
4268    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/flow_dependencies_async", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4269    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4270
4271    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4272        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4273    }
4274    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4275        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4276    };
4277    local_var_req_builder = local_var_req_builder.json(&run_flow_dependencies_async_request);
4278
4279    let local_var_req = local_var_req_builder.build()?;
4280    let local_var_resp = local_var_client.execute(local_var_req).await?;
4281
4282    let local_var_status = local_var_resp.status();
4283    let local_var_content = local_var_resp.text().await?;
4284
4285    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4286        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4287    } else {
4288        let local_var_entity: Option<RunFlowDependenciesAsyncError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4289        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4290        Err(Error::ResponseError(local_var_error))
4291    }
4292}
4293
4294pub 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>> {
4295    let local_var_configuration = configuration;
4296
4297    let local_var_client = &local_var_configuration.client;
4298
4299    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4300    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4301
4302    if let Some(ref local_var_str) = include_header {
4303        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4304    }
4305    if let Some(ref local_var_str) = invisible_to_owner {
4306        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
4307    }
4308    if let Some(ref local_var_str) = job_id {
4309        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4310    }
4311    if let Some(ref local_var_str) = memory_id {
4312        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
4313    }
4314    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4315        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4316    }
4317    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4318        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4319    };
4320    local_var_req_builder = local_var_req_builder.json(&flow_preview);
4321
4322    let local_var_req = local_var_req_builder.build()?;
4323    let local_var_resp = local_var_client.execute(local_var_req).await?;
4324
4325    let local_var_status = local_var_resp.status();
4326    let local_var_content = local_var_resp.text().await?;
4327
4328    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4329        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4330    } else {
4331        let local_var_entity: Option<RunFlowPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4332        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4333        Err(Error::ResponseError(local_var_error))
4334    }
4335}
4336
4337pub 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>> {
4338    let local_var_configuration = configuration;
4339
4340    let local_var_client = &local_var_configuration.client;
4341
4342    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4343    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4344
4345    if let Some(ref local_var_str) = memory_id {
4346        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
4347    }
4348    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4349        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4350    }
4351    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4352        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4353    };
4354    local_var_req_builder = local_var_req_builder.json(&flow_preview);
4355
4356    let local_var_req = local_var_req_builder.build()?;
4357    let local_var_resp = local_var_client.execute(local_var_req).await?;
4358
4359    let local_var_status = local_var_resp.status();
4360    let local_var_content = local_var_resp.text().await?;
4361
4362    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4363        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4364    } else {
4365        let local_var_entity: Option<RunFlowPreviewAndWaitResultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4366        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4367        Err(Error::ResponseError(local_var_error))
4368    }
4369}
4370
4371/// Moves the start of a queued job that is waiting for a future time (scheduled, debounced, re-scheduled by a concurrency limit, or a flow step waiting on a sleep or a retry delay) to now, keeping the same job id. A job with a concurrency limit is still checked against its limit when it is pulled. A schedule's upcoming tick is refused, since the schedule would queue that tick again. 
4372pub async fn run_queued_job_now(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<RunQueuedJobNowError>> {
4373    let local_var_configuration = configuration;
4374
4375    let local_var_client = &local_var_configuration.client;
4376
4377    let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/run_now/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
4378    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4379
4380    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4381        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4382    }
4383    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4384        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4385    };
4386
4387    let local_var_req = local_var_req_builder.build()?;
4388    let local_var_resp = local_var_client.execute(local_var_req).await?;
4389
4390    let local_var_status = local_var_resp.status();
4391    let local_var_content = local_var_resp.text().await?;
4392
4393    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4394        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4395    } else {
4396        let local_var_entity: Option<RunQueuedJobNowError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4397        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4398        Err(Error::ResponseError(local_var_error))
4399    }
4400}
4401
4402pub async fn run_raw_script_dependencies(configuration: &configuration::Configuration, workspace: &str, run_raw_script_dependencies_request: models::RunRawScriptDependenciesRequest) -> Result<models::RunRawScriptDependencies201Response, Error<RunRawScriptDependenciesError>> {
4403    let local_var_configuration = configuration;
4404
4405    let local_var_client = &local_var_configuration.client;
4406
4407    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dependencies", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4408    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4409
4410    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4411        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4412    }
4413    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4414        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4415    };
4416    local_var_req_builder = local_var_req_builder.json(&run_raw_script_dependencies_request);
4417
4418    let local_var_req = local_var_req_builder.build()?;
4419    let local_var_resp = local_var_client.execute(local_var_req).await?;
4420
4421    let local_var_status = local_var_resp.status();
4422    let local_var_content = local_var_resp.text().await?;
4423
4424    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4425        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4426    } else {
4427        let local_var_entity: Option<RunRawScriptDependenciesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4428        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4429        Err(Error::ResponseError(local_var_error))
4430    }
4431}
4432
4433pub async fn run_raw_script_dependencies_async(configuration: &configuration::Configuration, workspace: &str, run_raw_script_dependencies_request: models::RunRawScriptDependenciesRequest) -> Result<uuid::Uuid, Error<RunRawScriptDependenciesAsyncError>> {
4434    let local_var_configuration = configuration;
4435
4436    let local_var_client = &local_var_configuration.client;
4437
4438    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dependencies_async", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4439    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4440
4441    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4442        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4443    }
4444    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4445        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4446    };
4447    local_var_req_builder = local_var_req_builder.json(&run_raw_script_dependencies_request);
4448
4449    let local_var_req = local_var_req_builder.build()?;
4450    let local_var_resp = local_var_client.execute(local_var_req).await?;
4451
4452    let local_var_status = local_var_resp.status();
4453    let local_var_content = local_var_resp.text().await?;
4454
4455    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4456        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4457    } else {
4458        let local_var_entity: Option<RunRawScriptDependenciesAsyncError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4459        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4460        Err(Error::ResponseError(local_var_error))
4461    }
4462}
4463
4464pub 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>> {
4465    let local_var_configuration = configuration;
4466
4467    let local_var_client = &local_var_configuration.client;
4468
4469    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));
4470    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4471
4472    if let Some(ref local_var_str) = scheduled_for {
4473        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
4474    }
4475    if let Some(ref local_var_str) = scheduled_in_secs {
4476        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
4477    }
4478    if let Some(ref local_var_str) = skip_preprocessor {
4479        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4480    }
4481    if let Some(ref local_var_str) = parent_job {
4482        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
4483    }
4484    if let Some(ref local_var_str) = tag {
4485        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
4486    }
4487    if let Some(ref local_var_str) = cache_ttl {
4488        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
4489    }
4490    if let Some(ref local_var_str) = job_id {
4491        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4492    }
4493    if let Some(ref local_var_str) = include_header {
4494        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4495    }
4496    if let Some(ref local_var_str) = invisible_to_owner {
4497        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
4498    }
4499    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4500        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4501    }
4502    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4503        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4504    };
4505    local_var_req_builder = local_var_req_builder.json(&body);
4506
4507    let local_var_req = local_var_req_builder.build()?;
4508    let local_var_resp = local_var_client.execute(local_var_req).await?;
4509
4510    let local_var_status = local_var_resp.status();
4511    let local_var_content = local_var_resp.text().await?;
4512
4513    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4514        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4515    } else {
4516        let local_var_entity: Option<RunScriptByHashError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4517        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4518        Err(Error::ResponseError(local_var_error))
4519    }
4520}
4521
4522pub async fn run_script_by_hash_inline(configuration: &configuration::Configuration, workspace: &str, hash: &str, inline_script_args: models::InlineScriptArgs) -> Result<serde_json::Value, Error<RunScriptByHashInlineError>> {
4523    let local_var_configuration = configuration;
4524
4525    let local_var_client = &local_var_configuration.client;
4526
4527    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_inline/h/{hash}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), hash=crate::apis::urlencode(hash));
4528    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4529
4530    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4531        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4532    }
4533    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4534        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4535    };
4536    local_var_req_builder = local_var_req_builder.json(&inline_script_args);
4537
4538    let local_var_req = local_var_req_builder.build()?;
4539    let local_var_resp = local_var_client.execute(local_var_req).await?;
4540
4541    let local_var_status = local_var_resp.status();
4542    let local_var_content = local_var_resp.text().await?;
4543
4544    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4545        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4546    } else {
4547        let local_var_entity: Option<RunScriptByHashInlineError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4548        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4549        Err(Error::ResponseError(local_var_error))
4550    }
4551}
4552
4553pub 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>> {
4554    let local_var_configuration = configuration;
4555
4556    let local_var_client = &local_var_configuration.client;
4557
4558    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));
4559    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4560
4561    if let Some(ref local_var_str) = scheduled_for {
4562        local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
4563    }
4564    if let Some(ref local_var_str) = scheduled_in_secs {
4565        local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
4566    }
4567    if let Some(ref local_var_str) = skip_preprocessor {
4568        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4569    }
4570    if let Some(ref local_var_str) = parent_job {
4571        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
4572    }
4573    if let Some(ref local_var_str) = tag {
4574        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
4575    }
4576    if let Some(ref local_var_str) = cache_ttl {
4577        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
4578    }
4579    if let Some(ref local_var_str) = job_id {
4580        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4581    }
4582    if let Some(ref local_var_str) = invisible_to_owner {
4583        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
4584    }
4585    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4586        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4587    }
4588    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4589        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4590    };
4591    local_var_req_builder = local_var_req_builder.json(&request_body);
4592
4593    let local_var_req = local_var_req_builder.build()?;
4594    let local_var_resp = local_var_client.execute(local_var_req).await?;
4595
4596    let local_var_status = local_var_resp.status();
4597    let local_var_content = local_var_resp.text().await?;
4598
4599    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4600        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4601    } else {
4602        let local_var_entity: Option<RunScriptByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4603        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4604        Err(Error::ResponseError(local_var_error))
4605    }
4606}
4607
4608pub async fn run_script_by_path_inline(configuration: &configuration::Configuration, workspace: &str, path: &str, inline_script_args: models::InlineScriptArgs) -> Result<serde_json::Value, Error<RunScriptByPathInlineError>> {
4609    let local_var_configuration = configuration;
4610
4611    let local_var_client = &local_var_configuration.client;
4612
4613    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_inline/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
4614    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4615
4616    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4617        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4618    }
4619    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4620        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4621    };
4622    local_var_req_builder = local_var_req_builder.json(&inline_script_args);
4623
4624    let local_var_req = local_var_req_builder.build()?;
4625    let local_var_resp = local_var_client.execute(local_var_req).await?;
4626
4627    let local_var_status = local_var_resp.status();
4628    let local_var_content = local_var_resp.text().await?;
4629
4630    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4631        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4632    } else {
4633        let local_var_entity: Option<RunScriptByPathInlineError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4634        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4635        Err(Error::ResponseError(local_var_error))
4636    }
4637}
4638
4639pub async fn run_script_preview(configuration: &configuration::Configuration, workspace: &str, preview: models::Preview, include_header: Option<&str>, invisible_to_owner: Option<bool>, timeout: Option<i32>, job_id: Option<&str>) -> Result<uuid::Uuid, Error<RunScriptPreviewError>> {
4640    let local_var_configuration = configuration;
4641
4642    let local_var_client = &local_var_configuration.client;
4643
4644    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4645    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4646
4647    if let Some(ref local_var_str) = include_header {
4648        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4649    }
4650    if let Some(ref local_var_str) = invisible_to_owner {
4651        local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
4652    }
4653    if let Some(ref local_var_str) = timeout {
4654        local_var_req_builder = local_var_req_builder.query(&[("timeout", &local_var_str.to_string())]);
4655    }
4656    if let Some(ref local_var_str) = job_id {
4657        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4658    }
4659    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4660        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4661    }
4662    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4663        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4664    };
4665    local_var_req_builder = local_var_req_builder.json(&preview);
4666
4667    let local_var_req = local_var_req_builder.build()?;
4668    let local_var_resp = local_var_client.execute(local_var_req).await?;
4669
4670    let local_var_status = local_var_resp.status();
4671    let local_var_content = local_var_resp.text().await?;
4672
4673    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4674        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4675    } else {
4676        let local_var_entity: Option<RunScriptPreviewError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4677        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4678        Err(Error::ResponseError(local_var_error))
4679    }
4680}
4681
4682pub async fn run_script_preview_and_wait_result(configuration: &configuration::Configuration, workspace: &str, preview: models::Preview) -> Result<serde_json::Value, Error<RunScriptPreviewAndWaitResultError>> {
4683    let local_var_configuration = configuration;
4684
4685    let local_var_client = &local_var_configuration.client;
4686
4687    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4688    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4689
4690    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4691        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4692    }
4693    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4694        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4695    };
4696    local_var_req_builder = local_var_req_builder.json(&preview);
4697
4698    let local_var_req = local_var_req_builder.build()?;
4699    let local_var_resp = local_var_client.execute(local_var_req).await?;
4700
4701    let local_var_status = local_var_resp.status();
4702    let local_var_content = local_var_resp.text().await?;
4703
4704    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4705        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4706    } else {
4707        let local_var_entity: Option<RunScriptPreviewAndWaitResultError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4708        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4709        Err(Error::ResponseError(local_var_error))
4710    }
4711}
4712
4713pub async fn run_script_preview_inline(configuration: &configuration::Configuration, workspace: &str, preview_inline: models::PreviewInline) -> Result<serde_json::Value, Error<RunScriptPreviewInlineError>> {
4714    let local_var_configuration = configuration;
4715
4716    let local_var_client = &local_var_configuration.client;
4717
4718    let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_inline/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
4719    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4720
4721    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4722        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4723    }
4724    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4725        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4726    };
4727    local_var_req_builder = local_var_req_builder.json(&preview_inline);
4728
4729    let local_var_req = local_var_req_builder.build()?;
4730    let local_var_resp = local_var_client.execute(local_var_req).await?;
4731
4732    let local_var_status = local_var_resp.status();
4733    let local_var_content = local_var_resp.text().await?;
4734
4735    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4736        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4737    } else {
4738        let local_var_entity: Option<RunScriptPreviewInlineError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4739        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4740        Err(Error::ResponseError(local_var_error))
4741    }
4742}
4743
4744pub 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>> {
4745    let local_var_configuration = configuration;
4746
4747    let local_var_client = &local_var_configuration.client;
4748
4749    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));
4750    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4751
4752    if let Some(ref local_var_str) = include_header {
4753        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4754    }
4755    if let Some(ref local_var_str) = queue_limit {
4756        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
4757    }
4758    if let Some(ref local_var_str) = job_id {
4759        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4760    }
4761    if let Some(ref local_var_str) = skip_preprocessor {
4762        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4763    }
4764    if let Some(ref local_var_str) = memory_id {
4765        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
4766    }
4767    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4768        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4769    }
4770    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4771        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4772    };
4773    local_var_req_builder = local_var_req_builder.json(&request_body);
4774
4775    let local_var_req = local_var_req_builder.build()?;
4776    let local_var_resp = local_var_client.execute(local_var_req).await?;
4777
4778    let local_var_status = local_var_resp.status();
4779    let local_var_content = local_var_resp.text().await?;
4780
4781    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4782        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4783    } else {
4784        let local_var_entity: Option<RunWaitResultFlowByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4785        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4786        Err(Error::ResponseError(local_var_error))
4787    }
4788}
4789
4790pub 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>> {
4791    let local_var_configuration = configuration;
4792
4793    let local_var_client = &local_var_configuration.client;
4794
4795    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);
4796    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4797
4798    if let Some(ref local_var_str) = include_header {
4799        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4800    }
4801    if let Some(ref local_var_str) = queue_limit {
4802        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
4803    }
4804    if let Some(ref local_var_str) = job_id {
4805        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4806    }
4807    if let Some(ref local_var_str) = skip_preprocessor {
4808        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4809    }
4810    if let Some(ref local_var_str) = memory_id {
4811        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
4812    }
4813    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4814        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4815    }
4816    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4817        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4818    };
4819    local_var_req_builder = local_var_req_builder.json(&request_body);
4820
4821    let local_var_req = local_var_req_builder.build()?;
4822    let local_var_resp = local_var_client.execute(local_var_req).await?;
4823
4824    let local_var_status = local_var_resp.status();
4825    let local_var_content = local_var_resp.text().await?;
4826
4827    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4828        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4829    } else {
4830        let local_var_entity: Option<RunWaitResultFlowByVersionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4831        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4832        Err(Error::ResponseError(local_var_error))
4833    }
4834}
4835
4836pub 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>> {
4837    let local_var_configuration = configuration;
4838
4839    let local_var_client = &local_var_configuration.client;
4840
4841    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);
4842    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4843
4844    if let Some(ref local_var_str) = include_header {
4845        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4846    }
4847    if let Some(ref local_var_str) = queue_limit {
4848        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
4849    }
4850    if let Some(ref local_var_str) = payload {
4851        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
4852    }
4853    if let Some(ref local_var_str) = job_id {
4854        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4855    }
4856    if let Some(ref local_var_str) = skip_preprocessor {
4857        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4858    }
4859    if let Some(ref local_var_str) = memory_id {
4860        local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
4861    }
4862    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4863        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4864    }
4865    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4866        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4867    };
4868
4869    let local_var_req = local_var_req_builder.build()?;
4870    let local_var_resp = local_var_client.execute(local_var_req).await?;
4871
4872    let local_var_status = local_var_resp.status();
4873    let local_var_content = local_var_resp.text().await?;
4874
4875    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4876        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4877    } else {
4878        let local_var_entity: Option<RunWaitResultFlowByVersionGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4879        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4880        Err(Error::ResponseError(local_var_error))
4881    }
4882}
4883
4884pub 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>> {
4885    let local_var_configuration = configuration;
4886
4887    let local_var_client = &local_var_configuration.client;
4888
4889    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));
4890    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4891
4892    if let Some(ref local_var_str) = parent_job {
4893        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
4894    }
4895    if let Some(ref local_var_str) = tag {
4896        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
4897    }
4898    if let Some(ref local_var_str) = cache_ttl {
4899        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
4900    }
4901    if let Some(ref local_var_str) = job_id {
4902        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4903    }
4904    if let Some(ref local_var_str) = include_header {
4905        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4906    }
4907    if let Some(ref local_var_str) = queue_limit {
4908        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
4909    }
4910    if let Some(ref local_var_str) = skip_preprocessor {
4911        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4912    }
4913    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4914        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4915    }
4916    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4917        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4918    };
4919    local_var_req_builder = local_var_req_builder.json(&request_body);
4920
4921    let local_var_req = local_var_req_builder.build()?;
4922    let local_var_resp = local_var_client.execute(local_var_req).await?;
4923
4924    let local_var_status = local_var_resp.status();
4925    let local_var_content = local_var_resp.text().await?;
4926
4927    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4928        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4929    } else {
4930        let local_var_entity: Option<RunWaitResultScriptByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4931        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4932        Err(Error::ResponseError(local_var_error))
4933    }
4934}
4935
4936pub 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>> {
4937    let local_var_configuration = configuration;
4938
4939    let local_var_client = &local_var_configuration.client;
4940
4941    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));
4942    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
4943
4944    if let Some(ref local_var_str) = parent_job {
4945        local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
4946    }
4947    if let Some(ref local_var_str) = tag {
4948        local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
4949    }
4950    if let Some(ref local_var_str) = cache_ttl {
4951        local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
4952    }
4953    if let Some(ref local_var_str) = job_id {
4954        local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
4955    }
4956    if let Some(ref local_var_str) = include_header {
4957        local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
4958    }
4959    if let Some(ref local_var_str) = queue_limit {
4960        local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
4961    }
4962    if let Some(ref local_var_str) = payload {
4963        local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
4964    }
4965    if let Some(ref local_var_str) = skip_preprocessor {
4966        local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
4967    }
4968    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4969        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
4970    }
4971    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
4972        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
4973    };
4974
4975    let local_var_req = local_var_req_builder.build()?;
4976    let local_var_resp = local_var_client.execute(local_var_req).await?;
4977
4978    let local_var_status = local_var_resp.status();
4979    let local_var_content = local_var_resp.text().await?;
4980
4981    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
4982        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
4983    } else {
4984        let local_var_entity: Option<RunWaitResultScriptByPathGetError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
4985        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4986        Err(Error::ResponseError(local_var_error))
4987    }
4988}
4989
4990pub async fn set_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str, body: Option<serde_json::Value>) -> Result<String, Error<SetFlowUserStateError>> {
4991    let local_var_configuration = configuration;
4992
4993    let local_var_client = &local_var_configuration.client;
4994
4995    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));
4996    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
4997
4998    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
4999        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5000    }
5001    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5002        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5003    };
5004    local_var_req_builder = local_var_req_builder.json(&body);
5005
5006    let local_var_req = local_var_req_builder.build()?;
5007    let local_var_resp = local_var_client.execute(local_var_req).await?;
5008
5009    let local_var_status = local_var_resp.status();
5010    let local_var_content = local_var_resp.text().await?;
5011
5012    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5013        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5014    } else {
5015        let local_var_entity: Option<SetFlowUserStateError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5016        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5017        Err(Error::ResponseError(local_var_error))
5018    }
5019}
5020
5021pub async fn unresolve_completed_jobs(configuration: &configuration::Configuration, workspace: &str, unresolve_completed_jobs_request: models::UnresolveCompletedJobsRequest) -> Result<Vec<uuid::Uuid>, Error<UnresolveCompletedJobsError>> {
5022    let local_var_configuration = configuration;
5023
5024    let local_var_client = &local_var_configuration.client;
5025
5026    let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/unresolve", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
5027    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
5028
5029    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
5030        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
5031    }
5032    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
5033        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
5034    };
5035    local_var_req_builder = local_var_req_builder.json(&unresolve_completed_jobs_request);
5036
5037    let local_var_req = local_var_req_builder.build()?;
5038    let local_var_resp = local_var_client.execute(local_var_req).await?;
5039
5040    let local_var_status = local_var_resp.status();
5041    let local_var_content = local_var_resp.text().await?;
5042
5043    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
5044        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
5045    } else {
5046        let local_var_entity: Option<UnresolveCompletedJobsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
5047        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
5048        Err(Error::ResponseError(local_var_error))
5049    }
5050}
5051