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