// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: com.atproto.moderation.defs
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

//! Generated bindings for the `com.atproto.moderation` Lexicon namespace/module.
pub mod create_report;

use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
/// Appeal a previously taken moderation action

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReasonAppeal;
impl core::fmt::Display for ReasonAppeal {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "reasonAppeal")
    }
}

/// Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReasonMisleading;
impl core::fmt::Display for ReasonMisleading {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "reasonMisleading")
    }
}

/// Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReasonOther;
impl core::fmt::Display for ReasonOther {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "reasonOther")
    }
}

/// Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReasonRude;
impl core::fmt::Display for ReasonRude {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "reasonRude")
    }
}

/// Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReasonSexual;
impl core::fmt::Display for ReasonSexual {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "reasonSexual")
    }
}

/// Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReasonSpam;
impl core::fmt::Display for ReasonSpam {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "reasonSpam")
    }
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReasonType<S: BosStr = DefaultStr> {
    ComAtprotoModerationDefsReasonSpam,
    ComAtprotoModerationDefsReasonViolation,
    ComAtprotoModerationDefsReasonMisleading,
    ComAtprotoModerationDefsReasonSexual,
    ComAtprotoModerationDefsReasonRude,
    ComAtprotoModerationDefsReasonOther,
    ComAtprotoModerationDefsReasonAppeal,
    ToolsOzoneReportDefsReasonAppeal,
    ToolsOzoneReportDefsReasonOther,
    ToolsOzoneReportDefsReasonViolenceAnimal,
    ToolsOzoneReportDefsReasonViolenceThreats,
    ToolsOzoneReportDefsReasonViolenceGraphicContent,
    ToolsOzoneReportDefsReasonViolenceGlorification,
    ToolsOzoneReportDefsReasonViolenceExtremistContent,
    ToolsOzoneReportDefsReasonViolenceTrafficking,
    ToolsOzoneReportDefsReasonViolenceOther,
    ToolsOzoneReportDefsReasonSexualAbuseContent,
    ToolsOzoneReportDefsReasonSexualNcii,
    ToolsOzoneReportDefsReasonSexualDeepfake,
    ToolsOzoneReportDefsReasonSexualAnimal,
    ToolsOzoneReportDefsReasonSexualUnlabeled,
    ToolsOzoneReportDefsReasonSexualOther,
    ToolsOzoneReportDefsReasonChildSafetyCsam,
    ToolsOzoneReportDefsReasonChildSafetyGroom,
    ToolsOzoneReportDefsReasonChildSafetyPrivacy,
    ToolsOzoneReportDefsReasonChildSafetyHarassment,
    ToolsOzoneReportDefsReasonChildSafetyOther,
    ToolsOzoneReportDefsReasonHarassmentTroll,
    ToolsOzoneReportDefsReasonHarassmentTargeted,
    ToolsOzoneReportDefsReasonHarassmentHateSpeech,
    ToolsOzoneReportDefsReasonHarassmentDoxxing,
    ToolsOzoneReportDefsReasonHarassmentOther,
    ToolsOzoneReportDefsReasonMisleadingBot,
    ToolsOzoneReportDefsReasonMisleadingImpersonation,
    ToolsOzoneReportDefsReasonMisleadingSpam,
    ToolsOzoneReportDefsReasonMisleadingScam,
    ToolsOzoneReportDefsReasonMisleadingElections,
    ToolsOzoneReportDefsReasonMisleadingOther,
    ToolsOzoneReportDefsReasonRuleSiteSecurity,
    ToolsOzoneReportDefsReasonRuleProhibitedSales,
    ToolsOzoneReportDefsReasonRuleBanEvasion,
    ToolsOzoneReportDefsReasonRuleOther,
    ToolsOzoneReportDefsReasonSelfHarmContent,
    ToolsOzoneReportDefsReasonSelfHarmEd,
    ToolsOzoneReportDefsReasonSelfHarmStunts,
    ToolsOzoneReportDefsReasonSelfHarmSubstances,
    ToolsOzoneReportDefsReasonSelfHarmOther,
    Other(S),
}

