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.79
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 #[serde(rename = "organization_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35 pub organization_id: Option<Option<String>>,
36 /// 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.
37 #[serde(rename = "request_url")]
38 pub request_url: String,
39 /// ReturnTo contains the requested return_to URL.
40 #[serde(rename = "return_to", skip_serializing_if = "Option::is_none")]
41 pub return_to: Option<String>,
42 #[serde(rename = "state")]
43 pub state: models::SettingsFlowState,
44 /// TransientPayload is used to pass data from the settings flow to hooks and email templates
45 #[serde(rename = "transient_payload", skip_serializing_if = "Option::is_none")]
46 pub transient_payload: Option<serde_json::Value>,
47 /// The flow type can either be `api` or `browser`.
48 #[serde(rename = "type")]
49 pub r#type: String,
50 #[serde(rename = "ui")]
51 pub ui: Box<models::UiContainer>,
52}
53
54impl SettingsFlow {
55 /// 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)
56 pub fn new(expires_at: String, id: String, identity: models::Identity, issued_at: String, request_url: String, state: models::SettingsFlowState, r#type: String, ui: models::UiContainer) -> SettingsFlow {
57 SettingsFlow {
58 active: None,
59 continue_with: None,
60 expires_at,
61 id,
62 identity: Box::new(identity),
63 issued_at,
64 organization_id: None,
65 request_url,
66 return_to: None,
67 state,
68 transient_payload: None,
69 r#type,
70 ui: Box::new(ui),
71 }
72 }
73}
74