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