// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: sh.tangled.repo.listPulls
//
// 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, Cid, 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::sh_tangled::repo::list_pulls;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ListPulls<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub author: Option<Did<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cursor: Option<S>,
    /// Defaults to `50`. Min: 1. Max: 1000.
    #[serde(default = "_default_limit")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<i64>,
    /// Defaults to `"desc"`.
    #[serde(default = "_default_order")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub order: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<S>,
    pub subject: Did<S>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ListPullsOutput<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cursor: Option<S>,
    pub items: Vec<list_pulls::PullListItem<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 PullListItem<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<Cid<S>>,
    ///Count of sh.tangled.repo.pull.comment records targeting this pull.
    pub comment_count: i64,
    ///Latest derived state.
    pub state: PullListItemState<S>,
    ///TID-derived timestamp of the latest pull status record.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub state_updated_at: Option<Datetime>,
    pub uri: AtUri<S>,
    ///Embedded sh.tangled.repo.pull record
    pub value: Data<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/// Latest derived state.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PullListItemState<S: BosStr = DefaultStr> {
    Open,
    Closed,
    Merged,
    Other(S),
}

impl<S: BosStr> PullListItemState<S> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Open => "open",
            Self::Closed => "closed",
            Self::Merged => "merged",
            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() {
            "open" => Self::Open,
            "closed" => Self::Closed,
            "merged" => Self::Merged,
            _ => Self::Other(s),
        }
    }
}

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

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

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

impl<S: BosStr> jacquard_common::IntoStatic for PullListItemState<S>
where
    S: BosStr + jacquard_common::IntoStatic,
    S::Output: BosStr,
{
    type Output = PullListItemState<S::Output>;
    fn into_static(self) -> Self::Output {
        match self {
            PullListItemState::Open => PullListItemState::Open,
            PullListItemState::Closed => PullListItemState::Closed,
            PullListItemState::Merged => PullListItemState::Merged,
            PullListItemState::Other(v) => PullListItemState::Other(v.into_static()),
        }
    }
}

/** Response marker for the `sh.tangled.repo.listPulls` query.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `ListPullsOutput<S>` for this endpoint.*/
pub struct ListPullsResponse;
impl jacquard_common::xrpc::XrpcResp for ListPullsResponse {
    const NSID: &'static str = "sh.tangled.repo.listPulls";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = ListPullsOutput<S>;
    type Err = jacquard_common::xrpc::GenericError;
}

impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for ListPulls<S> {
    const NSID: &'static str = "sh.tangled.repo.listPulls";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Response = ListPullsResponse;
}

