use std::collections::BTreeMap;
use derive_more::{Display, Error, From};
use serde::{Deserialize, Serialize};
use url::Url;
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Flows {
#[serde(skip_serializing_if = "Option::is_none")]
pub implicit: Option<ImplicitFlow>,
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<PasswordFlow>,
#[serde(skip_serializing_if = "Option::is_none")]
pub client_credentials: Option<ClientCredentialsFlow>,
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization_code: Option<AuthorizationCodeFlow>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ImplicitFlow {
pub authorization_url: Url,
#[serde(skip_serializing_if = "Option::is_none")]
pub refresh_url: Option<Url>,
pub scopes: BTreeMap<String, String>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PasswordFlow {
token_url: Url,
#[serde(skip_serializing_if = "Option::is_none")]
pub refresh_url: Option<Url>,
pub scopes: BTreeMap<String, String>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ClientCredentialsFlow {
token_url: Url,
#[serde(skip_serializing_if = "Option::is_none")]
pub refresh_url: Option<Url>,
pub scopes: BTreeMap<String, String>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct AuthorizationCodeFlow {
pub authorization_url: Url,
pub token_url: Url,
#[serde(skip_serializing_if = "Option::is_none")]
pub refresh_url: Option<Url>,
pub scopes: BTreeMap<String, String>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
pub struct Callback(
serde_json::Value, );