impl<S: BosStr> ReasonType<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::ComAtprotoModerationDefsReasonSpam => {
                "com.atproto.moderation.defs#reasonSpam"
            }
            Self::ComAtprotoModerationDefsReasonViolation => {
                "com.atproto.moderation.defs#reasonViolation"
            }
            Self::ComAtprotoModerationDefsReasonMisleading => {
                "com.atproto.moderation.defs#reasonMisleading"
            }
            Self::ComAtprotoModerationDefsReasonSexual => {
                "com.atproto.moderation.defs#reasonSexual"
            }
            Self::ComAtprotoModerationDefsReasonRude => {
                "com.atproto.moderation.defs#reasonRude"
            }
            Self::ComAtprotoModerationDefsReasonOther => {
                "com.atproto.moderation.defs#reasonOther"
            }
            Self::ComAtprotoModerationDefsReasonAppeal => {
                "com.atproto.moderation.defs#reasonAppeal"
            }
            Self::ToolsOzoneReportDefsReasonAppeal => {
                "tools.ozone.report.defs#reasonAppeal"
            }
            Self::ToolsOzoneReportDefsReasonOther => {
                "tools.ozone.report.defs#reasonOther"
            }
            Self::ToolsOzoneReportDefsReasonViolenceAnimal => {
                "tools.ozone.report.defs#reasonViolenceAnimal"
            }
            Self::ToolsOzoneReportDefsReasonViolenceThreats => {
                "tools.ozone.report.defs#reasonViolenceThreats"
            }
            Self::ToolsOzoneReportDefsReasonViolenceGraphicContent => {
                "tools.ozone.report.defs#reasonViolenceGraphicContent"
            }
            Self::ToolsOzoneReportDefsReasonViolenceGlorification => {
                "tools.ozone.report.defs#reasonViolenceGlorification"
            }
            Self::ToolsOzoneReportDefsReasonViolenceExtremistContent => {
                "tools.ozone.report.defs#reasonViolenceExtremistContent"
            }
            Self::ToolsOzoneReportDefsReasonViolenceTrafficking => {
                "tools.ozone.report.defs#reasonViolenceTrafficking"
            }
            Self::ToolsOzoneReportDefsReasonViolenceOther => {
                "tools.ozone.report.defs#reasonViolenceOther"
            }
            Self::ToolsOzoneReportDefsReasonSexualAbuseContent => {
                "tools.ozone.report.defs#reasonSexualAbuseContent"
            }
            Self::ToolsOzoneReportDefsReasonSexualNcii => {
                "tools.ozone.report.defs#reasonSexualNCII"
            }
            Self::ToolsOzoneReportDefsReasonSexualDeepfake => {
                "tools.ozone.report.defs#reasonSexualDeepfake"
            }
            Self::ToolsOzoneReportDefsReasonSexualAnimal => {
                "tools.ozone.report.defs#reasonSexualAnimal"
            }
            Self::ToolsOzoneReportDefsReasonSexualUnlabeled => {
                "tools.ozone.report.defs#reasonSexualUnlabeled"
            }
            Self::ToolsOzoneReportDefsReasonSexualOther => {
                "tools.ozone.report.defs#reasonSexualOther"
            }
            Self::ToolsOzoneReportDefsReasonChildSafetyCsam => {
                "tools.ozone.report.defs#reasonChildSafetyCSAM"
            }
            Self::ToolsOzoneReportDefsReasonChildSafetyGroom => {
                "tools.ozone.report.defs#reasonChildSafetyGroom"
            }
            Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy => {
                "tools.ozone.report.defs#reasonChildSafetyPrivacy"
            }
            Self::ToolsOzoneReportDefsReasonChildSafetyHarassment => {
                "tools.ozone.report.defs#reasonChildSafetyHarassment"
            }
            Self::ToolsOzoneReportDefsReasonChildSafetyOther => {
                "tools.ozone.report.defs#reasonChildSafetyOther"
            }
            Self::ToolsOzoneReportDefsReasonHarassmentTroll => {
                "tools.ozone.report.defs#reasonHarassmentTroll"
            }
            Self::ToolsOzoneReportDefsReasonHarassmentTargeted => {
                "tools.ozone.report.defs#reasonHarassmentTargeted"
            }
            Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech => {
                "tools.ozone.report.defs#reasonHarassmentHateSpeech"
            }
            Self::ToolsOzoneReportDefsReasonHarassmentDoxxing => {
                "tools.ozone.report.defs#reasonHarassmentDoxxing"
            }
            Self::ToolsOzoneReportDefsReasonHarassmentOther => {
                "tools.ozone.report.defs#reasonHarassmentOther"
            }
            Self::ToolsOzoneReportDefsReasonMisleadingBot => {
                "tools.ozone.report.defs#reasonMisleadingBot"
            }
            Self::ToolsOzoneReportDefsReasonMisleadingImpersonation => {
                "tools.ozone.report.defs#reasonMisleadingImpersonation"
            }
            Self::ToolsOzoneReportDefsReasonMisleadingSpam => {
                "tools.ozone.report.defs#reasonMisleadingSpam"
            }
            Self::ToolsOzoneReportDefsReasonMisleadingScam => {
                "tools.ozone.report.defs#reasonMisleadingScam"
            }
            Self::ToolsOzoneReportDefsReasonMisleadingElections => {
                "tools.ozone.report.defs#reasonMisleadingElections"
            }
            Self::ToolsOzoneReportDefsReasonMisleadingOther => {
                "tools.ozone.report.defs#reasonMisleadingOther"
            }
            Self::ToolsOzoneReportDefsReasonRuleSiteSecurity => {
                "tools.ozone.report.defs#reasonRuleSiteSecurity"
            }
            Self::ToolsOzoneReportDefsReasonRuleProhibitedSales => {
                "tools.ozone.report.defs#reasonRuleProhibitedSales"
            }
            Self::ToolsOzoneReportDefsReasonRuleBanEvasion => {
                "tools.ozone.report.defs#reasonRuleBanEvasion"
            }
            Self::ToolsOzoneReportDefsReasonRuleOther => {
                "tools.ozone.report.defs#reasonRuleOther"
            }
            Self::ToolsOzoneReportDefsReasonSelfHarmContent => {
                "tools.ozone.report.defs#reasonSelfHarmContent"
            }
            Self::ToolsOzoneReportDefsReasonSelfHarmEd => {
                "tools.ozone.report.defs#reasonSelfHarmED"
            }
            Self::ToolsOzoneReportDefsReasonSelfHarmStunts => {
                "tools.ozone.report.defs#reasonSelfHarmStunts"
            }
            Self::ToolsOzoneReportDefsReasonSelfHarmSubstances => {
                "tools.ozone.report.defs#reasonSelfHarmSubstances"
            }
            Self::ToolsOzoneReportDefsReasonSelfHarmOther => {
                "tools.ozone.report.defs#reasonSelfHarmOther"
            }
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "com.atproto.moderation.defs#reasonSpam" => {
                Self::ComAtprotoModerationDefsReasonSpam
            }
            "com.atproto.moderation.defs#reasonViolation" => {
                Self::ComAtprotoModerationDefsReasonViolation
            }
            "com.atproto.moderation.defs#reasonMisleading" => {
                Self::ComAtprotoModerationDefsReasonMisleading
            }
            "com.atproto.moderation.defs#reasonSexual" => {
                Self::ComAtprotoModerationDefsReasonSexual
            }
            "com.atproto.moderation.defs#reasonRude" => {
                Self::ComAtprotoModerationDefsReasonRude
            }
            "com.atproto.moderation.defs#reasonOther" => {
                Self::ComAtprotoModerationDefsReasonOther
            }
            "com.atproto.moderation.defs#reasonAppeal" => {
                Self::ComAtprotoModerationDefsReasonAppeal
            }
            "tools.ozone.report.defs#reasonAppeal" => {
                Self::ToolsOzoneReportDefsReasonAppeal
            }
            "tools.ozone.report.defs#reasonOther" => {
                Self::ToolsOzoneReportDefsReasonOther
            }
            "tools.ozone.report.defs#reasonViolenceAnimal" => {
                Self::ToolsOzoneReportDefsReasonViolenceAnimal
            }
            "tools.ozone.report.defs#reasonViolenceThreats" => {
                Self::ToolsOzoneReportDefsReasonViolenceThreats
            }
            "tools.ozone.report.defs#reasonViolenceGraphicContent" => {
                Self::ToolsOzoneReportDefsReasonViolenceGraphicContent
            }
            "tools.ozone.report.defs#reasonViolenceGlorification" => {
                Self::ToolsOzoneReportDefsReasonViolenceGlorification
            }
            "tools.ozone.report.defs#reasonViolenceExtremistContent" => {
                Self::ToolsOzoneReportDefsReasonViolenceExtremistContent
            }
            "tools.ozone.report.defs#reasonViolenceTrafficking" => {
                Self::ToolsOzoneReportDefsReasonViolenceTrafficking
            }
            "tools.ozone.report.defs#reasonViolenceOther" => {
                Self::ToolsOzoneReportDefsReasonViolenceOther
            }
            "tools.ozone.report.defs#reasonSexualAbuseContent" => {
                Self::ToolsOzoneReportDefsReasonSexualAbuseContent
            }
            "tools.ozone.report.defs#reasonSexualNCII" => {
                Self::ToolsOzoneReportDefsReasonSexualNcii
            }
            "tools.ozone.report.defs#reasonSexualDeepfake" => {
                Self::ToolsOzoneReportDefsReasonSexualDeepfake
            }
            "tools.ozone.report.defs#reasonSexualAnimal" => {
                Self::ToolsOzoneReportDefsReasonSexualAnimal
            }
            "tools.ozone.report.defs#reasonSexualUnlabeled" => {
                Self::ToolsOzoneReportDefsReasonSexualUnlabeled
            }
            "tools.ozone.report.defs#reasonSexualOther" => {
                Self::ToolsOzoneReportDefsReasonSexualOther
            }
            "tools.ozone.report.defs#reasonChildSafetyCSAM" => {
                Self::ToolsOzoneReportDefsReasonChildSafetyCsam
            }
            "tools.ozone.report.defs#reasonChildSafetyGroom" => {
                Self::ToolsOzoneReportDefsReasonChildSafetyGroom
            }
            "tools.ozone.report.defs#reasonChildSafetyPrivacy" => {
                Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy
            }
            "tools.ozone.report.defs#reasonChildSafetyHarassment" => {
                Self::ToolsOzoneReportDefsReasonChildSafetyHarassment
            }
            "tools.ozone.report.defs#reasonChildSafetyOther" => {
                Self::ToolsOzoneReportDefsReasonChildSafetyOther
            }
            "tools.ozone.report.defs#reasonHarassmentTroll" => {
                Self::ToolsOzoneReportDefsReasonHarassmentTroll
            }
            "tools.ozone.report.defs#reasonHarassmentTargeted" => {
                Self::ToolsOzoneReportDefsReasonHarassmentTargeted
            }
            "tools.ozone.report.defs#reasonHarassmentHateSpeech" => {
                Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech
            }
            "tools.ozone.report.defs#reasonHarassmentDoxxing" => {
                Self::ToolsOzoneReportDefsReasonHarassmentDoxxing
            }
            "tools.ozone.report.defs#reasonHarassmentOther" => {
                Self::ToolsOzoneReportDefsReasonHarassmentOther
            }
            "tools.ozone.report.defs#reasonMisleadingBot" => {
                Self::ToolsOzoneReportDefsReasonMisleadingBot
            }
            "tools.ozone.report.defs#reasonMisleadingImpersonation" => {
                Self::ToolsOzoneReportDefsReasonMisleadingImpersonation
            }
            "tools.ozone.report.defs#reasonMisleadingSpam" => {
                Self::ToolsOzoneReportDefsReasonMisleadingSpam
            }
            "tools.ozone.report.defs#reasonMisleadingScam" => {
                Self::ToolsOzoneReportDefsReasonMisleadingScam
            }
            "tools.ozone.report.defs#reasonMisleadingElections" => {
                Self::ToolsOzoneReportDefsReasonMisleadingElections
            }
            "tools.ozone.report.defs#reasonMisleadingOther" => {
                Self::ToolsOzoneReportDefsReasonMisleadingOther
            }
            "tools.ozone.report.defs#reasonRuleSiteSecurity" => {
                Self::ToolsOzoneReportDefsReasonRuleSiteSecurity
            }
            "tools.ozone.report.defs#reasonRuleProhibitedSales" => {
                Self::ToolsOzoneReportDefsReasonRuleProhibitedSales
            }
            "tools.ozone.report.defs#reasonRuleBanEvasion" => {
                Self::ToolsOzoneReportDefsReasonRuleBanEvasion
            }
            "tools.ozone.report.defs#reasonRuleOther" => {
                Self::ToolsOzoneReportDefsReasonRuleOther
            }
            "tools.ozone.report.defs#reasonSelfHarmContent" => {
                Self::ToolsOzoneReportDefsReasonSelfHarmContent
            }
            "tools.ozone.report.defs#reasonSelfHarmED" => {
                Self::ToolsOzoneReportDefsReasonSelfHarmEd
            }
            "tools.ozone.report.defs#reasonSelfHarmStunts" => {
                Self::ToolsOzoneReportDefsReasonSelfHarmStunts
            }
            "tools.ozone.report.defs#reasonSelfHarmSubstances" => {
                Self::ToolsOzoneReportDefsReasonSelfHarmSubstances
            }
            "tools.ozone.report.defs#reasonSelfHarmOther" => {
                Self::ToolsOzoneReportDefsReasonSelfHarmOther
            }
            _ => Self::Other(s),
        }
    }
}

