ory_client/models/settings_flow.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.7
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// SettingsFlow : This flow is used when an identity wants to update settings (e.g. profile data, passwords, ...) in a selfservice manner. We recommend reading the [User Settings Documentation](../self-service/flows/user-settings)
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SettingsFlow {
17 /// Active, if set, contains the registration method that is being used. It is initially not set.
18 #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
19 pub active: Option<String>,
20 /// Contains a list of actions, that could follow this flow It can, for example, contain a reference to the verification flow, created as part of the user's registration.
21 #[serde(rename = "continue_with", skip_serializing_if = "Option::is_none")]
22 pub continue_with: Option<Vec<models::ContinueWith>>,
23 /// ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to update the setting, a new flow has to be initiated.
24 #[serde(rename = "expires_at")]
25 pub expires_at: String,
26 /// ID represents the flow's unique ID. When performing the settings flow, this represents the id in the settings ui's query parameter: http://<selfservice.flows.settings.ui_url>?flow=<id>
27 #[serde(rename = "id")]
28 pub id: String,
29 #[serde(rename = "identity")]
30 pub identity: Box<models::Identity>,
31 /// IssuedAt is the time (UTC) when the flow occurred.
32 #[serde(rename = "issued_at")]
33 pub issued_at: String,
34 /// RequestURL is the initial URL that was requested from Ory Kratos. It can be used to forward information contained in the URL's path or query for example.
35 #[serde(rename = "request_url")]
36 pub request_url: String,
37 /// ReturnTo contains the requested return_to URL.
38 #[serde(rename = "return_to", skip_serializing_if = "Option::is_none")]
39 pub return_to: Option<String>,
40 /// State represents the state of this flow. It knows two states: show_form: No user data has been collected, or it is invalid, and thus the form should be shown. success: Indicates that the settings flow has been updated successfully with the provided data. Done will stay true when repeatedly checking. If set to true, done will revert back to false only when a flow with invalid (e.g. \"please use a valid phone number\") data was sent.
41 #[serde(rename = "state", deserialize_with = "Option::deserialize")]
42 pub state: Option<serde_json::Value>,
43 /// TransientPayload is used to pass data from the settings flow to hooks and email templates
44 #[serde(rename = "transient_payload", skip_serializing_if = "Option::is_none")]
45 pub transient_payload: Option<serde_json::Value>,
46 /// The flow type can either be `api` or `browser`.
47 #[serde(rename = "type")]
48 pub r#type: String,
49 #[serde(rename = "ui")]
50 pub ui: Box<models::UiContainer>,
51}
52
53impl SettingsFlow {
54 /// This flow is used when an identity wants to update settings (e.g. profile data, passwords, ...) in a selfservice manner. We recommend reading the [User Settings Documentation](../self-service/flows/user-settings)
55 pub fn new(expires_at: String, id: String, identity: models::Identity, issued_at: String, request_url: String, state: Option<serde_json::Value>, r#type: String, ui: models::UiContainer) -> SettingsFlow {
56 SettingsFlow {
57 active: None,
58 continue_with: None,
59 expires_at,
60 id,
61 identity: Box::new(identity),
62 issued_at,
63 request_url,
64 return_to: None,
65 state,
66 transient_payload: None,
67 r#type,
68 ui: Box::new(ui),
69 }
70 }
71}
72