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