pub const NSID: &str = "app.bsky.contact.importContacts";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
pub contacts: Vec<String>,
pub token: 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 matches_and_contact_indexes: Vec<
crate::app::bsky::contact::defs::MatchAndContactIndex,
>,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
InvalidDid(Option<String>),
InvalidContacts(Option<String>),
TooManyContacts(Option<String>),
InvalidToken(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::InvalidDid(msg) => {
write!(_f, "InvalidDid")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InvalidContacts(msg) => {
write!(_f, "InvalidContacts")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::TooManyContacts(msg) => {
write!(_f, "TooManyContacts")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InvalidToken(msg) => {
write!(_f, "InvalidToken")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InternalError(msg) => {
write!(_f, "InternalError")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
}
Ok(())
}
}