authentik-rust 0.0.1

Making authentication simple.
Documentation
/*
 * authentik
 *
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2024.2.1
 * Contact: hello@goauthentik.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

/// PatchedOAuth2ProviderRequest : OAuth2Provider Serializer
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PatchedOAuth2ProviderRequest {
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
    #[serde(rename = "authentication_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub authentication_flow: Option<Option<uuid::Uuid>>,
    /// Flow used when authorizing this provider.
    #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")]
    pub authorization_flow: Option<uuid::Uuid>,
    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
    pub property_mappings: Option<Vec<uuid::Uuid>>,
    /// Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable  * `confidential` - Confidential * `public` - Public
    #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")]
    pub client_type: Option<models::ClientTypeEnum>,
    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
    pub client_id: Option<String>,
    #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")]
    pub client_secret: Option<String>,
    /// Access codes not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
    #[serde(rename = "access_code_validity", skip_serializing_if = "Option::is_none")]
    pub access_code_validity: Option<String>,
    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
    #[serde(rename = "access_token_validity", skip_serializing_if = "Option::is_none")]
    pub access_token_validity: Option<String>,
    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
    #[serde(rename = "refresh_token_validity", skip_serializing_if = "Option::is_none")]
    pub refresh_token_validity: Option<String>,
    /// Include User claims from scopes in the id_token, for applications that don't access the userinfo endpoint.
    #[serde(rename = "include_claims_in_id_token", skip_serializing_if = "Option::is_none")]
    pub include_claims_in_id_token: Option<bool>,
    /// Key used to sign the tokens. Only required when JWT Algorithm is set to RS256.
    #[serde(rename = "signing_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub signing_key: Option<Option<uuid::Uuid>>,
    /// Enter each URI on a new line.
    #[serde(rename = "redirect_uris", skip_serializing_if = "Option::is_none")]
    pub redirect_uris: Option<String>,
    /// Configure what data should be used as unique User Identifier. For most cases, the default should be fine.  * `hashed_user_id` - Based on the Hashed User ID * `user_id` - Based on user ID * `user_uuid` - Based on user UUID * `user_username` - Based on the username * `user_email` - Based on the User's Email. This is recommended over the UPN method. * `user_upn` - Based on the User's UPN, only works if user has a 'upn' attribute set. Use this method only if you have different UPN and Mail domains.
    #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")]
    pub sub_mode: Option<models::SubModeEnum>,
    /// Configure how the issuer field of the ID Token should be filled.  * `global` - Same identifier is used for all providers * `per_provider` - Each provider has a different issuer, based on the application slug.
    #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")]
    pub issuer_mode: Option<models::IssuerModeEnum>,
    #[serde(rename = "jwks_sources", skip_serializing_if = "Option::is_none")]
    pub jwks_sources: Option<Vec<uuid::Uuid>>,
}

impl PatchedOAuth2ProviderRequest {
    /// OAuth2Provider Serializer
    pub fn new() -> PatchedOAuth2ProviderRequest {
        PatchedOAuth2ProviderRequest {
            name: None,
            authentication_flow: None,
            authorization_flow: None,
            property_mappings: None,
            client_type: None,
            client_id: None,
            client_secret: None,
            access_code_validity: None,
            access_token_validity: None,
            refresh_token_validity: None,
            include_claims_in_id_token: None,
            signing_key: None,
            redirect_uris: None,
            sub_mode: None,
            issuer_mode: None,
            jwks_sources: None,
        }
    }
}