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