use thiserror::Error;
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum Mip05Error {
#[error("invalid notification platform")]
InvalidNotificationPlatform,
#[error("invalid device token length")]
InvalidDeviceTokenLength,
#[error("invalid MIP-05 token padding length")]
InvalidTokenPaddingLength,
#[error("device token is too large")]
DeviceTokenTooLarge,
#[error("invalid MIP-05 token plaintext length")]
InvalidTokenPlaintextLength,
#[error("invalid MIP-05 token length")]
InvalidTokenLength,
#[error("invalid encrypted token length")]
InvalidEncryptedTokenLength,
#[error("invalid encrypted token base64")]
InvalidEncryptedTokenBase64,
#[error("invalid encrypted token public key")]
InvalidEncryptedTokenPublicKey,
#[error("invalid encrypted token nonce")]
InvalidEncryptedTokenNonce,
#[error("failed to derive MIP-05 encryption key")]
KeyDerivationFailed,
#[error("failed to encrypt push token")]
EncryptionFailed,
#[error("failed to decrypt encrypted token")]
DecryptionFailed,
#[error("invalid encrypted token ciphertext length")]
InvalidCiphertextLength,
#[error("unsupported MIP-05 rumor kind")]
UnexpectedRumorKind,
#[error("MIP-05 rumors must have empty content")]
NonEmptyContent,
#[error("token request must include at least one token")]
TokenRequestMustIncludeToken,
#[error("token request contains unsupported tags")]
UnsupportedTokenRequestTags,
#[error("token list response must include at least one token")]
TokenListResponseMustIncludeToken,
#[error("token list response must contain exactly one event reference")]
TokenListResponseMustContainSingleEventReference,
#[error("token list response contains unsupported tags")]
UnsupportedTokenListResponseTags,
#[error("token removal rumors must not contain tags")]
TokenRemovalMustNotContainTags,
#[error("invalid token tag shape")]
InvalidTokenTagShape,
#[error("invalid notification server public key")]
InvalidNotificationServerPublicKey,
#[error("invalid notification relay hint")]
InvalidNotificationRelayHint,
#[error("invalid MIP-05 leaf index")]
InvalidLeafIndex,
#[error("duplicate MIP-05 leaf index")]
DuplicateLeafIndex,
#[error("missing event reference")]
MissingEventReference,
#[error("invalid event reference")]
InvalidEventReference,
#[error("notification request must include at least one token")]
NotificationRequestMustIncludeToken,
#[error("invalid notification request base64 content")]
InvalidNotificationRequestBase64,
#[error("invalid notification request content length")]
InvalidNotificationRequestContentLength,
#[error("missing notification request version tag")]
MissingNotificationRequestVersionTag,
#[error("invalid notification request version tag")]
InvalidNotificationRequestVersionTag,
#[error("duplicate notification request version tag")]
DuplicateNotificationRequestVersionTag,
#[error("missing notification request encoding tag")]
MissingNotificationRequestEncodingTag,
#[error("invalid notification request encoding tag")]
InvalidNotificationRequestEncodingTag,
#[error("duplicate notification request encoding tag")]
DuplicateNotificationRequestEncodingTag,
#[error("notification request contains unsupported tags")]
UnsupportedNotificationRequestTags,
#[error("duplicate encrypted token in notification request batch")]
DuplicateEncryptedToken,
#[error("failed to encrypt notification request")]
NotificationRequestEncryptionFailed,
#[error("failed to sign notification request seal")]
NotificationRequestSealFailed,
#[error("failed to build notification request gift wrap")]
NotificationRequestGiftWrapFailed,
}