pub const NSID: &str = "app.bsky.contact.verifyPhone";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
pub code: String,
pub phone: String,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
pub token: String,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
RateLimitExceeded(Option<String>),
InvalidDid(Option<String>),
InvalidPhone(Option<String>),
InvalidCode(Option<String>),
InternalError(Option<String>),
}
impl std::fmt::Display for Error {
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Error::RateLimitExceeded(msg) => {
write!(_f, "RateLimitExceeded")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InvalidDid(msg) => {
write!(_f, "InvalidDid")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InvalidPhone(msg) => {
write!(_f, "InvalidPhone")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InvalidCode(msg) => {
write!(_f, "InvalidCode")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InternalError(msg) => {
write!(_f, "InternalError")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
}
Ok(())
}
}