1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: com.atproto.server.getAccountInviteCodes
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 bon::Builder,
16 jacquard_derive::IntoStatic
17)]
18#[builder(start_fn = new)]
19#[serde(rename_all = "camelCase")]
20pub struct GetAccountInviteCodes {
21 ///(default: true)
22 #[serde(skip_serializing_if = "std::option::Option::is_none")]
23 pub create_available: std::option::Option<bool>,
24 ///(default: true)
25 #[serde(skip_serializing_if = "std::option::Option::is_none")]
26 pub include_used: std::option::Option<bool>,
27}
28
29#[jacquard_derive::lexicon]
30#[derive(
31 serde::Serialize,
32 serde::Deserialize,
33 Debug,
34 Clone,
35 PartialEq,
36 Eq,
37 jacquard_derive::IntoStatic
38)]
39#[serde(rename_all = "camelCase")]
40pub struct GetAccountInviteCodesOutput<'a> {
41 #[serde(borrow)]
42 pub codes: Vec<crate::com_atproto::server::InviteCode<'a>>,
43}
44
45#[jacquard_derive::open_union]
46#[derive(
47 serde::Serialize,
48 serde::Deserialize,
49 Debug,
50 Clone,
51 PartialEq,
52 Eq,
53 thiserror::Error,
54 miette::Diagnostic,
55 jacquard_derive::IntoStatic
56)]
57#[serde(tag = "error", content = "message")]
58#[serde(bound(deserialize = "'de: 'a"))]
59pub enum GetAccountInviteCodesError<'a> {
60 #[serde(rename = "DuplicateCreate")]
61 DuplicateCreate(std::option::Option<String>),
62}
63
64impl std::fmt::Display for GetAccountInviteCodesError<'_> {
65 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
66 match self {
67 Self::DuplicateCreate(msg) => {
68 write!(f, "DuplicateCreate")?;
69 if let Some(msg) = msg {
70 write!(f, ": {}", msg)?;
71 }
72 Ok(())
73 }
74 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
75 }
76 }
77}
78
79///Response type for
80///com.atproto.server.getAccountInviteCodes
81pub struct GetAccountInviteCodesResponse;
82impl jacquard_common::xrpc::XrpcResp for GetAccountInviteCodesResponse {
83 const NSID: &'static str = "com.atproto.server.getAccountInviteCodes";
84 const ENCODING: &'static str = "application/json";
85 type Output<'de> = GetAccountInviteCodesOutput<'de>;
86 type Err<'de> = GetAccountInviteCodesError<'de>;
87}
88
89impl jacquard_common::xrpc::XrpcRequest for GetAccountInviteCodes {
90 const NSID: &'static str = "com.atproto.server.getAccountInviteCodes";
91 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
92 type Response = GetAccountInviteCodesResponse;
93}
94
95///Endpoint type for
96///com.atproto.server.getAccountInviteCodes
97pub struct GetAccountInviteCodesRequest;
98impl jacquard_common::xrpc::XrpcEndpoint for GetAccountInviteCodesRequest {
99 const PATH: &'static str = "/xrpc/com.atproto.server.getAccountInviteCodes";
100 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
101 type Request<'de> = GetAccountInviteCodes;
102 type Response = GetAccountInviteCodesResponse;
103}