clerk_sdk_rust_community/models/
update_user_request.rs

1/*
2 * Clerk Backend API
3 *
4 * The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: support@clerk.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct UpdateUserRequest {
16    /// The ID of the user as used in your external systems or your previous authentication solution. Must be unique across your instance.
17    #[serde(rename = "external_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub external_id: Option<Option<String>>,
19    /// The first name to assign to the user
20    #[serde(rename = "first_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub first_name: Option<Option<String>>,
22    /// The last name to assign to the user
23    #[serde(rename = "last_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub last_name: Option<Option<String>>,
25    /// The ID of the email address to set as primary. It must be verified, and present on the current user.
26    #[serde(rename = "primary_email_address_id", skip_serializing_if = "Option::is_none")]
27    pub primary_email_address_id: Option<String>,
28    /// The ID of the phone number to set as primary. It must be verified, and present on the current user.
29    #[serde(rename = "primary_phone_number_id", skip_serializing_if = "Option::is_none")]
30    pub primary_phone_number_id: Option<String>,
31    /// The ID of the web3 wallets to set as primary. It must be verified, and present on the current user.
32    #[serde(rename = "primary_web3_wallet_id", skip_serializing_if = "Option::is_none")]
33    pub primary_web3_wallet_id: Option<String>,
34    /// The username to give to the user. It must be unique across your instance.
35    #[serde(rename = "username", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub username: Option<Option<String>>,
37    /// The ID of the image to set as the user's profile image
38    #[serde(rename = "profile_image_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub profile_image_id: Option<Option<String>>,
40    /// The plaintext password to give the user. Must be at least 8 characters long, and can not be in any list of hacked passwords.
41    #[serde(rename = "password", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub password: Option<Option<String>>,
43    /// In case TOTP is configured on the instance, you can provide the secret to enable it on the specific user without the need to reset it. Please note that currently the supported options are: * Period: 30 seconds * Code length: 6 digits * Algorithm: SHA1
44    #[serde(rename = "totp_secret", skip_serializing_if = "Option::is_none")]
45    pub totp_secret: Option<String>,
46    /// If Backup Codes are configured on the instance, you can provide them to enable it on the specific user without the need to reset them. You must provide the backup codes in plain format or the corresponding bcrypt digest.
47    #[serde(rename = "backup_codes", skip_serializing_if = "Option::is_none")]
48    pub backup_codes: Option<Vec<String>>,
49    /// Metadata saved on the user, that is visible to both your Frontend and Backend APIs
50    #[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
51    pub public_metadata: Option<serde_json::Value>,
52    /// Metadata saved on the user, that is only visible to your Backend API
53    #[serde(rename = "private_metadata", skip_serializing_if = "Option::is_none")]
54    pub private_metadata: Option<serde_json::Value>,
55    /// Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe.
56    #[serde(rename = "unsafe_metadata", skip_serializing_if = "Option::is_none")]
57    pub unsafe_metadata: Option<serde_json::Value>,
58    /// A custom date/time denoting _when_ the user signed up to the application, specified in RFC3339 format (e.g. `2012-10-20T07:15:20.902Z`).
59    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
60    pub created_at: Option<String>,
61}
62
63impl UpdateUserRequest {
64    pub fn new() -> UpdateUserRequest {
65        UpdateUserRequest {
66            external_id: None,
67            first_name: None,
68            last_name: None,
69            primary_email_address_id: None,
70            primary_phone_number_id: None,
71            primary_web3_wallet_id: None,
72            username: None,
73            profile_image_id: None,
74            password: None,
75            totp_secret: None,
76            backup_codes: None,
77            public_metadata: None,
78            private_metadata: None,
79            unsafe_metadata: None,
80            created_at: None,
81        }
82    }
83}
84
85