#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Region(pub String);

impl Region {
    pub fn new(name: impl Into<String>) -> Self {
        Region(name.into())
    }

    pub fn as_str(&self) -> &str {
        &self.0
    }
}

impl From<&str> for Region {
    fn from(s: &str) -> Self {
        Region(s.to_string())
    }
}

impl From<String> for Region {
    fn from(s: String) -> Self {
        Region(s)
    }
}

pub fn endpoint_host(service: &str, region: &Region) -> String {
    format!("{service}.{}.amazonaws.com", region.as_str())
}
