atrium_api/com/atproto/server/
get_service_auth.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.server.getServiceAuth` namespace.
3pub const NSID: &str = "com.atproto.server.getServiceAuth";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    ///The DID of the service that the token will be used to authenticate with
8    pub aud: crate::types::string::Did,
9    ///The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope.
10    #[serde(skip_serializing_if = "core::option::Option::is_none")]
11    pub exp: core::option::Option<i64>,
12    ///Lexicon (XRPC) method to bind the requested token to
13    #[serde(skip_serializing_if = "core::option::Option::is_none")]
14    pub lxm: core::option::Option<crate::types::string::Nsid>,
15}
16pub type Parameters = crate::types::Object<ParametersData>;
17#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
18#[serde(rename_all = "camelCase")]
19pub struct OutputData {
20    pub token: String,
21}
22pub type Output = crate::types::Object<OutputData>;
23#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
24#[serde(tag = "error", content = "message")]
25pub enum Error {
26    ///Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes.
27    BadExpiration(Option<String>),
28}
29impl std::fmt::Display for Error {
30    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
31        match self {
32            Error::BadExpiration(msg) => {
33                write!(_f, "BadExpiration")?;
34                if let Some(msg) = msg {
35                    write!(_f, ": {msg}")?;
36                }
37            }
38        }
39        Ok(())
40    }
41}