/*
* VPNDetection API
*
* The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
*
* The version of the OpenAPI document: 2026.11.20
* Contact: support@vpndetection.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OauthMetadata {
#[serde(rename = "issuer")]
pub issuer: String,
#[serde(rename = "authorization_endpoint")]
pub authorization_endpoint: String,
#[serde(rename = "token_endpoint")]
pub token_endpoint: String,
#[serde(rename = "device_authorization_endpoint", skip_serializing_if = "Option::is_none")]
pub device_authorization_endpoint: Option<String>,
#[serde(rename = "revocation_endpoint", skip_serializing_if = "Option::is_none")]
pub revocation_endpoint: Option<String>,
#[serde(rename = "scopes_supported", skip_serializing_if = "Option::is_none")]
pub scopes_supported: Option<Vec<String>>,
#[serde(rename = "response_types_supported", skip_serializing_if = "Option::is_none")]
pub response_types_supported: Option<Vec<String>>,
#[serde(rename = "grant_types_supported", skip_serializing_if = "Option::is_none")]
pub grant_types_supported: Option<Vec<String>>,
#[serde(rename = "code_challenge_methods_supported", skip_serializing_if = "Option::is_none")]
pub code_challenge_methods_supported: Option<Vec<String>>,
/// Any client may sign in with an https `client_id` serving its own metadata.
#[serde(
rename = "client_id_metadata_document_supported",
skip_serializing_if = "Option::is_none"
)]
pub client_id_metadata_document_supported: Option<bool>,
/// RFC 7591 dynamic client registration, for a client that cannot serve its own metadata.
#[serde(rename = "registration_endpoint", skip_serializing_if = "Option::is_none")]
pub registration_endpoint: Option<String>,
/// Always `none`. Every client is public and has no secret.
#[serde(
rename = "token_endpoint_auth_methods_supported",
skip_serializing_if = "Option::is_none"
)]
pub token_endpoint_auth_methods_supported: Option<Vec<String>>,
/// RFC 9207. A redirect back from the authorization endpoint carries `iss`.
#[serde(
rename = "authorization_response_iss_parameter_supported",
skip_serializing_if = "Option::is_none"
)]
pub authorization_response_iss_parameter_supported: Option<bool>,
#[serde(rename = "service_documentation", skip_serializing_if = "Option::is_none")]
pub service_documentation: Option<String>,
}
impl OauthMetadata {
pub fn new(
issuer: String,
authorization_endpoint: String,
token_endpoint: String,
) -> OauthMetadata {
OauthMetadata {
issuer,
authorization_endpoint,
token_endpoint,
device_authorization_endpoint: None,
revocation_endpoint: None,
scopes_supported: None,
response_types_supported: None,
grant_types_supported: None,
code_challenge_methods_supported: None,
client_id_metadata_document_supported: None,
registration_endpoint: None,
token_endpoint_auth_methods_supported: None,
authorization_response_iss_parameter_supported: None,
service_documentation: None,
}
}
}