jacquard_api/games_gamesgamesgamesgames/
create_list.rs1#[allow(unused_imports)]
9use alloc::collections::BTreeMap;
10
11#[allow(unused_imports)]
12use core::marker::PhantomData;
13use jacquard_common::deps::smol_str::SmolStr;
14use jacquard_common::types::string::AtUri;
15use jacquard_common::types::value::Data;
16use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
17use jacquard_derive::IntoStatic;
18use serde::{Deserialize, Serialize};
19
20#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
21#[serde(
22 rename_all = "camelCase",
23 bound(deserialize = "S: Deserialize<'de> + BosStr")
24)]
25pub struct CreateList<S: BosStr = DefaultStr> {
26 #[serde(skip_serializing_if = "Option::is_none")]
28 pub description: Option<S>,
29 pub name: S,
31 #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
32 pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
33}
34
35#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
36#[serde(
37 rename_all = "camelCase",
38 bound(deserialize = "S: Deserialize<'de> + BosStr")
39)]
40pub struct CreateListOutput<S: BosStr = DefaultStr> {
41 pub cid: S,
42 pub uri: AtUri<S>,
43 #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
44 pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
45}
46
47pub struct CreateListResponse;
51impl jacquard_common::xrpc::XrpcResp for CreateListResponse {
52 const NSID: &'static str = "games.gamesgamesgamesgames.createList";
53 const ENCODING: &'static str = "application/json";
54 type Output<S: BosStr> = CreateListOutput<S>;
55 type Err = jacquard_common::xrpc::GenericError;
56}
57
58impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for CreateList<S> {
59 const NSID: &'static str = "games.gamesgamesgamesgames.createList";
60 const METHOD: jacquard_common::xrpc::XrpcMethod =
61 jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
62 type Response = CreateListResponse;
63}
64
65pub struct CreateListRequest;
69impl jacquard_common::xrpc::XrpcEndpoint for CreateListRequest {
70 const PATH: &'static str = "/xrpc/games.gamesgamesgamesgames.createList";
71 const METHOD: jacquard_common::xrpc::XrpcMethod =
72 jacquard_common::xrpc::XrpcMethod::Procedure("application/json");
73 type Request<S: BosStr> = CreateList<S>;
74 type Response = CreateListResponse;
75}