// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: social.clippr.actor.getPreferences
//
// 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::{BosStr, DefaultStr, FromStaticStr};
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
use crate::social_clippr::actor::Preferences;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetPreferences;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetPreferencesOutput<S: BosStr = DefaultStr> {
    ///A ref to the user's preferences
    pub preferences: Preferences<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/** Response marker for the `social.clippr.actor.getPreferences` query.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `GetPreferencesOutput<S>` for this endpoint.*/
pub struct GetPreferencesResponse;
impl jacquard_common::xrpc::XrpcResp for GetPreferencesResponse {
    const NSID: &'static str = "social.clippr.actor.getPreferences";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = GetPreferencesOutput<S>;
    type Err = jacquard_common::xrpc::GenericError;
}

impl jacquard_common::xrpc::XrpcRequest for GetPreferences {
    const NSID: &'static str = "social.clippr.actor.getPreferences";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Response = GetPreferencesResponse;
}

/** Endpoint marker for the `social.clippr.actor.getPreferences` query.

Path: `/xrpc/social.clippr.actor.getPreferences`. The request payload type is `GetPreferences`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
pub struct GetPreferencesRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetPreferencesRequest {
    const PATH: &'static str = "/xrpc/social.clippr.actor.getPreferences";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Request<S: BosStr> = GetPreferences;
    type Response = GetPreferencesResponse;
}