1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.ocho.state.getConfig
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10 serde::Serialize,
11 serde::Deserialize,
12 Debug,
13 Clone,
14 PartialEq,
15 Eq,
16 jacquard_derive::IntoStatic,
17 Default
18)]
19#[serde(rename_all = "camelCase")]
20pub struct GetConfigOutput<'a> {
21 /// The token for the InstantDB account
22 #[serde(borrow)]
23 pub account_token: jacquard_common::CowStr<'a>,
24 /// The InstantDB admin token
25 #[serde(borrow)]
26 pub admin_token: jacquard_common::CowStr<'a>,
27 /// The App ID
28 #[serde(borrow)]
29 pub id: jacquard_common::CowStr<'a>,
30}
31
32#[jacquard_derive::open_union]
33#[derive(
34 serde::Serialize,
35 serde::Deserialize,
36 Debug,
37 Clone,
38 PartialEq,
39 Eq,
40 thiserror::Error,
41 miette::Diagnostic,
42 jacquard_derive::IntoStatic
43)]
44#[serde(tag = "error", content = "message")]
45#[serde(bound(deserialize = "'de: 'a"))]
46pub enum GetConfigError<'a> {
47 #[serde(rename = "InvalidID")]
48 InvalidId(std::option::Option<String>),
49 #[serde(rename = "InvalidServiceAuth")]
50 InvalidServiceAuth(std::option::Option<String>),
51}
52
53impl std::fmt::Display for GetConfigError<'_> {
54 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
55 match self {
56 Self::InvalidId(msg) => {
57 write!(f, "InvalidID")?;
58 if let Some(msg) = msg {
59 write!(f, ": {}", msg)?;
60 }
61 Ok(())
62 }
63 Self::InvalidServiceAuth(msg) => {
64 write!(f, "InvalidServiceAuth")?;
65 if let Some(msg) = msg {
66 write!(f, ": {}", msg)?;
67 }
68 Ok(())
69 }
70 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
71 }
72 }
73}
74
75/// XRPC request marker type
76#[derive(
77 Debug,
78 Clone,
79 Copy,
80 PartialEq,
81 Eq,
82 serde::Serialize,
83 serde::Deserialize,
84 jacquard_derive::IntoStatic
85)]
86pub struct GetConfig;
87///Response type for
88///app.ocho.state.getConfig
89pub struct GetConfigResponse;
90impl jacquard_common::xrpc::XrpcResp for GetConfigResponse {
91 const NSID: &'static str = "app.ocho.state.getConfig";
92 const ENCODING: &'static str = "application/json";
93 type Output<'de> = GetConfigOutput<'de>;
94 type Err<'de> = GetConfigError<'de>;
95}
96
97impl jacquard_common::xrpc::XrpcRequest for GetConfig {
98 const NSID: &'static str = "app.ocho.state.getConfig";
99 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
100 type Response = GetConfigResponse;
101}
102
103///Endpoint type for
104///app.ocho.state.getConfig
105pub struct GetConfigRequest;
106impl jacquard_common::xrpc::XrpcEndpoint for GetConfigRequest {
107 const PATH: &'static str = "/xrpc/app.ocho.state.getConfig";
108 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
109 type Request<'de> = GetConfig;
110 type Response = GetConfigResponse;
111}