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