ory_client/models/ui_node.rs
1/*
2 * Ory APIs
3 *
4 * # Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages: | Language | Download SDK | Documentation | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart | [pub.dev](https://pub.dev/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md) | | .NET | [nuget.org](https://www.nuget.org/packages/Ory.Client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md) | | Elixir | [hex.pm](https://hex.pm/packages/ory_client) | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md) | | Go | [github.com](https://github.com/ory/client-go) | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md) | | Java | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md) | | JavaScript | [npmjs.com](https://www.npmjs.com/package/@ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch) | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) | | PHP | [packagist.org](https://packagist.org/packages/ory/client) | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md) | | Python | [pypi.org](https://pypi.org/project/ory-client/) | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md) | | Ruby | [rubygems.org](https://rubygems.org/gems/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md) | | Rust | [crates.io](https://crates.io/crates/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md) |
5 *
6 * The version of the OpenAPI document: v1.22.2
7 * Contact: support@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 #[serde(rename = "oauth2_consent")]
73 Oauth2Consent,
74}
75
76impl Default for GroupEnum {
77 fn default() -> GroupEnum {
78 Self::Default
79 }
80}
81/// The node's type text Text input Input img Image a Anchor script Script div Division
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum TypeEnum {
84 #[serde(rename = "text")]
85 Text,
86 #[serde(rename = "input")]
87 Input,
88 #[serde(rename = "img")]
89 Img,
90 #[serde(rename = "a")]
91 A,
92 #[serde(rename = "script")]
93 Script,
94 #[serde(rename = "div")]
95 Div,
96}
97
98impl Default for TypeEnum {
99 fn default() -> TypeEnum {
100 Self::Text
101 }
102}
103