// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: space.polymodel.actor.bootstrapProfile // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[allow(unused_imports)] use alloc::collections::BTreeMap; #[allow(unused_imports)] use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::string::{AtUri, Cid}; use jacquard_common::types::value::Data; use jacquard_derive::IntoStatic; use serde::{Serialize, Deserialize}; use crate::space_polymodel::actor::ProfileView; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct BootstrapProfileOutput { #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option>, pub profile: ProfileView, pub status: BootstrapProfileOutputStatus, #[serde(skip_serializing_if = "Option::is_none")] pub uri: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum BootstrapProfileOutputStatus { ExistingLocal, ExistingRemote, Created, Other(S), } impl BootstrapProfileOutputStatus { pub fn as_str(&self) -> &str { match self { Self::ExistingLocal => "existingLocal", Self::ExistingRemote => "existingRemote", Self::Created => "created", Self::Other(s) => s.as_ref(), } } /// Construct from a string-like value, matching known values. pub fn from_value(s: S) -> Self { match s.as_ref() { "existingLocal" => Self::ExistingLocal, "existingRemote" => Self::ExistingRemote, "created" => Self::Created, _ => Self::Other(s), } } } impl core::fmt::Display for BootstrapProfileOutputStatus { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl AsRef for BootstrapProfileOutputStatus { fn as_ref(&self) -> &str { self.as_str() } } impl Serialize for BootstrapProfileOutputStatus { fn serialize(&self, serializer: Ser) -> Result where Ser: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for BootstrapProfileOutputStatus { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = S::deserialize(deserializer)?; Ok(Self::from_value(s)) } } impl Default for BootstrapProfileOutputStatus { fn default() -> Self { Self::Other(Default::default()) } } impl jacquard_common::IntoStatic for BootstrapProfileOutputStatus where S: BosStr + jacquard_common::IntoStatic, S::Output: BosStr, { type Output = BootstrapProfileOutputStatus; fn into_static(self) -> Self::Output { match self { BootstrapProfileOutputStatus::ExistingLocal => { BootstrapProfileOutputStatus::ExistingLocal } BootstrapProfileOutputStatus::ExistingRemote => { BootstrapProfileOutputStatus::ExistingRemote } BootstrapProfileOutputStatus::Created => { BootstrapProfileOutputStatus::Created } BootstrapProfileOutputStatus::Other(v) => { BootstrapProfileOutputStatus::Other(v.into_static()) } } } } /** Request marker for the `space.polymodel.actor.bootstrapProfile` procedure. This endpoint has no request parameters or input body; send this marker with `jacquard::Client`.*/ #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)] pub struct BootstrapProfile; /** Response marker for the `space.polymodel.actor.bootstrapProfile` procedure. Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output`, which is `BootstrapProfileOutput` for this endpoint.*/ pub struct BootstrapProfileResponse; impl jacquard_common::xrpc::XrpcResp for BootstrapProfileResponse { const NSID: &'static str = "space.polymodel.actor.bootstrapProfile"; const ENCODING: &'static str = "application/json"; type Output = BootstrapProfileOutput; type Err = jacquard_common::xrpc::GenericError; } impl jacquard_common::xrpc::XrpcRequest for BootstrapProfile { const NSID: &'static str = "space.polymodel.actor.bootstrapProfile"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Response = BootstrapProfileResponse; } /** Endpoint marker for the `space.polymodel.actor.bootstrapProfile` procedure. Path: `/xrpc/space.polymodel.actor.bootstrapProfile`. The request payload type is `BootstrapProfile`; use this marker with lower-level `XrpcEndpoint` APIs when you need endpoint metadata.*/ pub struct BootstrapProfileRequest; impl jacquard_common::xrpc::XrpcEndpoint for BootstrapProfileRequest { const PATH: &'static str = "/xrpc/space.polymodel.actor.bootstrapProfile"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Request = BootstrapProfile; type Response = BootstrapProfileResponse; }