// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: network.slices.tools.bug
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

//! Generated bindings for the `network.slices.tools.bug` Lexicon namespace/module.
pub mod comment;
pub mod issue;
pub mod response;


#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::network_slices::tools::Images;
use crate::network_slices::tools::richtext::facet::Facet;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
    rename_all = "camelCase",
    rename = "network.slices.tools.bug",
    tag = "$type",
    bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Bug<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub app_used: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub attachments: Option<Images<S>>,
    pub created_at: Datetime,
    pub description: S,
    ///Annotations of description (mentions and links)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description_facets: Option<Vec<Facet<S>>>,
    ///Target namespace like 'social.grain' or 'app.bsky'
    pub namespace: S,
    pub severity: BugSeverity<S>,
    pub steps_to_reproduce: S,
    ///Annotations of steps to reproduce (mentions and links)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub steps_to_reproduce_facets: Option<Vec<Facet<S>>>,
    pub title: S,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BugSeverity<S: BosStr = DefaultStr> {
    Cosmetic,
    Annoying,
    Broken,
    Unusable,
    Other(S),
}

impl<S: BosStr> BugSeverity<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Cosmetic => "cosmetic",
            Self::Annoying => "annoying",
            Self::Broken => "broken",
            Self::Unusable => "unusable",
            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() {
            "cosmetic" => Self::Cosmetic,
            "annoying" => Self::Annoying,
            "broken" => Self::Broken,
            "unusable" => Self::Unusable,
            _ => Self::Other(s),
        }
    }
}

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

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

impl<S: BosStr> Serialize for BugSeverity<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 BugSeverity<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 + Default> Default for BugSeverity<S> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl<S: BosStr> jacquard_common::IntoStatic for BugSeverity<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = BugSeverity<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            BugSeverity::Cosmetic => BugSeverity::Cosmetic,
            BugSeverity::Annoying => BugSeverity::Annoying,
            BugSeverity::Broken => BugSeverity::Broken,
            BugSeverity::Unusable => BugSeverity::Unusable,
            BugSeverity::Other(v) => BugSeverity::Other(v.into_static()),
        }
    }
}

/// Typed wrapper for GetRecord response with this collection's record type.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct BugGetRecordOutput<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<Cid<S>>,
    pub uri: AtUri<S>,
    pub value: Bug<S>,
}

impl<S: BosStr> Bug<S> {
    pub fn uri(uri: S) -> Result<RecordUri<S, BugRecord>, UriError> {
        RecordUri::try_from_uri(AtUri::new(uri)?)
    }
}

/// Marker type for deserializing records from this collection.

#[derive(Debug, Serialize, Deserialize)]
pub struct BugRecord;
impl XrpcResp for BugRecord {
    const NSID: &'static str = "network.slices.tools.bug";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = BugGetRecordOutput<S>;
    type Err = RecordError;
}

impl<S: BosStr> From<BugGetRecordOutput<S>> for Bug<S> {
    fn from(output: BugGetRecordOutput<S>) -> Self {
        output.value
    }
}

impl<S: BosStr> Collection for Bug<S> {
    const NSID: &'static str = "network.slices.tools.bug";
    type Record = BugRecord;
}

impl Collection for BugRecord {
    const NSID: &'static str = "network.slices.tools.bug";
    type Record = BugRecord;
}

impl<S: BosStr> LexiconSchema for Bug<S> {
    fn nsid() -> &'static str {
        "network.slices.tools.bug"
    }
    fn def_name() -> &'static str {
        "main"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_network_slices_tools_bug()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.app_used {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 300usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("app_used"),
                    max: 300usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.description;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 10000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("description"),
                    max: 10000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.description;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 3000usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("description"),
                        max: 3000usize,
                        actual: count,
                    });
                }
            }
        }
        {
            let value = &self.steps_to_reproduce;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 5000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("steps_to_reproduce"),
                    max: 5000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.steps_to_reproduce;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 1500usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("steps_to_reproduce"),
                        max: 1500usize,
                        actual: count,
                    });
                }
            }
        }
        {
            let value = &self.title;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 300usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("title"),
                    max: 300usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.title;
            {
                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
                if count > 100usize {
                    return Err(ConstraintError::MaxGraphemes {
                        path: ValidationPath::from_field("title"),
                        max: 100usize,
                        actual: count,
                    });
                }
            }
        }
        Ok(())
    }
}

