nomad_client/apis/
configuration.rs

1/*
2 * Nomad
3 *
4 * Nomad OpenApi specification
5 *
6 * The version of the OpenAPI document: 0.11.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14#[derive(Debug, Clone)]
15pub struct Configuration {
16    pub base_path: String,
17    pub user_agent: Option<String>,
18    pub client: reqwest::Client,
19    pub basic_auth: Option<BasicAuth>,
20    pub oauth_access_token: Option<String>,
21    pub bearer_access_token: Option<String>,
22    pub api_key: Option<ApiKey>,
23    // TODO: take an oauth2 token source, similar to the go one
24}
25
26pub type BasicAuth = (String, Option<String>);
27
28#[derive(Debug, Clone)]
29pub struct ApiKey {
30    pub prefix: Option<String>,
31    pub key: String,
32}
33
34impl Configuration {
35    pub fn new() -> Configuration {
36        Configuration::default()
37    }
38}
39
40impl Default for Configuration {
41    fn default() -> Self {
42        Configuration {
43            base_path: "http://localhost:4646/v1".to_owned(),
44            user_agent: Some("OpenAPI-Generator/0.11.0/rust".to_owned()),
45            client: reqwest::Client::new(),
46            basic_auth: None,
47            oauth_access_token: None,
48            bearer_access_token: None,
49            api_key: None,
50        }
51    }
52}