authentik_client/models/
source_type.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * authentik
 *
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2024.10.0
 * Contact: hello@goauthentik.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// SourceType : Serializer for SourceType
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SourceType {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "verbose_name")]
    pub verbose_name: String,
    #[serde(rename = "urls_customizable")]
    pub urls_customizable: bool,
    #[serde(rename = "request_token_url", deserialize_with = "Option::deserialize")]
    pub request_token_url: Option<String>,
    #[serde(rename = "authorization_url", deserialize_with = "Option::deserialize")]
    pub authorization_url: Option<String>,
    #[serde(rename = "access_token_url", deserialize_with = "Option::deserialize")]
    pub access_token_url: Option<String>,
    #[serde(rename = "profile_url", deserialize_with = "Option::deserialize")]
    pub profile_url: Option<String>,
    #[serde(rename = "oidc_well_known_url", deserialize_with = "Option::deserialize")]
    pub oidc_well_known_url: Option<String>,
    #[serde(rename = "oidc_jwks_url", deserialize_with = "Option::deserialize")]
    pub oidc_jwks_url: Option<String>,
}

impl SourceType {
    /// Serializer for SourceType
    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 {
        SourceType {
            name,
            verbose_name,
            urls_customizable,
            request_token_url,
            authorization_url,
            access_token_url,
            profile_url,
            oidc_well_known_url,
            oidc_jwks_url,
        }
    }
}