#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::AtUri;
use jacquard_common::types::value::Data;
use jacquard_common::{BosStr, DefaultStr, FromStaticStr};
use jacquard_derive::IntoStatic;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct MuteThread<S: BosStr = DefaultStr> {
pub root: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
pub struct MuteThreadResponse;
impl jacquard_common::xrpc::XrpcResp for MuteThreadResponse {
const NSID: &'static str = "app.bsky.graph.muteThread";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = ();
type Err = jacquard_common::xrpc::GenericError;
}
impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for MuteThread<S> {
const NSID: &'static str = "app.bsky.graph.muteThread";
const METHOD: jacquard_common::xrpc::XrpcMethod =
jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
type Response = MuteThreadResponse;
}
pub struct MuteThreadRequest;
impl jacquard_common::xrpc::XrpcEndpoint for MuteThreadRequest {
const PATH: &'static str = "/xrpc/app.bsky.graph.muteThread";
const METHOD: jacquard_common::xrpc::XrpcMethod =
jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
type Request<S: BosStr> = MuteThread<S>;
type Response = MuteThreadResponse;
}
pub mod mute_thread_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Root;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Root = Unset;
}
pub struct SetRoot<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRoot<St> {}
impl<St: State> State for SetRoot<St> {
type Root = Set<members::root>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct root(());
}
}
pub struct MuteThreadBuilder<S: BosStr, St: mute_thread_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<AtUri<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> MuteThread<S> {
pub fn new() -> MuteThreadBuilder<S, mute_thread_state::Empty> {
MuteThreadBuilder::new()
}
}
impl<S: BosStr> MuteThreadBuilder<S, mute_thread_state::Empty> {
pub fn new() -> Self {
MuteThreadBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> MuteThreadBuilder<S, St>
where
St: mute_thread_state::State,
St::Root: mute_thread_state::IsUnset,
{
pub fn root(
mut self,
value: impl Into<AtUri<S>>,
) -> MuteThreadBuilder<S, mute_thread_state::SetRoot<St>> {
self._fields.0 = Option::Some(value.into());
MuteThreadBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> MuteThreadBuilder<S, St>
where
St: mute_thread_state::State,
St::Root: mute_thread_state::IsSet,
{
pub fn build(self) -> MuteThread<S> {
MuteThread {
root: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> MuteThread<S> {
MuteThread {
root: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}