mangadex_api_types_rust/
oauth.rs

1use std::fmt::Display;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Clone, Copy, Debug, Deserialize, Hash, PartialEq, Eq, Serialize)]
6#[serde(rename_all = "snake_case")]
7#[cfg_attr(feature = "specta", derive(specta::Type))]
8pub enum GrantTypeSupported {
9    RefreshToken,
10    Password,
11    AuthorizationCode,
12    ClientCredentials,
13}
14
15impl Display for GrantTypeSupported {
16    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17        f.write_str(match self {
18            GrantTypeSupported::RefreshToken => "refresh_token",
19            GrantTypeSupported::Password => "password",
20            GrantTypeSupported::AuthorizationCode => "authorization_code",
21            GrantTypeSupported::ClientCredentials => "client_credentials",
22        })
23    }
24}