agentcat_api/apis/
configuration.rs1pub use reqwest::Client;
13
14#[derive(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}
24
25pub type BasicAuth = (String, Option<String>);
26
27#[derive(Clone)]
28pub struct ApiKey {
29 pub prefix: Option<String>,
30 pub key: String,
31}
32
33impl std::fmt::Debug for ApiKey {
34 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35 f.debug_struct("ApiKey")
36 .field("prefix", &self.prefix)
37 .field("key", &"[REDACTED]")
38 .finish()
39 }
40}
41
42
43impl std::fmt::Debug for Configuration {
44 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
45 let mut debug = f.debug_struct("Configuration");
46 debug
47 .field("base_path", &self.base_path)
48 .field("user_agent", &self.user_agent)
49 .field("client", &self.client);
50 debug
51 .field("basic_auth", &self.basic_auth.as_ref().map(|(username, password)| (username, password.as_ref().map(|_| "[REDACTED]"))))
52 .field("oauth_access_token", &self.oauth_access_token.as_ref().map(|_| "[REDACTED]"))
53 .field("bearer_access_token", &self.bearer_access_token.as_ref().map(|_| "[REDACTED]"))
54 .field("api_key", &self.api_key);
55 debug.finish()
56 }
57}
58
59impl Configuration {
60 pub fn new() -> Configuration {
61 Configuration::default()
62 }
63}
64
65impl Default for Configuration {
66 fn default() -> Self {
67 Configuration {
68 base_path: "https://api.agentcat.com".to_owned(),
69 user_agent: Some("OpenAPI-Generator/v1/rust".to_owned()),
70 client: reqwest::Client::new(),
71 basic_auth: None,
72 oauth_access_token: None,
73 bearer_access_token: None,
74 api_key: None,
75 }
76 }
77}