include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
impl Client {
pub fn new_authenticated(base_url: &str, token: &str, timeout: std::time::Duration) -> Self {
let mut headers = reqwest::header::HeaderMap::new();
headers.insert(
reqwest::header::AUTHORIZATION,
reqwest::header::HeaderValue::from_str(&format!("Bearer {}", token))
.expect("Invalid authorization token"),
);
let http_client = reqwest::Client::builder()
.default_headers(headers)
.timeout(timeout)
.build()
.expect("Failed to build HTTP client");
Self::new_with_client(base_url, http_client)
}
}