jacquard_api/com_bad_example/identity/
resolve_mini_doc.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: com.bad-example.identity.resolveMiniDoc
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[derive(
9    serde::Serialize,
10    serde::Deserialize,
11    Debug,
12    Clone,
13    PartialEq,
14    Eq,
15    jacquard_derive::IntoStatic
16)]
17#[serde(rename_all = "camelCase")]
18pub struct ResolveMiniDoc<'a> {
19    #[serde(borrow)]
20    pub identifier: jacquard_common::types::ident::AtIdentifier<'a>,
21}
22
23pub mod resolve_mini_doc_state {
24
25    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
26    #[allow(unused)]
27    use ::core::marker::PhantomData;
28    mod sealed {
29        pub trait Sealed {}
30    }
31    /// State trait tracking which required fields have been set
32    pub trait State: sealed::Sealed {
33        type Identifier;
34    }
35    /// Empty state - all required fields are unset
36    pub struct Empty(());
37    impl sealed::Sealed for Empty {}
38    impl State for Empty {
39        type Identifier = Unset;
40    }
41    ///State transition - sets the `identifier` field to Set
42    pub struct SetIdentifier<S: State = Empty>(PhantomData<fn() -> S>);
43    impl<S: State> sealed::Sealed for SetIdentifier<S> {}
44    impl<S: State> State for SetIdentifier<S> {
45        type Identifier = Set<members::identifier>;
46    }
47    /// Marker types for field names
48    #[allow(non_camel_case_types)]
49    pub mod members {
50        ///Marker type for the `identifier` field
51        pub struct identifier(());
52    }
53}
54
55/// Builder for constructing an instance of this type
56pub struct ResolveMiniDocBuilder<'a, S: resolve_mini_doc_state::State> {
57    _phantom_state: ::core::marker::PhantomData<fn() -> S>,
58    __unsafe_private_named: (
59        ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>,
60    ),
61    _phantom: ::core::marker::PhantomData<&'a ()>,
62}
63
64impl<'a> ResolveMiniDoc<'a> {
65    /// Create a new builder for this type
66    pub fn new() -> ResolveMiniDocBuilder<'a, resolve_mini_doc_state::Empty> {
67        ResolveMiniDocBuilder::new()
68    }
69}
70
71impl<'a> ResolveMiniDocBuilder<'a, resolve_mini_doc_state::Empty> {
72    /// Create a new builder with all fields unset
73    pub fn new() -> Self {
74        ResolveMiniDocBuilder {
75            _phantom_state: ::core::marker::PhantomData,
76            __unsafe_private_named: (None,),
77            _phantom: ::core::marker::PhantomData,
78        }
79    }
80}
81
82impl<'a, S> ResolveMiniDocBuilder<'a, S>
83where
84    S: resolve_mini_doc_state::State,
85    S::Identifier: resolve_mini_doc_state::IsUnset,
86{
87    /// Set the `identifier` field (required)
88    pub fn identifier(
89        mut self,
90        value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>,
91    ) -> ResolveMiniDocBuilder<'a, resolve_mini_doc_state::SetIdentifier<S>> {
92        self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
93        ResolveMiniDocBuilder {
94            _phantom_state: ::core::marker::PhantomData,
95            __unsafe_private_named: self.__unsafe_private_named,
96            _phantom: ::core::marker::PhantomData,
97        }
98    }
99}
100
101impl<'a, S> ResolveMiniDocBuilder<'a, S>
102where
103    S: resolve_mini_doc_state::State,
104    S::Identifier: resolve_mini_doc_state::IsSet,
105{
106    /// Build the final struct
107    pub fn build(self) -> ResolveMiniDoc<'a> {
108        ResolveMiniDoc {
109            identifier: self.__unsafe_private_named.0.unwrap(),
110        }
111    }
112}
113
114#[jacquard_derive::lexicon]
115#[derive(
116    serde::Serialize,
117    serde::Deserialize,
118    Debug,
119    Clone,
120    PartialEq,
121    Eq,
122    jacquard_derive::IntoStatic
123)]
124#[serde(rename_all = "camelCase")]
125pub struct ResolveMiniDocOutput<'a> {
126    /// DID, bi-directionally verified if a handle was provided in the query.
127    #[serde(borrow)]
128    pub did: jacquard_common::types::string::Did<'a>,
129    /** The validated handle of the account or `handle.invalid` if the handle
130did not bi-directionally match the DID document.*/
131    #[serde(borrow)]
132    pub handle: jacquard_common::types::string::Handle<'a>,
133    /// The identity's PDS URL
134    #[serde(borrow)]
135    pub pds: jacquard_common::types::string::Uri<'a>,
136    /** The atproto signing key publicKeyMultibase
137
138Legacy key encoding not supported. the key is returned directly; `id`,
139`type`, and `controller` are omitted.*/
140    #[serde(borrow)]
141    pub signing_key: jacquard_common::CowStr<'a>,
142}
143
144/// Response type for
145///com.bad-example.identity.resolveMiniDoc
146pub struct ResolveMiniDocResponse;
147impl jacquard_common::xrpc::XrpcResp for ResolveMiniDocResponse {
148    const NSID: &'static str = "com.bad-example.identity.resolveMiniDoc";
149    const ENCODING: &'static str = "application/json";
150    type Output<'de> = ResolveMiniDocOutput<'de>;
151    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
152}
153
154impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveMiniDoc<'a> {
155    const NSID: &'static str = "com.bad-example.identity.resolveMiniDoc";
156    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
157    type Response = ResolveMiniDocResponse;
158}
159
160/// Endpoint type for
161///com.bad-example.identity.resolveMiniDoc
162pub struct ResolveMiniDocRequest;
163impl jacquard_common::xrpc::XrpcEndpoint for ResolveMiniDocRequest {
164    const PATH: &'static str = "/xrpc/com.bad-example.identity.resolveMiniDoc";
165    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
166    type Request<'de> = ResolveMiniDoc<'de>;
167    type Response = ResolveMiniDocResponse;
168}