// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: blue.zio.atfile.meta
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

use jacquard_common::CowStr;

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
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};
/// Unknown metadata for an uploaded file.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Unknown<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub reason: Option<CowStr<'a>>,
}

impl<'a> LexiconSchema for Unknown<'a> {
    fn nsid() -> &'static str {
        "blue.zio.atfile.meta"
    }
    fn def_name() -> &'static str {
        "unknown"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_blue_zio_atfile_meta()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

fn lexicon_doc_blue_zio_atfile_meta() -> 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("blue.zio.atfile.meta"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("unknown"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Unknown metadata for an uploaded file."),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("reason"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}