// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: app.bsky.notification.putPreferencesV2
//
// 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::app_bsky::notification::ChatPreference;
use crate::app_bsky::notification::FilterablePreference;
use crate::app_bsky::notification::Preference;
use crate::app_bsky::notification::Preferences;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PutPreferencesV2<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub chat: Option<ChatPreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub follow: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like_via_repost: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mention: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub quote: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub repost: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub repost_via_repost: Option<FilterablePreference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub starterpack_joined: Option<Preference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub subscribed_post: Option<Preference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unverified: Option<Preference<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub verified: Option<Preference<S>>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PutPreferencesV2Output<S: BosStr = DefaultStr> {
    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 `app.bsky.notification.putPreferencesV2` procedure.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `PutPreferencesV2Output<S>` for this endpoint.*/
pub struct PutPreferencesV2Response;
impl jacquard_common::xrpc::XrpcResp for PutPreferencesV2Response {
    const NSID: &'static str = "app.bsky.notification.putPreferencesV2";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = PutPreferencesV2Output<S>;
    type Err = jacquard_common::xrpc::GenericError;
}

impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for PutPreferencesV2<S> {
    const NSID: &'static str = "app.bsky.notification.putPreferencesV2";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Response = PutPreferencesV2Response;
}

/** Endpoint marker for the `app.bsky.notification.putPreferencesV2` procedure.

Path: `/xrpc/app.bsky.notification.putPreferencesV2`. The request payload type is `PutPreferencesV2<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
pub struct PutPreferencesV2Request;
impl jacquard_common::xrpc::XrpcEndpoint for PutPreferencesV2Request {
    const PATH: &'static str = "/xrpc/app.bsky.notification.putPreferencesV2";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Request<S: BosStr> = PutPreferencesV2<S>;
    type Response = PutPreferencesV2Response;
}