nethsm_sdk_rs/apis/
configuration.rs

1/*
2 * NetHSM
3 *
4 * All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All [base64](https://tools.ietf.org/html/rfc4648#section-4) encoded values are Big Endian.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: Nitrokey <info@nitrokey.com>
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Debug, Clone)]
12pub struct Configuration {
13    pub base_path: String,
14    pub user_agent: Option<String>,
15    pub client: ureq::Agent,
16    pub basic_auth: Option<BasicAuth>,
17    pub oauth_access_token: Option<String>,
18    pub bearer_access_token: Option<String>,
19    pub api_key: Option<ApiKey>,
20}
21
22pub type BasicAuth = (String, Option<String>);
23
24#[derive(Debug, Clone)]
25pub struct ApiKey {
26    pub prefix: Option<String>,
27    pub key: String,
28}
29
30impl Configuration {
31    pub fn new() -> Configuration {
32        Configuration::default()
33    }
34}
35
36impl Default for Configuration {
37    fn default() -> Self {
38        Configuration {
39            base_path: "https://nethsmdemo.nitrokey.com/api/v1".to_owned(),
40            user_agent: Some("OpenAPI-Generator/v1/rust".to_owned()),
41            client: ureq::config::Config::builder()
42                .http_status_as_error(false)
43                .build()
44                .new_agent(),
45            basic_auth: None,
46            oauth_access_token: None,
47            bearer_access_token: None,
48            api_key: None,
49        }
50    }
51}