impl<S: BosStr> AsRef<str> for ReasonType<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<S: BosStr> core::fmt::Display for ReasonType<S> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<S: BosStr> Serialize for ReasonType<S> {
    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
    where
        Ser: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ReasonType<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for ReasonType<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = ReasonType<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            ReasonType::ComAtprotoModerationDefsReasonSpam => {
                ReasonType::ComAtprotoModerationDefsReasonSpam
            }
            ReasonType::ComAtprotoModerationDefsReasonViolation => {
                ReasonType::ComAtprotoModerationDefsReasonViolation
            }
            ReasonType::ComAtprotoModerationDefsReasonMisleading => {
                ReasonType::ComAtprotoModerationDefsReasonMisleading
            }
            ReasonType::ComAtprotoModerationDefsReasonSexual => {
                ReasonType::ComAtprotoModerationDefsReasonSexual
            }
            ReasonType::ComAtprotoModerationDefsReasonRude => {
                ReasonType::ComAtprotoModerationDefsReasonRude
            }
            ReasonType::ComAtprotoModerationDefsReasonOther => {
                ReasonType::ComAtprotoModerationDefsReasonOther
            }
            ReasonType::ComAtprotoModerationDefsReasonAppeal => {
                ReasonType::ComAtprotoModerationDefsReasonAppeal
            }
            ReasonType::ToolsOzoneReportDefsReasonAppeal => {
                ReasonType::ToolsOzoneReportDefsReasonAppeal
            }
            ReasonType::ToolsOzoneReportDefsReasonOther => {
                ReasonType::ToolsOzoneReportDefsReasonOther
            }
            ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal => {
                ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal
            }
            ReasonType::ToolsOzoneReportDefsReasonViolenceThreats => {
                ReasonType::ToolsOzoneReportDefsReasonViolenceThreats
            }
            ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent => {
                ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent
            }
            ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification => {
                ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification
            }
            ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent => {
                ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent
            }
            ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking => {
                ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking
            }
            ReasonType::ToolsOzoneReportDefsReasonViolenceOther => {
                ReasonType::ToolsOzoneReportDefsReasonViolenceOther
            }
            ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent => {
                ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent
            }
            ReasonType::ToolsOzoneReportDefsReasonSexualNcii => {
                ReasonType::ToolsOzoneReportDefsReasonSexualNcii
            }
            ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake => {
                ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake
            }
            ReasonType::ToolsOzoneReportDefsReasonSexualAnimal => {
                ReasonType::ToolsOzoneReportDefsReasonSexualAnimal
            }
            ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled => {
                ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled
            }
            ReasonType::ToolsOzoneReportDefsReasonSexualOther => {
                ReasonType::ToolsOzoneReportDefsReasonSexualOther
            }
            ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam => {
                ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam
            }
            ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom => {
                ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom
            }
            ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy => {
                ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy
            }
            ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment => {
                ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment
            }
            ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther => {
                ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther
            }
            ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll => {
                ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll
            }
            ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted => {
                ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted
            }
            ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech => {
                ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech
            }
            ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing => {
                ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing
            }
            ReasonType::ToolsOzoneReportDefsReasonHarassmentOther => {
                ReasonType::ToolsOzoneReportDefsReasonHarassmentOther
            }
            ReasonType::ToolsOzoneReportDefsReasonMisleadingBot => {
                ReasonType::ToolsOzoneReportDefsReasonMisleadingBot
            }
            ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation => {
                ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation
            }
            ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam => {
                ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam
            }
            ReasonType::ToolsOzoneReportDefsReasonMisleadingScam => {
                ReasonType::ToolsOzoneReportDefsReasonMisleadingScam
            }
            ReasonType::ToolsOzoneReportDefsReasonMisleadingElections => {
                ReasonType::ToolsOzoneReportDefsReasonMisleadingElections
            }
            ReasonType::ToolsOzoneReportDefsReasonMisleadingOther => {
                ReasonType::ToolsOzoneReportDefsReasonMisleadingOther
            }
            ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity => {
                ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity
            }
            ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales => {
                ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales
            }
            ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion => {
                ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion
            }
            ReasonType::ToolsOzoneReportDefsReasonRuleOther => {
                ReasonType::ToolsOzoneReportDefsReasonRuleOther
            }
            ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent => {
                ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent
            }
            ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd => {
                ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd
            }
            ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts => {
                ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts
            }
            ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances => {
                ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances
            }
            ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther => {
                ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther
            }
            ReasonType::Other(v) => ReasonType::Other(v.into_static()),
        }
    }
}

/// Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct ReasonViolation;
impl core::fmt::Display for ReasonViolation {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "reasonViolation")
    }
}

/// Tag describing a type of subject that might be reported.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SubjectType<S: BosStr = DefaultStr> {
    Account,
    Record,
    Chat,
    Other(S),
}

impl<S: BosStr> SubjectType<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Account => "account",
            Self::Record => "record",
            Self::Chat => "chat",
            Self::Other(s) => s.as_ref(),
        }
    }
    /// Construct from a string-like value, matching known values.
    pub fn from_value(s: S) -> Self {
        match s.as_ref() {
            "account" => Self::Account,
            "record" => Self::Record,
            "chat" => Self::Chat,
            _ => Self::Other(s),
        }
    }
}

impl<S: BosStr> AsRef<str> for SubjectType<S> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<S: BosStr> core::fmt::Display for SubjectType<S> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<S: BosStr> Serialize for SubjectType<S> {
    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
    where
        Ser: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for SubjectType<S> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = S::deserialize(deserializer)?;
        Ok(Self::from_value(s))
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for SubjectType<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = SubjectType<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            SubjectType::Account => SubjectType::Account,
            SubjectType::Record => SubjectType::Record,
            SubjectType::Chat => SubjectType::Chat,
            SubjectType::Other(v) => SubjectType::Other(v.into_static()),
        }
    }
}