authentik_rust/models/
plex_source_request.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/// PlexSourceRequest : Plex Source Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PlexSourceRequest {
16    /// Source's display Name.
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Internal source name, used in URLs.
20    #[serde(rename = "slug")]
21    pub slug: String,
22    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
23    pub enabled: Option<bool>,
24    /// Flow to use when authenticating existing users.
25    #[serde(rename = "authentication_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub authentication_flow: Option<Option<uuid::Uuid>>,
27    /// Flow to use when enrolling new users.
28    #[serde(rename = "enrollment_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub enrollment_flow: Option<Option<uuid::Uuid>>,
30    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
31    pub policy_engine_mode: Option<models::PolicyEngineMode>,
32    /// How the source determines if an existing user should be authenticated or a new user enrolled.  * `identifier` - Use the source-specific identifier * `email_link` - Link to a user with identical email address. Can have security implications when a source doesn't validate email addresses. * `email_deny` - Use the user's email address, but deny enrollment when the email address already exists. * `username_link` - Link to a user with identical username. Can have security implications when a username is used with another source. * `username_deny` - Use the user's username, but deny enrollment when the username already exists.
33    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
34    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
35    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
36    pub user_path_template: Option<String>,
37    /// Client identifier used to talk to Plex.
38    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
39    pub client_id: Option<String>,
40    /// Which servers a user has to be a member of to be granted access. Empty list allows every server.
41    #[serde(rename = "allowed_servers", skip_serializing_if = "Option::is_none")]
42    pub allowed_servers: Option<Vec<String>>,
43    /// Allow friends to authenticate, even if you don't share a server.
44    #[serde(rename = "allow_friends", skip_serializing_if = "Option::is_none")]
45    pub allow_friends: Option<bool>,
46    /// Plex token used to check friends
47    #[serde(rename = "plex_token")]
48    pub plex_token: String,
49}
50
51impl PlexSourceRequest {
52    /// Plex Source Serializer
53    pub fn new(name: String, slug: String, plex_token: String) -> PlexSourceRequest {
54        PlexSourceRequest {
55            name,
56            slug,
57            enabled: None,
58            authentication_flow: None,
59            enrollment_flow: None,
60            policy_engine_mode: None,
61            user_matching_mode: None,
62            user_path_template: None,
63            client_id: None,
64            allowed_servers: None,
65            allow_friends: None,
66            plex_token,
67        }
68    }
69}
70