Skip to main content

ory_kratos_client/models/
ui_node.rs

1/*
2 * Ory Identities API
3 *
4 * This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more. 
5 *
6 * The version of the OpenAPI document: v26.2.0
7 * Contact: office@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// UiNode : Nodes are represented as HTML elements or their native UI equivalents. For example, a node can be an `<img>` tag, or an `<input element>` but also `some plain text`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UiNode {
17    #[serde(rename = "attributes")]
18    pub attributes: Box<models::UiNodeAttributes>,
19    /// Group specifies which group (e.g. password authenticator) this node belongs to. default DefaultGroup password PasswordGroup oidc OpenIDConnectGroup profile ProfileGroup link LinkGroup code CodeGroup totp TOTPGroup lookup_secret LookupGroup webauthn WebAuthnGroup passkey PasskeyGroup identifier_first IdentifierFirstGroup captcha CaptchaGroup saml SAMLGroup
20    #[serde(rename = "group")]
21    pub group: GroupEnum,
22    #[serde(rename = "messages")]
23    pub messages: Vec<models::UiText>,
24    #[serde(rename = "meta")]
25    pub meta: Box<models::UiNodeMeta>,
26    /// The node's type text Text input Input img Image a Anchor script Script div Division
27    #[serde(rename = "type")]
28    pub r#type: TypeEnum,
29}
30
31impl UiNode {
32    /// Nodes are represented as HTML elements or their native UI equivalents. For example, a node can be an `<img>` tag, or an `<input element>` but also `some plain text`.
33    pub fn new(attributes: models::UiNodeAttributes, group: GroupEnum, messages: Vec<models::UiText>, meta: models::UiNodeMeta, r#type: TypeEnum) -> UiNode {
34        UiNode {
35            attributes: Box::new(attributes),
36            group,
37            messages,
38            meta: Box::new(meta),
39            r#type,
40        }
41    }
42}
43/// Group specifies which group (e.g. password authenticator) this node belongs to. default DefaultGroup password PasswordGroup oidc OpenIDConnectGroup profile ProfileGroup link LinkGroup code CodeGroup totp TOTPGroup lookup_secret LookupGroup webauthn WebAuthnGroup passkey PasskeyGroup identifier_first IdentifierFirstGroup captcha CaptchaGroup saml SAMLGroup
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
45pub enum GroupEnum {
46    #[serde(rename = "default")]
47    Default,
48    #[serde(rename = "password")]
49    Password,
50    #[serde(rename = "oidc")]
51    Oidc,
52    #[serde(rename = "profile")]
53    Profile,
54    #[serde(rename = "link")]
55    Link,
56    #[serde(rename = "code")]
57    Code,
58    #[serde(rename = "totp")]
59    Totp,
60    #[serde(rename = "lookup_secret")]
61    LookupSecret,
62    #[serde(rename = "webauthn")]
63    Webauthn,
64    #[serde(rename = "passkey")]
65    Passkey,
66    #[serde(rename = "identifier_first")]
67    IdentifierFirst,
68    #[serde(rename = "captcha")]
69    Captcha,
70    #[serde(rename = "saml")]
71    Saml,
72}
73
74impl Default for GroupEnum {
75    fn default() -> GroupEnum {
76        Self::Default
77    }
78}
79/// The node's type text Text input Input img Image a Anchor script Script div Division
80#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
81pub enum TypeEnum {
82    #[serde(rename = "text")]
83    Text,
84    #[serde(rename = "input")]
85    Input,
86    #[serde(rename = "img")]
87    Img,
88    #[serde(rename = "a")]
89    A,
90    #[serde(rename = "script")]
91    Script,
92    #[serde(rename = "div")]
93    Div,
94}
95
96impl Default for TypeEnum {
97    fn default() -> TypeEnum {
98        Self::Text
99    }
100}
101