1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum BatchReRunJobsError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum CancelPersistentQueuedJobsError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum CancelQueuedJobError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum CancelSelectionError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum CancelSuspendedJobGetError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum CancelSuspendedJobPostError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum CountCompletedJobsError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum CountJobsByTagError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum CreateJobSignatureError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteCompletedJobError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum DeleteJobsError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ExportCompletedJobsError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ExportQueuedJobsError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum ForceCancelQueuedJobError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetCompletedCountError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetCompletedJobError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetCompletedJobLogsTailError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetCompletedJobResultError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetCompletedJobResultMaybeError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetCompletedJobTimingError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetDbClockError {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetFlowDebugInfoError {
169 UnknownValue(serde_json::Value),
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetFlowUserStateError {
176 UnknownValue(serde_json::Value),
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetJobError {
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetJobArgsError {
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetJobLogsError {
197 UnknownValue(serde_json::Value),
198}
199
200#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetJobUpdatesError {
204 UnknownValue(serde_json::Value),
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetJobUpdatesSseError {
211 UnknownValue(serde_json::Value),
212}
213
214#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetLogFileFromStoreError {
218 UnknownValue(serde_json::Value),
219}
220
221#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetQueueCountError {
225 UnknownValue(serde_json::Value),
226}
227
228#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetQueuePositionError {
232 UnknownValue(serde_json::Value),
233}
234
235#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum GetResumeUrlsError {
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum GetRootJobIdError {
246 UnknownValue(serde_json::Value),
247}
248
249#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum GetScheduledForError {
253 UnknownValue(serde_json::Value),
254}
255
256#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum GetSlackApprovalPayloadError {
260 UnknownValue(serde_json::Value),
261}
262
263#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum GetStartedAtByIdsError {
267 UnknownValue(serde_json::Value),
268}
269
270#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum GetSuspendedJobFlowError {
274 UnknownValue(serde_json::Value),
275}
276
277#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum GetTeamsApprovalPayloadError {
281 UnknownValue(serde_json::Value),
282}
283
284#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum ImportCompletedJobsError {
288 UnknownValue(serde_json::Value),
289}
290
291#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum ImportQueuedJobsError {
295 UnknownValue(serde_json::Value),
296}
297
298#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum ListCompletedJobsError {
302 UnknownValue(serde_json::Value),
303}
304
305#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum ListExtendedJobsError {
309 UnknownValue(serde_json::Value),
310}
311
312#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum ListFilteredJobsUuidsError {
316 UnknownValue(serde_json::Value),
317}
318
319#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum ListFilteredQueueUuidsError {
323 UnknownValue(serde_json::Value),
324}
325
326#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum ListJobsError {
330 UnknownValue(serde_json::Value),
331}
332
333#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum ListQueueError {
337 UnknownValue(serde_json::Value),
338}
339
340#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum ListSelectedJobGroupsError {
344 UnknownValue(serde_json::Value),
345}
346
347#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum RestartFlowAtStepError {
351 UnknownValue(serde_json::Value),
352}
353
354#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum ResultByIdError {
358 UnknownValue(serde_json::Value),
359}
360
361#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum ResumeSuspendedFlowAsOwnerError {
365 UnknownValue(serde_json::Value),
366}
367
368#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum ResumeSuspendedJobGetError {
372 UnknownValue(serde_json::Value),
373}
374
375#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum ResumeSuspendedJobPostError {
379 UnknownValue(serde_json::Value),
380}
381
382#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum RunAndStreamFlowByPathError {
386 UnknownValue(serde_json::Value),
387}
388
389#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum RunAndStreamFlowByPathGetError {
393 UnknownValue(serde_json::Value),
394}
395
396#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum RunAndStreamFlowByVersionError {
400 UnknownValue(serde_json::Value),
401}
402
403#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum RunAndStreamFlowByVersionGetError {
407 UnknownValue(serde_json::Value),
408}
409
410#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum RunAndStreamScriptByHashError {
414 UnknownValue(serde_json::Value),
415}
416
417#[derive(Debug, Clone, Serialize, Deserialize)]
419#[serde(untagged)]
420pub enum RunAndStreamScriptByHashGetError {
421 UnknownValue(serde_json::Value),
422}
423
424#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum RunAndStreamScriptByPathError {
428 UnknownValue(serde_json::Value),
429}
430
431#[derive(Debug, Clone, Serialize, Deserialize)]
433#[serde(untagged)]
434pub enum RunAndStreamScriptByPathGetError {
435 UnknownValue(serde_json::Value),
436}
437
438#[derive(Debug, Clone, Serialize, Deserialize)]
440#[serde(untagged)]
441pub enum RunCodeWorkflowTaskError {
442 UnknownValue(serde_json::Value),
443}
444
445#[derive(Debug, Clone, Serialize, Deserialize)]
447#[serde(untagged)]
448pub enum RunDynamicSelectError {
449 UnknownValue(serde_json::Value),
450}
451
452#[derive(Debug, Clone, Serialize, Deserialize)]
454#[serde(untagged)]
455pub enum RunFlowByPathError {
456 UnknownValue(serde_json::Value),
457}
458
459#[derive(Debug, Clone, Serialize, Deserialize)]
461#[serde(untagged)]
462pub enum RunFlowByVersionError {
463 UnknownValue(serde_json::Value),
464}
465
466#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum RunFlowPreviewError {
470 UnknownValue(serde_json::Value),
471}
472
473#[derive(Debug, Clone, Serialize, Deserialize)]
475#[serde(untagged)]
476pub enum RunFlowPreviewAndWaitResultError {
477 UnknownValue(serde_json::Value),
478}
479
480#[derive(Debug, Clone, Serialize, Deserialize)]
482#[serde(untagged)]
483pub enum RunRawScriptDependenciesError {
484 UnknownValue(serde_json::Value),
485}
486
487#[derive(Debug, Clone, Serialize, Deserialize)]
489#[serde(untagged)]
490pub enum RunScriptByHashError {
491 UnknownValue(serde_json::Value),
492}
493
494#[derive(Debug, Clone, Serialize, Deserialize)]
496#[serde(untagged)]
497pub enum RunScriptByPathError {
498 UnknownValue(serde_json::Value),
499}
500
501#[derive(Debug, Clone, Serialize, Deserialize)]
503#[serde(untagged)]
504pub enum RunScriptPreviewError {
505 UnknownValue(serde_json::Value),
506}
507
508#[derive(Debug, Clone, Serialize, Deserialize)]
510#[serde(untagged)]
511pub enum RunScriptPreviewAndWaitResultError {
512 UnknownValue(serde_json::Value),
513}
514
515#[derive(Debug, Clone, Serialize, Deserialize)]
517#[serde(untagged)]
518pub enum RunScriptPreviewInlineError {
519 UnknownValue(serde_json::Value),
520}
521
522#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum RunWaitResultFlowByPathError {
526 UnknownValue(serde_json::Value),
527}
528
529#[derive(Debug, Clone, Serialize, Deserialize)]
531#[serde(untagged)]
532pub enum RunWaitResultFlowByVersionError {
533 UnknownValue(serde_json::Value),
534}
535
536#[derive(Debug, Clone, Serialize, Deserialize)]
538#[serde(untagged)]
539pub enum RunWaitResultFlowByVersionGetError {
540 UnknownValue(serde_json::Value),
541}
542
543#[derive(Debug, Clone, Serialize, Deserialize)]
545#[serde(untagged)]
546pub enum RunWaitResultScriptByPathError {
547 UnknownValue(serde_json::Value),
548}
549
550#[derive(Debug, Clone, Serialize, Deserialize)]
552#[serde(untagged)]
553pub enum RunWaitResultScriptByPathGetError {
554 UnknownValue(serde_json::Value),
555}
556
557#[derive(Debug, Clone, Serialize, Deserialize)]
559#[serde(untagged)]
560pub enum SetFlowUserStateError {
561 UnknownValue(serde_json::Value),
562}
563
564
565pub async fn batch_re_run_jobs(configuration: &configuration::Configuration, workspace: &str, batch_re_run_jobs_request: models::BatchReRunJobsRequest) -> Result<String, Error<BatchReRunJobsError>> {
566 let local_var_configuration = configuration;
567
568 let local_var_client = &local_var_configuration.client;
569
570 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/batch_rerun_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
571 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
572
573 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
574 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
575 }
576 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
577 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
578 };
579 local_var_req_builder = local_var_req_builder.json(&batch_re_run_jobs_request);
580
581 let local_var_req = local_var_req_builder.build()?;
582 let local_var_resp = local_var_client.execute(local_var_req).await?;
583
584 let local_var_status = local_var_resp.status();
585 let local_var_content = local_var_resp.text().await?;
586
587 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
588 crate::from_str_patched(&local_var_content).map_err(Error::from)
589 } else {
590 let local_var_entity: Option<BatchReRunJobsError> = crate::from_str_patched(&local_var_content).ok();
591 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
592 Err(Error::ResponseError(local_var_error))
593 }
594}
595
596pub async fn cancel_persistent_queued_jobs(configuration: &configuration::Configuration, workspace: &str, path: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelPersistentQueuedJobsError>> {
597 let local_var_configuration = configuration;
598
599 let local_var_client = &local_var_configuration.client;
600
601 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));
602 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
603
604 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
605 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
606 }
607 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
608 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
609 };
610 local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
611
612 let local_var_req = local_var_req_builder.build()?;
613 let local_var_resp = local_var_client.execute(local_var_req).await?;
614
615 let local_var_status = local_var_resp.status();
616 let local_var_content = local_var_resp.text().await?;
617
618 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
619 crate::from_str_patched(&local_var_content).map_err(Error::from)
620 } else {
621 let local_var_entity: Option<CancelPersistentQueuedJobsError> = crate::from_str_patched(&local_var_content).ok();
622 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
623 Err(Error::ResponseError(local_var_error))
624 }
625}
626
627pub async fn cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelQueuedJobError>> {
628 let local_var_configuration = configuration;
629
630 let local_var_client = &local_var_configuration.client;
631
632 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));
633 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
634
635 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
636 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
637 }
638 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
639 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
640 };
641 local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
642
643 let local_var_req = local_var_req_builder.build()?;
644 let local_var_resp = local_var_client.execute(local_var_req).await?;
645
646 let local_var_status = local_var_resp.status();
647 let local_var_content = local_var_resp.text().await?;
648
649 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
650 crate::from_str_patched(&local_var_content).map_err(Error::from)
651 } else {
652 let local_var_entity: Option<CancelQueuedJobError> = crate::from_str_patched(&local_var_content).ok();
653 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
654 Err(Error::ResponseError(local_var_error))
655 }
656}
657
658pub async fn cancel_selection(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>, force_cancel: Option<bool>) -> Result<Vec<String>, Error<CancelSelectionError>> {
659 let local_var_configuration = configuration;
660
661 let local_var_client = &local_var_configuration.client;
662
663 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/cancel_selection", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
664 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
665
666 if let Some(ref local_var_str) = force_cancel {
667 local_var_req_builder = local_var_req_builder.query(&[("force_cancel", &local_var_str.to_string())]);
668 }
669 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
670 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
671 }
672 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
673 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
674 };
675 local_var_req_builder = local_var_req_builder.json(&request_body);
676
677 let local_var_req = local_var_req_builder.build()?;
678 let local_var_resp = local_var_client.execute(local_var_req).await?;
679
680 let local_var_status = local_var_resp.status();
681 let local_var_content = local_var_resp.text().await?;
682
683 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
684 crate::from_str_patched(&local_var_content).map_err(Error::from)
685 } else {
686 let local_var_entity: Option<CancelSelectionError> = crate::from_str_patched(&local_var_content).ok();
687 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
688 Err(Error::ResponseError(local_var_error))
689 }
690}
691
692pub 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>> {
693 let local_var_configuration = configuration;
694
695 let local_var_client = &local_var_configuration.client;
696
697 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));
698 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
699
700 if let Some(ref local_var_str) = approver {
701 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
702 }
703 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
704 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
705 }
706 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
707 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
708 };
709
710 let local_var_req = local_var_req_builder.build()?;
711 let local_var_resp = local_var_client.execute(local_var_req).await?;
712
713 let local_var_status = local_var_resp.status();
714 let local_var_content = local_var_resp.text().await?;
715
716 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
717 crate::from_str_patched(&local_var_content).map_err(Error::from)
718 } else {
719 let local_var_entity: Option<CancelSuspendedJobGetError> = crate::from_str_patched(&local_var_content).ok();
720 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
721 Err(Error::ResponseError(local_var_error))
722 }
723}
724
725pub 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>> {
726 let local_var_configuration = configuration;
727
728 let local_var_client = &local_var_configuration.client;
729
730 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));
731 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
732
733 if let Some(ref local_var_str) = approver {
734 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
735 }
736 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
737 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
738 }
739 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
740 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
741 };
742 local_var_req_builder = local_var_req_builder.json(&body);
743
744 let local_var_req = local_var_req_builder.build()?;
745 let local_var_resp = local_var_client.execute(local_var_req).await?;
746
747 let local_var_status = local_var_resp.status();
748 let local_var_content = local_var_resp.text().await?;
749
750 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
751 crate::from_str_patched(&local_var_content).map_err(Error::from)
752 } else {
753 let local_var_entity: Option<CancelSuspendedJobPostError> = crate::from_str_patched(&local_var_content).ok();
754 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
755 Err(Error::ResponseError(local_var_error))
756 }
757}
758
759pub 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>> {
760 let local_var_configuration = configuration;
761
762 let local_var_client = &local_var_configuration.client;
763
764 let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
765 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
766
767 if let Some(ref local_var_str) = completed_after_s_ago {
768 local_var_req_builder = local_var_req_builder.query(&[("completed_after_s_ago", &local_var_str.to_string())]);
769 }
770 if let Some(ref local_var_str) = success {
771 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
772 }
773 if let Some(ref local_var_str) = tags {
774 local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]);
775 }
776 if let Some(ref local_var_str) = all_workspaces {
777 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
778 }
779 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
780 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
781 }
782 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
783 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
784 };
785
786 let local_var_req = local_var_req_builder.build()?;
787 let local_var_resp = local_var_client.execute(local_var_req).await?;
788
789 let local_var_status = local_var_resp.status();
790 let local_var_content = local_var_resp.text().await?;
791
792 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
793 crate::from_str_patched(&local_var_content).map_err(Error::from)
794 } else {
795 let local_var_entity: Option<CountCompletedJobsError> = crate::from_str_patched(&local_var_content).ok();
796 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
797 Err(Error::ResponseError(local_var_error))
798 }
799}
800
801pub async fn count_jobs_by_tag(configuration: &configuration::Configuration, horizon_secs: Option<i32>, workspace_id: Option<&str>) -> Result<Vec<models::CountJobsByTag200ResponseInner>, Error<CountJobsByTagError>> {
802 let local_var_configuration = configuration;
803
804 let local_var_client = &local_var_configuration.client;
805
806 let local_var_uri_str = format!("{}/jobs/completed/count_by_tag", local_var_configuration.base_path);
807 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
808
809 if let Some(ref local_var_str) = horizon_secs {
810 local_var_req_builder = local_var_req_builder.query(&[("horizon_secs", &local_var_str.to_string())]);
811 }
812 if let Some(ref local_var_str) = workspace_id {
813 local_var_req_builder = local_var_req_builder.query(&[("workspace_id", &local_var_str.to_string())]);
814 }
815 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
816 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
817 }
818 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
819 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
820 };
821
822 let local_var_req = local_var_req_builder.build()?;
823 let local_var_resp = local_var_client.execute(local_var_req).await?;
824
825 let local_var_status = local_var_resp.status();
826 let local_var_content = local_var_resp.text().await?;
827
828 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
829 crate::from_str_patched(&local_var_content).map_err(Error::from)
830 } else {
831 let local_var_entity: Option<CountJobsByTagError> = crate::from_str_patched(&local_var_content).ok();
832 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
833 Err(Error::ResponseError(local_var_error))
834 }
835}
836
837pub async fn create_job_signature(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, approver: Option<&str>) -> Result<String, Error<CreateJobSignatureError>> {
838 let local_var_configuration = configuration;
839
840 let local_var_client = &local_var_configuration.client;
841
842 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);
843 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
844
845 if let Some(ref local_var_str) = approver {
846 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
847 }
848 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
849 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
850 }
851 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
852 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
853 };
854
855 let local_var_req = local_var_req_builder.build()?;
856 let local_var_resp = local_var_client.execute(local_var_req).await?;
857
858 let local_var_status = local_var_resp.status();
859 let local_var_content = local_var_resp.text().await?;
860
861 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
862 crate::from_str_patched(&local_var_content).map_err(Error::from)
863 } else {
864 let local_var_entity: Option<CreateJobSignatureError> = crate::from_str_patched(&local_var_content).ok();
865 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
866 Err(Error::ResponseError(local_var_error))
867 }
868}
869
870pub async fn delete_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<DeleteCompletedJobError>> {
871 let local_var_configuration = configuration;
872
873 let local_var_client = &local_var_configuration.client;
874
875 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));
876 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
877
878 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
879 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
880 }
881 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
882 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
883 };
884
885 let local_var_req = local_var_req_builder.build()?;
886 let local_var_resp = local_var_client.execute(local_var_req).await?;
887
888 let local_var_status = local_var_resp.status();
889 let local_var_content = local_var_resp.text().await?;
890
891 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
892 crate::from_str_patched(&local_var_content).map_err(Error::from)
893 } else {
894 let local_var_entity: Option<DeleteCompletedJobError> = crate::from_str_patched(&local_var_content).ok();
895 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
896 Err(Error::ResponseError(local_var_error))
897 }
898}
899
900pub async fn delete_jobs(configuration: &configuration::Configuration, workspace: &str, uuid_colon_colon_uuid: Vec<uuid::Uuid>) -> Result<String, Error<DeleteJobsError>> {
901 let local_var_configuration = configuration;
902
903 let local_var_client = &local_var_configuration.client;
904
905 let local_var_uri_str = format!("{}/w/{workspace}/jobs/delete", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
906 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
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(&uuid_colon_colon_uuid);
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(&local_var_content).map_err(Error::from)
924 } else {
925 let local_var_entity: Option<DeleteJobsError> = crate::from_str_patched(&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 export_completed_jobs(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::ExportableCompletedJob>, Error<ExportCompletedJobsError>> {
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/completed/export", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
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) = page {
940 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
941 }
942 if let Some(ref local_var_str) = per_page {
943 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
944 }
945 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
946 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
947 }
948 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
949 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
950 };
951
952 let local_var_req = local_var_req_builder.build()?;
953 let local_var_resp = local_var_client.execute(local_var_req).await?;
954
955 let local_var_status = local_var_resp.status();
956 let local_var_content = local_var_resp.text().await?;
957
958 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
959 crate::from_str_patched(&local_var_content).map_err(Error::from)
960 } else {
961 let local_var_entity: Option<ExportCompletedJobsError> = crate::from_str_patched(&local_var_content).ok();
962 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
963 Err(Error::ResponseError(local_var_error))
964 }
965}
966
967pub async fn export_queued_jobs(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::ExportableQueuedJob>, Error<ExportQueuedJobsError>> {
968 let local_var_configuration = configuration;
969
970 let local_var_client = &local_var_configuration.client;
971
972 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/export", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
973 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
974
975 if let Some(ref local_var_str) = page {
976 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
977 }
978 if let Some(ref local_var_str) = per_page {
979 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
980 }
981 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
982 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
983 }
984 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
985 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
986 };
987
988 let local_var_req = local_var_req_builder.build()?;
989 let local_var_resp = local_var_client.execute(local_var_req).await?;
990
991 let local_var_status = local_var_resp.status();
992 let local_var_content = local_var_resp.text().await?;
993
994 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
995 crate::from_str_patched(&local_var_content).map_err(Error::from)
996 } else {
997 let local_var_entity: Option<ExportQueuedJobsError> = crate::from_str_patched(&local_var_content).ok();
998 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
999 Err(Error::ResponseError(local_var_error))
1000 }
1001}
1002
1003pub async fn force_cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<ForceCancelQueuedJobError>> {
1004 let local_var_configuration = configuration;
1005
1006 let local_var_client = &local_var_configuration.client;
1007
1008 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));
1009 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1010
1011 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1012 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1013 }
1014 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1015 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1016 };
1017 local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
1018
1019 let local_var_req = local_var_req_builder.build()?;
1020 let local_var_resp = local_var_client.execute(local_var_req).await?;
1021
1022 let local_var_status = local_var_resp.status();
1023 let local_var_content = local_var_resp.text().await?;
1024
1025 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1026 crate::from_str_patched(&local_var_content).map_err(Error::from)
1027 } else {
1028 let local_var_entity: Option<ForceCancelQueuedJobError> = crate::from_str_patched(&local_var_content).ok();
1029 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1030 Err(Error::ResponseError(local_var_error))
1031 }
1032}
1033
1034pub async fn get_completed_count(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCompletedCount200Response, Error<GetCompletedCountError>> {
1035 let local_var_configuration = configuration;
1036
1037 let local_var_client = &local_var_configuration.client;
1038
1039 let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1040 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1041
1042 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1043 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1044 }
1045 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1046 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1047 };
1048
1049 let local_var_req = local_var_req_builder.build()?;
1050 let local_var_resp = local_var_client.execute(local_var_req).await?;
1051
1052 let local_var_status = local_var_resp.status();
1053 let local_var_content = local_var_resp.text().await?;
1054
1055 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1056 crate::from_str_patched(&local_var_content).map_err(Error::from)
1057 } else {
1058 let local_var_entity: Option<GetCompletedCountError> = crate::from_str_patched(&local_var_content).ok();
1059 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1060 Err(Error::ResponseError(local_var_error))
1061 }
1062}
1063
1064pub async fn get_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<GetCompletedJobError>> {
1065 let local_var_configuration = configuration;
1066
1067 let local_var_client = &local_var_configuration.client;
1068
1069 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));
1070 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1071
1072 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1073 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1074 }
1075 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1076 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1077 };
1078
1079 let local_var_req = local_var_req_builder.build()?;
1080 let local_var_resp = local_var_client.execute(local_var_req).await?;
1081
1082 let local_var_status = local_var_resp.status();
1083 let local_var_content = local_var_resp.text().await?;
1084
1085 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1086 crate::from_str_patched(&local_var_content).map_err(Error::from)
1087 } else {
1088 let local_var_entity: Option<GetCompletedJobError> = crate::from_str_patched(&local_var_content).ok();
1089 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1090 Err(Error::ResponseError(local_var_error))
1091 }
1092}
1093
1094pub async fn get_completed_job_logs_tail(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetCompletedJobLogsTailError>> {
1095 let local_var_configuration = configuration;
1096
1097 let local_var_client = &local_var_configuration.client;
1098
1099 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));
1100 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1101
1102 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1103 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1104 }
1105 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1106 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1107 };
1108
1109 let local_var_req = local_var_req_builder.build()?;
1110 let local_var_resp = local_var_client.execute(local_var_req).await?;
1111
1112 let local_var_status = local_var_resp.status();
1113 let local_var_content = local_var_resp.text().await?;
1114
1115 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1116 crate::from_str_patched(&local_var_content).map_err(Error::from)
1117 } else {
1118 let local_var_entity: Option<GetCompletedJobLogsTailError> = crate::from_str_patched(&local_var_content).ok();
1119 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1120 Err(Error::ResponseError(local_var_error))
1121 }
1122}
1123
1124pub 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>> {
1125 let local_var_configuration = configuration;
1126
1127 let local_var_client = &local_var_configuration.client;
1128
1129 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));
1130 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1131
1132 if let Some(ref local_var_str) = suspended_job {
1133 local_var_req_builder = local_var_req_builder.query(&[("suspended_job", &local_var_str.to_string())]);
1134 }
1135 if let Some(ref local_var_str) = resume_id {
1136 local_var_req_builder = local_var_req_builder.query(&[("resume_id", &local_var_str.to_string())]);
1137 }
1138 if let Some(ref local_var_str) = secret {
1139 local_var_req_builder = local_var_req_builder.query(&[("secret", &local_var_str.to_string())]);
1140 }
1141 if let Some(ref local_var_str) = approver {
1142 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1143 }
1144 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1145 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1146 }
1147 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1148 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1149 };
1150
1151 let local_var_req = local_var_req_builder.build()?;
1152 let local_var_resp = local_var_client.execute(local_var_req).await?;
1153
1154 let local_var_status = local_var_resp.status();
1155 let local_var_content = local_var_resp.text().await?;
1156
1157 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1158 crate::from_str_patched(&local_var_content).map_err(Error::from)
1159 } else {
1160 let local_var_entity: Option<GetCompletedJobResultError> = crate::from_str_patched(&local_var_content).ok();
1161 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1162 Err(Error::ResponseError(local_var_error))
1163 }
1164}
1165
1166pub async fn get_completed_job_result_maybe(configuration: &configuration::Configuration, workspace: &str, id: &str, get_started: Option<bool>) -> Result<models::GetCompletedJobResultMaybe200Response, Error<GetCompletedJobResultMaybeError>> {
1167 let local_var_configuration = configuration;
1168
1169 let local_var_client = &local_var_configuration.client;
1170
1171 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));
1172 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1173
1174 if let Some(ref local_var_str) = get_started {
1175 local_var_req_builder = local_var_req_builder.query(&[("get_started", &local_var_str.to_string())]);
1176 }
1177 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1178 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1179 }
1180 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1181 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1182 };
1183
1184 let local_var_req = local_var_req_builder.build()?;
1185 let local_var_resp = local_var_client.execute(local_var_req).await?;
1186
1187 let local_var_status = local_var_resp.status();
1188 let local_var_content = local_var_resp.text().await?;
1189
1190 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1191 crate::from_str_patched(&local_var_content).map_err(Error::from)
1192 } else {
1193 let local_var_entity: Option<GetCompletedJobResultMaybeError> = crate::from_str_patched(&local_var_content).ok();
1194 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1195 Err(Error::ResponseError(local_var_error))
1196 }
1197}
1198
1199pub async fn get_completed_job_timing(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::GetCompletedJobTiming200Response, Error<GetCompletedJobTimingError>> {
1200 let local_var_configuration = configuration;
1201
1202 let local_var_client = &local_var_configuration.client;
1203
1204 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));
1205 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1206
1207 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1208 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1209 }
1210 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1211 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1212 };
1213
1214 let local_var_req = local_var_req_builder.build()?;
1215 let local_var_resp = local_var_client.execute(local_var_req).await?;
1216
1217 let local_var_status = local_var_resp.status();
1218 let local_var_content = local_var_resp.text().await?;
1219
1220 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1221 crate::from_str_patched(&local_var_content).map_err(Error::from)
1222 } else {
1223 let local_var_entity: Option<GetCompletedJobTimingError> = crate::from_str_patched(&local_var_content).ok();
1224 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1225 Err(Error::ResponseError(local_var_error))
1226 }
1227}
1228
1229pub async fn get_db_clock(configuration: &configuration::Configuration, ) -> Result<i32, Error<GetDbClockError>> {
1230 let local_var_configuration = configuration;
1231
1232 let local_var_client = &local_var_configuration.client;
1233
1234 let local_var_uri_str = format!("{}/jobs/db_clock", local_var_configuration.base_path);
1235 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1236
1237 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1238 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1239 }
1240 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1241 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1242 };
1243
1244 let local_var_req = local_var_req_builder.build()?;
1245 let local_var_resp = local_var_client.execute(local_var_req).await?;
1246
1247 let local_var_status = local_var_resp.status();
1248 let local_var_content = local_var_resp.text().await?;
1249
1250 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1251 crate::from_str_patched(&local_var_content).map_err(Error::from)
1252 } else {
1253 let local_var_entity: Option<GetDbClockError> = crate::from_str_patched(&local_var_content).ok();
1254 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1255 Err(Error::ResponseError(local_var_error))
1256 }
1257}
1258
1259pub async fn get_flow_debug_info(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetFlowDebugInfoError>> {
1260 let local_var_configuration = configuration;
1261
1262 let local_var_client = &local_var_configuration.client;
1263
1264 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));
1265 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1266
1267 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1268 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1269 }
1270 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1271 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1272 };
1273
1274 let local_var_req = local_var_req_builder.build()?;
1275 let local_var_resp = local_var_client.execute(local_var_req).await?;
1276
1277 let local_var_status = local_var_resp.status();
1278 let local_var_content = local_var_resp.text().await?;
1279
1280 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1281 crate::from_str_patched(&local_var_content).map_err(Error::from)
1282 } else {
1283 let local_var_entity: Option<GetFlowDebugInfoError> = crate::from_str_patched(&local_var_content).ok();
1284 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1285 Err(Error::ResponseError(local_var_error))
1286 }
1287}
1288
1289pub async fn get_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str) -> Result<serde_json::Value, Error<GetFlowUserStateError>> {
1290 let local_var_configuration = configuration;
1291
1292 let local_var_client = &local_var_configuration.client;
1293
1294 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));
1295 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1296
1297 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1298 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1299 }
1300 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1301 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1302 };
1303
1304 let local_var_req = local_var_req_builder.build()?;
1305 let local_var_resp = local_var_client.execute(local_var_req).await?;
1306
1307 let local_var_status = local_var_resp.status();
1308 let local_var_content = local_var_resp.text().await?;
1309
1310 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1311 crate::from_str_patched(&local_var_content).map_err(Error::from)
1312 } else {
1313 let local_var_entity: Option<GetFlowUserStateError> = crate::from_str_patched(&local_var_content).ok();
1314 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1315 Err(Error::ResponseError(local_var_error))
1316 }
1317}
1318
1319pub async fn get_job(configuration: &configuration::Configuration, workspace: &str, id: &str, no_logs: Option<bool>, no_code: Option<bool>) -> Result<models::Job, Error<GetJobError>> {
1320 let local_var_configuration = configuration;
1321
1322 let local_var_client = &local_var_configuration.client;
1323
1324 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));
1325 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1326
1327 if let Some(ref local_var_str) = no_logs {
1328 local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1329 }
1330 if let Some(ref local_var_str) = no_code {
1331 local_var_req_builder = local_var_req_builder.query(&[("no_code", &local_var_str.to_string())]);
1332 }
1333 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1334 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1335 }
1336 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1337 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1338 };
1339
1340 let local_var_req = local_var_req_builder.build()?;
1341 let local_var_resp = local_var_client.execute(local_var_req).await?;
1342
1343 let local_var_status = local_var_resp.status();
1344 let local_var_content = local_var_resp.text().await?;
1345
1346 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1347 crate::from_str_patched(&local_var_content).map_err(Error::from)
1348 } else {
1349 let local_var_entity: Option<GetJobError> = crate::from_str_patched(&local_var_content).ok();
1350 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1351 Err(Error::ResponseError(local_var_error))
1352 }
1353}
1354
1355pub async fn get_job_args(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetJobArgsError>> {
1356 let local_var_configuration = configuration;
1357
1358 let local_var_client = &local_var_configuration.client;
1359
1360 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));
1361 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1362
1363 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1364 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1365 }
1366 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1367 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1368 };
1369
1370 let local_var_req = local_var_req_builder.build()?;
1371 let local_var_resp = local_var_client.execute(local_var_req).await?;
1372
1373 let local_var_status = local_var_resp.status();
1374 let local_var_content = local_var_resp.text().await?;
1375
1376 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1377 crate::from_str_patched(&local_var_content).map_err(Error::from)
1378 } else {
1379 let local_var_entity: Option<GetJobArgsError> = crate::from_str_patched(&local_var_content).ok();
1380 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1381 Err(Error::ResponseError(local_var_error))
1382 }
1383}
1384
1385pub async fn get_job_logs(configuration: &configuration::Configuration, workspace: &str, id: &str, remove_ansi_warnings: Option<bool>) -> Result<String, Error<GetJobLogsError>> {
1386 let local_var_configuration = configuration;
1387
1388 let local_var_client = &local_var_configuration.client;
1389
1390 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));
1391 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1392
1393 if let Some(ref local_var_str) = remove_ansi_warnings {
1394 local_var_req_builder = local_var_req_builder.query(&[("remove_ansi_warnings", &local_var_str.to_string())]);
1395 }
1396 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1397 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1398 }
1399 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1400 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1401 };
1402
1403 let local_var_req = local_var_req_builder.build()?;
1404 let local_var_resp = local_var_client.execute(local_var_req).await?;
1405
1406 let local_var_status = local_var_resp.status();
1407 let local_var_content = local_var_resp.text().await?;
1408
1409 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1410 crate::from_str_patched(&local_var_content).map_err(Error::from)
1411 } else {
1412 let local_var_entity: Option<GetJobLogsError> = crate::from_str_patched(&local_var_content).ok();
1413 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1414 Err(Error::ResponseError(local_var_error))
1415 }
1416}
1417
1418pub 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>> {
1419 let local_var_configuration = configuration;
1420
1421 let local_var_client = &local_var_configuration.client;
1422
1423 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));
1424 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1425
1426 if let Some(ref local_var_str) = running {
1427 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1428 }
1429 if let Some(ref local_var_str) = log_offset {
1430 local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1431 }
1432 if let Some(ref local_var_str) = stream_offset {
1433 local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1434 }
1435 if let Some(ref local_var_str) = get_progress {
1436 local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
1437 }
1438 if let Some(ref local_var_str) = no_logs {
1439 local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1440 }
1441 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1442 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1443 }
1444 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1445 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1446 };
1447
1448 let local_var_req = local_var_req_builder.build()?;
1449 let local_var_resp = local_var_client.execute(local_var_req).await?;
1450
1451 let local_var_status = local_var_resp.status();
1452 let local_var_content = local_var_resp.text().await?;
1453
1454 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1455 crate::from_str_patched(&local_var_content).map_err(Error::from)
1456 } else {
1457 let local_var_entity: Option<GetJobUpdatesError> = crate::from_str_patched(&local_var_content).ok();
1458 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1459 Err(Error::ResponseError(local_var_error))
1460 }
1461}
1462
1463pub 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>) -> Result<String, Error<GetJobUpdatesSseError>> {
1464 let local_var_configuration = configuration;
1465
1466 let local_var_client = &local_var_configuration.client;
1467
1468 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));
1469 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1470
1471 if let Some(ref local_var_str) = running {
1472 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1473 }
1474 if let Some(ref local_var_str) = log_offset {
1475 local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1476 }
1477 if let Some(ref local_var_str) = stream_offset {
1478 local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1479 }
1480 if let Some(ref local_var_str) = get_progress {
1481 local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
1482 }
1483 if let Some(ref local_var_str) = only_result {
1484 local_var_req_builder = local_var_req_builder.query(&[("only_result", &local_var_str.to_string())]);
1485 }
1486 if let Some(ref local_var_str) = no_logs {
1487 local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1488 }
1489 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1490 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1491 }
1492 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1493 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1494 };
1495
1496 let local_var_req = local_var_req_builder.build()?;
1497 let local_var_resp = local_var_client.execute(local_var_req).await?;
1498
1499 let local_var_status = local_var_resp.status();
1500 let local_var_content = local_var_resp.text().await?;
1501
1502 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1503 crate::from_str_patched(&local_var_content).map_err(Error::from)
1504 } else {
1505 let local_var_entity: Option<GetJobUpdatesSseError> = crate::from_str_patched(&local_var_content).ok();
1506 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1507 Err(Error::ResponseError(local_var_error))
1508 }
1509}
1510
1511pub async fn get_log_file_from_store(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetLogFileFromStoreError>> {
1512 let local_var_configuration = configuration;
1513
1514 let local_var_client = &local_var_configuration.client;
1515
1516 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));
1517 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1518
1519 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1520 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1521 }
1522 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1523 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1524 };
1525
1526 let local_var_req = local_var_req_builder.build()?;
1527 let local_var_resp = local_var_client.execute(local_var_req).await?;
1528
1529 let local_var_status = local_var_resp.status();
1530 let local_var_content = local_var_resp.text().await?;
1531
1532 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1533 crate::from_str_patched(&local_var_content).map_err(Error::from)
1534 } else {
1535 let local_var_entity: Option<GetLogFileFromStoreError> = crate::from_str_patched(&local_var_content).ok();
1536 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1537 Err(Error::ResponseError(local_var_error))
1538 }
1539}
1540
1541pub async fn get_queue_count(configuration: &configuration::Configuration, workspace: &str, all_workspaces: Option<bool>) -> Result<models::GetQueueCount200Response, Error<GetQueueCountError>> {
1542 let local_var_configuration = configuration;
1543
1544 let local_var_client = &local_var_configuration.client;
1545
1546 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1547 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1548
1549 if let Some(ref local_var_str) = all_workspaces {
1550 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1551 }
1552 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1553 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1554 }
1555 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1556 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1557 };
1558
1559 let local_var_req = local_var_req_builder.build()?;
1560 let local_var_resp = local_var_client.execute(local_var_req).await?;
1561
1562 let local_var_status = local_var_resp.status();
1563 let local_var_content = local_var_resp.text().await?;
1564
1565 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1566 crate::from_str_patched(&local_var_content).map_err(Error::from)
1567 } else {
1568 let local_var_entity: Option<GetQueueCountError> = crate::from_str_patched(&local_var_content).ok();
1569 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1570 Err(Error::ResponseError(local_var_error))
1571 }
1572}
1573
1574pub async fn get_queue_position(configuration: &configuration::Configuration, workspace: &str, scheduled_for: i32) -> Result<models::GetQueuePosition200Response, Error<GetQueuePositionError>> {
1575 let local_var_configuration = configuration;
1576
1577 let local_var_client = &local_var_configuration.client;
1578
1579 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/position/{scheduled_for}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), scheduled_for=scheduled_for);
1580 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1581
1582 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1583 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1584 }
1585 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1586 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1587 };
1588
1589 let local_var_req = local_var_req_builder.build()?;
1590 let local_var_resp = local_var_client.execute(local_var_req).await?;
1591
1592 let local_var_status = local_var_resp.status();
1593 let local_var_content = local_var_resp.text().await?;
1594
1595 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1596 crate::from_str_patched(&local_var_content).map_err(Error::from)
1597 } else {
1598 let local_var_entity: Option<GetQueuePositionError> = crate::from_str_patched(&local_var_content).ok();
1599 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1600 Err(Error::ResponseError(local_var_error))
1601 }
1602}
1603
1604pub 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>> {
1605 let local_var_configuration = configuration;
1606
1607 let local_var_client = &local_var_configuration.client;
1608
1609 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);
1610 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1611
1612 if let Some(ref local_var_str) = approver {
1613 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1614 }
1615 if let Some(ref local_var_str) = flow_level {
1616 local_var_req_builder = local_var_req_builder.query(&[("flow_level", &local_var_str.to_string())]);
1617 }
1618 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1619 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1620 }
1621 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1622 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1623 };
1624
1625 let local_var_req = local_var_req_builder.build()?;
1626 let local_var_resp = local_var_client.execute(local_var_req).await?;
1627
1628 let local_var_status = local_var_resp.status();
1629 let local_var_content = local_var_resp.text().await?;
1630
1631 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1632 crate::from_str_patched(&local_var_content).map_err(Error::from)
1633 } else {
1634 let local_var_entity: Option<GetResumeUrlsError> = crate::from_str_patched(&local_var_content).ok();
1635 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1636 Err(Error::ResponseError(local_var_error))
1637 }
1638}
1639
1640pub async fn get_root_job_id(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetRootJobIdError>> {
1641 let local_var_configuration = configuration;
1642
1643 let local_var_client = &local_var_configuration.client;
1644
1645 let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_root_job_id/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1646 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1647
1648 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1649 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1650 }
1651 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1652 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1653 };
1654
1655 let local_var_req = local_var_req_builder.build()?;
1656 let local_var_resp = local_var_client.execute(local_var_req).await?;
1657
1658 let local_var_status = local_var_resp.status();
1659 let local_var_content = local_var_resp.text().await?;
1660
1661 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1662 crate::from_str_patched(&local_var_content).map_err(Error::from)
1663 } else {
1664 let local_var_entity: Option<GetRootJobIdError> = crate::from_str_patched(&local_var_content).ok();
1665 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1666 Err(Error::ResponseError(local_var_error))
1667 }
1668}
1669
1670pub async fn get_scheduled_for(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<i32, Error<GetScheduledForError>> {
1671 let local_var_configuration = configuration;
1672
1673 let local_var_client = &local_var_configuration.client;
1674
1675 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));
1676 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
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(&local_var_content).map_err(Error::from)
1693 } else {
1694 let local_var_entity: Option<GetScheduledForError> = crate::from_str_patched(&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_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>) -> Result<(), Error<GetSlackApprovalPayloadError>> {
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/slack_approval/{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_str) = approver {
1709 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1710 }
1711 if let Some(ref local_var_str) = message {
1712 local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
1713 }
1714 local_var_req_builder = local_var_req_builder.query(&[("slack_resource_path", &slack_resource_path.to_string())]);
1715 local_var_req_builder = local_var_req_builder.query(&[("channel_id", &channel_id.to_string())]);
1716 local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
1717 if let Some(ref local_var_str) = default_args_json {
1718 local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
1719 }
1720 if let Some(ref local_var_str) = dynamic_enums_json {
1721 local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
1722 }
1723 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1724 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1725 }
1726 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1727 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1728 };
1729
1730 let local_var_req = local_var_req_builder.build()?;
1731 let local_var_resp = local_var_client.execute(local_var_req).await?;
1732
1733 let local_var_status = local_var_resp.status();
1734 let local_var_content = local_var_resp.text().await?;
1735
1736 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1737 Ok(())
1738 } else {
1739 let local_var_entity: Option<GetSlackApprovalPayloadError> = crate::from_str_patched(&local_var_content).ok();
1740 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1741 Err(Error::ResponseError(local_var_error))
1742 }
1743}
1744
1745pub async fn get_started_at_by_ids(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<String>, Error<GetStartedAtByIdsError>> {
1746 let local_var_configuration = configuration;
1747
1748 let local_var_client = &local_var_configuration.client;
1749
1750 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));
1751 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1752
1753 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1754 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1755 }
1756 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1757 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1758 };
1759 local_var_req_builder = local_var_req_builder.json(&request_body);
1760
1761 let local_var_req = local_var_req_builder.build()?;
1762 let local_var_resp = local_var_client.execute(local_var_req).await?;
1763
1764 let local_var_status = local_var_resp.status();
1765 let local_var_content = local_var_resp.text().await?;
1766
1767 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1768 crate::from_str_patched(&local_var_content).map_err(Error::from)
1769 } else {
1770 let local_var_entity: Option<GetStartedAtByIdsError> = crate::from_str_patched(&local_var_content).ok();
1771 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1772 Err(Error::ResponseError(local_var_error))
1773 }
1774}
1775
1776pub 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>> {
1777 let local_var_configuration = configuration;
1778
1779 let local_var_client = &local_var_configuration.client;
1780
1781 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));
1782 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1783
1784 if let Some(ref local_var_str) = approver {
1785 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1786 }
1787 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1788 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1789 }
1790 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1791 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1792 };
1793
1794 let local_var_req = local_var_req_builder.build()?;
1795 let local_var_resp = local_var_client.execute(local_var_req).await?;
1796
1797 let local_var_status = local_var_resp.status();
1798 let local_var_content = local_var_resp.text().await?;
1799
1800 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1801 crate::from_str_patched(&local_var_content).map_err(Error::from)
1802 } else {
1803 let local_var_entity: Option<GetSuspendedJobFlowError> = crate::from_str_patched(&local_var_content).ok();
1804 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1805 Err(Error::ResponseError(local_var_error))
1806 }
1807}
1808
1809pub 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>) -> Result<(), Error<GetTeamsApprovalPayloadError>> {
1810 let local_var_configuration = configuration;
1811
1812 let local_var_client = &local_var_configuration.client;
1813
1814 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));
1815 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1816
1817 if let Some(ref local_var_str) = approver {
1818 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1819 }
1820 if let Some(ref local_var_str) = message {
1821 local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
1822 }
1823 local_var_req_builder = local_var_req_builder.query(&[("team_name", &team_name.to_string())]);
1824 local_var_req_builder = local_var_req_builder.query(&[("channel_name", &channel_name.to_string())]);
1825 local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
1826 if let Some(ref local_var_str) = default_args_json {
1827 local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
1828 }
1829 if let Some(ref local_var_str) = dynamic_enums_json {
1830 local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
1831 }
1832 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1833 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1834 }
1835 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1836 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1837 };
1838
1839 let local_var_req = local_var_req_builder.build()?;
1840 let local_var_resp = local_var_client.execute(local_var_req).await?;
1841
1842 let local_var_status = local_var_resp.status();
1843 let local_var_content = local_var_resp.text().await?;
1844
1845 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1846 Ok(())
1847 } else {
1848 let local_var_entity: Option<GetTeamsApprovalPayloadError> = crate::from_str_patched(&local_var_content).ok();
1849 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1850 Err(Error::ResponseError(local_var_error))
1851 }
1852}
1853
1854pub async fn import_completed_jobs(configuration: &configuration::Configuration, workspace: &str, exportable_completed_job: Vec<models::ExportableCompletedJob>) -> Result<String, Error<ImportCompletedJobsError>> {
1855 let local_var_configuration = configuration;
1856
1857 let local_var_client = &local_var_configuration.client;
1858
1859 let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/import", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1860 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1861
1862 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1863 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1864 }
1865 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1866 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1867 };
1868 local_var_req_builder = local_var_req_builder.json(&exportable_completed_job);
1869
1870 let local_var_req = local_var_req_builder.build()?;
1871 let local_var_resp = local_var_client.execute(local_var_req).await?;
1872
1873 let local_var_status = local_var_resp.status();
1874 let local_var_content = local_var_resp.text().await?;
1875
1876 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1877 crate::from_str_patched(&local_var_content).map_err(Error::from)
1878 } else {
1879 let local_var_entity: Option<ImportCompletedJobsError> = crate::from_str_patched(&local_var_content).ok();
1880 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1881 Err(Error::ResponseError(local_var_error))
1882 }
1883}
1884
1885pub async fn import_queued_jobs(configuration: &configuration::Configuration, workspace: &str, exportable_queued_job: Vec<models::ExportableQueuedJob>) -> Result<String, Error<ImportQueuedJobsError>> {
1886 let local_var_configuration = configuration;
1887
1888 let local_var_client = &local_var_configuration.client;
1889
1890 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/import", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1891 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1892
1893 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1894 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1895 }
1896 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1897 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1898 };
1899 local_var_req_builder = local_var_req_builder.json(&exportable_queued_job);
1900
1901 let local_var_req = local_var_req_builder.build()?;
1902 let local_var_resp = local_var_client.execute(local_var_req).await?;
1903
1904 let local_var_status = local_var_resp.status();
1905 let local_var_content = local_var_resp.text().await?;
1906
1907 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1908 crate::from_str_patched(&local_var_content).map_err(Error::from)
1909 } else {
1910 let local_var_entity: Option<ImportQueuedJobsError> = crate::from_str_patched(&local_var_content).ok();
1911 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1912 Err(Error::ResponseError(local_var_error))
1913 }
1914}
1915
1916pub 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>, 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>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<models::CompletedJob>, Error<ListCompletedJobsError>> {
1917 let local_var_configuration = configuration;
1918
1919 let local_var_client = &local_var_configuration.client;
1920
1921 let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1922 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1923
1924 if let Some(ref local_var_str) = order_desc {
1925 local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
1926 }
1927 if let Some(ref local_var_str) = created_by {
1928 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1929 }
1930 if let Some(ref local_var_str) = label {
1931 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1932 }
1933 if let Some(ref local_var_str) = worker {
1934 local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
1935 }
1936 if let Some(ref local_var_str) = parent_job {
1937 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1938 }
1939 if let Some(ref local_var_str) = script_path_exact {
1940 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1941 }
1942 if let Some(ref local_var_str) = script_path_start {
1943 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1944 }
1945 if let Some(ref local_var_str) = schedule_path {
1946 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1947 }
1948 if let Some(ref local_var_str) = script_hash {
1949 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1950 }
1951 if let Some(ref local_var_str) = started_before {
1952 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1953 }
1954 if let Some(ref local_var_str) = started_after {
1955 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1956 }
1957 if let Some(ref local_var_str) = success {
1958 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1959 }
1960 if let Some(ref local_var_str) = job_kinds {
1961 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1962 }
1963 if let Some(ref local_var_str) = args {
1964 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1965 }
1966 if let Some(ref local_var_str) = result {
1967 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1968 }
1969 if let Some(ref local_var_str) = allow_wildcards {
1970 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
1971 }
1972 if let Some(ref local_var_str) = tag {
1973 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1974 }
1975 if let Some(ref local_var_str) = page {
1976 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1977 }
1978 if let Some(ref local_var_str) = per_page {
1979 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1980 }
1981 if let Some(ref local_var_str) = is_skipped {
1982 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
1983 }
1984 if let Some(ref local_var_str) = is_flow_step {
1985 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
1986 }
1987 if let Some(ref local_var_str) = has_null_parent {
1988 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
1989 }
1990 if let Some(ref local_var_str) = is_not_schedule {
1991 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1992 }
1993 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1994 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1995 }
1996 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1997 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1998 };
1999
2000 let local_var_req = local_var_req_builder.build()?;
2001 let local_var_resp = local_var_client.execute(local_var_req).await?;
2002
2003 let local_var_status = local_var_resp.status();
2004 let local_var_content = local_var_resp.text().await?;
2005
2006 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2007 crate::from_str_patched(&local_var_content).map_err(Error::from)
2008 } else {
2009 let local_var_entity: Option<ListCompletedJobsError> = crate::from_str_patched(&local_var_content).ok();
2010 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2011 Err(Error::ResponseError(local_var_error))
2012 }
2013}
2014
2015pub 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<models::JobTriggerKind>, is_skipped: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<models::ExtendedJobs, Error<ListExtendedJobsError>> {
2016 let local_var_configuration = configuration;
2017
2018 let local_var_client = &local_var_configuration.client;
2019
2020 let local_var_uri_str = format!("{}/w/{workspace}/concurrency_groups/list_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2021 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2022
2023 if let Some(ref local_var_str) = concurrency_key {
2024 local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
2025 }
2026 if let Some(ref local_var_str) = row_limit {
2027 local_var_req_builder = local_var_req_builder.query(&[("row_limit", &local_var_str.to_string())]);
2028 }
2029 if let Some(ref local_var_str) = created_by {
2030 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2031 }
2032 if let Some(ref local_var_str) = label {
2033 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
2034 }
2035 if let Some(ref local_var_str) = parent_job {
2036 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2037 }
2038 if let Some(ref local_var_str) = script_path_exact {
2039 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2040 }
2041 if let Some(ref local_var_str) = script_path_start {
2042 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2043 }
2044 if let Some(ref local_var_str) = schedule_path {
2045 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2046 }
2047 if let Some(ref local_var_str) = script_hash {
2048 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2049 }
2050 if let Some(ref local_var_str) = started_before {
2051 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2052 }
2053 if let Some(ref local_var_str) = started_after {
2054 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2055 }
2056 if let Some(ref local_var_str) = running {
2057 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2058 }
2059 if let Some(ref local_var_str) = scheduled_for_before_now {
2060 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2061 }
2062 if let Some(ref local_var_str) = completed_before {
2063 local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
2064 }
2065 if let Some(ref local_var_str) = completed_after {
2066 local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
2067 }
2068 if let Some(ref local_var_str) = created_before_queue {
2069 local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
2070 }
2071 if let Some(ref local_var_str) = created_after_queue {
2072 local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
2073 }
2074 if let Some(ref local_var_str) = job_kinds {
2075 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2076 }
2077 if let Some(ref local_var_str) = args {
2078 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2079 }
2080 if let Some(ref local_var_str) = tag {
2081 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2082 }
2083 if let Some(ref local_var_str) = result {
2084 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2085 }
2086 if let Some(ref local_var_str) = allow_wildcards {
2087 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2088 }
2089 if let Some(ref local_var_str) = page {
2090 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2091 }
2092 if let Some(ref local_var_str) = per_page {
2093 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2094 }
2095 if let Some(ref local_var_str) = trigger_kind {
2096 local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
2097 }
2098 if let Some(ref local_var_str) = is_skipped {
2099 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2100 }
2101 if let Some(ref local_var_str) = is_flow_step {
2102 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2103 }
2104 if let Some(ref local_var_str) = has_null_parent {
2105 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2106 }
2107 if let Some(ref local_var_str) = success {
2108 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2109 }
2110 if let Some(ref local_var_str) = all_workspaces {
2111 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2112 }
2113 if let Some(ref local_var_str) = is_not_schedule {
2114 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2115 }
2116 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2117 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2118 }
2119 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2120 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2121 };
2122
2123 let local_var_req = local_var_req_builder.build()?;
2124 let local_var_resp = local_var_client.execute(local_var_req).await?;
2125
2126 let local_var_status = local_var_resp.status();
2127 let local_var_content = local_var_resp.text().await?;
2128
2129 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2130 crate::from_str_patched(&local_var_content).map_err(Error::from)
2131 } else {
2132 let local_var_entity: Option<ListExtendedJobsError> = crate::from_str_patched(&local_var_content).ok();
2133 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2134 Err(Error::ResponseError(local_var_error))
2135 }
2136}
2137
2138pub async fn list_filtered_jobs_uuids(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>, page: Option<i32>, per_page: Option<i32>, is_skipped: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<String>, Error<ListFilteredJobsUuidsError>> {
2139 let local_var_configuration = configuration;
2140
2141 let local_var_client = &local_var_configuration.client;
2142
2143 let local_var_uri_str = format!("{}/w/{workspace}/jobs/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2144 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2145
2146 if let Some(ref local_var_str) = created_by {
2147 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2148 }
2149 if let Some(ref local_var_str) = label {
2150 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
2151 }
2152 if let Some(ref local_var_str) = worker {
2153 local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2154 }
2155 if let Some(ref local_var_str) = parent_job {
2156 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2157 }
2158 if let Some(ref local_var_str) = script_path_exact {
2159 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2160 }
2161 if let Some(ref local_var_str) = script_path_start {
2162 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2163 }
2164 if let Some(ref local_var_str) = schedule_path {
2165 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2166 }
2167 if let Some(ref local_var_str) = script_hash {
2168 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2169 }
2170 if let Some(ref local_var_str) = started_before {
2171 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2172 }
2173 if let Some(ref local_var_str) = started_after {
2174 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2175 }
2176 if let Some(ref local_var_str) = created_before {
2177 local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
2178 }
2179 if let Some(ref local_var_str) = created_after {
2180 local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
2181 }
2182 if let Some(ref local_var_str) = completed_before {
2183 local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
2184 }
2185 if let Some(ref local_var_str) = completed_after {
2186 local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
2187 }
2188 if let Some(ref local_var_str) = created_before_queue {
2189 local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
2190 }
2191 if let Some(ref local_var_str) = created_after_queue {
2192 local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
2193 }
2194 if let Some(ref local_var_str) = running {
2195 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2196 }
2197 if let Some(ref local_var_str) = scheduled_for_before_now {
2198 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2199 }
2200 if let Some(ref local_var_str) = job_kinds {
2201 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2202 }
2203 if let Some(ref local_var_str) = suspended {
2204 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2205 }
2206 if let Some(ref local_var_str) = args {
2207 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2208 }
2209 if let Some(ref local_var_str) = tag {
2210 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2211 }
2212 if let Some(ref local_var_str) = result {
2213 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2214 }
2215 if let Some(ref local_var_str) = page {
2216 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2217 }
2218 if let Some(ref local_var_str) = per_page {
2219 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2220 }
2221 if let Some(ref local_var_str) = is_skipped {
2222 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2223 }
2224 if let Some(ref local_var_str) = is_flow_step {
2225 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2226 }
2227 if let Some(ref local_var_str) = has_null_parent {
2228 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2229 }
2230 if let Some(ref local_var_str) = success {
2231 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2232 }
2233 if let Some(ref local_var_str) = all_workspaces {
2234 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2235 }
2236 if let Some(ref local_var_str) = is_not_schedule {
2237 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2238 }
2239 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2240 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2241 }
2242 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2243 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2244 };
2245
2246 let local_var_req = local_var_req_builder.build()?;
2247 let local_var_resp = local_var_client.execute(local_var_req).await?;
2248
2249 let local_var_status = local_var_resp.status();
2250 let local_var_content = local_var_resp.text().await?;
2251
2252 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2253 crate::from_str_patched(&local_var_content).map_err(Error::from)
2254 } else {
2255 let local_var_entity: Option<ListFilteredJobsUuidsError> = crate::from_str_patched(&local_var_content).ok();
2256 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2257 Err(Error::ResponseError(local_var_error))
2258 }
2259}
2260
2261pub 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>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<String>, Error<ListFilteredQueueUuidsError>> {
2262 let local_var_configuration = configuration;
2263
2264 let local_var_client = &local_var_configuration.client;
2265
2266 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2267 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2268
2269 if let Some(ref local_var_str) = order_desc {
2270 local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
2271 }
2272 if let Some(ref local_var_str) = created_by {
2273 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2274 }
2275 if let Some(ref local_var_str) = parent_job {
2276 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2277 }
2278 if let Some(ref local_var_str) = script_path_exact {
2279 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2280 }
2281 if let Some(ref local_var_str) = script_path_start {
2282 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2283 }
2284 if let Some(ref local_var_str) = schedule_path {
2285 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2286 }
2287 if let Some(ref local_var_str) = script_hash {
2288 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2289 }
2290 if let Some(ref local_var_str) = started_before {
2291 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2292 }
2293 if let Some(ref local_var_str) = started_after {
2294 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2295 }
2296 if let Some(ref local_var_str) = success {
2297 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2298 }
2299 if let Some(ref local_var_str) = scheduled_for_before_now {
2300 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2301 }
2302 if let Some(ref local_var_str) = job_kinds {
2303 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2304 }
2305 if let Some(ref local_var_str) = suspended {
2306 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2307 }
2308 if let Some(ref local_var_str) = running {
2309 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2310 }
2311 if let Some(ref local_var_str) = args {
2312 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2313 }
2314 if let Some(ref local_var_str) = result {
2315 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2316 }
2317 if let Some(ref local_var_str) = allow_wildcards {
2318 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2319 }
2320 if let Some(ref local_var_str) = tag {
2321 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2322 }
2323 if let Some(ref local_var_str) = page {
2324 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2325 }
2326 if let Some(ref local_var_str) = per_page {
2327 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2328 }
2329 if let Some(ref local_var_str) = concurrency_key {
2330 local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
2331 }
2332 if let Some(ref local_var_str) = all_workspaces {
2333 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2334 }
2335 if let Some(ref local_var_str) = is_not_schedule {
2336 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2337 }
2338 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2339 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2340 }
2341 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2342 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2343 };
2344
2345 let local_var_req = local_var_req_builder.build()?;
2346 let local_var_resp = local_var_client.execute(local_var_req).await?;
2347
2348 let local_var_status = local_var_resp.status();
2349 let local_var_content = local_var_resp.text().await?;
2350
2351 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2352 crate::from_str_patched(&local_var_content).map_err(Error::from)
2353 } else {
2354 let local_var_entity: Option<ListFilteredQueueUuidsError> = crate::from_str_patched(&local_var_content).ok();
2355 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2356 Err(Error::ResponseError(local_var_error))
2357 }
2358}
2359
2360pub 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<models::JobTriggerKind>, is_skipped: Option<bool>, is_flow_step: Option<bool>, has_null_parent: Option<bool>, success: Option<bool>, all_workspaces: Option<bool>, is_not_schedule: Option<bool>) -> Result<Vec<models::Job>, Error<ListJobsError>> {
2361 let local_var_configuration = configuration;
2362
2363 let local_var_client = &local_var_configuration.client;
2364
2365 let local_var_uri_str = format!("{}/w/{workspace}/jobs/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2366 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2367
2368 if let Some(ref local_var_str) = created_by {
2369 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2370 }
2371 if let Some(ref local_var_str) = label {
2372 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
2373 }
2374 if let Some(ref local_var_str) = worker {
2375 local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2376 }
2377 if let Some(ref local_var_str) = parent_job {
2378 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2379 }
2380 if let Some(ref local_var_str) = script_path_exact {
2381 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2382 }
2383 if let Some(ref local_var_str) = script_path_start {
2384 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2385 }
2386 if let Some(ref local_var_str) = schedule_path {
2387 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2388 }
2389 if let Some(ref local_var_str) = script_hash {
2390 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2391 }
2392 if let Some(ref local_var_str) = started_before {
2393 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2394 }
2395 if let Some(ref local_var_str) = started_after {
2396 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2397 }
2398 if let Some(ref local_var_str) = created_before {
2399 local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
2400 }
2401 if let Some(ref local_var_str) = created_after {
2402 local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
2403 }
2404 if let Some(ref local_var_str) = completed_before {
2405 local_var_req_builder = local_var_req_builder.query(&[("completed_before", &local_var_str.to_string())]);
2406 }
2407 if let Some(ref local_var_str) = completed_after {
2408 local_var_req_builder = local_var_req_builder.query(&[("completed_after", &local_var_str.to_string())]);
2409 }
2410 if let Some(ref local_var_str) = created_before_queue {
2411 local_var_req_builder = local_var_req_builder.query(&[("created_before_queue", &local_var_str.to_string())]);
2412 }
2413 if let Some(ref local_var_str) = created_after_queue {
2414 local_var_req_builder = local_var_req_builder.query(&[("created_after_queue", &local_var_str.to_string())]);
2415 }
2416 if let Some(ref local_var_str) = running {
2417 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2418 }
2419 if let Some(ref local_var_str) = scheduled_for_before_now {
2420 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2421 }
2422 if let Some(ref local_var_str) = job_kinds {
2423 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2424 }
2425 if let Some(ref local_var_str) = suspended {
2426 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2427 }
2428 if let Some(ref local_var_str) = args {
2429 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2430 }
2431 if let Some(ref local_var_str) = tag {
2432 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2433 }
2434 if let Some(ref local_var_str) = result {
2435 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2436 }
2437 if let Some(ref local_var_str) = allow_wildcards {
2438 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2439 }
2440 if let Some(ref local_var_str) = per_page {
2441 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2442 }
2443 if let Some(ref local_var_str) = trigger_kind {
2444 local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
2445 }
2446 if let Some(ref local_var_str) = is_skipped {
2447 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2448 }
2449 if let Some(ref local_var_str) = is_flow_step {
2450 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2451 }
2452 if let Some(ref local_var_str) = has_null_parent {
2453 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2454 }
2455 if let Some(ref local_var_str) = success {
2456 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2457 }
2458 if let Some(ref local_var_str) = all_workspaces {
2459 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2460 }
2461 if let Some(ref local_var_str) = is_not_schedule {
2462 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2463 }
2464 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2465 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2466 }
2467 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2468 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2469 };
2470
2471 let local_var_req = local_var_req_builder.build()?;
2472 let local_var_resp = local_var_client.execute(local_var_req).await?;
2473
2474 let local_var_status = local_var_resp.status();
2475 let local_var_content = local_var_resp.text().await?;
2476
2477 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2478 crate::from_str_patched(&local_var_content).map_err(Error::from)
2479 } else {
2480 let local_var_entity: Option<ListJobsError> = crate::from_str_patched(&local_var_content).ok();
2481 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2482 Err(Error::ResponseError(local_var_error))
2483 }
2484}
2485
2486pub 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<models::JobTriggerKind>, 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>> {
2487 let local_var_configuration = configuration;
2488
2489 let local_var_client = &local_var_configuration.client;
2490
2491 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2492 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2493
2494 if let Some(ref local_var_str) = order_desc {
2495 local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
2496 }
2497 if let Some(ref local_var_str) = created_by {
2498 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2499 }
2500 if let Some(ref local_var_str) = parent_job {
2501 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2502 }
2503 if let Some(ref local_var_str) = worker {
2504 local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2505 }
2506 if let Some(ref local_var_str) = script_path_exact {
2507 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2508 }
2509 if let Some(ref local_var_str) = script_path_start {
2510 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2511 }
2512 if let Some(ref local_var_str) = schedule_path {
2513 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2514 }
2515 if let Some(ref local_var_str) = trigger_path {
2516 local_var_req_builder = local_var_req_builder.query(&[("trigger_path", &local_var_str.to_string())]);
2517 }
2518 if let Some(ref local_var_str) = trigger_kind {
2519 local_var_req_builder = local_var_req_builder.query(&[("trigger_kind", &local_var_str.to_string())]);
2520 }
2521 if let Some(ref local_var_str) = script_hash {
2522 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2523 }
2524 if let Some(ref local_var_str) = started_before {
2525 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2526 }
2527 if let Some(ref local_var_str) = started_after {
2528 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2529 }
2530 if let Some(ref local_var_str) = success {
2531 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2532 }
2533 if let Some(ref local_var_str) = scheduled_for_before_now {
2534 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2535 }
2536 if let Some(ref local_var_str) = job_kinds {
2537 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2538 }
2539 if let Some(ref local_var_str) = suspended {
2540 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2541 }
2542 if let Some(ref local_var_str) = running {
2543 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2544 }
2545 if let Some(ref local_var_str) = args {
2546 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2547 }
2548 if let Some(ref local_var_str) = result {
2549 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2550 }
2551 if let Some(ref local_var_str) = allow_wildcards {
2552 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2553 }
2554 if let Some(ref local_var_str) = tag {
2555 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2556 }
2557 if let Some(ref local_var_str) = page {
2558 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2559 }
2560 if let Some(ref local_var_str) = per_page {
2561 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2562 }
2563 if let Some(ref local_var_str) = all_workspaces {
2564 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2565 }
2566 if let Some(ref local_var_str) = is_not_schedule {
2567 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2568 }
2569 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2570 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2571 }
2572 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2573 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2574 };
2575
2576 let local_var_req = local_var_req_builder.build()?;
2577 let local_var_resp = local_var_client.execute(local_var_req).await?;
2578
2579 let local_var_status = local_var_resp.status();
2580 let local_var_content = local_var_resp.text().await?;
2581
2582 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2583 crate::from_str_patched(&local_var_content).map_err(Error::from)
2584 } else {
2585 let local_var_entity: Option<ListQueueError> = crate::from_str_patched(&local_var_content).ok();
2586 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2587 Err(Error::ResponseError(local_var_error))
2588 }
2589}
2590
2591pub async fn list_selected_job_groups(configuration: &configuration::Configuration, workspace: &str, uuid_colon_colon_uuid: Vec<uuid::Uuid>) -> Result<Vec<models::ListSelectedJobGroups200ResponseInner>, Error<ListSelectedJobGroupsError>> {
2592 let local_var_configuration = configuration;
2593
2594 let local_var_client = &local_var_configuration.client;
2595
2596 let local_var_uri_str = format!("{}/w/{workspace}/jobs/list_selected_job_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2597 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2598
2599 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2600 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2601 }
2602 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2603 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2604 };
2605 local_var_req_builder = local_var_req_builder.json(&uuid_colon_colon_uuid);
2606
2607 let local_var_req = local_var_req_builder.build()?;
2608 let local_var_resp = local_var_client.execute(local_var_req).await?;
2609
2610 let local_var_status = local_var_resp.status();
2611 let local_var_content = local_var_resp.text().await?;
2612
2613 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2614 crate::from_str_patched(&local_var_content).map_err(Error::from)
2615 } else {
2616 let local_var_entity: Option<ListSelectedJobGroupsError> = crate::from_str_patched(&local_var_content).ok();
2617 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2618 Err(Error::ResponseError(local_var_error))
2619 }
2620}
2621
2622pub 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>> {
2623 let local_var_configuration = configuration;
2624
2625 let local_var_client = &local_var_configuration.client;
2626
2627 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));
2628 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2629
2630 if let Some(ref local_var_str) = scheduled_for {
2631 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
2632 }
2633 if let Some(ref local_var_str) = scheduled_in_secs {
2634 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
2635 }
2636 if let Some(ref local_var_str) = parent_job {
2637 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2638 }
2639 if let Some(ref local_var_str) = tag {
2640 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2641 }
2642 if let Some(ref local_var_str) = job_id {
2643 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2644 }
2645 if let Some(ref local_var_str) = include_header {
2646 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2647 }
2648 if let Some(ref local_var_str) = invisible_to_owner {
2649 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2650 }
2651 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2652 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2653 }
2654 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2655 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2656 };
2657 local_var_req_builder = local_var_req_builder.json(&restart_flow_at_step_request);
2658
2659 let local_var_req = local_var_req_builder.build()?;
2660 let local_var_resp = local_var_client.execute(local_var_req).await?;
2661
2662 let local_var_status = local_var_resp.status();
2663 let local_var_content = local_var_resp.text().await?;
2664
2665 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2666 crate::from_str_patched(&local_var_content).map_err(Error::from)
2667 } else {
2668 let local_var_entity: Option<RestartFlowAtStepError> = crate::from_str_patched(&local_var_content).ok();
2669 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2670 Err(Error::ResponseError(local_var_error))
2671 }
2672}
2673
2674pub async fn result_by_id(configuration: &configuration::Configuration, workspace: &str, flow_job_id: &str, node_id: &str) -> Result<serde_json::Value, Error<ResultByIdError>> {
2675 let local_var_configuration = configuration;
2676
2677 let local_var_client = &local_var_configuration.client;
2678
2679 let local_var_uri_str = format!("{}/w/{workspace}/jobs/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));
2680 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2681
2682 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2683 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2684 }
2685 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2686 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2687 };
2688
2689 let local_var_req = local_var_req_builder.build()?;
2690 let local_var_resp = local_var_client.execute(local_var_req).await?;
2691
2692 let local_var_status = local_var_resp.status();
2693 let local_var_content = local_var_resp.text().await?;
2694
2695 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2696 crate::from_str_patched(&local_var_content).map_err(Error::from)
2697 } else {
2698 let local_var_entity: Option<ResultByIdError> = crate::from_str_patched(&local_var_content).ok();
2699 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2700 Err(Error::ResponseError(local_var_error))
2701 }
2702}
2703
2704pub async fn resume_suspended_flow_as_owner(configuration: &configuration::Configuration, workspace: &str, id: &str, body: serde_json::Value) -> Result<String, Error<ResumeSuspendedFlowAsOwnerError>> {
2705 let local_var_configuration = configuration;
2706
2707 let local_var_client = &local_var_configuration.client;
2708
2709 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));
2710 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2711
2712 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2713 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2714 }
2715 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2716 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2717 };
2718 local_var_req_builder = local_var_req_builder.json(&body);
2719
2720 let local_var_req = local_var_req_builder.build()?;
2721 let local_var_resp = local_var_client.execute(local_var_req).await?;
2722
2723 let local_var_status = local_var_resp.status();
2724 let local_var_content = local_var_resp.text().await?;
2725
2726 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2727 crate::from_str_patched(&local_var_content).map_err(Error::from)
2728 } else {
2729 let local_var_entity: Option<ResumeSuspendedFlowAsOwnerError> = crate::from_str_patched(&local_var_content).ok();
2730 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2731 Err(Error::ResponseError(local_var_error))
2732 }
2733}
2734
2735pub 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>> {
2736 let local_var_configuration = configuration;
2737
2738 let local_var_client = &local_var_configuration.client;
2739
2740 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));
2741 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2742
2743 if let Some(ref local_var_str) = payload {
2744 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2745 }
2746 if let Some(ref local_var_str) = approver {
2747 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2748 }
2749 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2750 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2751 }
2752 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2753 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2754 };
2755
2756 let local_var_req = local_var_req_builder.build()?;
2757 let local_var_resp = local_var_client.execute(local_var_req).await?;
2758
2759 let local_var_status = local_var_resp.status();
2760 let local_var_content = local_var_resp.text().await?;
2761
2762 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2763 crate::from_str_patched(&local_var_content).map_err(Error::from)
2764 } else {
2765 let local_var_entity: Option<ResumeSuspendedJobGetError> = crate::from_str_patched(&local_var_content).ok();
2766 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2767 Err(Error::ResponseError(local_var_error))
2768 }
2769}
2770
2771pub 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>> {
2772 let local_var_configuration = configuration;
2773
2774 let local_var_client = &local_var_configuration.client;
2775
2776 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));
2777 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2778
2779 if let Some(ref local_var_str) = approver {
2780 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2781 }
2782 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2783 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2784 }
2785 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2786 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2787 };
2788 local_var_req_builder = local_var_req_builder.json(&body);
2789
2790 let local_var_req = local_var_req_builder.build()?;
2791 let local_var_resp = local_var_client.execute(local_var_req).await?;
2792
2793 let local_var_status = local_var_resp.status();
2794 let local_var_content = local_var_resp.text().await?;
2795
2796 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2797 crate::from_str_patched(&local_var_content).map_err(Error::from)
2798 } else {
2799 let local_var_entity: Option<ResumeSuspendedJobPostError> = crate::from_str_patched(&local_var_content).ok();
2800 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2801 Err(Error::ResponseError(local_var_error))
2802 }
2803}
2804
2805pub 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>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByPathError>> {
2806 let local_var_configuration = configuration;
2807
2808 let local_var_client = &local_var_configuration.client;
2809
2810 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));
2811 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2812
2813 if let Some(ref local_var_str) = include_header {
2814 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2815 }
2816 if let Some(ref local_var_str) = queue_limit {
2817 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2818 }
2819 if let Some(ref local_var_str) = job_id {
2820 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2821 }
2822 if let Some(ref local_var_str) = skip_preprocessor {
2823 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2824 }
2825 if let Some(ref local_var_str) = memory_id {
2826 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2827 }
2828 if let Some(ref local_var_str) = poll_delay_ms {
2829 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2830 }
2831 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2832 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2833 }
2834 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2835 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2836 };
2837 local_var_req_builder = local_var_req_builder.json(&request_body);
2838
2839 let local_var_req = local_var_req_builder.build()?;
2840 let local_var_resp = local_var_client.execute(local_var_req).await?;
2841
2842 let local_var_status = local_var_resp.status();
2843 let local_var_content = local_var_resp.text().await?;
2844
2845 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2846 crate::from_str_patched(&local_var_content).map_err(Error::from)
2847 } else {
2848 let local_var_entity: Option<RunAndStreamFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
2849 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2850 Err(Error::ResponseError(local_var_error))
2851 }
2852}
2853
2854pub 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>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByPathGetError>> {
2855 let local_var_configuration = configuration;
2856
2857 let local_var_client = &local_var_configuration.client;
2858
2859 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));
2860 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2861
2862 if let Some(ref local_var_str) = include_header {
2863 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2864 }
2865 if let Some(ref local_var_str) = queue_limit {
2866 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2867 }
2868 if let Some(ref local_var_str) = payload {
2869 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2870 }
2871 if let Some(ref local_var_str) = job_id {
2872 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2873 }
2874 if let Some(ref local_var_str) = skip_preprocessor {
2875 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2876 }
2877 if let Some(ref local_var_str) = memory_id {
2878 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2879 }
2880 if let Some(ref local_var_str) = poll_delay_ms {
2881 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2882 }
2883 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2884 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2885 }
2886 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2887 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2888 };
2889
2890 let local_var_req = local_var_req_builder.build()?;
2891 let local_var_resp = local_var_client.execute(local_var_req).await?;
2892
2893 let local_var_status = local_var_resp.status();
2894 let local_var_content = local_var_resp.text().await?;
2895
2896 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2897 crate::from_str_patched(&local_var_content).map_err(Error::from)
2898 } else {
2899 let local_var_entity: Option<RunAndStreamFlowByPathGetError> = crate::from_str_patched(&local_var_content).ok();
2900 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2901 Err(Error::ResponseError(local_var_error))
2902 }
2903}
2904
2905pub 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>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByVersionError>> {
2906 let local_var_configuration = configuration;
2907
2908 let local_var_client = &local_var_configuration.client;
2909
2910 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);
2911 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2912
2913 if let Some(ref local_var_str) = include_header {
2914 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2915 }
2916 if let Some(ref local_var_str) = queue_limit {
2917 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2918 }
2919 if let Some(ref local_var_str) = job_id {
2920 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2921 }
2922 if let Some(ref local_var_str) = skip_preprocessor {
2923 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2924 }
2925 if let Some(ref local_var_str) = memory_id {
2926 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2927 }
2928 if let Some(ref local_var_str) = poll_delay_ms {
2929 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2930 }
2931 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2932 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2933 }
2934 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2935 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2936 };
2937 local_var_req_builder = local_var_req_builder.json(&request_body);
2938
2939 let local_var_req = local_var_req_builder.build()?;
2940 let local_var_resp = local_var_client.execute(local_var_req).await?;
2941
2942 let local_var_status = local_var_resp.status();
2943 let local_var_content = local_var_resp.text().await?;
2944
2945 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2946 crate::from_str_patched(&local_var_content).map_err(Error::from)
2947 } else {
2948 let local_var_entity: Option<RunAndStreamFlowByVersionError> = crate::from_str_patched(&local_var_content).ok();
2949 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2950 Err(Error::ResponseError(local_var_error))
2951 }
2952}
2953
2954pub 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>, poll_delay_ms: Option<i64>) -> Result<String, Error<RunAndStreamFlowByVersionGetError>> {
2955 let local_var_configuration = configuration;
2956
2957 let local_var_client = &local_var_configuration.client;
2958
2959 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);
2960 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2961
2962 if let Some(ref local_var_str) = include_header {
2963 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2964 }
2965 if let Some(ref local_var_str) = queue_limit {
2966 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2967 }
2968 if let Some(ref local_var_str) = payload {
2969 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2970 }
2971 if let Some(ref local_var_str) = job_id {
2972 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2973 }
2974 if let Some(ref local_var_str) = skip_preprocessor {
2975 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2976 }
2977 if let Some(ref local_var_str) = memory_id {
2978 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
2979 }
2980 if let Some(ref local_var_str) = poll_delay_ms {
2981 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
2982 }
2983 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2984 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2985 }
2986 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2987 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2988 };
2989
2990 let local_var_req = local_var_req_builder.build()?;
2991 let local_var_resp = local_var_client.execute(local_var_req).await?;
2992
2993 let local_var_status = local_var_resp.status();
2994 let local_var_content = local_var_resp.text().await?;
2995
2996 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2997 crate::from_str_patched(&local_var_content).map_err(Error::from)
2998 } else {
2999 let local_var_entity: Option<RunAndStreamFlowByVersionGetError> = crate::from_str_patched(&local_var_content).ok();
3000 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3001 Err(Error::ResponseError(local_var_error))
3002 }
3003}
3004
3005pub 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>> {
3006 let local_var_configuration = configuration;
3007
3008 let local_var_client = &local_var_configuration.client;
3009
3010 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));
3011 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3012
3013 if let Some(ref local_var_str) = parent_job {
3014 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3015 }
3016 if let Some(ref local_var_str) = tag {
3017 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3018 }
3019 if let Some(ref local_var_str) = cache_ttl {
3020 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3021 }
3022 if let Some(ref local_var_str) = job_id {
3023 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3024 }
3025 if let Some(ref local_var_str) = include_header {
3026 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3027 }
3028 if let Some(ref local_var_str) = queue_limit {
3029 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3030 }
3031 if let Some(ref local_var_str) = skip_preprocessor {
3032 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3033 }
3034 if let Some(ref local_var_str) = poll_delay_ms {
3035 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3036 }
3037 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3038 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3039 }
3040 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3041 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3042 };
3043 local_var_req_builder = local_var_req_builder.json(&request_body);
3044
3045 let local_var_req = local_var_req_builder.build()?;
3046 let local_var_resp = local_var_client.execute(local_var_req).await?;
3047
3048 let local_var_status = local_var_resp.status();
3049 let local_var_content = local_var_resp.text().await?;
3050
3051 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3052 crate::from_str_patched(&local_var_content).map_err(Error::from)
3053 } else {
3054 let local_var_entity: Option<RunAndStreamScriptByHashError> = crate::from_str_patched(&local_var_content).ok();
3055 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3056 Err(Error::ResponseError(local_var_error))
3057 }
3058}
3059
3060pub 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>> {
3061 let local_var_configuration = configuration;
3062
3063 let local_var_client = &local_var_configuration.client;
3064
3065 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));
3066 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3067
3068 if let Some(ref local_var_str) = parent_job {
3069 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3070 }
3071 if let Some(ref local_var_str) = tag {
3072 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3073 }
3074 if let Some(ref local_var_str) = cache_ttl {
3075 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3076 }
3077 if let Some(ref local_var_str) = job_id {
3078 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3079 }
3080 if let Some(ref local_var_str) = include_header {
3081 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3082 }
3083 if let Some(ref local_var_str) = queue_limit {
3084 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3085 }
3086 if let Some(ref local_var_str) = payload {
3087 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3088 }
3089 if let Some(ref local_var_str) = skip_preprocessor {
3090 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3091 }
3092 if let Some(ref local_var_str) = poll_delay_ms {
3093 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3094 }
3095 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3096 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3097 }
3098 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3099 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3100 };
3101
3102 let local_var_req = local_var_req_builder.build()?;
3103 let local_var_resp = local_var_client.execute(local_var_req).await?;
3104
3105 let local_var_status = local_var_resp.status();
3106 let local_var_content = local_var_resp.text().await?;
3107
3108 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3109 crate::from_str_patched(&local_var_content).map_err(Error::from)
3110 } else {
3111 let local_var_entity: Option<RunAndStreamScriptByHashGetError> = crate::from_str_patched(&local_var_content).ok();
3112 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3113 Err(Error::ResponseError(local_var_error))
3114 }
3115}
3116
3117pub 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>> {
3118 let local_var_configuration = configuration;
3119
3120 let local_var_client = &local_var_configuration.client;
3121
3122 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));
3123 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3124
3125 if let Some(ref local_var_str) = parent_job {
3126 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3127 }
3128 if let Some(ref local_var_str) = tag {
3129 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3130 }
3131 if let Some(ref local_var_str) = cache_ttl {
3132 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3133 }
3134 if let Some(ref local_var_str) = job_id {
3135 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3136 }
3137 if let Some(ref local_var_str) = include_header {
3138 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3139 }
3140 if let Some(ref local_var_str) = queue_limit {
3141 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3142 }
3143 if let Some(ref local_var_str) = skip_preprocessor {
3144 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3145 }
3146 if let Some(ref local_var_str) = poll_delay_ms {
3147 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3148 }
3149 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3150 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3151 }
3152 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3153 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3154 };
3155 local_var_req_builder = local_var_req_builder.json(&request_body);
3156
3157 let local_var_req = local_var_req_builder.build()?;
3158 let local_var_resp = local_var_client.execute(local_var_req).await?;
3159
3160 let local_var_status = local_var_resp.status();
3161 let local_var_content = local_var_resp.text().await?;
3162
3163 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3164 crate::from_str_patched(&local_var_content).map_err(Error::from)
3165 } else {
3166 let local_var_entity: Option<RunAndStreamScriptByPathError> = crate::from_str_patched(&local_var_content).ok();
3167 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3168 Err(Error::ResponseError(local_var_error))
3169 }
3170}
3171
3172pub 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>> {
3173 let local_var_configuration = configuration;
3174
3175 let local_var_client = &local_var_configuration.client;
3176
3177 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));
3178 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3179
3180 if let Some(ref local_var_str) = parent_job {
3181 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3182 }
3183 if let Some(ref local_var_str) = tag {
3184 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3185 }
3186 if let Some(ref local_var_str) = cache_ttl {
3187 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3188 }
3189 if let Some(ref local_var_str) = job_id {
3190 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3191 }
3192 if let Some(ref local_var_str) = include_header {
3193 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3194 }
3195 if let Some(ref local_var_str) = queue_limit {
3196 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3197 }
3198 if let Some(ref local_var_str) = payload {
3199 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3200 }
3201 if let Some(ref local_var_str) = skip_preprocessor {
3202 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3203 }
3204 if let Some(ref local_var_str) = poll_delay_ms {
3205 local_var_req_builder = local_var_req_builder.query(&[("poll_delay_ms", &local_var_str.to_string())]);
3206 }
3207 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3208 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3209 }
3210 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3211 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3212 };
3213
3214 let local_var_req = local_var_req_builder.build()?;
3215 let local_var_resp = local_var_client.execute(local_var_req).await?;
3216
3217 let local_var_status = local_var_resp.status();
3218 let local_var_content = local_var_resp.text().await?;
3219
3220 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3221 crate::from_str_patched(&local_var_content).map_err(Error::from)
3222 } else {
3223 let local_var_entity: Option<RunAndStreamScriptByPathGetError> = crate::from_str_patched(&local_var_content).ok();
3224 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3225 Err(Error::ResponseError(local_var_error))
3226 }
3227}
3228
3229pub 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>> {
3230 let local_var_configuration = configuration;
3231
3232 let local_var_client = &local_var_configuration.client;
3233
3234 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));
3235 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3236
3237 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3238 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3239 }
3240 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3241 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3242 };
3243 local_var_req_builder = local_var_req_builder.json(&workflow_task);
3244
3245 let local_var_req = local_var_req_builder.build()?;
3246 let local_var_resp = local_var_client.execute(local_var_req).await?;
3247
3248 let local_var_status = local_var_resp.status();
3249 let local_var_content = local_var_resp.text().await?;
3250
3251 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3252 crate::from_str_patched(&local_var_content).map_err(Error::from)
3253 } else {
3254 let local_var_entity: Option<RunCodeWorkflowTaskError> = crate::from_str_patched(&local_var_content).ok();
3255 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3256 Err(Error::ResponseError(local_var_error))
3257 }
3258}
3259
3260pub async fn run_dynamic_select(configuration: &configuration::Configuration, workspace: &str, dynamic_input_data: models::DynamicInputData) -> Result<uuid::Uuid, Error<RunDynamicSelectError>> {
3261 let local_var_configuration = configuration;
3262
3263 let local_var_client = &local_var_configuration.client;
3264
3265 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dynamic_select", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3266 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3267
3268 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3269 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3270 }
3271 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3272 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3273 };
3274 local_var_req_builder = local_var_req_builder.json(&dynamic_input_data);
3275
3276 let local_var_req = local_var_req_builder.build()?;
3277 let local_var_resp = local_var_client.execute(local_var_req).await?;
3278
3279 let local_var_status = local_var_resp.status();
3280 let local_var_content = local_var_resp.text().await?;
3281
3282 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3283 crate::from_str_patched(&local_var_content).map_err(Error::from)
3284 } else {
3285 let local_var_entity: Option<RunDynamicSelectError> = crate::from_str_patched(&local_var_content).ok();
3286 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3287 Err(Error::ResponseError(local_var_error))
3288 }
3289}
3290
3291pub 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>) -> Result<uuid::Uuid, Error<RunFlowByPathError>> {
3292 let local_var_configuration = configuration;
3293
3294 let local_var_client = &local_var_configuration.client;
3295
3296 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));
3297 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3298
3299 if let Some(ref local_var_str) = scheduled_for {
3300 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3301 }
3302 if let Some(ref local_var_str) = scheduled_in_secs {
3303 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3304 }
3305 if let Some(ref local_var_str) = skip_preprocessor {
3306 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3307 }
3308 if let Some(ref local_var_str) = parent_job {
3309 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3310 }
3311 if let Some(ref local_var_str) = tag {
3312 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3313 }
3314 if let Some(ref local_var_str) = job_id {
3315 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3316 }
3317 if let Some(ref local_var_str) = include_header {
3318 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3319 }
3320 if let Some(ref local_var_str) = invisible_to_owner {
3321 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3322 }
3323 if let Some(ref local_var_str) = memory_id {
3324 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3325 }
3326 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3327 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3328 }
3329 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3330 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3331 };
3332 local_var_req_builder = local_var_req_builder.json(&request_body);
3333
3334 let local_var_req = local_var_req_builder.build()?;
3335 let local_var_resp = local_var_client.execute(local_var_req).await?;
3336
3337 let local_var_status = local_var_resp.status();
3338 let local_var_content = local_var_resp.text().await?;
3339
3340 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3341 crate::from_str_patched(&local_var_content).map_err(Error::from)
3342 } else {
3343 let local_var_entity: Option<RunFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
3344 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3345 Err(Error::ResponseError(local_var_error))
3346 }
3347}
3348
3349pub 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>) -> Result<uuid::Uuid, Error<RunFlowByVersionError>> {
3350 let local_var_configuration = configuration;
3351
3352 let local_var_client = &local_var_configuration.client;
3353
3354 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/fv/{version}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version);
3355 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3356
3357 if let Some(ref local_var_str) = scheduled_for {
3358 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3359 }
3360 if let Some(ref local_var_str) = scheduled_in_secs {
3361 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3362 }
3363 if let Some(ref local_var_str) = skip_preprocessor {
3364 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3365 }
3366 if let Some(ref local_var_str) = parent_job {
3367 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3368 }
3369 if let Some(ref local_var_str) = tag {
3370 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3371 }
3372 if let Some(ref local_var_str) = job_id {
3373 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3374 }
3375 if let Some(ref local_var_str) = include_header {
3376 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3377 }
3378 if let Some(ref local_var_str) = invisible_to_owner {
3379 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3380 }
3381 if let Some(ref local_var_str) = memory_id {
3382 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3383 }
3384 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3385 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3386 }
3387 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3388 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3389 };
3390 local_var_req_builder = local_var_req_builder.json(&request_body);
3391
3392 let local_var_req = local_var_req_builder.build()?;
3393 let local_var_resp = local_var_client.execute(local_var_req).await?;
3394
3395 let local_var_status = local_var_resp.status();
3396 let local_var_content = local_var_resp.text().await?;
3397
3398 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3399 crate::from_str_patched(&local_var_content).map_err(Error::from)
3400 } else {
3401 let local_var_entity: Option<RunFlowByVersionError> = crate::from_str_patched(&local_var_content).ok();
3402 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3403 Err(Error::ResponseError(local_var_error))
3404 }
3405}
3406
3407pub 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>) -> Result<uuid::Uuid, Error<RunFlowPreviewError>> {
3408 let local_var_configuration = configuration;
3409
3410 let local_var_client = &local_var_configuration.client;
3411
3412 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3413 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3414
3415 if let Some(ref local_var_str) = include_header {
3416 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3417 }
3418 if let Some(ref local_var_str) = invisible_to_owner {
3419 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3420 }
3421 if let Some(ref local_var_str) = job_id {
3422 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3423 }
3424 if let Some(ref local_var_str) = memory_id {
3425 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3426 }
3427 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3428 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3429 }
3430 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3431 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3432 };
3433 local_var_req_builder = local_var_req_builder.json(&flow_preview);
3434
3435 let local_var_req = local_var_req_builder.build()?;
3436 let local_var_resp = local_var_client.execute(local_var_req).await?;
3437
3438 let local_var_status = local_var_resp.status();
3439 let local_var_content = local_var_resp.text().await?;
3440
3441 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3442 crate::from_str_patched(&local_var_content).map_err(Error::from)
3443 } else {
3444 let local_var_entity: Option<RunFlowPreviewError> = crate::from_str_patched(&local_var_content).ok();
3445 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3446 Err(Error::ResponseError(local_var_error))
3447 }
3448}
3449
3450pub async fn run_flow_preview_and_wait_result(configuration: &configuration::Configuration, workspace: &str, flow_preview: models::FlowPreview, memory_id: Option<&str>) -> Result<serde_json::Value, Error<RunFlowPreviewAndWaitResultError>> {
3451 let local_var_configuration = configuration;
3452
3453 let local_var_client = &local_var_configuration.client;
3454
3455 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3456 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3457
3458 if let Some(ref local_var_str) = memory_id {
3459 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3460 }
3461 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3462 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3463 }
3464 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3465 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3466 };
3467 local_var_req_builder = local_var_req_builder.json(&flow_preview);
3468
3469 let local_var_req = local_var_req_builder.build()?;
3470 let local_var_resp = local_var_client.execute(local_var_req).await?;
3471
3472 let local_var_status = local_var_resp.status();
3473 let local_var_content = local_var_resp.text().await?;
3474
3475 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3476 crate::from_str_patched(&local_var_content).map_err(Error::from)
3477 } else {
3478 let local_var_entity: Option<RunFlowPreviewAndWaitResultError> = crate::from_str_patched(&local_var_content).ok();
3479 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3480 Err(Error::ResponseError(local_var_error))
3481 }
3482}
3483
3484pub async fn run_raw_script_dependencies(configuration: &configuration::Configuration, workspace: &str, run_raw_script_dependencies_request: models::RunRawScriptDependenciesRequest) -> Result<models::RunRawScriptDependencies201Response, Error<RunRawScriptDependenciesError>> {
3485 let local_var_configuration = configuration;
3486
3487 let local_var_client = &local_var_configuration.client;
3488
3489 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dependencies", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3490 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3491
3492 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3493 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3494 }
3495 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3496 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3497 };
3498 local_var_req_builder = local_var_req_builder.json(&run_raw_script_dependencies_request);
3499
3500 let local_var_req = local_var_req_builder.build()?;
3501 let local_var_resp = local_var_client.execute(local_var_req).await?;
3502
3503 let local_var_status = local_var_resp.status();
3504 let local_var_content = local_var_resp.text().await?;
3505
3506 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3507 crate::from_str_patched(&local_var_content).map_err(Error::from)
3508 } else {
3509 let local_var_entity: Option<RunRawScriptDependenciesError> = crate::from_str_patched(&local_var_content).ok();
3510 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3511 Err(Error::ResponseError(local_var_error))
3512 }
3513}
3514
3515pub 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>, include_header: Option<&str>, invisible_to_owner: Option<bool>) -> Result<uuid::Uuid, Error<RunScriptByHashError>> {
3516 let local_var_configuration = configuration;
3517
3518 let local_var_client = &local_var_configuration.client;
3519
3520 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));
3521 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3522
3523 if let Some(ref local_var_str) = scheduled_for {
3524 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3525 }
3526 if let Some(ref local_var_str) = scheduled_in_secs {
3527 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3528 }
3529 if let Some(ref local_var_str) = skip_preprocessor {
3530 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3531 }
3532 if let Some(ref local_var_str) = parent_job {
3533 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3534 }
3535 if let Some(ref local_var_str) = tag {
3536 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3537 }
3538 if let Some(ref local_var_str) = cache_ttl {
3539 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3540 }
3541 if let Some(ref local_var_str) = job_id {
3542 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3543 }
3544 if let Some(ref local_var_str) = include_header {
3545 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3546 }
3547 if let Some(ref local_var_str) = invisible_to_owner {
3548 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3549 }
3550 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3551 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3552 }
3553 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3554 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3555 };
3556 local_var_req_builder = local_var_req_builder.json(&body);
3557
3558 let local_var_req = local_var_req_builder.build()?;
3559 let local_var_resp = local_var_client.execute(local_var_req).await?;
3560
3561 let local_var_status = local_var_resp.status();
3562 let local_var_content = local_var_resp.text().await?;
3563
3564 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3565 crate::from_str_patched(&local_var_content).map_err(Error::from)
3566 } else {
3567 let local_var_entity: Option<RunScriptByHashError> = crate::from_str_patched(&local_var_content).ok();
3568 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3569 Err(Error::ResponseError(local_var_error))
3570 }
3571}
3572
3573pub 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>, invisible_to_owner: Option<bool>) -> Result<uuid::Uuid, Error<RunScriptByPathError>> {
3574 let local_var_configuration = configuration;
3575
3576 let local_var_client = &local_var_configuration.client;
3577
3578 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));
3579 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3580
3581 if let Some(ref local_var_str) = scheduled_for {
3582 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
3583 }
3584 if let Some(ref local_var_str) = scheduled_in_secs {
3585 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
3586 }
3587 if let Some(ref local_var_str) = skip_preprocessor {
3588 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3589 }
3590 if let Some(ref local_var_str) = parent_job {
3591 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3592 }
3593 if let Some(ref local_var_str) = tag {
3594 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3595 }
3596 if let Some(ref local_var_str) = cache_ttl {
3597 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3598 }
3599 if let Some(ref local_var_str) = job_id {
3600 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3601 }
3602 if let Some(ref local_var_str) = invisible_to_owner {
3603 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3604 }
3605 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3606 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3607 }
3608 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3609 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3610 };
3611 local_var_req_builder = local_var_req_builder.json(&request_body);
3612
3613 let local_var_req = local_var_req_builder.build()?;
3614 let local_var_resp = local_var_client.execute(local_var_req).await?;
3615
3616 let local_var_status = local_var_resp.status();
3617 let local_var_content = local_var_resp.text().await?;
3618
3619 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3620 crate::from_str_patched(&local_var_content).map_err(Error::from)
3621 } else {
3622 let local_var_entity: Option<RunScriptByPathError> = crate::from_str_patched(&local_var_content).ok();
3623 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3624 Err(Error::ResponseError(local_var_error))
3625 }
3626}
3627
3628pub async fn run_script_preview(configuration: &configuration::Configuration, workspace: &str, preview: models::Preview, include_header: Option<&str>, invisible_to_owner: Option<bool>, job_id: Option<&str>) -> Result<uuid::Uuid, Error<RunScriptPreviewError>> {
3629 let local_var_configuration = configuration;
3630
3631 let local_var_client = &local_var_configuration.client;
3632
3633 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3634 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3635
3636 if let Some(ref local_var_str) = include_header {
3637 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3638 }
3639 if let Some(ref local_var_str) = invisible_to_owner {
3640 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
3641 }
3642 if let Some(ref local_var_str) = job_id {
3643 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3644 }
3645 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3646 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3647 }
3648 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3649 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3650 };
3651 local_var_req_builder = local_var_req_builder.json(&preview);
3652
3653 let local_var_req = local_var_req_builder.build()?;
3654 let local_var_resp = local_var_client.execute(local_var_req).await?;
3655
3656 let local_var_status = local_var_resp.status();
3657 let local_var_content = local_var_resp.text().await?;
3658
3659 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3660 crate::from_str_patched(&local_var_content).map_err(Error::from)
3661 } else {
3662 let local_var_entity: Option<RunScriptPreviewError> = crate::from_str_patched(&local_var_content).ok();
3663 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3664 Err(Error::ResponseError(local_var_error))
3665 }
3666}
3667
3668pub async fn run_script_preview_and_wait_result(configuration: &configuration::Configuration, workspace: &str, preview: models::Preview) -> Result<serde_json::Value, Error<RunScriptPreviewAndWaitResultError>> {
3669 let local_var_configuration = configuration;
3670
3671 let local_var_client = &local_var_configuration.client;
3672
3673 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3674 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3675
3676 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3677 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3678 }
3679 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3680 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3681 };
3682 local_var_req_builder = local_var_req_builder.json(&preview);
3683
3684 let local_var_req = local_var_req_builder.build()?;
3685 let local_var_resp = local_var_client.execute(local_var_req).await?;
3686
3687 let local_var_status = local_var_resp.status();
3688 let local_var_content = local_var_resp.text().await?;
3689
3690 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3691 crate::from_str_patched(&local_var_content).map_err(Error::from)
3692 } else {
3693 let local_var_entity: Option<RunScriptPreviewAndWaitResultError> = crate::from_str_patched(&local_var_content).ok();
3694 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3695 Err(Error::ResponseError(local_var_error))
3696 }
3697}
3698
3699pub async fn run_script_preview_inline(configuration: &configuration::Configuration, workspace: &str, preview_inline: models::PreviewInline) -> Result<serde_json::Value, Error<RunScriptPreviewInlineError>> {
3700 let local_var_configuration = configuration;
3701
3702 let local_var_client = &local_var_configuration.client;
3703
3704 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_inline/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
3705 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3706
3707 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3708 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3709 }
3710 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3711 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3712 };
3713 local_var_req_builder = local_var_req_builder.json(&preview_inline);
3714
3715 let local_var_req = local_var_req_builder.build()?;
3716 let local_var_resp = local_var_client.execute(local_var_req).await?;
3717
3718 let local_var_status = local_var_resp.status();
3719 let local_var_content = local_var_resp.text().await?;
3720
3721 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3722 crate::from_str_patched(&local_var_content).map_err(Error::from)
3723 } else {
3724 let local_var_entity: Option<RunScriptPreviewInlineError> = crate::from_str_patched(&local_var_content).ok();
3725 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3726 Err(Error::ResponseError(local_var_error))
3727 }
3728}
3729
3730pub async fn 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>) -> Result<serde_json::Value, Error<RunWaitResultFlowByPathError>> {
3731 let local_var_configuration = configuration;
3732
3733 let local_var_client = &local_var_configuration.client;
3734
3735 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/f/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
3736 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3737
3738 if let Some(ref local_var_str) = include_header {
3739 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3740 }
3741 if let Some(ref local_var_str) = queue_limit {
3742 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3743 }
3744 if let Some(ref local_var_str) = job_id {
3745 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3746 }
3747 if let Some(ref local_var_str) = skip_preprocessor {
3748 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3749 }
3750 if let Some(ref local_var_str) = memory_id {
3751 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3752 }
3753 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3754 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3755 }
3756 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3757 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3758 };
3759 local_var_req_builder = local_var_req_builder.json(&request_body);
3760
3761 let local_var_req = local_var_req_builder.build()?;
3762 let local_var_resp = local_var_client.execute(local_var_req).await?;
3763
3764 let local_var_status = local_var_resp.status();
3765 let local_var_content = local_var_resp.text().await?;
3766
3767 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3768 crate::from_str_patched(&local_var_content).map_err(Error::from)
3769 } else {
3770 let local_var_entity: Option<RunWaitResultFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
3771 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3772 Err(Error::ResponseError(local_var_error))
3773 }
3774}
3775
3776pub 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>) -> Result<serde_json::Value, Error<RunWaitResultFlowByVersionError>> {
3777 let local_var_configuration = configuration;
3778
3779 let local_var_client = &local_var_configuration.client;
3780
3781 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);
3782 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3783
3784 if let Some(ref local_var_str) = include_header {
3785 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3786 }
3787 if let Some(ref local_var_str) = queue_limit {
3788 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3789 }
3790 if let Some(ref local_var_str) = job_id {
3791 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3792 }
3793 if let Some(ref local_var_str) = skip_preprocessor {
3794 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3795 }
3796 if let Some(ref local_var_str) = memory_id {
3797 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3798 }
3799 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3800 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3801 }
3802 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3803 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3804 };
3805 local_var_req_builder = local_var_req_builder.json(&request_body);
3806
3807 let local_var_req = local_var_req_builder.build()?;
3808 let local_var_resp = local_var_client.execute(local_var_req).await?;
3809
3810 let local_var_status = local_var_resp.status();
3811 let local_var_content = local_var_resp.text().await?;
3812
3813 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3814 crate::from_str_patched(&local_var_content).map_err(Error::from)
3815 } else {
3816 let local_var_entity: Option<RunWaitResultFlowByVersionError> = crate::from_str_patched(&local_var_content).ok();
3817 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3818 Err(Error::ResponseError(local_var_error))
3819 }
3820}
3821
3822pub 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>) -> Result<serde_json::Value, Error<RunWaitResultFlowByVersionGetError>> {
3823 let local_var_configuration = configuration;
3824
3825 let local_var_client = &local_var_configuration.client;
3826
3827 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);
3828 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3829
3830 if let Some(ref local_var_str) = include_header {
3831 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3832 }
3833 if let Some(ref local_var_str) = queue_limit {
3834 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3835 }
3836 if let Some(ref local_var_str) = payload {
3837 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3838 }
3839 if let Some(ref local_var_str) = job_id {
3840 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3841 }
3842 if let Some(ref local_var_str) = skip_preprocessor {
3843 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3844 }
3845 if let Some(ref local_var_str) = memory_id {
3846 local_var_req_builder = local_var_req_builder.query(&[("memory_id", &local_var_str.to_string())]);
3847 }
3848 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3849 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3850 }
3851 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3852 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3853 };
3854
3855 let local_var_req = local_var_req_builder.build()?;
3856 let local_var_resp = local_var_client.execute(local_var_req).await?;
3857
3858 let local_var_status = local_var_resp.status();
3859 let local_var_content = local_var_resp.text().await?;
3860
3861 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3862 crate::from_str_patched(&local_var_content).map_err(Error::from)
3863 } else {
3864 let local_var_entity: Option<RunWaitResultFlowByVersionGetError> = crate::from_str_patched(&local_var_content).ok();
3865 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3866 Err(Error::ResponseError(local_var_error))
3867 }
3868}
3869
3870pub 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>> {
3871 let local_var_configuration = configuration;
3872
3873 let local_var_client = &local_var_configuration.client;
3874
3875 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));
3876 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3877
3878 if let Some(ref local_var_str) = parent_job {
3879 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3880 }
3881 if let Some(ref local_var_str) = tag {
3882 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3883 }
3884 if let Some(ref local_var_str) = cache_ttl {
3885 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3886 }
3887 if let Some(ref local_var_str) = job_id {
3888 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3889 }
3890 if let Some(ref local_var_str) = include_header {
3891 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3892 }
3893 if let Some(ref local_var_str) = queue_limit {
3894 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3895 }
3896 if let Some(ref local_var_str) = skip_preprocessor {
3897 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3898 }
3899 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3900 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3901 }
3902 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3903 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3904 };
3905 local_var_req_builder = local_var_req_builder.json(&request_body);
3906
3907 let local_var_req = local_var_req_builder.build()?;
3908 let local_var_resp = local_var_client.execute(local_var_req).await?;
3909
3910 let local_var_status = local_var_resp.status();
3911 let local_var_content = local_var_resp.text().await?;
3912
3913 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3914 crate::from_str_patched(&local_var_content).map_err(Error::from)
3915 } else {
3916 let local_var_entity: Option<RunWaitResultScriptByPathError> = crate::from_str_patched(&local_var_content).ok();
3917 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3918 Err(Error::ResponseError(local_var_error))
3919 }
3920}
3921
3922pub 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>> {
3923 let local_var_configuration = configuration;
3924
3925 let local_var_client = &local_var_configuration.client;
3926
3927 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));
3928 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
3929
3930 if let Some(ref local_var_str) = parent_job {
3931 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
3932 }
3933 if let Some(ref local_var_str) = tag {
3934 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
3935 }
3936 if let Some(ref local_var_str) = cache_ttl {
3937 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
3938 }
3939 if let Some(ref local_var_str) = job_id {
3940 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
3941 }
3942 if let Some(ref local_var_str) = include_header {
3943 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
3944 }
3945 if let Some(ref local_var_str) = queue_limit {
3946 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
3947 }
3948 if let Some(ref local_var_str) = payload {
3949 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
3950 }
3951 if let Some(ref local_var_str) = skip_preprocessor {
3952 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
3953 }
3954 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3955 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3956 }
3957 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3958 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3959 };
3960
3961 let local_var_req = local_var_req_builder.build()?;
3962 let local_var_resp = local_var_client.execute(local_var_req).await?;
3963
3964 let local_var_status = local_var_resp.status();
3965 let local_var_content = local_var_resp.text().await?;
3966
3967 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3968 crate::from_str_patched(&local_var_content).map_err(Error::from)
3969 } else {
3970 let local_var_entity: Option<RunWaitResultScriptByPathGetError> = crate::from_str_patched(&local_var_content).ok();
3971 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
3972 Err(Error::ResponseError(local_var_error))
3973 }
3974}
3975
3976pub async fn set_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str, body: Option<serde_json::Value>) -> Result<String, Error<SetFlowUserStateError>> {
3977 let local_var_configuration = configuration;
3978
3979 let local_var_client = &local_var_configuration.client;
3980
3981 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));
3982 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
3983
3984 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
3985 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
3986 }
3987 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
3988 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
3989 };
3990 local_var_req_builder = local_var_req_builder.json(&body);
3991
3992 let local_var_req = local_var_req_builder.build()?;
3993 let local_var_resp = local_var_client.execute(local_var_req).await?;
3994
3995 let local_var_status = local_var_resp.status();
3996 let local_var_content = local_var_resp.text().await?;
3997
3998 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
3999 crate::from_str_patched(&local_var_content).map_err(Error::from)
4000 } else {
4001 let local_var_entity: Option<SetFlowUserStateError> = crate::from_str_patched(&local_var_content).ok();
4002 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
4003 Err(Error::ResponseError(local_var_error))
4004 }
4005}
4006