Skip to main content

jacquard_api/com_atproto/server/
delete_session.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: com.atproto.server.deleteSession
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[allow(unused_imports)]
9use alloc::collections::BTreeMap;
10
11#[allow(unused_imports)]
12use core::marker::PhantomData;
13use jacquard_common::deps::smol_str::SmolStr;
14use jacquard_common::types::value::Data;
15use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
16use jacquard_derive::{IntoStatic, open_union};
17use serde::{Deserialize, Serialize};
18
19#[derive(
20    Serialize, Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic,
21)]
22#[serde(tag = "error", content = "message")]
23pub enum DeleteSessionError {
24    #[serde(rename = "InvalidToken")]
25    InvalidToken(Option<SmolStr>),
26    #[serde(rename = "ExpiredToken")]
27    ExpiredToken(Option<SmolStr>),
28    /// Catch-all for unknown error codes.
29    #[serde(untagged)]
30    Other {
31        error: SmolStr,
32        message: Option<SmolStr>,
33    },
34}
35
36impl core::fmt::Display for DeleteSessionError {
37    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
38        match self {
39            Self::InvalidToken(msg) => {
40                write!(f, "InvalidToken")?;
41                if let Some(msg) = msg {
42                    write!(f, ": {}", msg)?;
43                }
44                Ok(())
45            }
46            Self::ExpiredToken(msg) => {
47                write!(f, "ExpiredToken")?;
48                if let Some(msg) = msg {
49                    write!(f, ": {}", msg)?;
50                }
51                Ok(())
52            }
53            Self::Other { error, message } => {
54                write!(f, "{}", error)?;
55                if let Some(msg) = message {
56                    write!(f, ": {}", msg)?;
57                }
58                Ok(())
59            }
60        }
61    }
62}
63
64/** Request marker for the `com.atproto.server.deleteSession` procedure.
65
66This endpoint has no request parameters or input body; send this marker with `jacquard::Client`.*/
67
68#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)]
69pub struct DeleteSession;
70/** Response marker for the `com.atproto.server.deleteSession` procedure.
71
72Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `()` for this endpoint.*/
73pub struct DeleteSessionResponse;
74impl jacquard_common::xrpc::XrpcResp for DeleteSessionResponse {
75    const NSID: &'static str = "com.atproto.server.deleteSession";
76    const ENCODING: &'static str = "application/json";
77    type Output<S: BosStr> = ();
78    type Err = DeleteSessionError;
79}
80
81impl jacquard_common::xrpc::XrpcRequest for DeleteSession {
82    const NSID: &'static str = "com.atproto.server.deleteSession";
83    const METHOD: jacquard_common::xrpc::XrpcMethod =
84        jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
85    type Response = DeleteSessionResponse;
86}
87
88/** Endpoint marker for the `com.atproto.server.deleteSession` procedure.
89
90Path: `/xrpc/com.atproto.server.deleteSession`. The request payload type is `DeleteSession`; use this marker with lower-level `XrpcEndpoint` APIs when you need endpoint metadata.*/
91pub struct DeleteSessionRequest;
92impl jacquard_common::xrpc::XrpcEndpoint for DeleteSessionRequest {
93    const PATH: &'static str = "/xrpc/com.atproto.server.deleteSession";
94    const METHOD: jacquard_common::xrpc::XrpcMethod =
95        jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
96    type Request<S: BosStr> = DeleteSession;
97    type Response = DeleteSessionResponse;
98}