use derive_builder::Builder;
#[derive(Debug, Clone, Builder)]
#[builder(name = "BaseConfigBuilder", pattern = "owned", setter(strip_option))]
pub struct BaseConfig {
api_key: String,
base_url: String,
}
impl BaseConfig {
pub fn new(api_key: String, base_url: String) -> Self {
Self { api_key, base_url }
}
#[inline]
pub fn base_url(&self) -> &str {
&self.base_url
}
#[inline]
pub fn api_key(&self) -> &str {
&self.api_key
}
pub fn with_base_url(&mut self, base_url: impl Into<String>) -> &mut Self {
self.base_url = base_url.into();
self
}
pub fn with_api_key(&mut self, api_key: impl Into<String>) -> &mut Self {
self.api_key = api_key.into();
self
}
}