Skip to main content

nil_payload/request/
user.rs

1// Copyright (C) Call of Nil contributors
2// SPDX-License-Identifier: AGPL-3.0-only
3
4use bon::Builder;
5use nil_core::player::PlayerId;
6use nil_crypto::password::Password;
7use serde::{Deserialize, Serialize};
8
9#[cfg(feature = "typescript")]
10use ts_rs::TS;
11
12#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
13#[serde(rename_all = "camelCase")]
14#[cfg_attr(feature = "typescript", derive(TS))]
15#[cfg_attr(feature = "typescript", ts(export))]
16pub struct CreateUserRequest {
17  #[builder(into)]
18  pub player: PlayerId,
19  #[builder(into)]
20  pub password: Password,
21}
22
23#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
24#[serde(rename_all = "camelCase")]
25#[cfg_attr(feature = "typescript", derive(TS))]
26#[cfg_attr(feature = "typescript", ts(export))]
27pub struct UserExistsRequest {
28  #[builder(into)]
29  pub user: PlayerId,
30}