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 ForceCancelQueuedJobError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetCompletedCountError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetCompletedJobError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetCompletedJobLogsTailError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetCompletedJobResultError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetCompletedJobResultMaybeError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetDbClockError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetFlowDebugInfoError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetFlowUserStateError {
148 UnknownValue(serde_json::Value),
149}
150
151#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetJobError {
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetJobArgsError {
162 UnknownValue(serde_json::Value),
163}
164
165#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetJobLogsError {
169 UnknownValue(serde_json::Value),
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetJobUpdatesError {
176 UnknownValue(serde_json::Value),
177}
178
179#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetJobUpdatesSseError {
183 UnknownValue(serde_json::Value),
184}
185
186#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetLogFileFromStoreError {
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetQueueCountError {
197 UnknownValue(serde_json::Value),
198}
199
200#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetResumeUrlsError {
204 UnknownValue(serde_json::Value),
205}
206
207#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetRootJobIdError {
211 UnknownValue(serde_json::Value),
212}
213
214#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetSlackApprovalPayloadError {
218 UnknownValue(serde_json::Value),
219}
220
221#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetSuspendedJobFlowError {
225 UnknownValue(serde_json::Value),
226}
227
228#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum GetTeamsApprovalPayloadError {
232 UnknownValue(serde_json::Value),
233}
234
235#[derive(Debug, Clone, Serialize, Deserialize)]
237#[serde(untagged)]
238pub enum ListCompletedJobsError {
239 UnknownValue(serde_json::Value),
240}
241
242#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum ListExtendedJobsError {
246 UnknownValue(serde_json::Value),
247}
248
249#[derive(Debug, Clone, Serialize, Deserialize)]
251#[serde(untagged)]
252pub enum ListFilteredJobsUuidsError {
253 UnknownValue(serde_json::Value),
254}
255
256#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum ListFilteredQueueUuidsError {
260 UnknownValue(serde_json::Value),
261}
262
263#[derive(Debug, Clone, Serialize, Deserialize)]
265#[serde(untagged)]
266pub enum ListJobsError {
267 UnknownValue(serde_json::Value),
268}
269
270#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum ListQueueError {
274 UnknownValue(serde_json::Value),
275}
276
277#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum ListSelectedJobGroupsError {
281 UnknownValue(serde_json::Value),
282}
283
284#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum OpenaiSyncFlowByPathError {
288 UnknownValue(serde_json::Value),
289}
290
291#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum OpenaiSyncScriptByPathError {
295 UnknownValue(serde_json::Value),
296}
297
298#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum RestartFlowAtStepError {
302 UnknownValue(serde_json::Value),
303}
304
305#[derive(Debug, Clone, Serialize, Deserialize)]
307#[serde(untagged)]
308pub enum ResultByIdError {
309 UnknownValue(serde_json::Value),
310}
311
312#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum ResumeSuspendedFlowAsOwnerError {
316 UnknownValue(serde_json::Value),
317}
318
319#[derive(Debug, Clone, Serialize, Deserialize)]
321#[serde(untagged)]
322pub enum ResumeSuspendedJobGetError {
323 UnknownValue(serde_json::Value),
324}
325
326#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum ResumeSuspendedJobPostError {
330 UnknownValue(serde_json::Value),
331}
332
333#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum RunCodeWorkflowTaskError {
337 UnknownValue(serde_json::Value),
338}
339
340#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum RunFlowByPathError {
344 UnknownValue(serde_json::Value),
345}
346
347#[derive(Debug, Clone, Serialize, Deserialize)]
349#[serde(untagged)]
350pub enum RunFlowPreviewError {
351 UnknownValue(serde_json::Value),
352}
353
354#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum RunFlowPreviewAndWaitResultError {
358 UnknownValue(serde_json::Value),
359}
360
361#[derive(Debug, Clone, Serialize, Deserialize)]
363#[serde(untagged)]
364pub enum RunRawScriptDependenciesError {
365 UnknownValue(serde_json::Value),
366}
367
368#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum RunScriptByHashError {
372 UnknownValue(serde_json::Value),
373}
374
375#[derive(Debug, Clone, Serialize, Deserialize)]
377#[serde(untagged)]
378pub enum RunScriptByPathError {
379 UnknownValue(serde_json::Value),
380}
381
382#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum RunScriptPreviewError {
386 UnknownValue(serde_json::Value),
387}
388
389#[derive(Debug, Clone, Serialize, Deserialize)]
391#[serde(untagged)]
392pub enum RunScriptPreviewAndWaitResultError {
393 UnknownValue(serde_json::Value),
394}
395
396#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum RunWaitResultFlowByPathError {
400 UnknownValue(serde_json::Value),
401}
402
403#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum RunWaitResultScriptByPathError {
407 UnknownValue(serde_json::Value),
408}
409
410#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum RunWaitResultScriptByPathGetError {
414 UnknownValue(serde_json::Value),
415}
416
417#[derive(Debug, Clone, Serialize, Deserialize)]
419#[serde(untagged)]
420pub enum SetFlowUserStateError {
421 UnknownValue(serde_json::Value),
422}
423
424
425pub async fn batch_re_run_jobs(configuration: &configuration::Configuration, workspace: &str, batch_re_run_jobs_request: models::BatchReRunJobsRequest) -> Result<String, Error<BatchReRunJobsError>> {
426 let local_var_configuration = configuration;
427
428 let local_var_client = &local_var_configuration.client;
429
430 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/batch_rerun_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
431 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
432
433 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
434 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
435 }
436 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
437 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
438 };
439 local_var_req_builder = local_var_req_builder.json(&batch_re_run_jobs_request);
440
441 let local_var_req = local_var_req_builder.build()?;
442 let local_var_resp = local_var_client.execute(local_var_req).await?;
443
444 let local_var_status = local_var_resp.status();
445 let local_var_content = local_var_resp.text().await?;
446
447 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
448 crate::from_str_patched(&local_var_content).map_err(Error::from)
449 } else {
450 let local_var_entity: Option<BatchReRunJobsError> = crate::from_str_patched(&local_var_content).ok();
451 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
452 Err(Error::ResponseError(local_var_error))
453 }
454}
455
456pub async fn cancel_persistent_queued_jobs(configuration: &configuration::Configuration, workspace: &str, path: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelPersistentQueuedJobsError>> {
457 let local_var_configuration = configuration;
458
459 let local_var_client = &local_var_configuration.client;
460
461 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));
462 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
463
464 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
465 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
466 }
467 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
468 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
469 };
470 local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
471
472 let local_var_req = local_var_req_builder.build()?;
473 let local_var_resp = local_var_client.execute(local_var_req).await?;
474
475 let local_var_status = local_var_resp.status();
476 let local_var_content = local_var_resp.text().await?;
477
478 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
479 crate::from_str_patched(&local_var_content).map_err(Error::from)
480 } else {
481 let local_var_entity: Option<CancelPersistentQueuedJobsError> = crate::from_str_patched(&local_var_content).ok();
482 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
483 Err(Error::ResponseError(local_var_error))
484 }
485}
486
487pub async fn cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<CancelQueuedJobError>> {
488 let local_var_configuration = configuration;
489
490 let local_var_client = &local_var_configuration.client;
491
492 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));
493 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
494
495 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
496 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
497 }
498 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
499 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
500 };
501 local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
502
503 let local_var_req = local_var_req_builder.build()?;
504 let local_var_resp = local_var_client.execute(local_var_req).await?;
505
506 let local_var_status = local_var_resp.status();
507 let local_var_content = local_var_resp.text().await?;
508
509 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
510 crate::from_str_patched(&local_var_content).map_err(Error::from)
511 } else {
512 let local_var_entity: Option<CancelQueuedJobError> = crate::from_str_patched(&local_var_content).ok();
513 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
514 Err(Error::ResponseError(local_var_error))
515 }
516}
517
518pub async fn cancel_selection(configuration: &configuration::Configuration, workspace: &str, request_body: Vec<String>) -> Result<Vec<String>, Error<CancelSelectionError>> {
519 let local_var_configuration = configuration;
520
521 let local_var_client = &local_var_configuration.client;
522
523 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/cancel_selection", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
524 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
525
526 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
527 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
528 }
529 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
530 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
531 };
532 local_var_req_builder = local_var_req_builder.json(&request_body);
533
534 let local_var_req = local_var_req_builder.build()?;
535 let local_var_resp = local_var_client.execute(local_var_req).await?;
536
537 let local_var_status = local_var_resp.status();
538 let local_var_content = local_var_resp.text().await?;
539
540 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
541 crate::from_str_patched(&local_var_content).map_err(Error::from)
542 } else {
543 let local_var_entity: Option<CancelSelectionError> = crate::from_str_patched(&local_var_content).ok();
544 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
545 Err(Error::ResponseError(local_var_error))
546 }
547}
548
549pub 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>> {
550 let local_var_configuration = configuration;
551
552 let local_var_client = &local_var_configuration.client;
553
554 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));
555 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
556
557 if let Some(ref local_var_str) = approver {
558 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
559 }
560 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
561 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
562 }
563 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
564 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
565 };
566
567 let local_var_req = local_var_req_builder.build()?;
568 let local_var_resp = local_var_client.execute(local_var_req).await?;
569
570 let local_var_status = local_var_resp.status();
571 let local_var_content = local_var_resp.text().await?;
572
573 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
574 crate::from_str_patched(&local_var_content).map_err(Error::from)
575 } else {
576 let local_var_entity: Option<CancelSuspendedJobGetError> = crate::from_str_patched(&local_var_content).ok();
577 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
578 Err(Error::ResponseError(local_var_error))
579 }
580}
581
582pub 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>> {
583 let local_var_configuration = configuration;
584
585 let local_var_client = &local_var_configuration.client;
586
587 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));
588 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
589
590 if let Some(ref local_var_str) = approver {
591 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
592 }
593 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
594 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
595 }
596 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
597 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
598 };
599 local_var_req_builder = local_var_req_builder.json(&body);
600
601 let local_var_req = local_var_req_builder.build()?;
602 let local_var_resp = local_var_client.execute(local_var_req).await?;
603
604 let local_var_status = local_var_resp.status();
605 let local_var_content = local_var_resp.text().await?;
606
607 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
608 crate::from_str_patched(&local_var_content).map_err(Error::from)
609 } else {
610 let local_var_entity: Option<CancelSuspendedJobPostError> = crate::from_str_patched(&local_var_content).ok();
611 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
612 Err(Error::ResponseError(local_var_error))
613 }
614}
615
616pub 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>> {
617 let local_var_configuration = configuration;
618
619 let local_var_client = &local_var_configuration.client;
620
621 let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
622 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
623
624 if let Some(ref local_var_str) = completed_after_s_ago {
625 local_var_req_builder = local_var_req_builder.query(&[("completed_after_s_ago", &local_var_str.to_string())]);
626 }
627 if let Some(ref local_var_str) = success {
628 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
629 }
630 if let Some(ref local_var_str) = tags {
631 local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]);
632 }
633 if let Some(ref local_var_str) = all_workspaces {
634 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
635 }
636 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
637 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
638 }
639 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
640 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
641 };
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<CountCompletedJobsError> = 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 count_jobs_by_tag(configuration: &configuration::Configuration, horizon_secs: Option<i32>, workspace_id: Option<&str>) -> Result<Vec<models::CountJobsByTag200ResponseInner>, Error<CountJobsByTagError>> {
659 let local_var_configuration = configuration;
660
661 let local_var_client = &local_var_configuration.client;
662
663 let local_var_uri_str = format!("{}/jobs/completed/count_by_tag", local_var_configuration.base_path);
664 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
665
666 if let Some(ref local_var_str) = horizon_secs {
667 local_var_req_builder = local_var_req_builder.query(&[("horizon_secs", &local_var_str.to_string())]);
668 }
669 if let Some(ref local_var_str) = workspace_id {
670 local_var_req_builder = local_var_req_builder.query(&[("workspace_id", &local_var_str.to_string())]);
671 }
672 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
673 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
674 }
675 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
676 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
677 };
678
679 let local_var_req = local_var_req_builder.build()?;
680 let local_var_resp = local_var_client.execute(local_var_req).await?;
681
682 let local_var_status = local_var_resp.status();
683 let local_var_content = local_var_resp.text().await?;
684
685 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
686 crate::from_str_patched(&local_var_content).map_err(Error::from)
687 } else {
688 let local_var_entity: Option<CountJobsByTagError> = crate::from_str_patched(&local_var_content).ok();
689 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
690 Err(Error::ResponseError(local_var_error))
691 }
692}
693
694pub async fn create_job_signature(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, approver: Option<&str>) -> Result<String, Error<CreateJobSignatureError>> {
695 let local_var_configuration = configuration;
696
697 let local_var_client = &local_var_configuration.client;
698
699 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);
700 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
701
702 if let Some(ref local_var_str) = approver {
703 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
704 }
705 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
706 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
707 }
708 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
709 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
710 };
711
712 let local_var_req = local_var_req_builder.build()?;
713 let local_var_resp = local_var_client.execute(local_var_req).await?;
714
715 let local_var_status = local_var_resp.status();
716 let local_var_content = local_var_resp.text().await?;
717
718 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
719 crate::from_str_patched(&local_var_content).map_err(Error::from)
720 } else {
721 let local_var_entity: Option<CreateJobSignatureError> = crate::from_str_patched(&local_var_content).ok();
722 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
723 Err(Error::ResponseError(local_var_error))
724 }
725}
726
727pub async fn delete_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<DeleteCompletedJobError>> {
728 let local_var_configuration = configuration;
729
730 let local_var_client = &local_var_configuration.client;
731
732 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));
733 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
734
735 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
736 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
737 }
738 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
739 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
740 };
741
742 let local_var_req = local_var_req_builder.build()?;
743 let local_var_resp = local_var_client.execute(local_var_req).await?;
744
745 let local_var_status = local_var_resp.status();
746 let local_var_content = local_var_resp.text().await?;
747
748 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
749 crate::from_str_patched(&local_var_content).map_err(Error::from)
750 } else {
751 let local_var_entity: Option<DeleteCompletedJobError> = crate::from_str_patched(&local_var_content).ok();
752 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
753 Err(Error::ResponseError(local_var_error))
754 }
755}
756
757pub async fn force_cancel_queued_job(configuration: &configuration::Configuration, workspace: &str, id: &str, cancel_queued_job_request: models::CancelQueuedJobRequest) -> Result<String, Error<ForceCancelQueuedJobError>> {
758 let local_var_configuration = configuration;
759
760 let local_var_client = &local_var_configuration.client;
761
762 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));
763 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
764
765 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
766 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
767 }
768 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
769 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
770 };
771 local_var_req_builder = local_var_req_builder.json(&cancel_queued_job_request);
772
773 let local_var_req = local_var_req_builder.build()?;
774 let local_var_resp = local_var_client.execute(local_var_req).await?;
775
776 let local_var_status = local_var_resp.status();
777 let local_var_content = local_var_resp.text().await?;
778
779 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
780 crate::from_str_patched(&local_var_content).map_err(Error::from)
781 } else {
782 let local_var_entity: Option<ForceCancelQueuedJobError> = crate::from_str_patched(&local_var_content).ok();
783 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
784 Err(Error::ResponseError(local_var_error))
785 }
786}
787
788pub async fn get_completed_count(configuration: &configuration::Configuration, workspace: &str) -> Result<models::GetCompletedCount200Response, Error<GetCompletedCountError>> {
789 let local_var_configuration = configuration;
790
791 let local_var_client = &local_var_configuration.client;
792
793 let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
794 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
795
796 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
797 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
798 }
799 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
800 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
801 };
802
803 let local_var_req = local_var_req_builder.build()?;
804 let local_var_resp = local_var_client.execute(local_var_req).await?;
805
806 let local_var_status = local_var_resp.status();
807 let local_var_content = local_var_resp.text().await?;
808
809 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
810 crate::from_str_patched(&local_var_content).map_err(Error::from)
811 } else {
812 let local_var_entity: Option<GetCompletedCountError> = crate::from_str_patched(&local_var_content).ok();
813 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
814 Err(Error::ResponseError(local_var_error))
815 }
816}
817
818pub async fn get_completed_job(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<models::CompletedJob, Error<GetCompletedJobError>> {
819 let local_var_configuration = configuration;
820
821 let local_var_client = &local_var_configuration.client;
822
823 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));
824 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
825
826 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
827 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
828 }
829 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
830 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
831 };
832
833 let local_var_req = local_var_req_builder.build()?;
834 let local_var_resp = local_var_client.execute(local_var_req).await?;
835
836 let local_var_status = local_var_resp.status();
837 let local_var_content = local_var_resp.text().await?;
838
839 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
840 crate::from_str_patched(&local_var_content).map_err(Error::from)
841 } else {
842 let local_var_entity: Option<GetCompletedJobError> = crate::from_str_patched(&local_var_content).ok();
843 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
844 Err(Error::ResponseError(local_var_error))
845 }
846}
847
848pub async fn get_completed_job_logs_tail(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetCompletedJobLogsTailError>> {
849 let local_var_configuration = configuration;
850
851 let local_var_client = &local_var_configuration.client;
852
853 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));
854 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
855
856 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
857 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
858 }
859 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
860 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
861 };
862
863 let local_var_req = local_var_req_builder.build()?;
864 let local_var_resp = local_var_client.execute(local_var_req).await?;
865
866 let local_var_status = local_var_resp.status();
867 let local_var_content = local_var_resp.text().await?;
868
869 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
870 crate::from_str_patched(&local_var_content).map_err(Error::from)
871 } else {
872 let local_var_entity: Option<GetCompletedJobLogsTailError> = crate::from_str_patched(&local_var_content).ok();
873 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
874 Err(Error::ResponseError(local_var_error))
875 }
876}
877
878pub 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>> {
879 let local_var_configuration = configuration;
880
881 let local_var_client = &local_var_configuration.client;
882
883 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));
884 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
885
886 if let Some(ref local_var_str) = suspended_job {
887 local_var_req_builder = local_var_req_builder.query(&[("suspended_job", &local_var_str.to_string())]);
888 }
889 if let Some(ref local_var_str) = resume_id {
890 local_var_req_builder = local_var_req_builder.query(&[("resume_id", &local_var_str.to_string())]);
891 }
892 if let Some(ref local_var_str) = secret {
893 local_var_req_builder = local_var_req_builder.query(&[("secret", &local_var_str.to_string())]);
894 }
895 if let Some(ref local_var_str) = approver {
896 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
897 }
898 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
899 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
900 }
901 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
902 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
903 };
904
905 let local_var_req = local_var_req_builder.build()?;
906 let local_var_resp = local_var_client.execute(local_var_req).await?;
907
908 let local_var_status = local_var_resp.status();
909 let local_var_content = local_var_resp.text().await?;
910
911 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
912 crate::from_str_patched(&local_var_content).map_err(Error::from)
913 } else {
914 let local_var_entity: Option<GetCompletedJobResultError> = crate::from_str_patched(&local_var_content).ok();
915 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
916 Err(Error::ResponseError(local_var_error))
917 }
918}
919
920pub async fn get_completed_job_result_maybe(configuration: &configuration::Configuration, workspace: &str, id: &str, get_started: Option<bool>) -> Result<models::GetCompletedJobResultMaybe200Response, Error<GetCompletedJobResultMaybeError>> {
921 let local_var_configuration = configuration;
922
923 let local_var_client = &local_var_configuration.client;
924
925 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));
926 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
927
928 if let Some(ref local_var_str) = get_started {
929 local_var_req_builder = local_var_req_builder.query(&[("get_started", &local_var_str.to_string())]);
930 }
931 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
932 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
933 }
934 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
935 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
936 };
937
938 let local_var_req = local_var_req_builder.build()?;
939 let local_var_resp = local_var_client.execute(local_var_req).await?;
940
941 let local_var_status = local_var_resp.status();
942 let local_var_content = local_var_resp.text().await?;
943
944 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
945 crate::from_str_patched(&local_var_content).map_err(Error::from)
946 } else {
947 let local_var_entity: Option<GetCompletedJobResultMaybeError> = crate::from_str_patched(&local_var_content).ok();
948 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
949 Err(Error::ResponseError(local_var_error))
950 }
951}
952
953pub async fn get_db_clock(configuration: &configuration::Configuration, ) -> Result<i32, Error<GetDbClockError>> {
954 let local_var_configuration = configuration;
955
956 let local_var_client = &local_var_configuration.client;
957
958 let local_var_uri_str = format!("{}/jobs/db_clock", local_var_configuration.base_path);
959 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
960
961 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
962 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
963 }
964 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
965 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
966 };
967
968 let local_var_req = local_var_req_builder.build()?;
969 let local_var_resp = local_var_client.execute(local_var_req).await?;
970
971 let local_var_status = local_var_resp.status();
972 let local_var_content = local_var_resp.text().await?;
973
974 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
975 crate::from_str_patched(&local_var_content).map_err(Error::from)
976 } else {
977 let local_var_entity: Option<GetDbClockError> = crate::from_str_patched(&local_var_content).ok();
978 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
979 Err(Error::ResponseError(local_var_error))
980 }
981}
982
983pub async fn get_flow_debug_info(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetFlowDebugInfoError>> {
984 let local_var_configuration = configuration;
985
986 let local_var_client = &local_var_configuration.client;
987
988 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));
989 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
990
991 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
992 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
993 }
994 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
995 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
996 };
997
998 let local_var_req = local_var_req_builder.build()?;
999 let local_var_resp = local_var_client.execute(local_var_req).await?;
1000
1001 let local_var_status = local_var_resp.status();
1002 let local_var_content = local_var_resp.text().await?;
1003
1004 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1005 crate::from_str_patched(&local_var_content).map_err(Error::from)
1006 } else {
1007 let local_var_entity: Option<GetFlowDebugInfoError> = crate::from_str_patched(&local_var_content).ok();
1008 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1009 Err(Error::ResponseError(local_var_error))
1010 }
1011}
1012
1013pub async fn get_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str) -> Result<serde_json::Value, Error<GetFlowUserStateError>> {
1014 let local_var_configuration = configuration;
1015
1016 let local_var_client = &local_var_configuration.client;
1017
1018 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));
1019 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1020
1021 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1022 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1023 }
1024 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1025 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1026 };
1027
1028 let local_var_req = local_var_req_builder.build()?;
1029 let local_var_resp = local_var_client.execute(local_var_req).await?;
1030
1031 let local_var_status = local_var_resp.status();
1032 let local_var_content = local_var_resp.text().await?;
1033
1034 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1035 crate::from_str_patched(&local_var_content).map_err(Error::from)
1036 } else {
1037 let local_var_entity: Option<GetFlowUserStateError> = crate::from_str_patched(&local_var_content).ok();
1038 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1039 Err(Error::ResponseError(local_var_error))
1040 }
1041}
1042
1043pub async fn get_job(configuration: &configuration::Configuration, workspace: &str, id: &str, no_logs: Option<bool>, no_code: Option<bool>) -> Result<models::Job, Error<GetJobError>> {
1044 let local_var_configuration = configuration;
1045
1046 let local_var_client = &local_var_configuration.client;
1047
1048 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));
1049 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1050
1051 if let Some(ref local_var_str) = no_logs {
1052 local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1053 }
1054 if let Some(ref local_var_str) = no_code {
1055 local_var_req_builder = local_var_req_builder.query(&[("no_code", &local_var_str.to_string())]);
1056 }
1057 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1058 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1059 }
1060 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1061 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1062 };
1063
1064 let local_var_req = local_var_req_builder.build()?;
1065 let local_var_resp = local_var_client.execute(local_var_req).await?;
1066
1067 let local_var_status = local_var_resp.status();
1068 let local_var_content = local_var_resp.text().await?;
1069
1070 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1071 crate::from_str_patched(&local_var_content).map_err(Error::from)
1072 } else {
1073 let local_var_entity: Option<GetJobError> = crate::from_str_patched(&local_var_content).ok();
1074 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1075 Err(Error::ResponseError(local_var_error))
1076 }
1077}
1078
1079pub async fn get_job_args(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<serde_json::Value, Error<GetJobArgsError>> {
1080 let local_var_configuration = configuration;
1081
1082 let local_var_client = &local_var_configuration.client;
1083
1084 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));
1085 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1086
1087 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1088 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1089 }
1090 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1091 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1092 };
1093
1094 let local_var_req = local_var_req_builder.build()?;
1095 let local_var_resp = local_var_client.execute(local_var_req).await?;
1096
1097 let local_var_status = local_var_resp.status();
1098 let local_var_content = local_var_resp.text().await?;
1099
1100 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1101 crate::from_str_patched(&local_var_content).map_err(Error::from)
1102 } else {
1103 let local_var_entity: Option<GetJobArgsError> = crate::from_str_patched(&local_var_content).ok();
1104 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1105 Err(Error::ResponseError(local_var_error))
1106 }
1107}
1108
1109pub async fn get_job_logs(configuration: &configuration::Configuration, workspace: &str, id: &str, remove_ansi_warnings: Option<bool>) -> Result<String, Error<GetJobLogsError>> {
1110 let local_var_configuration = configuration;
1111
1112 let local_var_client = &local_var_configuration.client;
1113
1114 let local_var_uri_str = format!("{}/w/{workspace}/jobs_u/get_logs/{id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id));
1115 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1116
1117 if let Some(ref local_var_str) = remove_ansi_warnings {
1118 local_var_req_builder = local_var_req_builder.query(&[("remove_ansi_warnings", &local_var_str.to_string())]);
1119 }
1120 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1121 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1122 }
1123 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1124 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1125 };
1126
1127 let local_var_req = local_var_req_builder.build()?;
1128 let local_var_resp = local_var_client.execute(local_var_req).await?;
1129
1130 let local_var_status = local_var_resp.status();
1131 let local_var_content = local_var_resp.text().await?;
1132
1133 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1134 crate::from_str_patched(&local_var_content).map_err(Error::from)
1135 } else {
1136 let local_var_entity: Option<GetJobLogsError> = crate::from_str_patched(&local_var_content).ok();
1137 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1138 Err(Error::ResponseError(local_var_error))
1139 }
1140}
1141
1142pub 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>> {
1143 let local_var_configuration = configuration;
1144
1145 let local_var_client = &local_var_configuration.client;
1146
1147 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));
1148 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1149
1150 if let Some(ref local_var_str) = running {
1151 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1152 }
1153 if let Some(ref local_var_str) = log_offset {
1154 local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1155 }
1156 if let Some(ref local_var_str) = stream_offset {
1157 local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1158 }
1159 if let Some(ref local_var_str) = get_progress {
1160 local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
1161 }
1162 if let Some(ref local_var_str) = no_logs {
1163 local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1164 }
1165 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1166 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1167 }
1168 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1169 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1170 };
1171
1172 let local_var_req = local_var_req_builder.build()?;
1173 let local_var_resp = local_var_client.execute(local_var_req).await?;
1174
1175 let local_var_status = local_var_resp.status();
1176 let local_var_content = local_var_resp.text().await?;
1177
1178 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1179 crate::from_str_patched(&local_var_content).map_err(Error::from)
1180 } else {
1181 let local_var_entity: Option<GetJobUpdatesError> = crate::from_str_patched(&local_var_content).ok();
1182 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1183 Err(Error::ResponseError(local_var_error))
1184 }
1185}
1186
1187pub 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>> {
1188 let local_var_configuration = configuration;
1189
1190 let local_var_client = &local_var_configuration.client;
1191
1192 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));
1193 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1194
1195 if let Some(ref local_var_str) = running {
1196 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1197 }
1198 if let Some(ref local_var_str) = log_offset {
1199 local_var_req_builder = local_var_req_builder.query(&[("log_offset", &local_var_str.to_string())]);
1200 }
1201 if let Some(ref local_var_str) = stream_offset {
1202 local_var_req_builder = local_var_req_builder.query(&[("stream_offset", &local_var_str.to_string())]);
1203 }
1204 if let Some(ref local_var_str) = get_progress {
1205 local_var_req_builder = local_var_req_builder.query(&[("get_progress", &local_var_str.to_string())]);
1206 }
1207 if let Some(ref local_var_str) = only_result {
1208 local_var_req_builder = local_var_req_builder.query(&[("only_result", &local_var_str.to_string())]);
1209 }
1210 if let Some(ref local_var_str) = no_logs {
1211 local_var_req_builder = local_var_req_builder.query(&[("no_logs", &local_var_str.to_string())]);
1212 }
1213 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1214 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1215 }
1216 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1217 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1218 };
1219
1220 let local_var_req = local_var_req_builder.build()?;
1221 let local_var_resp = local_var_client.execute(local_var_req).await?;
1222
1223 let local_var_status = local_var_resp.status();
1224 let local_var_content = local_var_resp.text().await?;
1225
1226 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1227 crate::from_str_patched(&local_var_content).map_err(Error::from)
1228 } else {
1229 let local_var_entity: Option<GetJobUpdatesSseError> = crate::from_str_patched(&local_var_content).ok();
1230 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1231 Err(Error::ResponseError(local_var_error))
1232 }
1233}
1234
1235pub async fn get_log_file_from_store(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<GetLogFileFromStoreError>> {
1236 let local_var_configuration = configuration;
1237
1238 let local_var_client = &local_var_configuration.client;
1239
1240 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));
1241 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1242
1243 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1244 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1245 }
1246 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1247 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1248 };
1249
1250 let local_var_req = local_var_req_builder.build()?;
1251 let local_var_resp = local_var_client.execute(local_var_req).await?;
1252
1253 let local_var_status = local_var_resp.status();
1254 let local_var_content = local_var_resp.text().await?;
1255
1256 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1257 crate::from_str_patched(&local_var_content).map_err(Error::from)
1258 } else {
1259 let local_var_entity: Option<GetLogFileFromStoreError> = crate::from_str_patched(&local_var_content).ok();
1260 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1261 Err(Error::ResponseError(local_var_error))
1262 }
1263}
1264
1265pub async fn get_queue_count(configuration: &configuration::Configuration, workspace: &str, all_workspaces: Option<bool>) -> Result<models::GetQueueCount200Response, Error<GetQueueCountError>> {
1266 let local_var_configuration = configuration;
1267
1268 let local_var_client = &local_var_configuration.client;
1269
1270 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/count", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1271 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1272
1273 if let Some(ref local_var_str) = all_workspaces {
1274 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1275 }
1276 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1277 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1278 }
1279 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1280 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1281 };
1282
1283 let local_var_req = local_var_req_builder.build()?;
1284 let local_var_resp = local_var_client.execute(local_var_req).await?;
1285
1286 let local_var_status = local_var_resp.status();
1287 let local_var_content = local_var_resp.text().await?;
1288
1289 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1290 crate::from_str_patched(&local_var_content).map_err(Error::from)
1291 } else {
1292 let local_var_entity: Option<GetQueueCountError> = crate::from_str_patched(&local_var_content).ok();
1293 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1294 Err(Error::ResponseError(local_var_error))
1295 }
1296}
1297
1298pub async fn get_resume_urls(configuration: &configuration::Configuration, workspace: &str, id: &str, resume_id: i32, approver: Option<&str>) -> Result<models::GetResumeUrls200Response, Error<GetResumeUrlsError>> {
1299 let local_var_configuration = configuration;
1300
1301 let local_var_client = &local_var_configuration.client;
1302
1303 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);
1304 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1305
1306 if let Some(ref local_var_str) = approver {
1307 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1308 }
1309 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1310 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1311 }
1312 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1313 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1314 };
1315
1316 let local_var_req = local_var_req_builder.build()?;
1317 let local_var_resp = local_var_client.execute(local_var_req).await?;
1318
1319 let local_var_status = local_var_resp.status();
1320 let local_var_content = local_var_resp.text().await?;
1321
1322 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1323 crate::from_str_patched(&local_var_content).map_err(Error::from)
1324 } else {
1325 let local_var_entity: Option<GetResumeUrlsError> = crate::from_str_patched(&local_var_content).ok();
1326 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1327 Err(Error::ResponseError(local_var_error))
1328 }
1329}
1330
1331pub async fn get_root_job_id(configuration: &configuration::Configuration, workspace: &str, id: &str) -> Result<String, Error<GetRootJobIdError>> {
1332 let local_var_configuration = configuration;
1333
1334 let local_var_client = &local_var_configuration.client;
1335
1336 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));
1337 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1338
1339 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1340 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1341 }
1342 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1343 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1344 };
1345
1346 let local_var_req = local_var_req_builder.build()?;
1347 let local_var_resp = local_var_client.execute(local_var_req).await?;
1348
1349 let local_var_status = local_var_resp.status();
1350 let local_var_content = local_var_resp.text().await?;
1351
1352 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1353 crate::from_str_patched(&local_var_content).map_err(Error::from)
1354 } else {
1355 let local_var_entity: Option<GetRootJobIdError> = crate::from_str_patched(&local_var_content).ok();
1356 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1357 Err(Error::ResponseError(local_var_error))
1358 }
1359}
1360
1361pub 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>> {
1362 let local_var_configuration = configuration;
1363
1364 let local_var_client = &local_var_configuration.client;
1365
1366 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));
1367 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1368
1369 if let Some(ref local_var_str) = approver {
1370 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1371 }
1372 if let Some(ref local_var_str) = message {
1373 local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
1374 }
1375 local_var_req_builder = local_var_req_builder.query(&[("slack_resource_path", &slack_resource_path.to_string())]);
1376 local_var_req_builder = local_var_req_builder.query(&[("channel_id", &channel_id.to_string())]);
1377 local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
1378 if let Some(ref local_var_str) = default_args_json {
1379 local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
1380 }
1381 if let Some(ref local_var_str) = dynamic_enums_json {
1382 local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
1383 }
1384 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1385 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1386 }
1387 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1388 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1389 };
1390
1391 let local_var_req = local_var_req_builder.build()?;
1392 let local_var_resp = local_var_client.execute(local_var_req).await?;
1393
1394 let local_var_status = local_var_resp.status();
1395 let local_var_content = local_var_resp.text().await?;
1396
1397 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1398 Ok(())
1399 } else {
1400 let local_var_entity: Option<GetSlackApprovalPayloadError> = crate::from_str_patched(&local_var_content).ok();
1401 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1402 Err(Error::ResponseError(local_var_error))
1403 }
1404}
1405
1406pub 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>> {
1407 let local_var_configuration = configuration;
1408
1409 let local_var_client = &local_var_configuration.client;
1410
1411 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));
1412 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1413
1414 if let Some(ref local_var_str) = approver {
1415 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1416 }
1417 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1418 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1419 }
1420 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1421 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1422 };
1423
1424 let local_var_req = local_var_req_builder.build()?;
1425 let local_var_resp = local_var_client.execute(local_var_req).await?;
1426
1427 let local_var_status = local_var_resp.status();
1428 let local_var_content = local_var_resp.text().await?;
1429
1430 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1431 crate::from_str_patched(&local_var_content).map_err(Error::from)
1432 } else {
1433 let local_var_entity: Option<GetSuspendedJobFlowError> = crate::from_str_patched(&local_var_content).ok();
1434 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1435 Err(Error::ResponseError(local_var_error))
1436 }
1437}
1438
1439pub 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>> {
1440 let local_var_configuration = configuration;
1441
1442 let local_var_client = &local_var_configuration.client;
1443
1444 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));
1445 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1446
1447 if let Some(ref local_var_str) = approver {
1448 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
1449 }
1450 if let Some(ref local_var_str) = message {
1451 local_var_req_builder = local_var_req_builder.query(&[("message", &local_var_str.to_string())]);
1452 }
1453 local_var_req_builder = local_var_req_builder.query(&[("team_name", &team_name.to_string())]);
1454 local_var_req_builder = local_var_req_builder.query(&[("channel_name", &channel_name.to_string())]);
1455 local_var_req_builder = local_var_req_builder.query(&[("flow_step_id", &flow_step_id.to_string())]);
1456 if let Some(ref local_var_str) = default_args_json {
1457 local_var_req_builder = local_var_req_builder.query(&[("default_args_json", &local_var_str.to_string())]);
1458 }
1459 if let Some(ref local_var_str) = dynamic_enums_json {
1460 local_var_req_builder = local_var_req_builder.query(&[("dynamic_enums_json", &local_var_str.to_string())]);
1461 }
1462 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1463 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1464 }
1465 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1466 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1467 };
1468
1469 let local_var_req = local_var_req_builder.build()?;
1470 let local_var_resp = local_var_client.execute(local_var_req).await?;
1471
1472 let local_var_status = local_var_resp.status();
1473 let local_var_content = local_var_resp.text().await?;
1474
1475 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1476 Ok(())
1477 } else {
1478 let local_var_entity: Option<GetTeamsApprovalPayloadError> = crate::from_str_patched(&local_var_content).ok();
1479 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1480 Err(Error::ResponseError(local_var_error))
1481 }
1482}
1483
1484pub async fn 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>> {
1485 let local_var_configuration = configuration;
1486
1487 let local_var_client = &local_var_configuration.client;
1488
1489 let local_var_uri_str = format!("{}/w/{workspace}/jobs/completed/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1490 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1491
1492 if let Some(ref local_var_str) = order_desc {
1493 local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
1494 }
1495 if let Some(ref local_var_str) = created_by {
1496 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1497 }
1498 if let Some(ref local_var_str) = label {
1499 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1500 }
1501 if let Some(ref local_var_str) = worker {
1502 local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
1503 }
1504 if let Some(ref local_var_str) = parent_job {
1505 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1506 }
1507 if let Some(ref local_var_str) = script_path_exact {
1508 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1509 }
1510 if let Some(ref local_var_str) = script_path_start {
1511 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1512 }
1513 if let Some(ref local_var_str) = schedule_path {
1514 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1515 }
1516 if let Some(ref local_var_str) = script_hash {
1517 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1518 }
1519 if let Some(ref local_var_str) = started_before {
1520 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1521 }
1522 if let Some(ref local_var_str) = started_after {
1523 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1524 }
1525 if let Some(ref local_var_str) = success {
1526 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1527 }
1528 if let Some(ref local_var_str) = job_kinds {
1529 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1530 }
1531 if let Some(ref local_var_str) = args {
1532 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1533 }
1534 if let Some(ref local_var_str) = result {
1535 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1536 }
1537 if let Some(ref local_var_str) = allow_wildcards {
1538 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
1539 }
1540 if let Some(ref local_var_str) = tag {
1541 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1542 }
1543 if let Some(ref local_var_str) = page {
1544 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1545 }
1546 if let Some(ref local_var_str) = per_page {
1547 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1548 }
1549 if let Some(ref local_var_str) = is_skipped {
1550 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
1551 }
1552 if let Some(ref local_var_str) = is_flow_step {
1553 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
1554 }
1555 if let Some(ref local_var_str) = has_null_parent {
1556 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
1557 }
1558 if let Some(ref local_var_str) = is_not_schedule {
1559 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1560 }
1561 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1562 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1563 }
1564 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1565 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1566 };
1567
1568 let local_var_req = local_var_req_builder.build()?;
1569 let local_var_resp = local_var_client.execute(local_var_req).await?;
1570
1571 let local_var_status = local_var_resp.status();
1572 let local_var_content = local_var_resp.text().await?;
1573
1574 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1575 crate::from_str_patched(&local_var_content).map_err(Error::from)
1576 } else {
1577 let local_var_entity: Option<ListCompletedJobsError> = crate::from_str_patched(&local_var_content).ok();
1578 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1579 Err(Error::ResponseError(local_var_error))
1580 }
1581}
1582
1583pub 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>, created_or_started_before: Option<String>, running: Option<bool>, scheduled_for_before_now: Option<bool>, created_or_started_after: Option<String>, created_or_started_after_completed_jobs: 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>, 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>> {
1584 let local_var_configuration = configuration;
1585
1586 let local_var_client = &local_var_configuration.client;
1587
1588 let local_var_uri_str = format!("{}/w/{workspace}/concurrency_groups/list_jobs", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1589 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1590
1591 if let Some(ref local_var_str) = concurrency_key {
1592 local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
1593 }
1594 if let Some(ref local_var_str) = row_limit {
1595 local_var_req_builder = local_var_req_builder.query(&[("row_limit", &local_var_str.to_string())]);
1596 }
1597 if let Some(ref local_var_str) = created_by {
1598 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1599 }
1600 if let Some(ref local_var_str) = label {
1601 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1602 }
1603 if let Some(ref local_var_str) = parent_job {
1604 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1605 }
1606 if let Some(ref local_var_str) = script_path_exact {
1607 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1608 }
1609 if let Some(ref local_var_str) = script_path_start {
1610 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1611 }
1612 if let Some(ref local_var_str) = schedule_path {
1613 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1614 }
1615 if let Some(ref local_var_str) = script_hash {
1616 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1617 }
1618 if let Some(ref local_var_str) = started_before {
1619 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1620 }
1621 if let Some(ref local_var_str) = started_after {
1622 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1623 }
1624 if let Some(ref local_var_str) = created_or_started_before {
1625 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_before", &local_var_str.to_string())]);
1626 }
1627 if let Some(ref local_var_str) = running {
1628 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1629 }
1630 if let Some(ref local_var_str) = scheduled_for_before_now {
1631 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
1632 }
1633 if let Some(ref local_var_str) = created_or_started_after {
1634 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_after", &local_var_str.to_string())]);
1635 }
1636 if let Some(ref local_var_str) = created_or_started_after_completed_jobs {
1637 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_after_completed_jobs", &local_var_str.to_string())]);
1638 }
1639 if let Some(ref local_var_str) = job_kinds {
1640 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1641 }
1642 if let Some(ref local_var_str) = args {
1643 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1644 }
1645 if let Some(ref local_var_str) = tag {
1646 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1647 }
1648 if let Some(ref local_var_str) = result {
1649 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1650 }
1651 if let Some(ref local_var_str) = allow_wildcards {
1652 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
1653 }
1654 if let Some(ref local_var_str) = page {
1655 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1656 }
1657 if let Some(ref local_var_str) = per_page {
1658 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1659 }
1660 if let Some(ref local_var_str) = is_skipped {
1661 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
1662 }
1663 if let Some(ref local_var_str) = is_flow_step {
1664 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
1665 }
1666 if let Some(ref local_var_str) = has_null_parent {
1667 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
1668 }
1669 if let Some(ref local_var_str) = success {
1670 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1671 }
1672 if let Some(ref local_var_str) = all_workspaces {
1673 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1674 }
1675 if let Some(ref local_var_str) = is_not_schedule {
1676 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1677 }
1678 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1679 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1680 }
1681 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1682 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1683 };
1684
1685 let local_var_req = local_var_req_builder.build()?;
1686 let local_var_resp = local_var_client.execute(local_var_req).await?;
1687
1688 let local_var_status = local_var_resp.status();
1689 let local_var_content = local_var_resp.text().await?;
1690
1691 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1692 crate::from_str_patched(&local_var_content).map_err(Error::from)
1693 } else {
1694 let local_var_entity: Option<ListExtendedJobsError> = 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 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>, created_or_started_before: Option<String>, running: Option<bool>, scheduled_for_before_now: Option<bool>, created_or_started_after: Option<String>, created_or_started_after_completed_jobs: Option<String>, 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>> {
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/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
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) = created_by {
1709 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1710 }
1711 if let Some(ref local_var_str) = label {
1712 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
1713 }
1714 if let Some(ref local_var_str) = worker {
1715 local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
1716 }
1717 if let Some(ref local_var_str) = parent_job {
1718 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1719 }
1720 if let Some(ref local_var_str) = script_path_exact {
1721 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1722 }
1723 if let Some(ref local_var_str) = script_path_start {
1724 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1725 }
1726 if let Some(ref local_var_str) = schedule_path {
1727 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1728 }
1729 if let Some(ref local_var_str) = script_hash {
1730 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1731 }
1732 if let Some(ref local_var_str) = started_before {
1733 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1734 }
1735 if let Some(ref local_var_str) = started_after {
1736 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1737 }
1738 if let Some(ref local_var_str) = created_before {
1739 local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
1740 }
1741 if let Some(ref local_var_str) = created_after {
1742 local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
1743 }
1744 if let Some(ref local_var_str) = created_or_started_before {
1745 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_before", &local_var_str.to_string())]);
1746 }
1747 if let Some(ref local_var_str) = running {
1748 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1749 }
1750 if let Some(ref local_var_str) = scheduled_for_before_now {
1751 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
1752 }
1753 if let Some(ref local_var_str) = created_or_started_after {
1754 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_after", &local_var_str.to_string())]);
1755 }
1756 if let Some(ref local_var_str) = created_or_started_after_completed_jobs {
1757 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_after_completed_jobs", &local_var_str.to_string())]);
1758 }
1759 if let Some(ref local_var_str) = job_kinds {
1760 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1761 }
1762 if let Some(ref local_var_str) = suspended {
1763 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
1764 }
1765 if let Some(ref local_var_str) = args {
1766 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1767 }
1768 if let Some(ref local_var_str) = tag {
1769 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1770 }
1771 if let Some(ref local_var_str) = result {
1772 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1773 }
1774 if let Some(ref local_var_str) = page {
1775 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1776 }
1777 if let Some(ref local_var_str) = per_page {
1778 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1779 }
1780 if let Some(ref local_var_str) = is_skipped {
1781 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
1782 }
1783 if let Some(ref local_var_str) = is_flow_step {
1784 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
1785 }
1786 if let Some(ref local_var_str) = has_null_parent {
1787 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
1788 }
1789 if let Some(ref local_var_str) = success {
1790 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1791 }
1792 if let Some(ref local_var_str) = all_workspaces {
1793 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1794 }
1795 if let Some(ref local_var_str) = is_not_schedule {
1796 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1797 }
1798 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1799 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1800 }
1801 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1802 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1803 };
1804
1805 let local_var_req = local_var_req_builder.build()?;
1806 let local_var_resp = local_var_client.execute(local_var_req).await?;
1807
1808 let local_var_status = local_var_resp.status();
1809 let local_var_content = local_var_resp.text().await?;
1810
1811 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1812 crate::from_str_patched(&local_var_content).map_err(Error::from)
1813 } else {
1814 let local_var_entity: Option<ListFilteredJobsUuidsError> = crate::from_str_patched(&local_var_content).ok();
1815 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1816 Err(Error::ResponseError(local_var_error))
1817 }
1818}
1819
1820pub 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>> {
1821 let local_var_configuration = configuration;
1822
1823 let local_var_client = &local_var_configuration.client;
1824
1825 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list_filtered_uuids", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1826 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1827
1828 if let Some(ref local_var_str) = order_desc {
1829 local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
1830 }
1831 if let Some(ref local_var_str) = created_by {
1832 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
1833 }
1834 if let Some(ref local_var_str) = parent_job {
1835 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
1836 }
1837 if let Some(ref local_var_str) = script_path_exact {
1838 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
1839 }
1840 if let Some(ref local_var_str) = script_path_start {
1841 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
1842 }
1843 if let Some(ref local_var_str) = schedule_path {
1844 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
1845 }
1846 if let Some(ref local_var_str) = script_hash {
1847 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
1848 }
1849 if let Some(ref local_var_str) = started_before {
1850 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
1851 }
1852 if let Some(ref local_var_str) = started_after {
1853 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
1854 }
1855 if let Some(ref local_var_str) = success {
1856 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
1857 }
1858 if let Some(ref local_var_str) = scheduled_for_before_now {
1859 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
1860 }
1861 if let Some(ref local_var_str) = job_kinds {
1862 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1863 }
1864 if let Some(ref local_var_str) = suspended {
1865 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
1866 }
1867 if let Some(ref local_var_str) = running {
1868 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1869 }
1870 if let Some(ref local_var_str) = args {
1871 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1872 }
1873 if let Some(ref local_var_str) = result {
1874 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1875 }
1876 if let Some(ref local_var_str) = allow_wildcards {
1877 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
1878 }
1879 if let Some(ref local_var_str) = tag {
1880 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1881 }
1882 if let Some(ref local_var_str) = page {
1883 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1884 }
1885 if let Some(ref local_var_str) = per_page {
1886 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1887 }
1888 if let Some(ref local_var_str) = concurrency_key {
1889 local_var_req_builder = local_var_req_builder.query(&[("concurrency_key", &local_var_str.to_string())]);
1890 }
1891 if let Some(ref local_var_str) = all_workspaces {
1892 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
1893 }
1894 if let Some(ref local_var_str) = is_not_schedule {
1895 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
1896 }
1897 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1898 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1899 }
1900 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1901 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1902 };
1903
1904 let local_var_req = local_var_req_builder.build()?;
1905 let local_var_resp = local_var_client.execute(local_var_req).await?;
1906
1907 let local_var_status = local_var_resp.status();
1908 let local_var_content = local_var_resp.text().await?;
1909
1910 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1911 crate::from_str_patched(&local_var_content).map_err(Error::from)
1912 } else {
1913 let local_var_entity: Option<ListFilteredQueueUuidsError> = crate::from_str_patched(&local_var_content).ok();
1914 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1915 Err(Error::ResponseError(local_var_error))
1916 }
1917}
1918
1919pub 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>, created_or_started_before: Option<String>, running: Option<bool>, scheduled_for_before_now: Option<bool>, created_or_started_after: Option<String>, created_or_started_after_completed_jobs: Option<String>, job_kinds: Option<&str>, suspended: Option<bool>, args: Option<&str>, tag: Option<&str>, result: Option<&str>, allow_wildcards: Option<bool>, 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<models::Job>, Error<ListJobsError>> {
1920 let local_var_configuration = configuration;
1921
1922 let local_var_client = &local_var_configuration.client;
1923
1924 let local_var_uri_str = format!("{}/w/{workspace}/jobs/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
1925 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
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) = created_before {
1958 local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]);
1959 }
1960 if let Some(ref local_var_str) = created_after {
1961 local_var_req_builder = local_var_req_builder.query(&[("created_after", &local_var_str.to_string())]);
1962 }
1963 if let Some(ref local_var_str) = created_or_started_before {
1964 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_before", &local_var_str.to_string())]);
1965 }
1966 if let Some(ref local_var_str) = running {
1967 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
1968 }
1969 if let Some(ref local_var_str) = scheduled_for_before_now {
1970 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
1971 }
1972 if let Some(ref local_var_str) = created_or_started_after {
1973 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_after", &local_var_str.to_string())]);
1974 }
1975 if let Some(ref local_var_str) = created_or_started_after_completed_jobs {
1976 local_var_req_builder = local_var_req_builder.query(&[("created_or_started_after_completed_jobs", &local_var_str.to_string())]);
1977 }
1978 if let Some(ref local_var_str) = job_kinds {
1979 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
1980 }
1981 if let Some(ref local_var_str) = suspended {
1982 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
1983 }
1984 if let Some(ref local_var_str) = args {
1985 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
1986 }
1987 if let Some(ref local_var_str) = tag {
1988 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
1989 }
1990 if let Some(ref local_var_str) = result {
1991 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
1992 }
1993 if let Some(ref local_var_str) = allow_wildcards {
1994 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
1995 }
1996 if let Some(ref local_var_str) = page {
1997 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1998 }
1999 if let Some(ref local_var_str) = per_page {
2000 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2001 }
2002 if let Some(ref local_var_str) = is_skipped {
2003 local_var_req_builder = local_var_req_builder.query(&[("is_skipped", &local_var_str.to_string())]);
2004 }
2005 if let Some(ref local_var_str) = is_flow_step {
2006 local_var_req_builder = local_var_req_builder.query(&[("is_flow_step", &local_var_str.to_string())]);
2007 }
2008 if let Some(ref local_var_str) = has_null_parent {
2009 local_var_req_builder = local_var_req_builder.query(&[("has_null_parent", &local_var_str.to_string())]);
2010 }
2011 if let Some(ref local_var_str) = success {
2012 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2013 }
2014 if let Some(ref local_var_str) = all_workspaces {
2015 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2016 }
2017 if let Some(ref local_var_str) = is_not_schedule {
2018 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2019 }
2020 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2021 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2022 }
2023 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2024 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2025 };
2026
2027 let local_var_req = local_var_req_builder.build()?;
2028 let local_var_resp = local_var_client.execute(local_var_req).await?;
2029
2030 let local_var_status = local_var_resp.status();
2031 let local_var_content = local_var_resp.text().await?;
2032
2033 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2034 crate::from_str_patched(&local_var_content).map_err(Error::from)
2035 } else {
2036 let local_var_entity: Option<ListJobsError> = crate::from_str_patched(&local_var_content).ok();
2037 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2038 Err(Error::ResponseError(local_var_error))
2039 }
2040}
2041
2042pub 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>, 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>> {
2043 let local_var_configuration = configuration;
2044
2045 let local_var_client = &local_var_configuration.client;
2046
2047 let local_var_uri_str = format!("{}/w/{workspace}/jobs/queue/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2048 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2049
2050 if let Some(ref local_var_str) = order_desc {
2051 local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
2052 }
2053 if let Some(ref local_var_str) = created_by {
2054 local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
2055 }
2056 if let Some(ref local_var_str) = parent_job {
2057 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2058 }
2059 if let Some(ref local_var_str) = worker {
2060 local_var_req_builder = local_var_req_builder.query(&[("worker", &local_var_str.to_string())]);
2061 }
2062 if let Some(ref local_var_str) = script_path_exact {
2063 local_var_req_builder = local_var_req_builder.query(&[("script_path_exact", &local_var_str.to_string())]);
2064 }
2065 if let Some(ref local_var_str) = script_path_start {
2066 local_var_req_builder = local_var_req_builder.query(&[("script_path_start", &local_var_str.to_string())]);
2067 }
2068 if let Some(ref local_var_str) = schedule_path {
2069 local_var_req_builder = local_var_req_builder.query(&[("schedule_path", &local_var_str.to_string())]);
2070 }
2071 if let Some(ref local_var_str) = script_hash {
2072 local_var_req_builder = local_var_req_builder.query(&[("script_hash", &local_var_str.to_string())]);
2073 }
2074 if let Some(ref local_var_str) = started_before {
2075 local_var_req_builder = local_var_req_builder.query(&[("started_before", &local_var_str.to_string())]);
2076 }
2077 if let Some(ref local_var_str) = started_after {
2078 local_var_req_builder = local_var_req_builder.query(&[("started_after", &local_var_str.to_string())]);
2079 }
2080 if let Some(ref local_var_str) = success {
2081 local_var_req_builder = local_var_req_builder.query(&[("success", &local_var_str.to_string())]);
2082 }
2083 if let Some(ref local_var_str) = scheduled_for_before_now {
2084 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for_before_now", &local_var_str.to_string())]);
2085 }
2086 if let Some(ref local_var_str) = job_kinds {
2087 local_var_req_builder = local_var_req_builder.query(&[("job_kinds", &local_var_str.to_string())]);
2088 }
2089 if let Some(ref local_var_str) = suspended {
2090 local_var_req_builder = local_var_req_builder.query(&[("suspended", &local_var_str.to_string())]);
2091 }
2092 if let Some(ref local_var_str) = running {
2093 local_var_req_builder = local_var_req_builder.query(&[("running", &local_var_str.to_string())]);
2094 }
2095 if let Some(ref local_var_str) = args {
2096 local_var_req_builder = local_var_req_builder.query(&[("args", &local_var_str.to_string())]);
2097 }
2098 if let Some(ref local_var_str) = result {
2099 local_var_req_builder = local_var_req_builder.query(&[("result", &local_var_str.to_string())]);
2100 }
2101 if let Some(ref local_var_str) = allow_wildcards {
2102 local_var_req_builder = local_var_req_builder.query(&[("allow_wildcards", &local_var_str.to_string())]);
2103 }
2104 if let Some(ref local_var_str) = tag {
2105 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2106 }
2107 if let Some(ref local_var_str) = page {
2108 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2109 }
2110 if let Some(ref local_var_str) = per_page {
2111 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
2112 }
2113 if let Some(ref local_var_str) = all_workspaces {
2114 local_var_req_builder = local_var_req_builder.query(&[("all_workspaces", &local_var_str.to_string())]);
2115 }
2116 if let Some(ref local_var_str) = is_not_schedule {
2117 local_var_req_builder = local_var_req_builder.query(&[("is_not_schedule", &local_var_str.to_string())]);
2118 }
2119 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2120 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2121 }
2122 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2123 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2124 };
2125
2126 let local_var_req = local_var_req_builder.build()?;
2127 let local_var_resp = local_var_client.execute(local_var_req).await?;
2128
2129 let local_var_status = local_var_resp.status();
2130 let local_var_content = local_var_resp.text().await?;
2131
2132 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2133 crate::from_str_patched(&local_var_content).map_err(Error::from)
2134 } else {
2135 let local_var_entity: Option<ListQueueError> = crate::from_str_patched(&local_var_content).ok();
2136 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2137 Err(Error::ResponseError(local_var_error))
2138 }
2139}
2140
2141pub async fn list_selected_job_groups(configuration: &configuration::Configuration, workspace: &str, uuid_colon_colon_uuid: Vec<uuid::Uuid>) -> Result<Vec<models::ListSelectedJobGroups200ResponseInner>, Error<ListSelectedJobGroupsError>> {
2142 let local_var_configuration = configuration;
2143
2144 let local_var_client = &local_var_configuration.client;
2145
2146 let local_var_uri_str = format!("{}/w/{workspace}/jobs/list_selected_job_groups", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2147 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2148
2149 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2150 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2151 }
2152 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2153 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2154 };
2155 local_var_req_builder = local_var_req_builder.json(&uuid_colon_colon_uuid);
2156
2157 let local_var_req = local_var_req_builder.build()?;
2158 let local_var_resp = local_var_client.execute(local_var_req).await?;
2159
2160 let local_var_status = local_var_resp.status();
2161 let local_var_content = local_var_resp.text().await?;
2162
2163 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2164 crate::from_str_patched(&local_var_content).map_err(Error::from)
2165 } else {
2166 let local_var_entity: Option<ListSelectedJobGroupsError> = crate::from_str_patched(&local_var_content).ok();
2167 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2168 Err(Error::ResponseError(local_var_error))
2169 }
2170}
2171
2172pub async fn openai_sync_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>) -> Result<serde_json::Value, Error<OpenaiSyncFlowByPathError>> {
2173 let local_var_configuration = configuration;
2174
2175 let local_var_client = &local_var_configuration.client;
2176
2177 let local_var_uri_str = format!("{}/w/{workspace}/jobs/openai_sync/f/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
2178 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2179
2180 if let Some(ref local_var_str) = include_header {
2181 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2182 }
2183 if let Some(ref local_var_str) = queue_limit {
2184 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2185 }
2186 if let Some(ref local_var_str) = job_id {
2187 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2188 }
2189 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2190 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2191 }
2192 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2193 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2194 };
2195 local_var_req_builder = local_var_req_builder.json(&request_body);
2196
2197 let local_var_req = local_var_req_builder.build()?;
2198 let local_var_resp = local_var_client.execute(local_var_req).await?;
2199
2200 let local_var_status = local_var_resp.status();
2201 let local_var_content = local_var_resp.text().await?;
2202
2203 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2204 crate::from_str_patched(&local_var_content).map_err(Error::from)
2205 } else {
2206 let local_var_entity: Option<OpenaiSyncFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
2207 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2208 Err(Error::ResponseError(local_var_error))
2209 }
2210}
2211
2212pub async fn openai_sync_script_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, request_body: std::collections::HashMap<String, serde_json::Value>, parent_job: Option<&str>, job_id: Option<&str>, include_header: Option<&str>, queue_limit: Option<&str>) -> Result<serde_json::Value, Error<OpenaiSyncScriptByPathError>> {
2213 let local_var_configuration = configuration;
2214
2215 let local_var_client = &local_var_configuration.client;
2216
2217 let local_var_uri_str = format!("{}/w/{workspace}/jobs/openai_sync/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
2218 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2219
2220 if let Some(ref local_var_str) = parent_job {
2221 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2222 }
2223 if let Some(ref local_var_str) = job_id {
2224 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2225 }
2226 if let Some(ref local_var_str) = include_header {
2227 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2228 }
2229 if let Some(ref local_var_str) = queue_limit {
2230 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2231 }
2232 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2233 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2234 }
2235 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2236 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2237 };
2238 local_var_req_builder = local_var_req_builder.json(&request_body);
2239
2240 let local_var_req = local_var_req_builder.build()?;
2241 let local_var_resp = local_var_client.execute(local_var_req).await?;
2242
2243 let local_var_status = local_var_resp.status();
2244 let local_var_content = local_var_resp.text().await?;
2245
2246 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2247 crate::from_str_patched(&local_var_content).map_err(Error::from)
2248 } else {
2249 let local_var_entity: Option<OpenaiSyncScriptByPathError> = crate::from_str_patched(&local_var_content).ok();
2250 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2251 Err(Error::ResponseError(local_var_error))
2252 }
2253}
2254
2255pub async fn restart_flow_at_step(configuration: &configuration::Configuration, workspace: &str, id: &str, step_id: &str, branch_or_iteration_n: i32, request_body: std::collections::HashMap<String, serde_json::Value>, 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>> {
2256 let local_var_configuration = configuration;
2257
2258 let local_var_client = &local_var_configuration.client;
2259
2260 let local_var_uri_str = format!("{}/w/{workspace}/jobs/restart/f/{id}/from/{step_id}/{branch_or_iteration_n}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=crate::apis::urlencode(id), step_id=crate::apis::urlencode(step_id), branch_or_iteration_n=branch_or_iteration_n);
2261 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2262
2263 if let Some(ref local_var_str) = scheduled_for {
2264 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
2265 }
2266 if let Some(ref local_var_str) = scheduled_in_secs {
2267 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
2268 }
2269 if let Some(ref local_var_str) = parent_job {
2270 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2271 }
2272 if let Some(ref local_var_str) = tag {
2273 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2274 }
2275 if let Some(ref local_var_str) = job_id {
2276 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2277 }
2278 if let Some(ref local_var_str) = include_header {
2279 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2280 }
2281 if let Some(ref local_var_str) = invisible_to_owner {
2282 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2283 }
2284 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2285 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2286 }
2287 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2288 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2289 };
2290 local_var_req_builder = local_var_req_builder.json(&request_body);
2291
2292 let local_var_req = local_var_req_builder.build()?;
2293 let local_var_resp = local_var_client.execute(local_var_req).await?;
2294
2295 let local_var_status = local_var_resp.status();
2296 let local_var_content = local_var_resp.text().await?;
2297
2298 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2299 crate::from_str_patched(&local_var_content).map_err(Error::from)
2300 } else {
2301 let local_var_entity: Option<RestartFlowAtStepError> = crate::from_str_patched(&local_var_content).ok();
2302 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2303 Err(Error::ResponseError(local_var_error))
2304 }
2305}
2306
2307pub async fn result_by_id(configuration: &configuration::Configuration, workspace: &str, flow_job_id: &str, node_id: &str) -> Result<serde_json::Value, Error<ResultByIdError>> {
2308 let local_var_configuration = configuration;
2309
2310 let local_var_client = &local_var_configuration.client;
2311
2312 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));
2313 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2314
2315 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2316 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2317 }
2318 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2319 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2320 };
2321
2322 let local_var_req = local_var_req_builder.build()?;
2323 let local_var_resp = local_var_client.execute(local_var_req).await?;
2324
2325 let local_var_status = local_var_resp.status();
2326 let local_var_content = local_var_resp.text().await?;
2327
2328 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2329 crate::from_str_patched(&local_var_content).map_err(Error::from)
2330 } else {
2331 let local_var_entity: Option<ResultByIdError> = crate::from_str_patched(&local_var_content).ok();
2332 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2333 Err(Error::ResponseError(local_var_error))
2334 }
2335}
2336
2337pub async fn resume_suspended_flow_as_owner(configuration: &configuration::Configuration, workspace: &str, id: &str, body: serde_json::Value) -> Result<String, Error<ResumeSuspendedFlowAsOwnerError>> {
2338 let local_var_configuration = configuration;
2339
2340 let local_var_client = &local_var_configuration.client;
2341
2342 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));
2343 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2344
2345 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2346 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2347 }
2348 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2349 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2350 };
2351 local_var_req_builder = local_var_req_builder.json(&body);
2352
2353 let local_var_req = local_var_req_builder.build()?;
2354 let local_var_resp = local_var_client.execute(local_var_req).await?;
2355
2356 let local_var_status = local_var_resp.status();
2357 let local_var_content = local_var_resp.text().await?;
2358
2359 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2360 crate::from_str_patched(&local_var_content).map_err(Error::from)
2361 } else {
2362 let local_var_entity: Option<ResumeSuspendedFlowAsOwnerError> = crate::from_str_patched(&local_var_content).ok();
2363 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2364 Err(Error::ResponseError(local_var_error))
2365 }
2366}
2367
2368pub 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>> {
2369 let local_var_configuration = configuration;
2370
2371 let local_var_client = &local_var_configuration.client;
2372
2373 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));
2374 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2375
2376 if let Some(ref local_var_str) = payload {
2377 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2378 }
2379 if let Some(ref local_var_str) = approver {
2380 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2381 }
2382 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2383 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2384 }
2385 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2386 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2387 };
2388
2389 let local_var_req = local_var_req_builder.build()?;
2390 let local_var_resp = local_var_client.execute(local_var_req).await?;
2391
2392 let local_var_status = local_var_resp.status();
2393 let local_var_content = local_var_resp.text().await?;
2394
2395 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2396 crate::from_str_patched(&local_var_content).map_err(Error::from)
2397 } else {
2398 let local_var_entity: Option<ResumeSuspendedJobGetError> = crate::from_str_patched(&local_var_content).ok();
2399 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2400 Err(Error::ResponseError(local_var_error))
2401 }
2402}
2403
2404pub 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>> {
2405 let local_var_configuration = configuration;
2406
2407 let local_var_client = &local_var_configuration.client;
2408
2409 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));
2410 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2411
2412 if let Some(ref local_var_str) = approver {
2413 local_var_req_builder = local_var_req_builder.query(&[("approver", &local_var_str.to_string())]);
2414 }
2415 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2416 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2417 }
2418 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2419 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2420 };
2421 local_var_req_builder = local_var_req_builder.json(&body);
2422
2423 let local_var_req = local_var_req_builder.build()?;
2424 let local_var_resp = local_var_client.execute(local_var_req).await?;
2425
2426 let local_var_status = local_var_resp.status();
2427 let local_var_content = local_var_resp.text().await?;
2428
2429 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2430 crate::from_str_patched(&local_var_content).map_err(Error::from)
2431 } else {
2432 let local_var_entity: Option<ResumeSuspendedJobPostError> = crate::from_str_patched(&local_var_content).ok();
2433 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2434 Err(Error::ResponseError(local_var_error))
2435 }
2436}
2437
2438pub 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>> {
2439 let local_var_configuration = configuration;
2440
2441 let local_var_client = &local_var_configuration.client;
2442
2443 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));
2444 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2445
2446 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2447 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2448 }
2449 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2450 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2451 };
2452 local_var_req_builder = local_var_req_builder.json(&workflow_task);
2453
2454 let local_var_req = local_var_req_builder.build()?;
2455 let local_var_resp = local_var_client.execute(local_var_req).await?;
2456
2457 let local_var_status = local_var_resp.status();
2458 let local_var_content = local_var_resp.text().await?;
2459
2460 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2461 crate::from_str_patched(&local_var_content).map_err(Error::from)
2462 } else {
2463 let local_var_entity: Option<RunCodeWorkflowTaskError> = crate::from_str_patched(&local_var_content).ok();
2464 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2465 Err(Error::ResponseError(local_var_error))
2466 }
2467}
2468
2469pub 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>) -> Result<uuid::Uuid, Error<RunFlowByPathError>> {
2470 let local_var_configuration = configuration;
2471
2472 let local_var_client = &local_var_configuration.client;
2473
2474 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));
2475 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2476
2477 if let Some(ref local_var_str) = scheduled_for {
2478 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
2479 }
2480 if let Some(ref local_var_str) = scheduled_in_secs {
2481 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
2482 }
2483 if let Some(ref local_var_str) = skip_preprocessor {
2484 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2485 }
2486 if let Some(ref local_var_str) = parent_job {
2487 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2488 }
2489 if let Some(ref local_var_str) = tag {
2490 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2491 }
2492 if let Some(ref local_var_str) = job_id {
2493 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2494 }
2495 if let Some(ref local_var_str) = include_header {
2496 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2497 }
2498 if let Some(ref local_var_str) = invisible_to_owner {
2499 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2500 }
2501 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2502 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2503 }
2504 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2505 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2506 };
2507 local_var_req_builder = local_var_req_builder.json(&request_body);
2508
2509 let local_var_req = local_var_req_builder.build()?;
2510 let local_var_resp = local_var_client.execute(local_var_req).await?;
2511
2512 let local_var_status = local_var_resp.status();
2513 let local_var_content = local_var_resp.text().await?;
2514
2515 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2516 crate::from_str_patched(&local_var_content).map_err(Error::from)
2517 } else {
2518 let local_var_entity: Option<RunFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
2519 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2520 Err(Error::ResponseError(local_var_error))
2521 }
2522}
2523
2524pub 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>) -> Result<uuid::Uuid, Error<RunFlowPreviewError>> {
2525 let local_var_configuration = configuration;
2526
2527 let local_var_client = &local_var_configuration.client;
2528
2529 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2530 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2531
2532 if let Some(ref local_var_str) = include_header {
2533 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2534 }
2535 if let Some(ref local_var_str) = invisible_to_owner {
2536 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2537 }
2538 if let Some(ref local_var_str) = job_id {
2539 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2540 }
2541 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2542 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2543 }
2544 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2545 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2546 };
2547 local_var_req_builder = local_var_req_builder.json(&flow_preview);
2548
2549 let local_var_req = local_var_req_builder.build()?;
2550 let local_var_resp = local_var_client.execute(local_var_req).await?;
2551
2552 let local_var_status = local_var_resp.status();
2553 let local_var_content = local_var_resp.text().await?;
2554
2555 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2556 crate::from_str_patched(&local_var_content).map_err(Error::from)
2557 } else {
2558 let local_var_entity: Option<RunFlowPreviewError> = crate::from_str_patched(&local_var_content).ok();
2559 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2560 Err(Error::ResponseError(local_var_error))
2561 }
2562}
2563
2564pub async fn run_flow_preview_and_wait_result(configuration: &configuration::Configuration, workspace: &str, flow_preview: models::FlowPreview) -> Result<serde_json::Value, Error<RunFlowPreviewAndWaitResultError>> {
2565 let local_var_configuration = configuration;
2566
2567 let local_var_client = &local_var_configuration.client;
2568
2569 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview_flow", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2570 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2571
2572 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2573 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2574 }
2575 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2576 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2577 };
2578 local_var_req_builder = local_var_req_builder.json(&flow_preview);
2579
2580 let local_var_req = local_var_req_builder.build()?;
2581 let local_var_resp = local_var_client.execute(local_var_req).await?;
2582
2583 let local_var_status = local_var_resp.status();
2584 let local_var_content = local_var_resp.text().await?;
2585
2586 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2587 crate::from_str_patched(&local_var_content).map_err(Error::from)
2588 } else {
2589 let local_var_entity: Option<RunFlowPreviewAndWaitResultError> = crate::from_str_patched(&local_var_content).ok();
2590 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2591 Err(Error::ResponseError(local_var_error))
2592 }
2593}
2594
2595pub async fn run_raw_script_dependencies(configuration: &configuration::Configuration, workspace: &str, run_raw_script_dependencies_request: models::RunRawScriptDependenciesRequest) -> Result<models::RunRawScriptDependencies201Response, Error<RunRawScriptDependenciesError>> {
2596 let local_var_configuration = configuration;
2597
2598 let local_var_client = &local_var_configuration.client;
2599
2600 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/dependencies", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2601 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2602
2603 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2604 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2605 }
2606 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2607 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2608 };
2609 local_var_req_builder = local_var_req_builder.json(&run_raw_script_dependencies_request);
2610
2611 let local_var_req = local_var_req_builder.build()?;
2612 let local_var_resp = local_var_client.execute(local_var_req).await?;
2613
2614 let local_var_status = local_var_resp.status();
2615 let local_var_content = local_var_resp.text().await?;
2616
2617 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2618 crate::from_str_patched(&local_var_content).map_err(Error::from)
2619 } else {
2620 let local_var_entity: Option<RunRawScriptDependenciesError> = crate::from_str_patched(&local_var_content).ok();
2621 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2622 Err(Error::ResponseError(local_var_error))
2623 }
2624}
2625
2626pub 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>> {
2627 let local_var_configuration = configuration;
2628
2629 let local_var_client = &local_var_configuration.client;
2630
2631 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));
2632 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2633
2634 if let Some(ref local_var_str) = scheduled_for {
2635 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
2636 }
2637 if let Some(ref local_var_str) = scheduled_in_secs {
2638 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
2639 }
2640 if let Some(ref local_var_str) = skip_preprocessor {
2641 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2642 }
2643 if let Some(ref local_var_str) = parent_job {
2644 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2645 }
2646 if let Some(ref local_var_str) = tag {
2647 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2648 }
2649 if let Some(ref local_var_str) = cache_ttl {
2650 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2651 }
2652 if let Some(ref local_var_str) = job_id {
2653 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2654 }
2655 if let Some(ref local_var_str) = include_header {
2656 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2657 }
2658 if let Some(ref local_var_str) = invisible_to_owner {
2659 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2660 }
2661 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2662 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2663 }
2664 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2665 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2666 };
2667 local_var_req_builder = local_var_req_builder.json(&body);
2668
2669 let local_var_req = local_var_req_builder.build()?;
2670 let local_var_resp = local_var_client.execute(local_var_req).await?;
2671
2672 let local_var_status = local_var_resp.status();
2673 let local_var_content = local_var_resp.text().await?;
2674
2675 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2676 crate::from_str_patched(&local_var_content).map_err(Error::from)
2677 } else {
2678 let local_var_entity: Option<RunScriptByHashError> = crate::from_str_patched(&local_var_content).ok();
2679 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2680 Err(Error::ResponseError(local_var_error))
2681 }
2682}
2683
2684pub 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>> {
2685 let local_var_configuration = configuration;
2686
2687 let local_var_client = &local_var_configuration.client;
2688
2689 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));
2690 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2691
2692 if let Some(ref local_var_str) = scheduled_for {
2693 local_var_req_builder = local_var_req_builder.query(&[("scheduled_for", &local_var_str.to_string())]);
2694 }
2695 if let Some(ref local_var_str) = scheduled_in_secs {
2696 local_var_req_builder = local_var_req_builder.query(&[("scheduled_in_secs", &local_var_str.to_string())]);
2697 }
2698 if let Some(ref local_var_str) = skip_preprocessor {
2699 local_var_req_builder = local_var_req_builder.query(&[("skip_preprocessor", &local_var_str.to_string())]);
2700 }
2701 if let Some(ref local_var_str) = parent_job {
2702 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2703 }
2704 if let Some(ref local_var_str) = tag {
2705 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2706 }
2707 if let Some(ref local_var_str) = cache_ttl {
2708 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2709 }
2710 if let Some(ref local_var_str) = job_id {
2711 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2712 }
2713 if let Some(ref local_var_str) = invisible_to_owner {
2714 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2715 }
2716 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2717 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2718 }
2719 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2720 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2721 };
2722 local_var_req_builder = local_var_req_builder.json(&request_body);
2723
2724 let local_var_req = local_var_req_builder.build()?;
2725 let local_var_resp = local_var_client.execute(local_var_req).await?;
2726
2727 let local_var_status = local_var_resp.status();
2728 let local_var_content = local_var_resp.text().await?;
2729
2730 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2731 crate::from_str_patched(&local_var_content).map_err(Error::from)
2732 } else {
2733 let local_var_entity: Option<RunScriptByPathError> = crate::from_str_patched(&local_var_content).ok();
2734 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2735 Err(Error::ResponseError(local_var_error))
2736 }
2737}
2738
2739pub 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>> {
2740 let local_var_configuration = configuration;
2741
2742 let local_var_client = &local_var_configuration.client;
2743
2744 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2745 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2746
2747 if let Some(ref local_var_str) = include_header {
2748 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2749 }
2750 if let Some(ref local_var_str) = invisible_to_owner {
2751 local_var_req_builder = local_var_req_builder.query(&[("invisible_to_owner", &local_var_str.to_string())]);
2752 }
2753 if let Some(ref local_var_str) = job_id {
2754 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2755 }
2756 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2757 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2758 }
2759 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2760 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2761 };
2762 local_var_req_builder = local_var_req_builder.json(&preview);
2763
2764 let local_var_req = local_var_req_builder.build()?;
2765 let local_var_resp = local_var_client.execute(local_var_req).await?;
2766
2767 let local_var_status = local_var_resp.status();
2768 let local_var_content = local_var_resp.text().await?;
2769
2770 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2771 crate::from_str_patched(&local_var_content).map_err(Error::from)
2772 } else {
2773 let local_var_entity: Option<RunScriptPreviewError> = crate::from_str_patched(&local_var_content).ok();
2774 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2775 Err(Error::ResponseError(local_var_error))
2776 }
2777}
2778
2779pub async fn run_script_preview_and_wait_result(configuration: &configuration::Configuration, workspace: &str, preview: models::Preview) -> Result<serde_json::Value, Error<RunScriptPreviewAndWaitResultError>> {
2780 let local_var_configuration = configuration;
2781
2782 let local_var_client = &local_var_configuration.client;
2783
2784 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/preview", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
2785 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2786
2787 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2788 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2789 }
2790 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2791 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2792 };
2793 local_var_req_builder = local_var_req_builder.json(&preview);
2794
2795 let local_var_req = local_var_req_builder.build()?;
2796 let local_var_resp = local_var_client.execute(local_var_req).await?;
2797
2798 let local_var_status = local_var_resp.status();
2799 let local_var_content = local_var_resp.text().await?;
2800
2801 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2802 crate::from_str_patched(&local_var_content).map_err(Error::from)
2803 } else {
2804 let local_var_entity: Option<RunScriptPreviewAndWaitResultError> = crate::from_str_patched(&local_var_content).ok();
2805 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2806 Err(Error::ResponseError(local_var_error))
2807 }
2808}
2809
2810pub async fn 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>) -> Result<serde_json::Value, Error<RunWaitResultFlowByPathError>> {
2811 let local_var_configuration = configuration;
2812
2813 let local_var_client = &local_var_configuration.client;
2814
2815 let local_var_uri_str = format!("{}/w/{workspace}/jobs/run_wait_result/f/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
2816 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2817
2818 if let Some(ref local_var_str) = include_header {
2819 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2820 }
2821 if let Some(ref local_var_str) = queue_limit {
2822 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2823 }
2824 if let Some(ref local_var_str) = job_id {
2825 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2826 }
2827 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2828 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2829 }
2830 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2831 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2832 };
2833 local_var_req_builder = local_var_req_builder.json(&request_body);
2834
2835 let local_var_req = local_var_req_builder.build()?;
2836 let local_var_resp = local_var_client.execute(local_var_req).await?;
2837
2838 let local_var_status = local_var_resp.status();
2839 let local_var_content = local_var_resp.text().await?;
2840
2841 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2842 crate::from_str_patched(&local_var_content).map_err(Error::from)
2843 } else {
2844 let local_var_entity: Option<RunWaitResultFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
2845 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2846 Err(Error::ResponseError(local_var_error))
2847 }
2848}
2849
2850pub 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>) -> Result<serde_json::Value, Error<RunWaitResultScriptByPathError>> {
2851 let local_var_configuration = configuration;
2852
2853 let local_var_client = &local_var_configuration.client;
2854
2855 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));
2856 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2857
2858 if let Some(ref local_var_str) = parent_job {
2859 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2860 }
2861 if let Some(ref local_var_str) = tag {
2862 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2863 }
2864 if let Some(ref local_var_str) = cache_ttl {
2865 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2866 }
2867 if let Some(ref local_var_str) = job_id {
2868 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2869 }
2870 if let Some(ref local_var_str) = include_header {
2871 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2872 }
2873 if let Some(ref local_var_str) = queue_limit {
2874 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2875 }
2876 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2877 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2878 }
2879 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2880 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2881 };
2882 local_var_req_builder = local_var_req_builder.json(&request_body);
2883
2884 let local_var_req = local_var_req_builder.build()?;
2885 let local_var_resp = local_var_client.execute(local_var_req).await?;
2886
2887 let local_var_status = local_var_resp.status();
2888 let local_var_content = local_var_resp.text().await?;
2889
2890 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2891 crate::from_str_patched(&local_var_content).map_err(Error::from)
2892 } else {
2893 let local_var_entity: Option<RunWaitResultScriptByPathError> = crate::from_str_patched(&local_var_content).ok();
2894 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2895 Err(Error::ResponseError(local_var_error))
2896 }
2897}
2898
2899pub 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>) -> Result<serde_json::Value, Error<RunWaitResultScriptByPathGetError>> {
2900 let local_var_configuration = configuration;
2901
2902 let local_var_client = &local_var_configuration.client;
2903
2904 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));
2905 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2906
2907 if let Some(ref local_var_str) = parent_job {
2908 local_var_req_builder = local_var_req_builder.query(&[("parent_job", &local_var_str.to_string())]);
2909 }
2910 if let Some(ref local_var_str) = tag {
2911 local_var_req_builder = local_var_req_builder.query(&[("tag", &local_var_str.to_string())]);
2912 }
2913 if let Some(ref local_var_str) = cache_ttl {
2914 local_var_req_builder = local_var_req_builder.query(&[("cache_ttl", &local_var_str.to_string())]);
2915 }
2916 if let Some(ref local_var_str) = job_id {
2917 local_var_req_builder = local_var_req_builder.query(&[("job_id", &local_var_str.to_string())]);
2918 }
2919 if let Some(ref local_var_str) = include_header {
2920 local_var_req_builder = local_var_req_builder.query(&[("include_header", &local_var_str.to_string())]);
2921 }
2922 if let Some(ref local_var_str) = queue_limit {
2923 local_var_req_builder = local_var_req_builder.query(&[("queue_limit", &local_var_str.to_string())]);
2924 }
2925 if let Some(ref local_var_str) = payload {
2926 local_var_req_builder = local_var_req_builder.query(&[("payload", &local_var_str.to_string())]);
2927 }
2928 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2929 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2930 }
2931 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2932 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2933 };
2934
2935 let local_var_req = local_var_req_builder.build()?;
2936 let local_var_resp = local_var_client.execute(local_var_req).await?;
2937
2938 let local_var_status = local_var_resp.status();
2939 let local_var_content = local_var_resp.text().await?;
2940
2941 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2942 crate::from_str_patched(&local_var_content).map_err(Error::from)
2943 } else {
2944 let local_var_entity: Option<RunWaitResultScriptByPathGetError> = crate::from_str_patched(&local_var_content).ok();
2945 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2946 Err(Error::ResponseError(local_var_error))
2947 }
2948}
2949
2950pub async fn set_flow_user_state(configuration: &configuration::Configuration, workspace: &str, id: &str, key: &str, body: Option<serde_json::Value>) -> Result<String, Error<SetFlowUserStateError>> {
2951 let local_var_configuration = configuration;
2952
2953 let local_var_client = &local_var_configuration.client;
2954
2955 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));
2956 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2957
2958 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2959 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2960 }
2961 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
2962 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2963 };
2964 local_var_req_builder = local_var_req_builder.json(&body);
2965
2966 let local_var_req = local_var_req_builder.build()?;
2967 let local_var_resp = local_var_client.execute(local_var_req).await?;
2968
2969 let local_var_status = local_var_resp.status();
2970 let local_var_content = local_var_resp.text().await?;
2971
2972 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2973 crate::from_str_patched(&local_var_content).map_err(Error::from)
2974 } else {
2975 let local_var_entity: Option<SetFlowUserStateError> = crate::from_str_patched(&local_var_content).ok();
2976 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2977 Err(Error::ResponseError(local_var_error))
2978 }
2979}
2980