use serde::{Deserialize, Serialize}; #[derive(Deserialize, Serialize, Debug)] pub struct GetAuthRequest { pub response_type: String, pub client_id: String, pub redirect_uri: String, pub scope: Option, pub state: Option, } #[derive(Debug, Deserialize, Serialize)] pub struct GetLoginRequest { pub state: String, } #[derive(Debug, Serialize)] pub struct PostLoginRequest { pub account: String, pub password: String, pub state: String, } #[derive(Debug, Deserialize, Serialize)] pub struct GetAuthorizeRequest { pub response_type: String, pub client_id: String, pub redirect_uri: String, #[serde(skip_serializing_if = "Option::is_none")] pub scope: Option, #[serde(skip_serializing_if = "Option::is_none")] pub state: Option, pub session_id: String, } #[derive(Debug, Serialize)] pub struct PostAuthorizeRequest { pub response_type: String, pub client_id: String, pub redirect_uri: String, #[serde(skip_serializing_if = "Option::is_none")] pub scope: Option, #[serde(skip_serializing_if = "Option::is_none")] pub state: Option, pub session_id: String, #[serde(skip_serializing_if = "Option::is_none")] pub allow: Option, } // Used for authorization code grant flow. #[derive(Debug, Serialize)] pub struct PostTokenRequest { pub grant_type: String, pub code: String, pub redirect_uri: String, #[serde(skip_serializing_if = "Option::is_none")] pub client_id: Option, } // Used for client credentials grant flow. #[derive(Debug, Serialize)] pub struct PostTokenClientRequest { pub grant_type: String, #[serde(skip_serializing_if = "Option::is_none")] pub scope: Option, } #[derive(Debug, Serialize)] pub struct PostRefreshRequest { pub grant_type: String, pub refresh_token: String, #[serde(skip_serializing_if = "Option::is_none")] pub scope: Option, #[serde(skip_serializing_if = "Option::is_none")] pub client_id: Option, }