// @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_derive::{IntoStatic, lexicon};
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;

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct PutPreferencesV2<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub chat: Option<ChatPreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub follow: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub like: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub like_via_repost: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub mention: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub quote: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub reply: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub repost: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub repost_via_repost: Option<FilterablePreference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub starterpack_joined: Option<Preference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub subscribed_post: Option<Preference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub unverified: Option<Preference<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub verified: Option<Preference<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct PutPreferencesV2Output<'a> {
    #[serde(borrow)]
    pub preferences: Preferences<'a>,
}

/// Response type for app.bsky.notification.putPreferencesV2
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<'de> = PutPreferencesV2Output<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

impl<'a> jacquard_common::xrpc::XrpcRequest for PutPreferencesV2<'a> {
    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 type for app.bsky.notification.putPreferencesV2
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<'de> = PutPreferencesV2<'de>;
    type Response = PutPreferencesV2Response;
}