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