// @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;

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::{Did, Datetime, UriValue};
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::network_slices::slice::get_o_auth_clients;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetOAuthClients<'a> {
    #[serde(borrow)]
    pub slice: CowStr<'a>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetOAuthClientsOutput<'a> {
    #[serde(borrow)]
    pub clients: Vec<get_o_auth_clients::OauthClientDetails<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct OauthClientDetails<'a> {
    ///OAuth client ID
    #[serde(borrow)]
    pub client_id: CowStr<'a>,
    ///Human-readable name of the OAuth client
    #[serde(borrow)]
    pub client_name: CowStr<'a>,
    ///OAuth client secret (only returned on creation)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub client_secret: Option<CowStr<'a>>,
    ///URI of the client application
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub client_uri: Option<UriValue<'a>>,
    ///When the OAuth client was created
    pub created_at: Datetime,
    ///DID of the user who created this client
    #[serde(borrow)]
    pub created_by_did: Did<'a>,
    ///Allowed OAuth grant types
    #[serde(borrow)]
    pub grant_types: Vec<CowStr<'a>>,
    ///URI of the client logo
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub logo_uri: Option<UriValue<'a>>,
    ///URI of the privacy policy
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub policy_uri: Option<UriValue<'a>>,
    ///Allowed redirect URIs for OAuth flow
    #[serde(borrow)]
    pub redirect_uris: Vec<UriValue<'a>>,
    ///Allowed OAuth response types
    #[serde(borrow)]
    pub response_types: Vec<CowStr<'a>>,
    ///OAuth scope
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub scope: Option<CowStr<'a>>,
    ///URI of the terms of service
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub tos_uri: Option<UriValue<'a>>,
}

/// Response type for network.slices.slice.getOAuthClients
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<'de> = GetOAuthClientsOutput<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

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

/// Endpoint type for network.slices.slice.getOAuthClients
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<'de> = GetOAuthClients<'de>;
    type Response = GetOAuthClientsResponse;
}

impl<'a> LexiconSchema for OauthClientDetails<'a> {
    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<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetSlice<S> {}
    impl<S: State> State for SetSlice<S> {
        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<'a, S: get_o_auth_clients_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<CowStr<'a>>,),
    _lifetime: PhantomData<&'a ()>,
}

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

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

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

