use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum HttpStatusCode {
#[serde(rename = "Continue")]
Continue,
#[serde(rename = "SwitchingProtocols")]
SwitchingProtocols,
#[serde(rename = "Processing")]
Processing,
#[serde(rename = "EarlyHints")]
EarlyHints,
#[serde(rename = "OK")]
Ok,
#[serde(rename = "Created")]
Created,
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "NonAuthoritativeInformation")]
NonAuthoritativeInformation,
#[serde(rename = "NoContent")]
NoContent,
#[serde(rename = "ResetContent")]
ResetContent,
#[serde(rename = "PartialContent")]
PartialContent,
#[serde(rename = "MultiStatus")]
MultiStatus,
#[serde(rename = "AlreadyReported")]
AlreadyReported,
#[serde(rename = "IMUsed")]
ImUsed,
#[serde(rename = "MultipleChoices")]
MultipleChoices,
#[serde(rename = "MovedPermanently")]
MovedPermanently,
#[serde(rename = "Found")]
Found,
#[serde(rename = "SeeOther")]
SeeOther,
#[serde(rename = "NotModified")]
NotModified,
#[serde(rename = "UseProxy")]
UseProxy,
#[serde(rename = "Unused")]
Unused,
#[serde(rename = "TemporaryRedirect")]
TemporaryRedirect,
#[serde(rename = "PermanentRedirect")]
PermanentRedirect,
#[serde(rename = "BadRequest")]
BadRequest,
#[serde(rename = "Unauthorized")]
Unauthorized,
#[serde(rename = "PaymentRequired")]
PaymentRequired,
#[serde(rename = "Forbidden")]
Forbidden,
#[serde(rename = "NotFound")]
NotFound,
#[serde(rename = "MethodNotAllowed")]
MethodNotAllowed,
#[serde(rename = "NotAcceptable")]
NotAcceptable,
#[serde(rename = "ProxyAuthenticationRequired")]
ProxyAuthenticationRequired,
#[serde(rename = "RequestTimeout")]
RequestTimeout,
#[serde(rename = "Conflict")]
Conflict,
#[serde(rename = "Gone")]
Gone,
#[serde(rename = "LengthRequired")]
LengthRequired,
#[serde(rename = "PreconditionFailed")]
PreconditionFailed,
#[serde(rename = "RequestEntityTooLarge")]
RequestEntityTooLarge,
#[serde(rename = "RequestUriTooLong")]
RequestUriTooLong,
#[serde(rename = "UnsupportedMediaType")]
UnsupportedMediaType,
#[serde(rename = "RequestedRangeNotSatisfiable")]
RequestedRangeNotSatisfiable,
#[serde(rename = "ExpectationFailed")]
ExpectationFailed,
#[serde(rename = "MisdirectedRequest")]
MisdirectedRequest,
#[serde(rename = "UnprocessableEntity")]
UnprocessableEntity,
#[serde(rename = "Locked")]
Locked,
#[serde(rename = "FailedDependency")]
FailedDependency,
#[serde(rename = "UpgradeRequired")]
UpgradeRequired,
#[serde(rename = "PreconditionRequired")]
PreconditionRequired,
#[serde(rename = "TooManyRequests")]
TooManyRequests,
#[serde(rename = "RequestHeaderFieldsTooLarge")]
RequestHeaderFieldsTooLarge,
#[serde(rename = "UnavailableForLegalReasons")]
UnavailableForLegalReasons,
#[serde(rename = "InternalServerError")]
InternalServerError,
#[serde(rename = "NotImplemented")]
NotImplemented,
#[serde(rename = "BadGateway")]
BadGateway,
#[serde(rename = "ServiceUnavailable")]
ServiceUnavailable,
#[serde(rename = "GatewayTimeout")]
GatewayTimeout,
#[serde(rename = "HttpVersionNotSupported")]
HttpVersionNotSupported,
#[serde(rename = "VariantAlsoNegotiates")]
VariantAlsoNegotiates,
#[serde(rename = "InsufficientStorage")]
InsufficientStorage,
#[serde(rename = "LoopDetected")]
LoopDetected,
#[serde(rename = "NotExtended")]
NotExtended,
#[serde(rename = "NetworkAuthenticationRequired")]
NetworkAuthenticationRequired,
}
impl std::fmt::Display for HttpStatusCode {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Continue => write!(f, "Continue"),
Self::SwitchingProtocols => write!(f, "SwitchingProtocols"),
Self::Processing => write!(f, "Processing"),
Self::EarlyHints => write!(f, "EarlyHints"),
Self::Ok => write!(f, "OK"),
Self::Created => write!(f, "Created"),
Self::Accepted => write!(f, "Accepted"),
Self::NonAuthoritativeInformation => write!(f, "NonAuthoritativeInformation"),
Self::NoContent => write!(f, "NoContent"),
Self::ResetContent => write!(f, "ResetContent"),
Self::PartialContent => write!(f, "PartialContent"),
Self::MultiStatus => write!(f, "MultiStatus"),
Self::AlreadyReported => write!(f, "AlreadyReported"),
Self::ImUsed => write!(f, "IMUsed"),
Self::MultipleChoices => write!(f, "MultipleChoices"),
Self::MovedPermanently => write!(f, "MovedPermanently"),
Self::Found => write!(f, "Found"),
Self::SeeOther => write!(f, "SeeOther"),
Self::NotModified => write!(f, "NotModified"),
Self::UseProxy => write!(f, "UseProxy"),
Self::Unused => write!(f, "Unused"),
Self::TemporaryRedirect => write!(f, "TemporaryRedirect"),
Self::PermanentRedirect => write!(f, "PermanentRedirect"),
Self::BadRequest => write!(f, "BadRequest"),
Self::Unauthorized => write!(f, "Unauthorized"),
Self::PaymentRequired => write!(f, "PaymentRequired"),
Self::Forbidden => write!(f, "Forbidden"),
Self::NotFound => write!(f, "NotFound"),
Self::MethodNotAllowed => write!(f, "MethodNotAllowed"),
Self::NotAcceptable => write!(f, "NotAcceptable"),
Self::ProxyAuthenticationRequired => write!(f, "ProxyAuthenticationRequired"),
Self::RequestTimeout => write!(f, "RequestTimeout"),
Self::Conflict => write!(f, "Conflict"),
Self::Gone => write!(f, "Gone"),
Self::LengthRequired => write!(f, "LengthRequired"),
Self::PreconditionFailed => write!(f, "PreconditionFailed"),
Self::RequestEntityTooLarge => write!(f, "RequestEntityTooLarge"),
Self::RequestUriTooLong => write!(f, "RequestUriTooLong"),
Self::UnsupportedMediaType => write!(f, "UnsupportedMediaType"),
Self::RequestedRangeNotSatisfiable => write!(f, "RequestedRangeNotSatisfiable"),
Self::ExpectationFailed => write!(f, "ExpectationFailed"),
Self::MisdirectedRequest => write!(f, "MisdirectedRequest"),
Self::UnprocessableEntity => write!(f, "UnprocessableEntity"),
Self::Locked => write!(f, "Locked"),
Self::FailedDependency => write!(f, "FailedDependency"),
Self::UpgradeRequired => write!(f, "UpgradeRequired"),
Self::PreconditionRequired => write!(f, "PreconditionRequired"),
Self::TooManyRequests => write!(f, "TooManyRequests"),
Self::RequestHeaderFieldsTooLarge => write!(f, "RequestHeaderFieldsTooLarge"),
Self::UnavailableForLegalReasons => write!(f, "UnavailableForLegalReasons"),
Self::InternalServerError => write!(f, "InternalServerError"),
Self::NotImplemented => write!(f, "NotImplemented"),
Self::BadGateway => write!(f, "BadGateway"),
Self::ServiceUnavailable => write!(f, "ServiceUnavailable"),
Self::GatewayTimeout => write!(f, "GatewayTimeout"),
Self::HttpVersionNotSupported => write!(f, "HttpVersionNotSupported"),
Self::VariantAlsoNegotiates => write!(f, "VariantAlsoNegotiates"),
Self::InsufficientStorage => write!(f, "InsufficientStorage"),
Self::LoopDetected => write!(f, "LoopDetected"),
Self::NotExtended => write!(f, "NotExtended"),
Self::NetworkAuthenticationRequired => write!(f, "NetworkAuthenticationRequired"),
}
}
}
impl Default for HttpStatusCode {
fn default() -> HttpStatusCode {
Self::Continue
}
}