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.17.2
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
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
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 input's pattern.
47    #[serde(rename = "pattern", skip_serializing_if = "Option::is_none")]
48    pub pattern: Option<String>,
49    /// Mark this input field as required.
50    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
51    pub required: Option<bool>,
52    /// 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
53    #[serde(rename = "type")]
54    pub r#type: TypeEnum,
55    /// The input's value.
56    #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
57    pub value: Option<Option<serde_json::Value>>,
58}
59
60impl UiNodeInputAttributes {
61    /// InputAttributes represents the attributes of an input node
62    pub fn new(disabled: bool, name: String, node_type: NodeTypeEnum, r#type: TypeEnum) -> UiNodeInputAttributes {
63        UiNodeInputAttributes {
64            autocomplete: None,
65            disabled,
66            label: None,
67            maxlength: None,
68            name,
69            node_type,
70            onclick: None,
71            onclick_trigger: None,
72            onload: None,
73            onload_trigger: None,
74            pattern: None,
75            required: None,
76            r#type,
77            value: None,
78        }
79    }
80}
81/// The autocomplete attribute for the input. email InputAttributeAutocompleteEmail tel InputAttributeAutocompleteTel url InputAttributeAutocompleteUrl current-password InputAttributeAutocompleteCurrentPassword new-password InputAttributeAutocompleteNewPassword one-time-code InputAttributeAutocompleteOneTimeCode
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum AutocompleteEnum {
84    #[serde(rename = "email")]
85    Email,
86    #[serde(rename = "tel")]
87    Tel,
88    #[serde(rename = "url")]
89    Url,
90    #[serde(rename = "current-password")]
91    CurrentPassword,
92    #[serde(rename = "new-password")]
93    NewPassword,
94    #[serde(rename = "one-time-code")]
95    OneTimeCode,
96}
97
98impl Default for AutocompleteEnum {
99    fn default() -> AutocompleteEnum {
100        Self::Email
101    }
102}
103/// 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
104#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
105pub enum NodeTypeEnum {
106    #[serde(rename = "text")]
107    Text,
108    #[serde(rename = "input")]
109    Input,
110    #[serde(rename = "img")]
111    Img,
112    #[serde(rename = "a")]
113    A,
114    #[serde(rename = "script")]
115    Script,
116}
117
118impl Default for NodeTypeEnum {
119    fn default() -> NodeTypeEnum {
120        Self::Text
121    }
122}
123/// 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
124#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
125pub enum OnclickTriggerEnum {
126    #[serde(rename = "oryWebAuthnRegistration")]
127    OryWebAuthnRegistration,
128    #[serde(rename = "oryWebAuthnLogin")]
129    OryWebAuthnLogin,
130    #[serde(rename = "oryPasskeyLogin")]
131    OryPasskeyLogin,
132    #[serde(rename = "oryPasskeyLoginAutocompleteInit")]
133    OryPasskeyLoginAutocompleteInit,
134    #[serde(rename = "oryPasskeyRegistration")]
135    OryPasskeyRegistration,
136    #[serde(rename = "oryPasskeySettingsRegistration")]
137    OryPasskeySettingsRegistration,
138}
139
140impl Default for OnclickTriggerEnum {
141    fn default() -> OnclickTriggerEnum {
142        Self::OryWebAuthnRegistration
143    }
144}
145/// 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
146#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
147pub enum OnloadTriggerEnum {
148    #[serde(rename = "oryWebAuthnRegistration")]
149    OryWebAuthnRegistration,
150    #[serde(rename = "oryWebAuthnLogin")]
151    OryWebAuthnLogin,
152    #[serde(rename = "oryPasskeyLogin")]
153    OryPasskeyLogin,
154    #[serde(rename = "oryPasskeyLoginAutocompleteInit")]
155    OryPasskeyLoginAutocompleteInit,
156    #[serde(rename = "oryPasskeyRegistration")]
157    OryPasskeyRegistration,
158    #[serde(rename = "oryPasskeySettingsRegistration")]
159    OryPasskeySettingsRegistration,
160}
161
162impl Default for OnloadTriggerEnum {
163    fn default() -> OnloadTriggerEnum {
164        Self::OryWebAuthnRegistration
165    }
166}
167/// 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
168#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
169pub enum TypeEnum {
170    #[serde(rename = "text")]
171    Text,
172    #[serde(rename = "password")]
173    Password,
174    #[serde(rename = "number")]
175    Number,
176    #[serde(rename = "checkbox")]
177    Checkbox,
178    #[serde(rename = "hidden")]
179    Hidden,
180    #[serde(rename = "email")]
181    Email,
182    #[serde(rename = "tel")]
183    Tel,
184    #[serde(rename = "submit")]
185    Submit,
186    #[serde(rename = "button")]
187    Button,
188    #[serde(rename = "datetime-local")]
189    DatetimeLocal,
190    #[serde(rename = "date")]
191    Date,
192    #[serde(rename = "url")]
193    Url,
194}
195
196impl Default for TypeEnum {
197    fn default() -> TypeEnum {
198        Self::Text
199    }
200}
201