pub mod bug_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type CreatedAt;
        type Description;
        type Namespace;
        type Severity;
        type StepsToReproduce;
        type Title;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type CreatedAt = Unset;
        type Description = Unset;
        type Namespace = Unset;
        type Severity = Unset;
        type StepsToReproduce = Unset;
        type Title = Unset;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
    impl<St: State> State for SetCreatedAt<St> {
        type CreatedAt = Set<members::created_at>;
        type Description = St::Description;
        type Namespace = St::Namespace;
        type Severity = St::Severity;
        type StepsToReproduce = St::StepsToReproduce;
        type Title = St::Title;
    }
    ///State transition - sets the `description` field to Set
    pub struct SetDescription<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDescription<St> {}
    impl<St: State> State for SetDescription<St> {
        type CreatedAt = St::CreatedAt;
        type Description = Set<members::description>;
        type Namespace = St::Namespace;
        type Severity = St::Severity;
        type StepsToReproduce = St::StepsToReproduce;
        type Title = St::Title;
    }
    ///State transition - sets the `namespace` field to Set
    pub struct SetNamespace<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetNamespace<St> {}
    impl<St: State> State for SetNamespace<St> {
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type Namespace = Set<members::namespace>;
        type Severity = St::Severity;
        type StepsToReproduce = St::StepsToReproduce;
        type Title = St::Title;
    }
    ///State transition - sets the `severity` field to Set
    pub struct SetSeverity<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetSeverity<St> {}
    impl<St: State> State for SetSeverity<St> {
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type Namespace = St::Namespace;
        type Severity = Set<members::severity>;
        type StepsToReproduce = St::StepsToReproduce;
        type Title = St::Title;
    }
    ///State transition - sets the `steps_to_reproduce` field to Set
    pub struct SetStepsToReproduce<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetStepsToReproduce<St> {}
    impl<St: State> State for SetStepsToReproduce<St> {
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type Namespace = St::Namespace;
        type Severity = St::Severity;
        type StepsToReproduce = Set<members::steps_to_reproduce>;
        type Title = St::Title;
    }
    ///State transition - sets the `title` field to Set
    pub struct SetTitle<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetTitle<St> {}
    impl<St: State> State for SetTitle<St> {
        type CreatedAt = St::CreatedAt;
        type Description = St::Description;
        type Namespace = St::Namespace;
        type Severity = St::Severity;
        type StepsToReproduce = St::StepsToReproduce;
        type Title = Set<members::title>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `created_at` field
        pub struct created_at(());
        ///Marker type for the `description` field
        pub struct description(());
        ///Marker type for the `namespace` field
        pub struct namespace(());
        ///Marker type for the `severity` field
        pub struct severity(());
        ///Marker type for the `steps_to_reproduce` field
        pub struct steps_to_reproduce(());
        ///Marker type for the `title` field
        pub struct title(());
    }
}

/// Builder for constructing an instance of this type.
pub struct BugBuilder<St: bug_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<S>,
        Option<Images<S>>,
        Option<Datetime>,
        Option<S>,
        Option<Vec<Facet<S>>>,
        Option<S>,
        Option<BugSeverity<S>>,
        Option<S>,
        Option<Vec<Facet<S>>>,
        Option<S>,
    ),
    _type: PhantomData<fn() -> S>,
}

impl Bug<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> BugBuilder<bug_state::Empty, DefaultStr> {
        BugBuilder::new()
    }
}

impl<S: BosStr> Bug<S> {
    /// Create a new builder for this type
    pub fn builder() -> BugBuilder<bug_state::Empty, S> {
        BugBuilder::builder()
    }
}

