use thiserror::Error;
pub type Result<T> = std::result::Result<T, SmartIdClientError>;
#[derive(Error, Debug)]
#[non_exhaustive]
#[allow(dead_code)]
pub enum SmartIdClientError {
#[error("Configuration missing: {0}")]
ConfigMissingException(&'static str),
#[error("Serialization error: {0}")]
SerializationError(String),
#[error("Relying Party account configuration exception: {0}")]
RelyingPartyAccountConfigurationException(&'static str),
#[error("Smart ID client exception: {0}")]
SmartIdClientException(&'static str),
#[error("Smart ID API Exception: {0}")]
SmartIDAPIException(String),
#[error("Session timed out without getting any response from user")]
SessionTimeoutException,
#[error("There is no running session")]
NoSessionException,
#[error("Failed to get the running session")]
GetSessionException,
#[error("Failed to set the running session")]
SetSessionException,
#[error("Failed to get user identity")]
GetUserIdentityException,
#[error("Failed to set user identity")]
SetUserIdentityException,
#[error("Get signing certificate failed: {0}")]
GetSigningCertificateException(String),
#[error("Authentication session completed without result")]
AuthenticationSessionCompletedWithoutResult,
#[error("Session did not complete within timeout")]
StatusRequestLongPollingTimeoutException,
#[error("Session does not exist or has expired")]
SessionDoesNotExistOrHasExpired,
#[error("Api client is too old and is not supported anymore")]
ApiClientIsTooOldException,
#[error("System is under maintenance and is not available")]
SystemIsUnderMaintenanceException,
#[error("Session response missing certificate")]
SessionResponseMissingCertificate,
#[error("Session response missing signature")]
SessionResponseMissingSignature,
#[error("Session response missing interaction type")]
SessionResponseMissingInteractionType,
#[error("Session response signature verification failed: {0}")]
InvalidResponseSignature(String),
#[error("User has multiple accounts and pressed Cancel on device choice screen on any device")]
UserRefusedCertChoiceException,
#[error("User cancelled on confirmationMessage screen")]
UserRefusedConfirmationMessageException,
#[error("User cancelled on confirmationMessageAndVerificationCodeChoice screen")]
UserRefusedConfirmationMessageWithVerificationChoiceException,
#[error("User pressed Cancel on PIN screen")]
UserRefusedDisplayTextAndPinException,
#[error("User cancelled verificationCodeChoice screen")]
UserRefusedVerificationChoiceException,
#[error("User selected wrong verification code")]
UserSelectedWrongVerificationCodeException,
#[error("DOCUMENT_UNUSABLE. User must either check his/her Smart-ID mobile application or turn to customer support for getting the exact reason")]
DocumentUnusableException,
#[error("No suitable account of requested type found, but user has some other accounts")]
NoSuitableAccountOfRequestedTypeFoundException,
#[error("Person should view Smart-ID app or Smart-ID self-service portal now")]
PersonShouldViewSmartIdPortalException,
#[error("User app version does not support any of the allowedInteractionsOrder interactions")]
RequiredInteractionNotSupportedByAppException,
#[error("Interaction parameters are invalid: {0}")]
InvalidInteractionParametersException(&'static str),
#[error("Failed to generate device link: {0}")]
GenerateDeviceLinkException(&'static str),
#[error("Invalid signature protocol: {0}")]
InvalidSignatureProtocal(&'static str),
#[error("Failed to validate session response certificate: {0}")]
FailedToValidateSessionResponseCertificate(String),
#[error("Digest is not in valid format: {0}")]
InvalidDigestException(String),
#[error("User should view Smart-ID app or portal")]
UserShouldViewSmartIDAppOrPortalException,
#[error("Not found exception from Smart ID API")]
NotFoundException,
#[error("Bad request exception from Smart ID API")]
BadRequestException,
#[error("Smart ID client is outdated")]
ClientOutdatedException,
#[error("Invalid semantic identifier: {0}")]
InvalidSemanticIdentifierException(String),
#[error("Protocol failure exception")]
ProtocolFailureException,
#[error("Server error exception")]
ServerErrorException,
}