// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: app.gainforest.organization.info
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

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

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime, UriValue};
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};
/// A declaration of an organization or project

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Info<'a> {
    ///The country of the organization or project in two letter code (ISO 3166-1 alpha-2)
    #[serde(borrow)]
    pub country: CowStr<'a>,
    ///Cover image for the organization
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cover_image: Option<Data<'a>>,
    ///The date and time of the creation of the record
    pub created_at: Datetime,
    ///The name of the organization or project
    #[serde(borrow)]
    pub display_name: CowStr<'a>,
    ///Logo for the organization
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub logo: Option<Data<'a>>,
    ///The long description of the organization or project in richtext
    #[serde(borrow)]
    pub long_description: CowStr<'a>,
    ///The objectives of the organization or project
    #[serde(borrow)]
    pub objectives: Vec<CowStr<'a>>,
    ///The description of the organization or project
    #[serde(borrow)]
    pub short_description: CowStr<'a>,
    ///The start date of the organization or project
    #[serde(skip_serializing_if = "Option::is_none")]
    pub start_date: Option<Datetime>,
    ///The visibility of the organization or project in the Green Globe
    #[serde(borrow)]
    pub visibility: CowStr<'a>,
    ///The website of the organization or project
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub website: Option<UriValue<'a>>,
}

/// 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 InfoGetRecordOutput<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cid: Option<Cid<'a>>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(borrow)]
    pub value: Info<'a>,
}

impl<'a> Info<'a> {
    pub fn uri(
        uri: impl Into<CowStr<'a>>,
    ) -> Result<RecordUri<'a, InfoRecord>, UriError> {
        RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
    }
}

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

#[derive(Debug, Serialize, Deserialize)]
pub struct InfoRecord;
impl XrpcResp for InfoRecord {
    const NSID: &'static str = "app.gainforest.organization.info";
    const ENCODING: &'static str = "application/json";
    type Output<'de> = InfoGetRecordOutput<'de>;
    type Err<'de> = RecordError<'de>;
}

impl From<InfoGetRecordOutput<'_>> for Info<'_> {
    fn from(output: InfoGetRecordOutput<'_>) -> Self {
        use jacquard_common::IntoStatic;
        output.value.into_static()
    }
}

impl Collection for Info<'_> {
    const NSID: &'static str = "app.gainforest.organization.info";
    type Record = InfoRecord;
}

impl Collection for InfoRecord {
    const NSID: &'static str = "app.gainforest.organization.info";
    type Record = InfoRecord;
}