impl<'a, S> GetOAuthClientsBuilder<'a, S>
where
    S: get_o_auth_clients_state::State,
    S::Slice: get_o_auth_clients_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> GetOAuthClients<'a> {
        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 CreatedAt;
        type ClientId;
        type GrantTypes;
        type CreatedByDid;
        type ResponseTypes;
        type ClientName;
        type RedirectUris;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type CreatedAt = Unset;
        type ClientId = Unset;
        type GrantTypes = Unset;
        type CreatedByDid = Unset;
        type ResponseTypes = Unset;
        type ClientName = Unset;
        type RedirectUris = Unset;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
    impl<S: State> State for SetCreatedAt<S> {
        type CreatedAt = Set<members::created_at>;
        type ClientId = S::ClientId;
        type GrantTypes = S::GrantTypes;
        type CreatedByDid = S::CreatedByDid;
        type ResponseTypes = S::ResponseTypes;
        type ClientName = S::ClientName;
        type RedirectUris = S::RedirectUris;
    }
    ///State transition - sets the `client_id` field to Set
    pub struct SetClientId<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetClientId<S> {}
    impl<S: State> State for SetClientId<S> {
        type CreatedAt = S::CreatedAt;
        type ClientId = Set<members::client_id>;
        type GrantTypes = S::GrantTypes;
        type CreatedByDid = S::CreatedByDid;
        type ResponseTypes = S::ResponseTypes;
        type ClientName = S::ClientName;
        type RedirectUris = S::RedirectUris;
    }
    ///State transition - sets the `grant_types` field to Set
    pub struct SetGrantTypes<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetGrantTypes<S> {}
    impl<S: State> State for SetGrantTypes<S> {
        type CreatedAt = S::CreatedAt;
        type ClientId = S::ClientId;
        type GrantTypes = Set<members::grant_types>;
        type CreatedByDid = S::CreatedByDid;
        type ResponseTypes = S::ResponseTypes;
        type ClientName = S::ClientName;
        type RedirectUris = S::RedirectUris;
    }
    ///State transition - sets the `created_by_did` field to Set
    pub struct SetCreatedByDid<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreatedByDid<S> {}
    impl<S: State> State for SetCreatedByDid<S> {
        type CreatedAt = S::CreatedAt;
        type ClientId = S::ClientId;
        type GrantTypes = S::GrantTypes;
        type CreatedByDid = Set<members::created_by_did>;
        type ResponseTypes = S::ResponseTypes;
        type ClientName = S::ClientName;
        type RedirectUris = S::RedirectUris;
    }
    ///State transition - sets the `response_types` field to Set
    pub struct SetResponseTypes<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetResponseTypes<S> {}
    impl<S: State> State for SetResponseTypes<S> {
        type CreatedAt = S::CreatedAt;
        type ClientId = S::ClientId;
        type GrantTypes = S::GrantTypes;
        type CreatedByDid = S::CreatedByDid;
        type ResponseTypes = Set<members::response_types>;
        type ClientName = S::ClientName;
        type RedirectUris = S::RedirectUris;
    }
    ///State transition - sets the `client_name` field to Set
    pub struct SetClientName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetClientName<S> {}
    impl<S: State> State for SetClientName<S> {
        type CreatedAt = S::CreatedAt;
        type ClientId = S::ClientId;
        type GrantTypes = S::GrantTypes;
        type CreatedByDid = S::CreatedByDid;
        type ResponseTypes = S::ResponseTypes;
        type ClientName = Set<members::client_name>;
        type RedirectUris = S::RedirectUris;
    }
    ///State transition - sets the `redirect_uris` field to Set
    pub struct SetRedirectUris<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetRedirectUris<S> {}
    impl<S: State> State for SetRedirectUris<S> {
        type CreatedAt = S::CreatedAt;
        type ClientId = S::ClientId;
        type GrantTypes = S::GrantTypes;
        type CreatedByDid = S::CreatedByDid;
        type ResponseTypes = S::ResponseTypes;
        type ClientName = S::ClientName;
        type RedirectUris = Set<members::redirect_uris>;
    }
    /// 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 `client_id` field
        pub struct client_id(());
        ///Marker type for the `grant_types` field
        pub struct grant_types(());
        ///Marker type for the `created_by_did` field
        pub struct created_by_did(());
        ///Marker type for the `response_types` field
        pub struct response_types(());
        ///Marker type for the `client_name` field
        pub struct client_name(());
        ///Marker type for the `redirect_uris` field
        pub struct redirect_uris(());
    }
}

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

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

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

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

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

impl<'a, S: oauth_client_details_state::State> OauthClientDetailsBuilder<'a, S> {
    /// Set the `clientSecret` field (optional)
    pub fn client_secret(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: oauth_client_details_state::State> OauthClientDetailsBuilder<'a, S> {
    /// Set the `clientUri` field (optional)
    pub fn client_uri(mut self, value: impl Into<Option<UriValue<'a>>>) -> 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<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

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

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

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

impl<'a, S: oauth_client_details_state::State> OauthClientDetailsBuilder<'a, S> {
    /// Set the `logoUri` field (optional)
    pub fn logo_uri(mut self, value: impl Into<Option<UriValue<'a>>>) -> 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<'a>>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<'a, S: oauth_client_details_state::State> OauthClientDetailsBuilder<'a, S> {
    /// Set the `policyUri` field (optional)
    pub fn policy_uri(mut self, value: impl Into<Option<UriValue<'a>>>) -> 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<'a>>) -> Self {
        self._fields.8 = value;
        self
    }
}

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

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

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

impl<'a, S: oauth_client_details_state::State> OauthClientDetailsBuilder<'a, S> {
    /// Set the `tosUri` field (optional)
    pub fn tos_uri(mut self, value: impl Into<Option<UriValue<'a>>>) -> 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<'a>>) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<'a, S> OauthClientDetailsBuilder<'a, S>
where
    S: oauth_client_details_state::State,
    S::CreatedAt: oauth_client_details_state::IsSet,
    S::ClientId: oauth_client_details_state::IsSet,
    S::GrantTypes: oauth_client_details_state::IsSet,
    S::CreatedByDid: oauth_client_details_state::IsSet,
    S::ResponseTypes: oauth_client_details_state::IsSet,
    S::ClientName: oauth_client_details_state::IsSet,
    S::RedirectUris: oauth_client_details_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> OauthClientDetails<'a> {
        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<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> OauthClientDetails<'a> {
        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()
    }
}