authentik_rust/models/
source_type.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2024.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// SourceType : Serializer for SourceType
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SourceType {
16    #[serde(rename = "name")]
17    pub name: String,
18    #[serde(rename = "verbose_name")]
19    pub verbose_name: String,
20    #[serde(rename = "urls_customizable")]
21    pub urls_customizable: bool,
22    #[serde(rename = "request_token_url", deserialize_with = "Option::deserialize")]
23    pub request_token_url: Option<String>,
24    #[serde(rename = "authorization_url", deserialize_with = "Option::deserialize")]
25    pub authorization_url: Option<String>,
26    #[serde(rename = "access_token_url", deserialize_with = "Option::deserialize")]
27    pub access_token_url: Option<String>,
28    #[serde(rename = "profile_url", deserialize_with = "Option::deserialize")]
29    pub profile_url: Option<String>,
30    #[serde(rename = "oidc_well_known_url", deserialize_with = "Option::deserialize")]
31    pub oidc_well_known_url: Option<String>,
32    #[serde(rename = "oidc_jwks_url", deserialize_with = "Option::deserialize")]
33    pub oidc_jwks_url: Option<String>,
34}
35
36impl SourceType {
37    /// Serializer for SourceType
38    pub fn new(name: String, verbose_name: String, urls_customizable: bool, request_token_url: Option<String>, authorization_url: Option<String>, access_token_url: Option<String>, profile_url: Option<String>, oidc_well_known_url: Option<String>, oidc_jwks_url: Option<String>) -> SourceType {
39        SourceType {
40            name,
41            verbose_name,
42            urls_customizable,
43            request_token_url,
44            authorization_url,
45            access_token_url,
46            profile_url,
47            oidc_well_known_url,
48            oidc_jwks_url,
49        }
50    }
51}
52