ory_client/models/
account_experience_configuration.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.21
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AccountExperienceConfiguration {
16    #[serde(rename = "default_locale")]
17    pub default_locale: String,
18    #[serde(rename = "default_redirect_url")]
19    pub default_redirect_url: String,
20    #[serde(rename = "enabled_locales")]
21    pub enabled_locales: Vec<String>,
22    #[serde(rename = "error_ui_url")]
23    pub error_ui_url: String,
24    #[serde(rename = "favicon_dark_url", skip_serializing_if = "Option::is_none")]
25    pub favicon_dark_url: Option<String>,
26    #[serde(rename = "favicon_light_url", skip_serializing_if = "Option::is_none")]
27    pub favicon_light_url: Option<String>,
28    ///  force_default AccountExperienceLocaleBehaviorForceDefault respect_accept_language AccountExperienceLocaleBehaviorRespectAcceptLanguage
29    #[serde(rename = "locale_behavior")]
30    pub locale_behavior: LocaleBehaviorEnum,
31    #[serde(rename = "login_ui_url")]
32    pub login_ui_url: String,
33    #[serde(rename = "logo_dark_url", skip_serializing_if = "Option::is_none")]
34    pub logo_dark_url: Option<String>,
35    #[serde(rename = "logo_light_url", skip_serializing_if = "Option::is_none")]
36    pub logo_light_url: Option<String>,
37    #[serde(rename = "name")]
38    pub name: String,
39    #[serde(rename = "recovery_enabled")]
40    pub recovery_enabled: bool,
41    #[serde(rename = "recovery_ui_url")]
42    pub recovery_ui_url: String,
43    #[serde(rename = "registration_enabled")]
44    pub registration_enabled: bool,
45    #[serde(rename = "registration_ui_url")]
46    pub registration_ui_url: String,
47    #[serde(rename = "settings_ui_url")]
48    pub settings_ui_url: String,
49    #[serde(rename = "stylesheet", skip_serializing_if = "Option::is_none")]
50    pub stylesheet: Option<String>,
51    #[serde(rename = "translations")]
52    pub translations: Vec<models::RevisionAccountExperienceCustomTranslation>,
53    #[serde(rename = "verification_enabled")]
54    pub verification_enabled: bool,
55    #[serde(rename = "verification_ui_url")]
56    pub verification_ui_url: String,
57}
58
59impl AccountExperienceConfiguration {
60    pub fn new(default_locale: String, default_redirect_url: String, enabled_locales: Vec<String>, error_ui_url: String, locale_behavior: LocaleBehaviorEnum, login_ui_url: String, name: String, recovery_enabled: bool, recovery_ui_url: String, registration_enabled: bool, registration_ui_url: String, settings_ui_url: String, translations: Vec<models::RevisionAccountExperienceCustomTranslation>, verification_enabled: bool, verification_ui_url: String) -> AccountExperienceConfiguration {
61        AccountExperienceConfiguration {
62            default_locale,
63            default_redirect_url,
64            enabled_locales,
65            error_ui_url,
66            favicon_dark_url: None,
67            favicon_light_url: None,
68            locale_behavior,
69            login_ui_url,
70            logo_dark_url: None,
71            logo_light_url: None,
72            name,
73            recovery_enabled,
74            recovery_ui_url,
75            registration_enabled,
76            registration_ui_url,
77            settings_ui_url,
78            stylesheet: None,
79            translations,
80            verification_enabled,
81            verification_ui_url,
82        }
83    }
84}
85///  force_default AccountExperienceLocaleBehaviorForceDefault respect_accept_language AccountExperienceLocaleBehaviorRespectAcceptLanguage
86#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
87pub enum LocaleBehaviorEnum {
88    #[serde(rename = "force_default")]
89    ForceDefault,
90    #[serde(rename = "respect_accept_language")]
91    RespectAcceptLanguage,
92}
93
94impl Default for LocaleBehaviorEnum {
95    fn default() -> LocaleBehaviorEnum {
96        Self::ForceDefault
97    }
98}
99