impl<'a> LexiconSchema for Info<'a> {
    fn nsid() -> &'static str {
        "app.gainforest.organization.info"
    }
    fn def_name() -> &'static str {
        "main"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_app_gainforest_organization_info()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.display_name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 255usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("display_name"),
                    max: 255usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.display_name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) < 8usize {
                return Err(ConstraintError::MinLength {
                    path: ValidationPath::from_field("display_name"),
                    min: 8usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.long_description;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 5000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("long_description"),
                    max: 5000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.long_description;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) < 50usize {
                return Err(ConstraintError::MinLength {
                    path: ValidationPath::from_field("long_description"),
                    min: 50usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.short_description;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("short_description"),
                    max: 2000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.short_description;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) < 50usize {
                return Err(ConstraintError::MinLength {
                    path: ValidationPath::from_field("short_description"),
                    min: 50usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

pub mod info_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 DisplayName;
        type Objectives;
        type Country;
        type Visibility;
        type CreatedAt;
        type ShortDescription;
        type LongDescription;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type DisplayName = Unset;
        type Objectives = Unset;
        type Country = Unset;
        type Visibility = Unset;
        type CreatedAt = Unset;
        type ShortDescription = Unset;
        type LongDescription = Unset;
    }
    ///State transition - sets the `display_name` field to Set
    pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetDisplayName<S> {}
    impl<S: State> State for SetDisplayName<S> {
        type DisplayName = Set<members::display_name>;
        type Objectives = S::Objectives;
        type Country = S::Country;
        type Visibility = S::Visibility;
        type CreatedAt = S::CreatedAt;
        type ShortDescription = S::ShortDescription;
        type LongDescription = S::LongDescription;
    }
    ///State transition - sets the `objectives` field to Set
    pub struct SetObjectives<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetObjectives<S> {}
    impl<S: State> State for SetObjectives<S> {
        type DisplayName = S::DisplayName;
        type Objectives = Set<members::objectives>;
        type Country = S::Country;
        type Visibility = S::Visibility;
        type CreatedAt = S::CreatedAt;
        type ShortDescription = S::ShortDescription;
        type LongDescription = S::LongDescription;
    }
    ///State transition - sets the `country` field to Set
    pub struct SetCountry<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCountry<S> {}
    impl<S: State> State for SetCountry<S> {
        type DisplayName = S::DisplayName;
        type Objectives = S::Objectives;
        type Country = Set<members::country>;
        type Visibility = S::Visibility;
        type CreatedAt = S::CreatedAt;
        type ShortDescription = S::ShortDescription;
        type LongDescription = S::LongDescription;
    }
    ///State transition - sets the `visibility` field to Set
    pub struct SetVisibility<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetVisibility<S> {}
    impl<S: State> State for SetVisibility<S> {
        type DisplayName = S::DisplayName;
        type Objectives = S::Objectives;
        type Country = S::Country;
        type Visibility = Set<members::visibility>;
        type CreatedAt = S::CreatedAt;
        type ShortDescription = S::ShortDescription;
        type LongDescription = S::LongDescription;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
    impl<S: State> State for SetCreatedAt<S> {
        type DisplayName = S::DisplayName;
        type Objectives = S::Objectives;
        type Country = S::Country;
        type Visibility = S::Visibility;
        type CreatedAt = Set<members::created_at>;
        type ShortDescription = S::ShortDescription;
        type LongDescription = S::LongDescription;
    }
    ///State transition - sets the `short_description` field to Set
    pub struct SetShortDescription<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetShortDescription<S> {}
    impl<S: State> State for SetShortDescription<S> {
        type DisplayName = S::DisplayName;
        type Objectives = S::Objectives;
        type Country = S::Country;
        type Visibility = S::Visibility;
        type CreatedAt = S::CreatedAt;
        type ShortDescription = Set<members::short_description>;
        type LongDescription = S::LongDescription;
    }
    ///State transition - sets the `long_description` field to Set
    pub struct SetLongDescription<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLongDescription<S> {}
    impl<S: State> State for SetLongDescription<S> {
        type DisplayName = S::DisplayName;
        type Objectives = S::Objectives;
        type Country = S::Country;
        type Visibility = S::Visibility;
        type CreatedAt = S::CreatedAt;
        type ShortDescription = S::ShortDescription;
        type LongDescription = Set<members::long_description>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `display_name` field
        pub struct display_name(());
        ///Marker type for the `objectives` field
        pub struct objectives(());
        ///Marker type for the `country` field
        pub struct country(());
        ///Marker type for the `visibility` field
        pub struct visibility(());
        ///Marker type for the `created_at` field
        pub struct created_at(());
        ///Marker type for the `short_description` field
        pub struct short_description(());
        ///Marker type for the `long_description` field
        pub struct long_description(());
    }
}

/// Builder for constructing an instance of this type
pub struct InfoBuilder<'a, S: info_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<Data<'a>>,
        Option<Datetime>,
        Option<CowStr<'a>>,
        Option<Data<'a>>,
        Option<CowStr<'a>>,
        Option<Vec<CowStr<'a>>>,
        Option<CowStr<'a>>,
        Option<Datetime>,
        Option<CowStr<'a>>,
        Option<UriValue<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> Info<'a> {
    /// Create a new builder for this type
    pub fn new() -> InfoBuilder<'a, info_state::Empty> {
        InfoBuilder::new()
    }
}

impl<'a> InfoBuilder<'a, info_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        InfoBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> InfoBuilder<'a, S>
where
    S: info_state::State,
    S::Country: info_state::IsUnset,
{
    /// Set the `country` field (required)
    pub fn country(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> InfoBuilder<'a, info_state::SetCountry<S>> {
        self._fields.0 = Option::Some(value.into());
        InfoBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: info_state::State> InfoBuilder<'a, S> {
    /// Set the `coverImage` field (optional)
    pub fn cover_image(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `coverImage` field to an Option value (optional)
    pub fn maybe_cover_image(mut self, value: Option<Data<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

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

impl<'a, S> InfoBuilder<'a, S>
where
    S: info_state::State,
    S::DisplayName: info_state::IsUnset,
{
    /// Set the `displayName` field (required)
    pub fn display_name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> InfoBuilder<'a, info_state::SetDisplayName<S>> {
        self._fields.3 = Option::Some(value.into());
        InfoBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: info_state::State> InfoBuilder<'a, S> {
    /// Set the `logo` field (optional)
    pub fn logo(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `logo` field to an Option value (optional)
    pub fn maybe_logo(mut self, value: Option<Data<'a>>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S> InfoBuilder<'a, S>
where
    S: info_state::State,
    S::LongDescription: info_state::IsUnset,
{
    /// Set the `longDescription` field (required)
    pub fn long_description(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> InfoBuilder<'a, info_state::SetLongDescription<S>> {
        self._fields.5 = Option::Some(value.into());
        InfoBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> InfoBuilder<'a, S>
where
    S: info_state::State,
    S::Objectives: info_state::IsUnset,
{
    /// Set the `objectives` field (required)
    pub fn objectives(
        mut self,
        value: impl Into<Vec<CowStr<'a>>>,
    ) -> InfoBuilder<'a, info_state::SetObjectives<S>> {
        self._fields.6 = Option::Some(value.into());
        InfoBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> InfoBuilder<'a, S>
where
    S: info_state::State,
    S::ShortDescription: info_state::IsUnset,
{
    /// Set the `shortDescription` field (required)
    pub fn short_description(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> InfoBuilder<'a, info_state::SetShortDescription<S>> {
        self._fields.7 = Option::Some(value.into());
        InfoBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: info_state::State> InfoBuilder<'a, S> {
    /// Set the `startDate` field (optional)
    pub fn start_date(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `startDate` field to an Option value (optional)
    pub fn maybe_start_date(mut self, value: Option<Datetime>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<'a, S> InfoBuilder<'a, S>
where
    S: info_state::State,
    S::Visibility: info_state::IsUnset,
{
    /// Set the `visibility` field (required)
    pub fn visibility(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> InfoBuilder<'a, info_state::SetVisibility<S>> {
        self._fields.9 = Option::Some(value.into());
        InfoBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: info_state::State> InfoBuilder<'a, S> {
    /// Set the `website` field (optional)
    pub fn website(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `website` field to an Option value (optional)
    pub fn maybe_website(mut self, value: Option<UriValue<'a>>) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<'a, S> InfoBuilder<'a, S>
where
    S: info_state::State,
    S::DisplayName: info_state::IsSet,
    S::Objectives: info_state::IsSet,
    S::Country: info_state::IsSet,
    S::Visibility: info_state::IsSet,
    S::CreatedAt: info_state::IsSet,
    S::ShortDescription: info_state::IsSet,
    S::LongDescription: info_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> Info<'a> {
        Info {
            country: self._fields.0.unwrap(),
            cover_image: self._fields.1,
            created_at: self._fields.2.unwrap(),
            display_name: self._fields.3.unwrap(),
            logo: self._fields.4,
            long_description: self._fields.5.unwrap(),
            objectives: self._fields.6.unwrap(),
            short_description: self._fields.7.unwrap(),
            start_date: self._fields.8,
            visibility: self._fields.9.unwrap(),
            website: self._fields.10,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
    ) -> Info<'a> {
        Info {
            country: self._fields.0.unwrap(),
            cover_image: self._fields.1,
            created_at: self._fields.2.unwrap(),
            display_name: self._fields.3.unwrap(),
            logo: self._fields.4,
            long_description: self._fields.5.unwrap(),
            objectives: self._fields.6.unwrap(),
            short_description: self._fields.7.unwrap(),
            start_date: self._fields.8,
            visibility: self._fields.9.unwrap(),
            website: self._fields.10,
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_app_gainforest_organization_info() -> 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("app.gainforest.organization.info"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::Record(LexRecord {
                    description: Some(
                        CowStr::new_static("A declaration of an organization or project"),
                    ),
                    key: Some(CowStr::new_static("literal:self")),
                    record: LexRecordRecord::Object(LexObject {
                        required: Some(
                            vec![
                                SmolStr::new_static("displayName"),
                                SmolStr::new_static("shortDescription"),
                                SmolStr::new_static("longDescription"),
                                SmolStr::new_static("objectives"),
                                SmolStr::new_static("country"),
                                SmolStr::new_static("visibility"),
                                SmolStr::new_static("createdAt")
                            ],
                        ),
                        properties: {
                            #[allow(unused_mut)]
                            let mut map = BTreeMap::new();
                            map.insert(
                                SmolStr::new_static("country"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The country of the organization or project in two letter code (ISO 3166-1 alpha-2)",
                                        ),
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("coverImage"),
                                LexObjectProperty::Ref(LexRef {
                                    r#ref: CowStr::new_static(
                                        "app.gainforest.common.defs#smallImage",
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("createdAt"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The date and time of the creation of the record",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Datetime),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("displayName"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The name of the organization or project",
                                        ),
                                    ),
                                    min_length: Some(8usize),
                                    max_length: Some(255usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("logo"),
                                LexObjectProperty::Ref(LexRef {
                                    r#ref: CowStr::new_static(
                                        "app.gainforest.common.defs#smallImage",
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("longDescription"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The long description of the organization or project in richtext",
                                        ),
                                    ),
                                    min_length: Some(50usize),
                                    max_length: Some(5000usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("objectives"),
                                LexObjectProperty::Array(LexArray {
                                    description: Some(
                                        CowStr::new_static(
                                            "The objectives of the organization or project",
                                        ),
                                    ),
                                    items: LexArrayItem::String(LexString {
                                        ..Default::default()
                                    }),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("shortDescription"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The description of the organization or project",
                                        ),
                                    ),
                                    min_length: Some(50usize),
                                    max_length: Some(2000usize),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("startDate"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The start date of the organization or project",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Datetime),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("visibility"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The visibility of the organization or project in the Green Globe",
                                        ),
                                    ),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("website"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "The website of the organization or project",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                            );
                            map
                        },
                        ..Default::default()
                    }),
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}