// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: network.slices.slice.getOAuthClients
//
// 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, Datetime, UriValue};
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::network_slices::slice::get_o_auth_clients;

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


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetOAuthClientsOutput<S: BosStr = DefaultStr> {
    pub clients: Vec<get_o_auth_clients::OauthClientDetails<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 OauthClientDetails<S: BosStr = DefaultStr> {
    ///OAuth client ID
    pub client_id: S,
    ///Human-readable name of the OAuth client
    pub client_name: S,
    ///OAuth client secret (only returned on creation)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub client_secret: Option<S>,
    ///URI of the client application
    #[serde(skip_serializing_if = "Option::is_none")]
    pub client_uri: Option<UriValue<S>>,
    ///When the OAuth client was created
    pub created_at: Datetime,
    ///DID of the user who created this client
    pub created_by_did: Did<S>,
    ///Allowed OAuth grant types
    pub grant_types: Vec<S>,
    ///URI of the client logo
    #[serde(skip_serializing_if = "Option::is_none")]
    pub logo_uri: Option<UriValue<S>>,
    ///URI of the privacy policy
    #[serde(skip_serializing_if = "Option::is_none")]
    pub policy_uri: Option<UriValue<S>>,
    ///Allowed redirect URIs for OAuth flow
    pub redirect_uris: Vec<UriValue<S>>,
    ///Allowed OAuth response types
    pub response_types: Vec<S>,
    ///OAuth scope
    #[serde(skip_serializing_if = "Option::is_none")]
    pub scope: Option<S>,
    ///URI of the terms of service
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tos_uri: Option<UriValue<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/** Response marker for the `network.slices.slice.getOAuthClients` query.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `GetOAuthClientsOutput<S>` for this endpoint.*/
pub struct GetOAuthClientsResponse;
impl jacquard_common::xrpc::XrpcResp for GetOAuthClientsResponse {
    const NSID: &'static str = "network.slices.slice.getOAuthClients";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = GetOAuthClientsOutput<S>;
    type Err = jacquard_common::xrpc::GenericError;
}

impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for GetOAuthClients<S> {
    const NSID: &'static str = "network.slices.slice.getOAuthClients";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Response = GetOAuthClientsResponse;
}

/** Endpoint marker for the `network.slices.slice.getOAuthClients` query.

Path: `/xrpc/network.slices.slice.getOAuthClients`. The request payload type is `GetOAuthClients<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
pub struct GetOAuthClientsRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetOAuthClientsRequest {
    const PATH: &'static str = "/xrpc/network.slices.slice.getOAuthClients";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Request<S: BosStr> = GetOAuthClients<S>;
    type Response = GetOAuthClientsResponse;
}

impl<S: BosStr> LexiconSchema for OauthClientDetails<S> {
    fn nsid() -> &'static str {
        "network.slices.slice.getOAuthClients"
    }
    fn def_name() -> &'static str {
        "oauthClientDetails"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_network_slices_slice_getOAuthClients()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

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

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

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

impl<S: BosStr> GetOAuthClients<S> {
    /// Create a new builder for this type
    pub fn builder() -> GetOAuthClientsBuilder<get_o_auth_clients_state::Empty, S> {
        GetOAuthClientsBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> GetOAuthClientsBuilder<St, S>
where
    St: get_o_auth_clients_state::State,
    St::Slice: get_o_auth_clients_state::IsUnset,
{
    /// Set the `slice` field (required)
    pub fn slice(
        mut self,
        value: impl Into<S>,
    ) -> GetOAuthClientsBuilder<get_o_auth_clients_state::SetSlice<St>, S> {
        self._fields.0 = Option::Some(value.into());
        GetOAuthClientsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> GetOAuthClientsBuilder<St, S>
where
    St: get_o_auth_clients_state::State,
    St::Slice: get_o_auth_clients_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> GetOAuthClients<S> {
        GetOAuthClients {
            slice: self._fields.0.unwrap(),
        }
    }
}

pub mod oauth_client_details_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 ClientId;
        type ClientName;
        type CreatedAt;
        type CreatedByDid;
        type GrantTypes;
        type RedirectUris;
        type ResponseTypes;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type ClientId = Unset;
        type ClientName = Unset;
        type CreatedAt = Unset;
        type CreatedByDid = Unset;
        type GrantTypes = Unset;
        type RedirectUris = Unset;
        type ResponseTypes = Unset;
    }
    ///State transition - sets the `client_id` field to Set
    pub struct SetClientId<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetClientId<St> {}
    impl<St: State> State for SetClientId<St> {
        type ClientId = Set<members::client_id>;
        type ClientName = St::ClientName;
        type CreatedAt = St::CreatedAt;
        type CreatedByDid = St::CreatedByDid;
        type GrantTypes = St::GrantTypes;
        type RedirectUris = St::RedirectUris;
        type ResponseTypes = St::ResponseTypes;
    }
    ///State transition - sets the `client_name` field to Set
    pub struct SetClientName<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetClientName<St> {}
    impl<St: State> State for SetClientName<St> {
        type ClientId = St::ClientId;
        type ClientName = Set<members::client_name>;
        type CreatedAt = St::CreatedAt;
        type CreatedByDid = St::CreatedByDid;
        type GrantTypes = St::GrantTypes;
        type RedirectUris = St::RedirectUris;
        type ResponseTypes = St::ResponseTypes;
    }
    ///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 ClientId = St::ClientId;
        type ClientName = St::ClientName;
        type CreatedAt = Set<members::created_at>;
        type CreatedByDid = St::CreatedByDid;
        type GrantTypes = St::GrantTypes;
        type RedirectUris = St::RedirectUris;
        type ResponseTypes = St::ResponseTypes;
    }
    ///State transition - sets the `created_by_did` field to Set
    pub struct SetCreatedByDid<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetCreatedByDid<St> {}
    impl<St: State> State for SetCreatedByDid<St> {
        type ClientId = St::ClientId;
        type ClientName = St::ClientName;
        type CreatedAt = St::CreatedAt;
        type CreatedByDid = Set<members::created_by_did>;
        type GrantTypes = St::GrantTypes;
        type RedirectUris = St::RedirectUris;
        type ResponseTypes = St::ResponseTypes;
    }
    ///State transition - sets the `grant_types` field to Set
    pub struct SetGrantTypes<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetGrantTypes<St> {}
    impl<St: State> State for SetGrantTypes<St> {
        type ClientId = St::ClientId;
        type ClientName = St::ClientName;
        type CreatedAt = St::CreatedAt;
        type CreatedByDid = St::CreatedByDid;
        type GrantTypes = Set<members::grant_types>;
        type RedirectUris = St::RedirectUris;
        type ResponseTypes = St::ResponseTypes;
    }
    ///State transition - sets the `redirect_uris` field to Set
    pub struct SetRedirectUris<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetRedirectUris<St> {}
    impl<St: State> State for SetRedirectUris<St> {
        type ClientId = St::ClientId;
        type ClientName = St::ClientName;
        type CreatedAt = St::CreatedAt;
        type CreatedByDid = St::CreatedByDid;
        type GrantTypes = St::GrantTypes;
        type RedirectUris = Set<members::redirect_uris>;
        type ResponseTypes = St::ResponseTypes;
    }
    ///State transition - sets the `response_types` field to Set
    pub struct SetResponseTypes<St: State = Empty>(PhantomData<fn() -> St>);
    impl<St: State> sealed::Sealed for SetResponseTypes<St> {}
    impl<St: State> State for SetResponseTypes<St> {
        type ClientId = St::ClientId;
        type ClientName = St::ClientName;
        type CreatedAt = St::CreatedAt;
        type CreatedByDid = St::CreatedByDid;
        type GrantTypes = St::GrantTypes;
        type RedirectUris = St::RedirectUris;
        type ResponseTypes = Set<members::response_types>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `client_id` field
        pub struct client_id(());
        ///Marker type for the `client_name` field
        pub struct client_name(());
        ///Marker type for the `created_at` field
        pub struct created_at(());
        ///Marker type for the `created_by_did` field
        pub struct created_by_did(());
        ///Marker type for the `grant_types` field
        pub struct grant_types(());
        ///Marker type for the `redirect_uris` field
        pub struct redirect_uris(());
        ///Marker type for the `response_types` field
        pub struct response_types(());
    }
}

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

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

impl<S: BosStr> OauthClientDetails<S> {
    /// Create a new builder for this type
    pub fn builder() -> OauthClientDetailsBuilder<oauth_client_details_state::Empty, S> {
        OauthClientDetailsBuilder::builder()
    }
}

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

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

impl<St, S: BosStr> OauthClientDetailsBuilder<St, S>
where
    St: oauth_client_details_state::State,
    St::ClientId: oauth_client_details_state::IsUnset,
{
    /// Set the `clientId` field (required)
    pub fn client_id(
        mut self,
        value: impl Into<S>,
    ) -> OauthClientDetailsBuilder<oauth_client_details_state::SetClientId<St>, S> {
        self._fields.0 = Option::Some(value.into());
        OauthClientDetailsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> OauthClientDetailsBuilder<St, S>
where
    St: oauth_client_details_state::State,
    St::ClientName: oauth_client_details_state::IsUnset,
{
    /// Set the `clientName` field (required)
    pub fn client_name(
        mut self,
        value: impl Into<S>,
    ) -> OauthClientDetailsBuilder<oauth_client_details_state::SetClientName<St>, S> {
        self._fields.1 = Option::Some(value.into());
        OauthClientDetailsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

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

impl<St: oauth_client_details_state::State, S: BosStr> OauthClientDetailsBuilder<St, S> {
    /// Set the `clientUri` field (optional)
    pub fn client_uri(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `clientUri` field to an Option value (optional)
    pub fn maybe_client_uri(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.3 = value;
        self
    }
}

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

impl<St, S: BosStr> OauthClientDetailsBuilder<St, S>
where
    St: oauth_client_details_state::State,
    St::CreatedByDid: oauth_client_details_state::IsUnset,
{
    /// Set the `createdByDid` field (required)
    pub fn created_by_did(
        mut self,
        value: impl Into<Did<S>>,
    ) -> OauthClientDetailsBuilder<oauth_client_details_state::SetCreatedByDid<St>, S> {
        self._fields.5 = Option::Some(value.into());
        OauthClientDetailsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> OauthClientDetailsBuilder<St, S>
where
    St: oauth_client_details_state::State,
    St::GrantTypes: oauth_client_details_state::IsUnset,
{
    /// Set the `grantTypes` field (required)
    pub fn grant_types(
        mut self,
        value: impl Into<Vec<S>>,
    ) -> OauthClientDetailsBuilder<oauth_client_details_state::SetGrantTypes<St>, S> {
        self._fields.6 = Option::Some(value.into());
        OauthClientDetailsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: oauth_client_details_state::State, S: BosStr> OauthClientDetailsBuilder<St, S> {
    /// Set the `logoUri` field (optional)
    pub fn logo_uri(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `logoUri` field to an Option value (optional)
    pub fn maybe_logo_uri(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<St: oauth_client_details_state::State, S: BosStr> OauthClientDetailsBuilder<St, S> {
    /// Set the `policyUri` field (optional)
    pub fn policy_uri(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `policyUri` field to an Option value (optional)
    pub fn maybe_policy_uri(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St, S: BosStr> OauthClientDetailsBuilder<St, S>
where
    St: oauth_client_details_state::State,
    St::RedirectUris: oauth_client_details_state::IsUnset,
{
    /// Set the `redirectUris` field (required)
    pub fn redirect_uris(
        mut self,
        value: impl Into<Vec<UriValue<S>>>,
    ) -> OauthClientDetailsBuilder<oauth_client_details_state::SetRedirectUris<St>, S> {
        self._fields.9 = Option::Some(value.into());
        OauthClientDetailsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St, S: BosStr> OauthClientDetailsBuilder<St, S>
where
    St: oauth_client_details_state::State,
    St::ResponseTypes: oauth_client_details_state::IsUnset,
{
    /// Set the `responseTypes` field (required)
    pub fn response_types(
        mut self,
        value: impl Into<Vec<S>>,
    ) -> OauthClientDetailsBuilder<oauth_client_details_state::SetResponseTypes<St>, S> {
        self._fields.10 = Option::Some(value.into());
        OauthClientDetailsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _type: PhantomData,
        }
    }
}

impl<St: oauth_client_details_state::State, S: BosStr> OauthClientDetailsBuilder<St, S> {
    /// Set the `scope` field (optional)
    pub fn scope(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `scope` field to an Option value (optional)
    pub fn maybe_scope(mut self, value: Option<S>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<St: oauth_client_details_state::State, S: BosStr> OauthClientDetailsBuilder<St, S> {
    /// Set the `tosUri` field (optional)
    pub fn tos_uri(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
        self._fields.12 = value.into();
        self
    }
    /// Set the `tosUri` field to an Option value (optional)
    pub fn maybe_tos_uri(mut self, value: Option<UriValue<S>>) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<St, S: BosStr> OauthClientDetailsBuilder<St, S>
where
    St: oauth_client_details_state::State,
    St::ClientId: oauth_client_details_state::IsSet,
    St::ClientName: oauth_client_details_state::IsSet,
    St::CreatedAt: oauth_client_details_state::IsSet,
    St::CreatedByDid: oauth_client_details_state::IsSet,
    St::GrantTypes: oauth_client_details_state::IsSet,
    St::RedirectUris: oauth_client_details_state::IsSet,
    St::ResponseTypes: oauth_client_details_state::IsSet,
{
    /// Build the final struct.
    pub fn build(self) -> OauthClientDetails<S> {
        OauthClientDetails {
            client_id: self._fields.0.unwrap(),
            client_name: self._fields.1.unwrap(),
            client_secret: self._fields.2,
            client_uri: self._fields.3,
            created_at: self._fields.4.unwrap(),
            created_by_did: self._fields.5.unwrap(),
            grant_types: self._fields.6.unwrap(),
            logo_uri: self._fields.7,
            policy_uri: self._fields.8,
            redirect_uris: self._fields.9.unwrap(),
            response_types: self._fields.10.unwrap(),
            scope: self._fields.11,
            tos_uri: self._fields.12,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data.
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<SmolStr, Data<S>>,
    ) -> OauthClientDetails<S> {
        OauthClientDetails {
            client_id: self._fields.0.unwrap(),
            client_name: self._fields.1.unwrap(),
            client_secret: self._fields.2,
            client_uri: self._fields.3,
            created_at: self._fields.4.unwrap(),
            created_by_did: self._fields.5.unwrap(),
            grant_types: self._fields.6.unwrap(),
            logo_uri: self._fields.7,
            policy_uri: self._fields.8,
            redirect_uris: self._fields.9.unwrap(),
            response_types: self._fields.10.unwrap(),
            scope: self._fields.11,
            tos_uri: self._fields.12,
            extra_data: Some(extra_data),
        }
    }
}

fn lexicon_doc_network_slices_slice_getOAuthClients() -> 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.slice.getOAuthClients"),
        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("slice")]),
                            properties: {
                                #[allow(unused_mut)]
                                let mut map = BTreeMap::new();
                                map.insert(
                                    SmolStr::new_static("slice"),
                                    LexXrpcParametersProperty::String(LexString {
                                        description: Some(
                                            CowStr::new_static(
                                                "AT-URI of the slice to get OAuth clients for",
                                            ),
                                        ),
                                        ..Default::default()
                                    }),
                                );
                                map
                            },
                            ..Default::default()
                        }),
                    ),
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("oauthClientDetails"),
                LexUserType::Object(LexObject {
                    required: Some(
                        vec![
                            SmolStr::new_static("clientId"),
                            SmolStr::new_static("clientName"),
                            SmolStr::new_static("redirectUris"),
                            SmolStr::new_static("grantTypes"),
                            SmolStr::new_static("responseTypes"),
                            SmolStr::new_static("createdAt"),
                            SmolStr::new_static("createdByDid")
                        ],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("clientId"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("OAuth client ID")),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("clientName"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Human-readable name of the OAuth client",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("clientSecret"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "OAuth client secret (only returned on creation)",
                                    ),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("clientUri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("URI of the client application"),
                                ),
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdAt"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("When the OAuth client was created"),
                                ),
                                format: Some(LexStringFormat::Datetime),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("createdByDid"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "DID of the user who created this client",
                                    ),
                                ),
                                format: Some(LexStringFormat::Did),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("grantTypes"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Allowed OAuth grant types"),
                                ),
                                items: LexArrayItem::String(LexString {
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("logoUri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("URI of the client logo"),
                                ),
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("policyUri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("URI of the privacy policy"),
                                ),
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("redirectUris"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Allowed redirect URIs for OAuth flow"),
                                ),
                                items: LexArrayItem::String(LexString {
                                    format: Some(LexStringFormat::Uri),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("responseTypes"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Allowed OAuth response types"),
                                ),
                                items: LexArrayItem::String(LexString {
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("scope"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("OAuth scope")),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("tosUri"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("URI of the terms of service"),
                                ),
                                format: Some(LexStringFormat::Uri),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}