camunda_client/apis/
engine_api.rs

1/*
2 * Camunda BPM REST API
3 *
4 * OpenApi Spec for Camunda BPM REST API.
5 *
6 * The version of the OpenAPI document: 7.13.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use std::rc::Rc;
12use std::borrow::Borrow;
13#[allow(unused_imports)]
14use std::option::Option;
15
16use reqwest;
17
18use super::{Error, configuration};
19
20pub struct EngineApiClient {
21    configuration: Rc<configuration::Configuration>,
22}
23
24impl EngineApiClient {
25    pub fn new(configuration: Rc<configuration::Configuration>) -> EngineApiClient {
26        EngineApiClient {
27            configuration,
28        }
29    }
30}
31
32pub trait EngineApi {
33    fn get_process_engine_names(&self, ) -> Result<Vec<crate::models::ProcessEngineDto>, Error>;
34}
35
36impl EngineApi for EngineApiClient {
37    fn get_process_engine_names(&self, ) -> Result<Vec<crate::models::ProcessEngineDto>, Error> {
38        let configuration: &configuration::Configuration = self.configuration.borrow();
39        let client = &configuration.client;
40
41        let uri_str = format!("{}/engine", configuration.base_path);
42        let mut req_builder = client.get(uri_str.as_str());
43
44        if let Some(ref user_agent) = configuration.user_agent {
45            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
46        }
47
48        // send request
49        let req = req_builder.build()?;
50
51        Ok(client.execute(req)?.error_for_status()?.json()?)
52    }
53
54}