/** Endpoint marker for the `sh.tangled.repo.listPulls` query.

Path: `/xrpc/sh.tangled.repo.listPulls`. The request payload type is `ListPulls<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
pub struct ListPullsRequest;
impl jacquard_common::xrpc::XrpcEndpoint for ListPullsRequest {
    const PATH: &'static str = "/xrpc/sh.tangled.repo.listPulls";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Request<S: BosStr> = ListPulls<S>;
    type Response = ListPullsResponse;
}

impl<S: BosStr> LexiconSchema for PullListItem<S> {
    fn nsid() -> &'static str {
        "sh.tangled.repo.listPulls"
    }
    fn def_name() -> &'static str {
        "pullListItem"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_sh_tangled_repo_listPulls()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.comment_count;
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("comment_count"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

fn _default_limit() -> Option<i64> {
    Some(50i64)
}

fn _default_order<S: jacquard_common::FromStaticStr>() -> Option<S> {
    Some(S::from_static("desc"))
}

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

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

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

impl<S: BosStr> ListPulls<S> {
    /// Create a new builder for this type
    pub fn builder() -> ListPullsBuilder<list_pulls_state::Empty, S> {
        ListPullsBuilder::builder()
    }
}

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

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

impl<St: list_pulls_state::State, S: BosStr> ListPullsBuilder<St, S> {
    /// Set the `author` field (optional)
    pub fn author(mut self, value: impl Into<Option<Did<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `author` field to an Option value (optional)
    pub fn maybe_author(mut self, value: Option<Did<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

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

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

impl<St: list_pulls_state::State, S: BosStr> ListPullsBuilder<St, S> {
    /// Set the `order` field (optional)
    pub fn order(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `order` field to an Option value (optional)
    pub fn maybe_order(mut self, value: Option<S>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St: list_pulls_state::State, S: BosStr> ListPullsBuilder<St, S> {
    /// Set the `status` field (optional)
    pub fn status(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `status` field to an Option value (optional)
    pub fn maybe_status(mut self, value: Option<S>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St, S: BosStr> ListPullsBuilder<St, S>
where
    St: list_pulls_state::State,
    St::Subject: list_pulls_state::IsUnset,
{
    /// Set the `subject` field (required)
    pub fn subject(
        mut self,
        value: impl Into<Did<S>>,
    ) -> ListPullsBuilder<list_pulls_state::SetSubject<St>, S> {
        self._fields.5 = Option::Some(value.into());
        ListPullsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> ListPullsBuilder<St, S>
where
    St: list_pulls_state::State,
    St::Subject: list_pulls_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> ListPulls<S> {
        ListPulls {
            author: self._fields.0,
            cursor: self._fields.1,
            limit: self._fields.2,
            order: self._fields.3,
            status: self._fields.4,
            subject: self._fields.5.unwrap(),
        }
    }
}

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

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

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

impl<S: BosStr> PullListItem<S> {
    /// Create a new builder for this type
    pub fn builder() -> PullListItemBuilder<pull_list_item_state::Empty, S> {
        PullListItemBuilder::builder()
    }
}

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

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

impl<St: pull_list_item_state::State, S: BosStr> PullListItemBuilder<St, S> {
    /// Set the `cid` field (optional)
    pub fn cid(mut self, value: impl Into<Option<Cid<S>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `cid` field to an Option value (optional)
    pub fn maybe_cid(mut self, value: Option<Cid<S>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St, S: BosStr> PullListItemBuilder<St, S>
where
    St: pull_list_item_state::State,
    St::CommentCount: pull_list_item_state::IsUnset,
{
    /// Set the `commentCount` field (required)
    pub fn comment_count(
        mut self,
        value: impl Into<i64>,
    ) -> PullListItemBuilder<pull_list_item_state::SetCommentCount<St>, S> {
        self._fields.1 = Option::Some(value.into());
        PullListItemBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PullListItemBuilder<St, S>
where
    St: pull_list_item_state::State,
    St::State: pull_list_item_state::IsUnset,
{
    /// Set the `state` field (required)
    pub fn state(
        mut self,
        value: impl Into<PullListItemState<S>>,
    ) -> PullListItemBuilder<pull_list_item_state::SetState<St>, S> {
        self._fields.2 = Option::Some(value.into());
        PullListItemBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: pull_list_item_state::State, S: BosStr> PullListItemBuilder<St, S> {
    /// Set the `stateUpdatedAt` field (optional)
    pub fn state_updated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `stateUpdatedAt` field to an Option value (optional)
    pub fn maybe_state_updated_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.3 = value;
        self
    }
}

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

impl<St, S: BosStr> PullListItemBuilder<St, S>
where
    St: pull_list_item_state::State,
    St::Value: pull_list_item_state::IsUnset,
{
    /// Set the `value` field (required)
    pub fn value(
        mut self,
        value: impl Into<Data<S>>,
    ) -> PullListItemBuilder<pull_list_item_state::SetValue<St>, S> {
        self._fields.5 = Option::Some(value.into());
        PullListItemBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> PullListItemBuilder<St, S>
where
    St: pull_list_item_state::State,
    St::CommentCount: pull_list_item_state::IsSet,
    St::State: pull_list_item_state::IsSet,
    St::Uri: pull_list_item_state::IsSet,
    St::Value: pull_list_item_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> PullListItem<S> {
        PullListItem {
            cid: self._fields.0,
            comment_count: self._fields.1.unwrap(),
            state: self._fields.2.unwrap(),
            state_updated_at: self._fields.3,
            uri: self._fields.4.unwrap(),
            value: 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>>,
    ) -> PullListItem<S> {
        PullListItem {
            cid: self._fields.0,
            comment_count: self._fields.1.unwrap(),
            state: self._fields.2.unwrap(),
            state_updated_at: self._fields.3,
            uri: self._fields.4.unwrap(),
            value: self._fields.5.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_sh_tangled_repo_listPulls() -> 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("sh.tangled.repo.listPulls"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::XrpcQuery(LexXrpcQuery {
                    parameters: Some(
                        LexXrpcQueryParameter::Params(LexXrpcParameters {
                            required: Some(vec![SmolStr::new_static("subject")]),
                            properties: {
                                #[allow(unused_mut)]
                                let mut map = BTreeMap::new();
                                map.insert(
                                    SmolStr::new_static("author"),
                                    LexXrpcParametersProperty::String(LexString {
                                        description: Some(
                                            CowStr::new_static(
                                                "Restrict to pulls authored by this user DID.",
                                            ),
                                        ),
                                        format: Some(LexStringFormat::Did),
                                        ..Default::default()
                                    }),
                                );
                                map.insert(
                                    SmolStr::new_static("cursor"),
                                    LexXrpcParametersProperty::String(LexString {
                                        description: Some(CowStr::new_static("Pagination cursor")),
                                        ..Default::default()
                                    }),
                                );
                                map.insert(
                                    SmolStr::new_static("limit"),
                                    LexXrpcParametersProperty::Integer(LexInteger {
                                        ..Default::default()
                                    }),
                                );
                                map.insert(
                                    SmolStr::new_static("order"),
                                    LexXrpcParametersProperty::String(LexString {
                                        description: Some(
                                            CowStr::new_static("Sort direction by createdAt."),
                                        ),
                                        ..Default::default()
                                    }),
                                );
                                map.insert(
                                    SmolStr::new_static("status"),
                                    LexXrpcParametersProperty::String(LexString {
                                        description: Some(
                                            CowStr::new_static(
                                                "Restrict to pulls whose latest derived status matches.",
                                            ),
                                        ),
                                        ..Default::default()
                                    }),
                                );
                                map.insert(
                                    SmolStr::new_static("subject"),
                                    LexXrpcParametersProperty::String(LexString {
                                        description: Some(
                                            CowStr::new_static("Repo DID to list pulls for"),
                                        ),
                                        format: Some(LexStringFormat::Did),
                                        ..Default::default()
                                    }),
                                );
                                map
                            },
                            ..Default::default()
                        }),
                    ),
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("pullListItem"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("uri"), SmolStr::new_static("value"),
                            SmolStr::new_static("state"),
                            SmolStr::new_static("commentCount")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("cid"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::Cid),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("commentCount"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("state"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Latest derived state."),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("stateUpdatedAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "TID-derived timestamp of the latest pull status record.",
                                    ),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("uri"),
                            LexObjectProperty::String(LexString {
                                format: Some(LexStringFormat::AtUri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("value"),
                            LexObjectProperty::Unknown(LexUnknown {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}