impl BugBuilder<bug_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        BugBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> BugBuilder<bug_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        BugBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None, None),
            _type: PhantomData,
        }
    }
}

impl<St: bug_state::State, S: BosStr> BugBuilder<St, S> {
    /// Set the `appUsed` field (optional)
    pub fn app_used(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `appUsed` field to an Option value (optional)
    pub fn maybe_app_used(mut self, value: Option<S>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St: bug_state::State, S: BosStr> BugBuilder<St, S> {
    /// Set the `attachments` field (optional)
    pub fn attachments(mut self, value: impl Into<Option<Images<S>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `attachments` field to an Option value (optional)
    pub fn maybe_attachments(mut self, value: Option<Images<S>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St, S: BosStr> BugBuilder<St, S>
where
    St: bug_state::State,
    St::CreatedAt: bug_state::IsUnset,
{
    /// Set the `createdAt` field (required)
    pub fn created_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> BugBuilder<bug_state::SetCreatedAt<St>, S> {
        self._fields.2 = Option::Some(value.into());
        BugBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> BugBuilder<St, S>
where
    St: bug_state::State,
    St::Description: bug_state::IsUnset,
{
    /// Set the `description` field (required)
    pub fn description(
        mut self,
        value: impl Into<S>,
    ) -> BugBuilder<bug_state::SetDescription<St>, S> {
        self._fields.3 = Option::Some(value.into());
        BugBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: bug_state::State, S: BosStr> BugBuilder<St, S> {
    /// Set the `descriptionFacets` field (optional)
    pub fn description_facets(
        mut self,
        value: impl Into<Option<Vec<Facet<S>>>>,
    ) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `descriptionFacets` field to an Option value (optional)
    pub fn maybe_description_facets(mut self, value: Option<Vec<Facet<S>>>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St, S: BosStr> BugBuilder<St, S>
where
    St: bug_state::State,
    St::Namespace: bug_state::IsUnset,
{
    /// Set the `namespace` field (required)
    pub fn namespace(
        mut self,
        value: impl Into<S>,
    ) -> BugBuilder<bug_state::SetNamespace<St>, S> {
        self._fields.5 = Option::Some(value.into());
        BugBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> BugBuilder<St, S>
where
    St: bug_state::State,
    St::Severity: bug_state::IsUnset,
{
    /// Set the `severity` field (required)
    pub fn severity(
        mut self,
        value: impl Into<BugSeverity<S>>,
    ) -> BugBuilder<bug_state::SetSeverity<St>, S> {
        self._fields.6 = Option::Some(value.into());
        BugBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> BugBuilder<St, S>
where
    St: bug_state::State,
    St::StepsToReproduce: bug_state::IsUnset,
{
    /// Set the `stepsToReproduce` field (required)
    pub fn steps_to_reproduce(
        mut self,
        value: impl Into<S>,
    ) -> BugBuilder<bug_state::SetStepsToReproduce<St>, S> {
        self._fields.7 = Option::Some(value.into());
        BugBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: bug_state::State, S: BosStr> BugBuilder<St, S> {
    /// Set the `stepsToReproduceFacets` field (optional)
    pub fn steps_to_reproduce_facets(
        mut self,
        value: impl Into<Option<Vec<Facet<S>>>>,
    ) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `stepsToReproduceFacets` field to an Option value (optional)
    pub fn maybe_steps_to_reproduce_facets(
        mut self,
        value: Option<Vec<Facet<S>>>,
    ) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St, S: BosStr> BugBuilder<St, S>
where
    St: bug_state::State,
    St::Title: bug_state::IsUnset,
{
    /// Set the `title` field (required)
    pub fn title(
        mut self,
        value: impl Into<S>,
    ) -> BugBuilder<bug_state::SetTitle<St>, S> {
        self._fields.9 = Option::Some(value.into());
        BugBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> BugBuilder<St, S>
where
    St: bug_state::State,
    St::CreatedAt: bug_state::IsSet,
    St::Description: bug_state::IsSet,
    St::Namespace: bug_state::IsSet,
    St::Severity: bug_state::IsSet,
    St::StepsToReproduce: bug_state::IsSet,
    St::Title: bug_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> Bug<S> {
        Bug {
            app_used: self._fields.0,
            attachments: self._fields.1,
            created_at: self._fields.2.unwrap(),
            description: self._fields.3.unwrap(),
            description_facets: self._fields.4,
            namespace: self._fields.5.unwrap(),
            severity: self._fields.6.unwrap(),
            steps_to_reproduce: self._fields.7.unwrap(),
            steps_to_reproduce_facets: self._fields.8,
            title: self._fields.9.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Bug<S> {
        Bug {
            app_used: self._fields.0,
            attachments: self._fields.1,
            created_at: self._fields.2.unwrap(),
            description: self._fields.3.unwrap(),
            description_facets: self._fields.4,
            namespace: self._fields.5.unwrap(),
            severity: self._fields.6.unwrap(),
            steps_to_reproduce: self._fields.7.unwrap(),
            steps_to_reproduce_facets: self._fields.8,
            title: self._fields.9.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_network_slices_tools_bug() -> LexiconDoc<'static> {
    #[allow(unused_imports)]
    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
    use jacquard_lexicon::lexicon::*;
    use alloc::collections::BTreeMap;
    LexiconDoc {
        lexicon: Lexicon::Lexicon1,
        id: CowStr::new_static("network.slices.tools.bug"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::Record(LexRecord {
                    key: Some(CowStr::new_static("tid")),
                    record: LexRecordRecord::Object(LexObject {
                        required: Some(
                            vec![
                                SmolStr::new_static("title"),
                                SmolStr::new_static("namespace"),
                                SmolStr::new_static("description"),
                                SmolStr::new_static("stepsToReproduce"),
                                SmolStr::new_static("severity"),
                                SmolStr::new_static("createdAt")
                            ],
                        ),
                        properties: {
                            #[allow(unused_mut)]
                            let mut map = BTreeMap::new();
                            map.insert(
                                SmolStr::new_static("appUsed"),
                                LexObjectProperty::String(LexString {
                                    max_length: Some(300usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("attachments"),
                                LexObjectProperty::Union(LexRefUnion {
                                    refs: vec![
                                        CowStr::new_static("network.slices.tools.defs#images")
                                    ],
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("createdAt"),
                                LexObjectProperty::String(LexString {
                                    format: Some(LexStringFormat::Datetime),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("description"),
                                LexObjectProperty::String(LexString {
                                    max_length: Some(10000usize),
                                    max_graphemes: Some(3000usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("descriptionFacets"),
                                LexObjectProperty::Array(LexArray {
                                    description: Some(
                                        CowStr::new_static(
                                            "Annotations of description (mentions and links)",
                                        ),
                                    ),
                                    items: LexArrayItem::Ref(LexRef {
                                        r#ref: CowStr::new_static(
                                            "network.slices.tools.richtext.facet",
                                        ),
                                        ..Default::default()
                                    }),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("namespace"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "Target namespace like 'social.grain' or 'app.bsky'",
                                        ),
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("severity"),
                                LexObjectProperty::String(LexString {
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("stepsToReproduce"),
                                LexObjectProperty::String(LexString {
                                    max_length: Some(5000usize),
                                    max_graphemes: Some(1500usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("stepsToReproduceFacets"),
                                LexObjectProperty::Array(LexArray {
                                    description: Some(
                                        CowStr::new_static(
                                            "Annotations of steps to reproduce (mentions and links)",
                                        ),
                                    ),
                                    items: LexArrayItem::Ref(LexRef {
                                        r#ref: CowStr::new_static(
                                            "network.slices.tools.richtext.facet",
                                        ),
                                        ..Default::default()
                                    }),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("title"),
                                LexObjectProperty::String(LexString {
                                    max_length: Some(300usize),
                                    max_graphemes: Some(100usize),
                                    ..Default::default()
                                }),
                            );
                            map
                        },
                        ..Default::default()
                    }),
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}