// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: games.gamesgamesgamesgames.feed.getList
//
// 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, 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::string::{Did, AtUri, Datetime};
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
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::games_gamesgamesgamesgames::feed::get_list;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct CreatorView<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub avatar: Option<Data<S>>,
    pub did: Did<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub display_name: Option<S>,
    pub handle: S,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ListDetailView<S: BosStr = DefaultStr> {
    pub created_at: Datetime,
    pub creator: get_list::CreatorView<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<S>,
    pub item_count: i64,
    pub name: S,
    pub uri: AtUri<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetList<S: BosStr = DefaultStr> {
    pub uri: AtUri<S>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetListOutput<S: BosStr = DefaultStr> {
    pub list: get_list::ListDetailView<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

impl<S: BosStr> LexiconSchema for CreatorView<S> {
    fn nsid() -> &'static str {
        "games.gamesgamesgamesgames.feed.getList"
    }
    fn def_name() -> &'static str {
        "creatorView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_games_gamesgamesgamesgames_feed_getList()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<S: BosStr> LexiconSchema for ListDetailView<S> {
    fn nsid() -> &'static str {
        "games.gamesgamesgamesgames.feed.getList"
    }
    fn def_name() -> &'static str {
        "listDetailView"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_games_gamesgamesgamesgames_feed_getList()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

/** Response marker for the `games.gamesgamesgamesgames.feed.getList` query.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `GetListOutput<S>` for this endpoint.*/
pub struct GetListResponse;
impl jacquard_common::xrpc::XrpcResp for GetListResponse {
    const NSID: &'static str = "games.gamesgamesgamesgames.feed.getList";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = GetListOutput<S>;
    type Err = jacquard_common::xrpc::GenericError;
}

impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for GetList<S> {
    const NSID: &'static str = "games.gamesgamesgamesgames.feed.getList";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Response = GetListResponse;
}

/** Endpoint marker for the `games.gamesgamesgamesgames.feed.getList` query.

Path: `/xrpc/games.gamesgamesgamesgames.feed.getList`. The request payload type is `GetList<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
pub struct GetListRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetListRequest {
    const PATH: &'static str = "/xrpc/games.gamesgamesgamesgames.feed.getList";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Request<S: BosStr> = GetList<S>;
    type Response = GetListResponse;
}

pub mod creator_view_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 Did;
        type Handle;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Did = Unset;
        type Handle = Unset;
    }
    ///State transition - sets the `did` field to Set
    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetDid<St> {}
    impl<St: State> State for SetDid<St> {
        type Did = Set<members::did>;
        type Handle = St::Handle;
    }
    ///State transition - sets the `handle` field to Set
    pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetHandle<St> {}
    impl<St: State> State for SetHandle<St> {
        type Did = St::Did;
        type Handle = Set<members::handle>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `did` field
        pub struct did(());
        ///Marker type for the `handle` field
        pub struct handle(());
    }
}

/// Builder for constructing an instance of this type.
pub struct CreatorViewBuilder<St: creator_view_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<Data<S>>, Option<Did<S>>, Option<S>, Option<S>),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> CreatorView<S> {
    /// Create a new builder for this type
    pub fn builder() -> CreatorViewBuilder<creator_view_state::Empty, S> {
        CreatorViewBuilder::builder()
    }
}

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

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

impl<St: creator_view_state::State, S: BosStr> CreatorViewBuilder<St, S> {
    /// Set the `avatar` field (optional)
    pub fn avatar(mut self, value: impl Into<Option<Data<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `avatar` field to an Option value (optional)
    pub fn maybe_avatar(mut self, value: Option<Data<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St, S: BosStr> CreatorViewBuilder<St, S>
where
    St: creator_view_state::State,
    St::Did: creator_view_state::IsUnset,
{
    /// Set the `did` field (required)
    pub fn did(
        mut self,
        value: impl Into<Did<S>>,
    ) -> CreatorViewBuilder<creator_view_state::SetDid<St>, S> {
        self._fields.1 = Option::Some(value.into());
        CreatorViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: creator_view_state::State, S: BosStr> CreatorViewBuilder<St, S> {
    /// Set the `displayName` field (optional)
    pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `displayName` field to an Option value (optional)
    pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St, S: BosStr> CreatorViewBuilder<St, S>
where
    St: creator_view_state::State,
    St::Handle: creator_view_state::IsUnset,
{
    /// Set the `handle` field (required)
    pub fn handle(
        mut self,
        value: impl Into<S>,
    ) -> CreatorViewBuilder<creator_view_state::SetHandle<St>, S> {
        self._fields.3 = Option::Some(value.into());
        CreatorViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> CreatorViewBuilder<St, S>
where
    St: creator_view_state::State,
    St::Did: creator_view_state::IsSet,
    St::Handle: creator_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> CreatorView<S> {
        CreatorView {
            avatar: self._fields.0,
            did: self._fields.1.unwrap(),
            display_name: self._fields.2,
            handle: self._fields.3.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>>,
    ) -> CreatorView<S> {
        CreatorView {
            avatar: self._fields.0,
            did: self._fields.1.unwrap(),
            display_name: self._fields.2,
            handle: self._fields.3.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_games_gamesgamesgamesgames_feed_getList() -> 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("games.gamesgamesgamesgames.feed.getList"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("creatorView"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("avatar"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("did"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("displayName"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("handle"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("listDetailView"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("name"),
                            SmolStr::new_static("itemCount"),
                            SmolStr::new_static("createdAt"),
                            SmolStr::new_static("creator")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("creator"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#creatorView"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("description"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("itemCount"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString { ..Default::default() }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::XrpcQuery(LexXrpcQuery {
                    parameters: Some(
                        LexXrpcQueryParameter::Params(LexXrpcParameters {
                            required: Some(vec![SmolStr::new_static("uri")]),
                            properties: {
                                #[allow(unused_mut)]
                                let mut map = BTreeMap::new();
                                map.insert(
                                    SmolStr::new_static("uri"),
                                    LexXrpcParametersProperty::String(LexString {
                                        description: Some(
                                            CowStr::new_static("The AT-URI of the list record."),
                                        ),
                                        format: Some(LexStringFormat::AtUri),
                                        ..Default::default()
                                    }),
                                );
                                map
                            },
                            ..Default::default()
                        }),
                    ),
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

pub mod list_detail_view_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 Creator;
        type ItemCount;
        type Name;
        type Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type CreatedAt = Unset;
        type Creator = Unset;
        type ItemCount = Unset;
        type Name = Unset;
        type Uri = 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 Creator = St::Creator;
        type ItemCount = St::ItemCount;
        type Name = St::Name;
        type Uri = St::Uri;
    }
    ///State transition - sets the `creator` field to Set
    pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreator<St> {}
    impl<St: State> State for SetCreator<St> {
        type CreatedAt = St::CreatedAt;
        type Creator = Set<members::creator>;
        type ItemCount = St::ItemCount;
        type Name = St::Name;
        type Uri = St::Uri;
    }
    ///State transition - sets the `item_count` field to Set
    pub struct SetItemCount<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetItemCount<St> {}
    impl<St: State> State for SetItemCount<St> {
        type CreatedAt = St::CreatedAt;
        type Creator = St::Creator;
        type ItemCount = Set<members::item_count>;
        type Name = St::Name;
        type Uri = St::Uri;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetName<St> {}
    impl<St: State> State for SetName<St> {
        type CreatedAt = St::CreatedAt;
        type Creator = St::Creator;
        type ItemCount = St::ItemCount;
        type Name = Set<members::name>;
        type Uri = St::Uri;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type CreatedAt = St::CreatedAt;
        type Creator = St::Creator;
        type ItemCount = St::ItemCount;
        type Name = St::Name;
        type Uri = Set<members::uri>;
    }
    /// 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 `creator` field
        pub struct creator(());
        ///Marker type for the `item_count` field
        pub struct item_count(());
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct ListDetailViewBuilder<
    St: list_detail_view_state::State,
    S: BosStr = DefaultStr,
> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<Datetime>,
        Option<get_list::CreatorView<S>>,
        Option<S>,
        Option<i64>,
        Option<S>,
        Option<AtUri<S>>,
    ),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> ListDetailView<S> {
    /// Create a new builder for this type
    pub fn builder() -> ListDetailViewBuilder<list_detail_view_state::Empty, S> {
        ListDetailViewBuilder::builder()
    }
}

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

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

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

impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
    St: list_detail_view_state::State,
    St::Creator: list_detail_view_state::IsUnset,
{
    /// Set the `creator` field (required)
    pub fn creator(
        mut self,
        value: impl Into<get_list::CreatorView<S>>,
    ) -> ListDetailViewBuilder<list_detail_view_state::SetCreator<St>, S> {
        self._fields.1 = Option::Some(value.into());
        ListDetailViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: list_detail_view_state::State, S: BosStr> ListDetailViewBuilder<St, S> {
    /// Set the `description` field (optional)
    pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `description` field to an Option value (optional)
    pub fn maybe_description(mut self, value: Option<S>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
    St: list_detail_view_state::State,
    St::ItemCount: list_detail_view_state::IsUnset,
{
    /// Set the `itemCount` field (required)
    pub fn item_count(
        mut self,
        value: impl Into<i64>,
    ) -> ListDetailViewBuilder<list_detail_view_state::SetItemCount<St>, S> {
        self._fields.3 = Option::Some(value.into());
        ListDetailViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
    St: list_detail_view_state::State,
    St::Name: list_detail_view_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<S>,
    ) -> ListDetailViewBuilder<list_detail_view_state::SetName<St>, S> {
        self._fields.4 = Option::Some(value.into());
        ListDetailViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
    St: list_detail_view_state::State,
    St::Uri: list_detail_view_state::IsUnset,
{
    /// Set the `uri` field (required)
    pub fn uri(
        mut self,
        value: impl Into<AtUri<S>>,
    ) -> ListDetailViewBuilder<list_detail_view_state::SetUri<St>, S> {
        self._fields.5 = Option::Some(value.into());
        ListDetailViewBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListDetailViewBuilder<St, S>
where
    St: list_detail_view_state::State,
    St::CreatedAt: list_detail_view_state::IsSet,
    St::Creator: list_detail_view_state::IsSet,
    St::ItemCount: list_detail_view_state::IsSet,
    St::Name: list_detail_view_state::IsSet,
    St::Uri: list_detail_view_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ListDetailView<S> {
        ListDetailView {
            created_at: self._fields.0.unwrap(),
            creator: self._fields.1.unwrap(),
            description: self._fields.2,
            item_count: self._fields.3.unwrap(),
            name: self._fields.4.unwrap(),
            uri: self._fields.5.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>>,
    ) -> ListDetailView<S> {
        ListDetailView {
            created_at: self._fields.0.unwrap(),
            creator: self._fields.1.unwrap(),
            description: self._fields.2,
            item_count: self._fields.3.unwrap(),
            name: self._fields.4.unwrap(),
            uri: self._fields.5.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod get_list_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 Uri;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Uri = Unset;
    }
    ///State transition - sets the `uri` field to Set
    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetUri<St> {}
    impl<St: State> State for SetUri<St> {
        type Uri = Set<members::uri>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `uri` field
        pub struct uri(());
    }
}

/// Builder for constructing an instance of this type.
pub struct GetListBuilder<St: get_list_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (Option<AtUri<S>>,),
    _type: PhantomData<fn() -> S>,
}

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

impl<S: BosStr> GetList<S> {
    /// Create a new builder for this type
    pub fn builder() -> GetListBuilder<get_list_state::Empty, S> {
        GetListBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> GetListBuilder<St, S>
where
    St: get_list_state::State,
    St::Uri: get_list_state::IsUnset,
{
    /// Set the `uri` field (required)
    pub fn uri(
        mut self,
        value: impl Into<AtUri<S>>,
    ) -> GetListBuilder<get_list_state::SetUri<St>, S> {
        self._fields.0 = Option::Some(value.into());
        GetListBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> GetListBuilder<St, S>
where
    St: get_list_state::State,
    St::Uri: get_list_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> GetList<S> {
        GetList {
            uri: self._fields.0.unwrap(),
        }
    }
}