use std::collections::HashMap;
use std::time::Duration;
#[derive(Debug, Clone, Default)]
pub struct RequestConfig {
pub timeout: Option<Duration>,
pub headers: HashMap<String, String>,
pub bearer_token: Option<String>,
}
impl RequestConfig {
pub fn new() -> Self {
Self::default()
}
pub fn timeout(mut self, duration: Duration) -> Self {
self.timeout = Some(duration);
self
}
pub fn bearer_token(mut self, token: impl Into<String>) -> Self {
self.bearer_token = Some(token.into());
self
}
pub fn header(mut self, key: impl Into<String>, value: impl Into<String>) -> Self {
self.headers.insert(key.into(), value.into());
self
}
}