Skip to main content

jacquard_api/games_gamesgamesgamesgames/
create_list.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: games.gamesgamesgamesgames.createList
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[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    ///Optional description of the list.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub description: Option<S>,
29    ///The name of the list.
30    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
47/** Response marker for the `games.gamesgamesgamesgames.createList` procedure.
48
49Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `CreateListOutput<S>` for this endpoint.*/
50pub 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
65/** Endpoint marker for the `games.gamesgamesgamesgames.createList` procedure.
66
67Path: `/xrpc/games.gamesgamesgamesgames.createList`. The request payload type is `CreateList<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
68pub 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}