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