meteroid-rs 0.31.4

Official Rust SDK for Meteroid, the open-source billing platform: subscriptions, invoicing, usage-based billing and webhooks.
Documentation
// this file is @generated

#[derive(
    Clone,
    Debug,
    Default,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    serde::Deserialize,
    serde::Serialize,
)]
#[serde(transparent)]
pub struct EntitlementId(String);

impl EntitlementId {
    /// The value, as sent on the wire.
    #[must_use]
    pub fn as_str(&self) -> &str {
        &self.0
    }

    /// The value as a `String`.
    #[must_use]
    pub fn into_string(self) -> String {
        self.0
    }
}

impl std::ops::Deref for EntitlementId {
    type Target = str;

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

impl AsRef<str> for EntitlementId {
    fn as_ref(&self) -> &str {
        &self.0
    }
}

impl std::borrow::Borrow<str> for EntitlementId {
    fn borrow(&self) -> &str {
        &self.0
    }
}

impl std::fmt::Display for EntitlementId {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(&self.0)
    }
}

impl From<String> for EntitlementId {
    fn from(value: String) -> Self {
        Self(value)
    }
}

impl From<&str> for EntitlementId {
    fn from(value: &str) -> Self {
        Self(value.to_owned())
    }
}

impl From<&String> for EntitlementId {
    fn from(value: &String) -> Self {
        Self(value.clone())
    }
}

impl From<&EntitlementId> for EntitlementId {
    fn from(value: &EntitlementId) -> Self {
        value.clone()
    }
}

impl From<EntitlementId> for String {
    fn from(value: EntitlementId) -> Self {
        value.0
    }
}

impl PartialEq<str> for EntitlementId {
    fn eq(&self, other: &str) -> bool {
        self.0 == other
    }
}

impl PartialEq<&str> for EntitlementId {
    fn eq(&self, other: &&str) -> bool {
        self.0 == *other
    }
}

impl PartialEq<String> for EntitlementId {
    fn eq(&self, other: &String) -> bool {
        &self.0 == other
    }
}

impl crate::request::QueryParamValue for EntitlementId {
    fn encode(&self) -> String {
        self.0.clone()
    }
}