Skip to main content

args_api/endpoint/auth/device/
create_device_code.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{endpoint::Endpoint, resource::auth::DeviceCodeResource};
4
5pub struct CreateDeviceCode;
6
7impl Endpoint for CreateDeviceCode {
8    const PATH: &'static str = "/auth/device/code";
9    const METHOD: http::Method = http::Method::POST;
10
11    type Request = CreateDeviceCodeRequest;
12    type Response = CreateDeviceCodeResponse;
13}
14
15#[derive(ApiRequest, Debug, Serialize, Deserialize)]
16pub struct CreateDeviceCodeRequest {
17    pub client_id: String,
18}
19
20pub type CreateDeviceCodeResponse = DeviceCodeResource;