#[allow(unused_imports)]
use alloc::collections::BTreeMap;
use crate::place_stream::badge::BadgeView;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::Did;
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 GetValidBadges<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub streamer: Option<Did<S>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct GetValidBadgesOutput<S: BosStr = DefaultStr> {
pub badges: Vec<BadgeView<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
pub struct GetValidBadgesResponse;
impl jacquard_common::xrpc::XrpcResp for GetValidBadgesResponse {
const NSID: &'static str = "place.stream.badge.getValidBadges";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = GetValidBadgesOutput<S>;
type Err = jacquard_common::xrpc::GenericError;
}
impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for GetValidBadges<S> {
const NSID: &'static str = "place.stream.badge.getValidBadges";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetValidBadgesResponse;
}
pub struct GetValidBadgesRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetValidBadgesRequest {
const PATH: &'static str = "/xrpc/place.stream.badge.getValidBadges";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<S: BosStr> = GetValidBadges<S>;
type Response = GetValidBadgesResponse;
}
pub mod get_valid_badges_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 {}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {}
#[allow(non_camel_case_types)]
pub mod members {}
}
pub struct GetValidBadgesBuilder<S: BosStr, St: get_valid_badges_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Did<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> GetValidBadges<S> {
pub fn new() -> GetValidBadgesBuilder<S, get_valid_badges_state::Empty> {
GetValidBadgesBuilder::new()
}
}
impl<S: BosStr> GetValidBadgesBuilder<S, get_valid_badges_state::Empty> {
pub fn new() -> Self {
GetValidBadgesBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: get_valid_badges_state::State> GetValidBadgesBuilder<S, St> {
pub fn streamer(mut self, value: impl Into<Option<Did<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_streamer(mut self, value: Option<Did<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> GetValidBadgesBuilder<S, St>
where
St: get_valid_badges_state::State,
{
pub fn build(self) -> GetValidBadges<S> {
GetValidBadges {
streamer: self._fields.0,
}
}
}