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