space_traders/apis/configuration.rs
1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5/// Configuration for accessing endpoints.
6#[derive(Debug, Clone)]
7pub struct Configuration {
8 /// The base path of the server.
9 ///
10 /// This is prepended to the request path.
11 pub base_path: String,
12
13 /// The user agent string to use.
14 pub user_agent: Option<String>,
15
16 /// Client to use for the request.
17 pub client: reqwest::Client,
18
19 /// Basic http auth data.
20 pub basic_auth: Option<BasicAuth>,
21
22 /// OAuth access token.
23 ///
24 /// This is set as a bearer token.
25 pub oauth_access_token: Option<String>,
26
27 /// Bearer token.
28 pub bearer_access_token: Option<String>,
29
30 /// API key to send.
31 pub api_key: Option<ApiKey>,
32}
33
34/// Basic http auth.
35///
36/// This is of the form `(username, password)`.
37pub type BasicAuth = (String, Option<String>);
38
39/// An API key.
40#[derive(Debug, Clone)]
41pub struct ApiKey {
42 /// Prefix to apply to the query.
43 pub prefix: Option<String>,
44
45 /// The key value.
46 pub key: String,
47}
48
49impl Configuration {
50 /// Create default configuration.
51 ///
52 /// The base path is set to `https://api.spacetraders.io/v2` by default.
53 /// The user agent is set to `openapi-rust/2.0.0` by default.
54 pub fn new() -> Configuration {
55 Configuration::default()
56 }
57}
58
59impl Default for Configuration {
60 fn default() -> Self {
61 Configuration {
62 base_path: "https://api.spacetraders.io/v2".to_owned(),
63 user_agent: Some("openapi-rust/2.0.0".to_owned()),
64 client: reqwest::Client::new(),
65 basic_auth: None,
66 oauth_access_token: None,
67 bearer_access_token: None,
68 api_key: None,
69 }
70 }
71}