gitea_client/apis/
configuration.rs

1/*
2 * Gitea API
3 *
4 * This documentation describes the Gitea API.
5 *
6 * The version of the OpenAPI document: 1.22.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13#[derive(Debug, Clone)]
14pub struct Configuration {
15    pub base_path: String,
16    pub user_agent: Option<String>,
17    pub client: reqwest::Client,
18    pub basic_auth: Option<BasicAuth>,
19    pub oauth_access_token: Option<String>,
20    pub bearer_access_token: Option<String>,
21    pub api_key: Option<ApiKey>,
22    // TODO: take an oauth2 token source, similar to the go one
23}
24
25pub type BasicAuth = (String, Option<String>);
26
27#[derive(Debug, Clone)]
28pub struct ApiKey {
29    pub prefix: Option<String>,
30    pub key: String,
31}
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: "/api/v1".to_owned(),
44            user_agent: Some("OpenAPI-Generator/1.22.1/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    }
53}