Skip to main content

ory_client/models/
ui_node_input_attributes.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.40
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// UiNodeInputAttributes : InputAttributes represents the attributes of an input node
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UiNodeInputAttributes {
17    /// The autocomplete attribute for the input. email InputAttributeAutocompleteEmail tel InputAttributeAutocompleteTel url InputAttributeAutocompleteUrl current-password InputAttributeAutocompleteCurrentPassword new-password InputAttributeAutocompleteNewPassword one-time-code InputAttributeAutocompleteOneTimeCode username webauthn InputAttributeAutocompleteUsernameWebauthn
18    #[serde(rename = "autocomplete", skip_serializing_if = "Option::is_none")]
19    pub autocomplete: Option<AutocompleteEnum>,
20    /// Sets the input's disabled field to true or false.
21    #[serde(rename = "disabled")]
22    pub disabled: bool,
23    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
24    pub label: Option<Box<models::UiText>>,
25    /// MaxLength may contain the input's maximum length.
26    #[serde(rename = "maxlength", skip_serializing_if = "Option::is_none")]
27    pub maxlength: Option<i64>,
28    /// The input's element name.
29    #[serde(rename = "name")]
30    pub name: String,
31    /// NodeType represents this node's types. It is a mirror of `node.type` and is primarily used to allow compatibility with OpenAPI 3.0.  In this struct it technically always is \"input\". text Text input Input img Image a Anchor script Script div Division
32    #[serde(rename = "node_type")]
33    pub node_type: NodeTypeEnum,
34    /// OnClick may contain javascript which should be executed on click. This is primarily used for WebAuthn.  Deprecated: Using OnClick requires the use of eval() which is a security risk. Use OnClickTrigger instead.
35    #[serde(rename = "onclick", skip_serializing_if = "Option::is_none")]
36    pub onclick: Option<String>,
37    /// OnClickTrigger may contain a WebAuthn trigger which should be executed on click.  The trigger maps to a JavaScript function provided by Ory, which triggers actions such as PassKey registration or login. oryWebAuthnRegistration WebAuthnTriggersWebAuthnRegistration oryWebAuthnLogin WebAuthnTriggersWebAuthnLogin oryPasskeyLogin WebAuthnTriggersPasskeyLogin oryPasskeyLoginAutocompleteInit WebAuthnTriggersPasskeyLoginAutocompleteInit oryPasskeyRegistration WebAuthnTriggersPasskeyRegistration oryPasskeySettingsRegistration WebAuthnTriggersPasskeySettingsRegistration
38    #[serde(rename = "onclickTrigger", skip_serializing_if = "Option::is_none")]
39    pub onclick_trigger: Option<OnclickTriggerEnum>,
40    /// OnLoad may contain javascript which should be executed on load. This is primarily used for WebAuthn.  Deprecated: Using OnLoad requires the use of eval() which is a security risk. Use OnLoadTrigger instead.
41    #[serde(rename = "onload", skip_serializing_if = "Option::is_none")]
42    pub onload: Option<String>,
43    /// OnLoadTrigger may contain a WebAuthn trigger which should be executed on load.  The trigger maps to a JavaScript function provided by Ory, which triggers actions such as PassKey registration or login. oryWebAuthnRegistration WebAuthnTriggersWebAuthnRegistration oryWebAuthnLogin WebAuthnTriggersWebAuthnLogin oryPasskeyLogin WebAuthnTriggersPasskeyLogin oryPasskeyLoginAutocompleteInit WebAuthnTriggersPasskeyLoginAutocompleteInit oryPasskeyRegistration WebAuthnTriggersPasskeyRegistration oryPasskeySettingsRegistration WebAuthnTriggersPasskeySettingsRegistration
44    #[serde(rename = "onloadTrigger", skip_serializing_if = "Option::is_none")]
45    pub onload_trigger: Option<OnloadTriggerEnum>,
46    /// The allowed values for the input when the underlying JSON schema defines an `enum`. When present, clients should render the field as a select/dropdown rather than a free-form text input. When absent, clients continue to render a plain text input, so this field is backward compatible with UIs that do not look at it.
47    #[serde(rename = "options", skip_serializing_if = "Option::is_none")]
48    pub options: Option<Vec<models::UiNodeInputAttributesOption>>,
49    /// The input's pattern.
50    #[serde(rename = "pattern", skip_serializing_if = "Option::is_none")]
51    pub pattern: Option<String>,
52    /// Mark this input field as required.
53    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
54    pub required: Option<bool>,
55    /// The input's element type. text InputAttributeTypeText password InputAttributeTypePassword number InputAttributeTypeNumber checkbox InputAttributeTypeCheckbox hidden InputAttributeTypeHidden email InputAttributeTypeEmail tel InputAttributeTypeTel submit InputAttributeTypeSubmit button InputAttributeTypeButton datetime-local InputAttributeTypeDateTimeLocal date InputAttributeTypeDate url InputAttributeTypeURI
56    #[serde(rename = "type")]
57    pub r#type: TypeEnum,
58    /// The input's value.
59    #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
60    pub value: Option<Option<serde_json::Value>>,
61}
62
63impl UiNodeInputAttributes {
64    /// InputAttributes represents the attributes of an input node
65    pub fn new(disabled: bool, name: String, node_type: NodeTypeEnum, r#type: TypeEnum) -> UiNodeInputAttributes {
66        UiNodeInputAttributes {
67            autocomplete: None,
68            disabled,
69            label: None,
70            maxlength: None,
71            name,
72            node_type,
73            onclick: None,
74            onclick_trigger: None,
75            onload: None,
76            onload_trigger: None,
77            options: None,
78            pattern: None,
79            required: None,
80            r#type,
81            value: None,
82        }
83    }
84}
85/// The autocomplete attribute for the input. email InputAttributeAutocompleteEmail tel InputAttributeAutocompleteTel url InputAttributeAutocompleteUrl current-password InputAttributeAutocompleteCurrentPassword new-password InputAttributeAutocompleteNewPassword one-time-code InputAttributeAutocompleteOneTimeCode username webauthn InputAttributeAutocompleteUsernameWebauthn
86#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
87pub enum AutocompleteEnum {
88    #[serde(rename = "email")]
89    Email,
90    #[serde(rename = "tel")]
91    Tel,
92    #[serde(rename = "url")]
93    Url,
94    #[serde(rename = "current-password")]
95    CurrentPassword,
96    #[serde(rename = "new-password")]
97    NewPassword,
98    #[serde(rename = "one-time-code")]
99    OneTimeCode,
100    #[serde(rename = "username webauthn")]
101    UsernameWebauthn,
102}
103
104impl Default for AutocompleteEnum {
105    fn default() -> AutocompleteEnum {
106        Self::Email
107    }
108}
109/// NodeType represents this node's types. It is a mirror of `node.type` and is primarily used to allow compatibility with OpenAPI 3.0.  In this struct it technically always is \"input\". text Text input Input img Image a Anchor script Script div Division
110#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
111pub enum NodeTypeEnum {
112    #[serde(rename = "input")]
113    Input,
114}
115
116impl Default for NodeTypeEnum {
117    fn default() -> NodeTypeEnum {
118        Self::Input
119    }
120}
121/// OnClickTrigger may contain a WebAuthn trigger which should be executed on click.  The trigger maps to a JavaScript function provided by Ory, which triggers actions such as PassKey registration or login. oryWebAuthnRegistration WebAuthnTriggersWebAuthnRegistration oryWebAuthnLogin WebAuthnTriggersWebAuthnLogin oryPasskeyLogin WebAuthnTriggersPasskeyLogin oryPasskeyLoginAutocompleteInit WebAuthnTriggersPasskeyLoginAutocompleteInit oryPasskeyRegistration WebAuthnTriggersPasskeyRegistration oryPasskeySettingsRegistration WebAuthnTriggersPasskeySettingsRegistration
122#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
123pub enum OnclickTriggerEnum {
124    #[serde(rename = "oryWebAuthnRegistration")]
125    OryWebAuthnRegistration,
126    #[serde(rename = "oryWebAuthnLogin")]
127    OryWebAuthnLogin,
128    #[serde(rename = "oryPasskeyLogin")]
129    OryPasskeyLogin,
130    #[serde(rename = "oryPasskeyLoginAutocompleteInit")]
131    OryPasskeyLoginAutocompleteInit,
132    #[serde(rename = "oryPasskeyRegistration")]
133    OryPasskeyRegistration,
134    #[serde(rename = "oryPasskeySettingsRegistration")]
135    OryPasskeySettingsRegistration,
136}
137
138impl Default for OnclickTriggerEnum {
139    fn default() -> OnclickTriggerEnum {
140        Self::OryWebAuthnRegistration
141    }
142}
143/// OnLoadTrigger may contain a WebAuthn trigger which should be executed on load.  The trigger maps to a JavaScript function provided by Ory, which triggers actions such as PassKey registration or login. oryWebAuthnRegistration WebAuthnTriggersWebAuthnRegistration oryWebAuthnLogin WebAuthnTriggersWebAuthnLogin oryPasskeyLogin WebAuthnTriggersPasskeyLogin oryPasskeyLoginAutocompleteInit WebAuthnTriggersPasskeyLoginAutocompleteInit oryPasskeyRegistration WebAuthnTriggersPasskeyRegistration oryPasskeySettingsRegistration WebAuthnTriggersPasskeySettingsRegistration
144#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
145pub enum OnloadTriggerEnum {
146    #[serde(rename = "oryWebAuthnRegistration")]
147    OryWebAuthnRegistration,
148    #[serde(rename = "oryWebAuthnLogin")]
149    OryWebAuthnLogin,
150    #[serde(rename = "oryPasskeyLogin")]
151    OryPasskeyLogin,
152    #[serde(rename = "oryPasskeyLoginAutocompleteInit")]
153    OryPasskeyLoginAutocompleteInit,
154    #[serde(rename = "oryPasskeyRegistration")]
155    OryPasskeyRegistration,
156    #[serde(rename = "oryPasskeySettingsRegistration")]
157    OryPasskeySettingsRegistration,
158}
159
160impl Default for OnloadTriggerEnum {
161    fn default() -> OnloadTriggerEnum {
162        Self::OryWebAuthnRegistration
163    }
164}
165/// The input's element type. text InputAttributeTypeText password InputAttributeTypePassword number InputAttributeTypeNumber checkbox InputAttributeTypeCheckbox hidden InputAttributeTypeHidden email InputAttributeTypeEmail tel InputAttributeTypeTel submit InputAttributeTypeSubmit button InputAttributeTypeButton datetime-local InputAttributeTypeDateTimeLocal date InputAttributeTypeDate url InputAttributeTypeURI
166#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
167pub enum TypeEnum {
168    #[serde(rename = "text")]
169    Text,
170    #[serde(rename = "password")]
171    Password,
172    #[serde(rename = "number")]
173    Number,
174    #[serde(rename = "checkbox")]
175    Checkbox,
176    #[serde(rename = "hidden")]
177    Hidden,
178    #[serde(rename = "email")]
179    Email,
180    #[serde(rename = "tel")]
181    Tel,
182    #[serde(rename = "submit")]
183    Submit,
184    #[serde(rename = "button")]
185    Button,
186    #[serde(rename = "datetime-local")]
187    DatetimeLocal,
188    #[serde(rename = "date")]
189    Date,
190    #[serde(rename = "url")]
191    Url,
192}
193
194impl Default for TypeEnum {
195    fn default() -> TypeEnum {
196        Self::Text
197    }
198}
199