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.61
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 InputAttributeAutocompleteUsername 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 InputAttributeAutocompleteUsername 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")]
101    Username,
102    #[serde(rename = "username webauthn")]
103    UsernameWebauthn,
104}
105
106impl Default for AutocompleteEnum {
107    fn default() -> AutocompleteEnum {
108        Self::Email
109    }
110}
111/// 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
112#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
113pub enum NodeTypeEnum {
114    #[serde(rename = "input")]
115    Input,
116}
117
118impl Default for NodeTypeEnum {
119    fn default() -> NodeTypeEnum {
120        Self::Input
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