2026-01-08 09:10:00 +02:00
|
|
|
use anyhow::Result;
|
|
|
|
|
use common_http_client::CommonHttpClient;
|
2026-01-08 09:10:45 +02:00
|
|
|
pub use common_http_client::{BasicAuthCredentials, Error};
|
2026-01-08 09:10:00 +02:00
|
|
|
use reqwest::Client;
|
2026-01-07 16:29:37 +02:00
|
|
|
|
2026-01-08 09:10:00 +02:00
|
|
|
// Simple wrapper
|
|
|
|
|
// maybe extend in the future for our purposes
|
|
|
|
|
pub struct BedrockClient(pub CommonHttpClient);
|
2026-01-07 16:29:37 +02:00
|
|
|
|
2026-01-08 09:10:00 +02:00
|
|
|
impl BedrockClient {
|
|
|
|
|
pub fn new(auth: Option<BasicAuthCredentials>) -> Result<Self> {
|
|
|
|
|
let client = Client::builder()
|
|
|
|
|
//Add more fiedls if needed
|
|
|
|
|
.timeout(std::time::Duration::from_secs(60))
|
|
|
|
|
.build()?;
|
2026-01-07 16:29:37 +02:00
|
|
|
|
2026-01-08 09:10:45 +02:00
|
|
|
Ok(BedrockClient(CommonHttpClient::new_with_client(
|
|
|
|
|
client, auth,
|
|
|
|
|
)))
|
2026-01-07 16:29:37 +02:00
|
|
|
}
|
|
|
|
|
}
|