#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, 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::games_gamesgamesgamesgames::ActivityFeedItem;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetActivityFeed<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<S>,
pub did: S,
#[serde(default = "_default_limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetActivityFeedOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<S>,
pub feed: Vec<ActivityFeedItem<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
pub struct GetActivityFeedResponse;
impl jacquard_common::xrpc::XrpcResp for GetActivityFeedResponse {
const NSID: &'static str = "games.gamesgamesgamesgames.feed.getActivityFeed";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = GetActivityFeedOutput<S>;
type Err = jacquard_common::xrpc::GenericError;
}
impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for GetActivityFeed<S> {
const NSID: &'static str = "games.gamesgamesgamesgames.feed.getActivityFeed";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetActivityFeedResponse;
}
pub struct GetActivityFeedRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetActivityFeedRequest {
const PATH: &'static str = "/xrpc/games.gamesgamesgamesgames.feed.getActivityFeed";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<S: BosStr> = GetActivityFeed<S>;
type Response = GetActivityFeedResponse;
}
fn _default_limit() -> Option<i64> {
Some(30i64)
}
pub mod get_activity_feed_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct GetActivityFeedBuilder<
St: get_activity_feed_state::State,
S: BosStr = DefaultStr,
> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<S>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl GetActivityFeed<DefaultStr> {
pub fn new() -> GetActivityFeedBuilder<get_activity_feed_state::Empty, DefaultStr> {
GetActivityFeedBuilder::new()
}
}
impl<S: BosStr> GetActivityFeed<S> {
pub fn builder() -> GetActivityFeedBuilder<get_activity_feed_state::Empty, S> {
GetActivityFeedBuilder::builder()
}
}
impl GetActivityFeedBuilder<get_activity_feed_state::Empty, DefaultStr> {
pub fn new() -> Self {
GetActivityFeedBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> GetActivityFeedBuilder<get_activity_feed_state::Empty, S> {
pub fn builder() -> Self {
GetActivityFeedBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<St: get_activity_feed_state::State, S: BosStr> GetActivityFeedBuilder<St, S> {
pub fn cursor(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_cursor(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<St, S: BosStr> GetActivityFeedBuilder<St, S>
where
St: get_activity_feed_state::State,
St::Did: get_activity_feed_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<S>,
) -> GetActivityFeedBuilder<get_activity_feed_state::SetDid<St>, S> {
self._fields.1 = Option::Some(value.into());
GetActivityFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: get_activity_feed_state::State, S: BosStr> GetActivityFeedBuilder<St, S> {
pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
self._fields.2 = value;
self
}
}
impl<St, S: BosStr> GetActivityFeedBuilder<St, S>
where
St: get_activity_feed_state::State,
St::Did: get_activity_feed_state::IsSet,
{
pub fn build(self) -> GetActivityFeed<S> {
GetActivityFeed {
cursor: self._fields.0,
did: self._fields.1.unwrap(),
limit: self._fields.2,
}
}
}