rocie_client/apis/
configuration.rs1#[derive(Debug, Clone)]
22pub struct Configuration {
23 pub base_path: String,
24 pub user_agent: Option<String>,
25 pub client: reqwest::Client,
26 pub basic_auth: Option<BasicAuth>,
27 pub oauth_access_token: Option<String>,
28 pub bearer_access_token: Option<String>,
29 pub api_key: Option<ApiKey>,
30}
31
32pub type BasicAuth = (String, Option<String>);
33
34#[derive(Debug, Clone)]
35pub struct ApiKey {
36 pub prefix: Option<String>,
37 pub key: String,
38}
39
40impl Configuration {
41 pub fn new() -> Configuration {
42 Configuration::default()
43 }
44}
45
46impl Default for Configuration {
47 fn default() -> Self {
48 let client = {
49 let builder = reqwest::Client::builder();
50
51 #[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))]
53 let builder = builder.cookie_store(true);
54
55 builder.build().expect("to be not missconfigured")
56 };
57
58 Configuration {
59 base_path: "http://localhost".to_owned(),
60 user_agent: Some("OpenAPI-Generator/0.1.0/rust".to_owned()),
61 client,
62 basic_auth: None,
63 oauth_access_token: None,
64 bearer_access_token: None,
65 api_key: None,
66 }
67 }
68}