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