ory_client/models/identity_credentials.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.2
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// IdentityCredentials : Credentials represents a specific credential type
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct IdentityCredentials {
17 #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
18 pub config: Option<serde_json::Value>,
19 /// CreatedAt is a helper struct field for gobuffalo.pop.
20 #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
21 pub created_at: Option<String>,
22 /// Identifiers represents a list of unique identifiers this credential type matches.
23 #[serde(rename = "identifiers", skip_serializing_if = "Option::is_none")]
24 pub identifiers: Option<Vec<String>>,
25 /// Type discriminates between different types of credentials. password CredentialsTypePassword oidc CredentialsTypeOIDC totp CredentialsTypeTOTP lookup_secret CredentialsTypeLookup webauthn CredentialsTypeWebAuthn code CredentialsTypeCodeAuth passkey CredentialsTypePasskey profile CredentialsTypeProfile saml CredentialsTypeSAML link_recovery CredentialsTypeRecoveryLink CredentialsTypeRecoveryLink is a special credential type linked to the link strategy (recovery flow). It is not used within the credentials object itself. code_recovery CredentialsTypeRecoveryCode
26 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
27 pub r#type: Option<TypeEnum>,
28 /// UpdatedAt is a helper struct field for gobuffalo.pop.
29 #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
30 pub updated_at: Option<String>,
31 /// Version refers to the version of the credential. Useful when changing the config schema.
32 #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
33 pub version: Option<i64>,
34}
35
36impl IdentityCredentials {
37 /// Credentials represents a specific credential type
38 pub fn new() -> IdentityCredentials {
39 IdentityCredentials {
40 config: None,
41 created_at: None,
42 identifiers: None,
43 r#type: None,
44 updated_at: None,
45 version: None,
46 }
47 }
48}
49/// Type discriminates between different types of credentials. password CredentialsTypePassword oidc CredentialsTypeOIDC totp CredentialsTypeTOTP lookup_secret CredentialsTypeLookup webauthn CredentialsTypeWebAuthn code CredentialsTypeCodeAuth passkey CredentialsTypePasskey profile CredentialsTypeProfile saml CredentialsTypeSAML link_recovery CredentialsTypeRecoveryLink CredentialsTypeRecoveryLink is a special credential type linked to the link strategy (recovery flow). It is not used within the credentials object itself. code_recovery CredentialsTypeRecoveryCode
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum TypeEnum {
52 #[serde(rename = "password")]
53 Password,
54 #[serde(rename = "oidc")]
55 Oidc,
56 #[serde(rename = "totp")]
57 Totp,
58 #[serde(rename = "lookup_secret")]
59 LookupSecret,
60 #[serde(rename = "webauthn")]
61 Webauthn,
62 #[serde(rename = "code")]
63 Code,
64 #[serde(rename = "passkey")]
65 Passkey,
66 #[serde(rename = "profile")]
67 Profile,
68 #[serde(rename = "saml")]
69 Saml,
70 #[serde(rename = "link_recovery")]
71 LinkRecovery,
72 #[serde(rename = "code_recovery")]
73 CodeRecovery,
74}
75
76impl Default for TypeEnum {
77 fn default() -> TypeEnum {
78 Self::Password
79 }
80}
81