args-api 0.1.0

Shared API contract types and endpoint definitions for args.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{Deserialize, Serialize};

use crate::{endpoint::Endpoint, resource::user::CurrentUserResource};

pub struct GetCurrentUser;

impl Endpoint for GetCurrentUser {
    const PATH: &'static str = "/user";
    const METHOD: http::Method = http::Method::GET;

    type Request = GetCurrentUserRequest;
    type Response = GetCurrentUserResponse;
}

#[derive(ApiRequest, Debug, Serialize, Deserialize)]
pub struct GetCurrentUserRequest {}

pub type GetCurrentUserResponse = CurrentUserResource;