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