clerk_rs/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.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct UpdateUserRequest {
13	/// The ID of the user as used in your external systems or your previous authentication solution. Must be unique across your instance.
14	#[serde(
15		rename = "external_id",
16		default,
17		with = "::serde_with::rust::double_option",
18		skip_serializing_if = "Option::is_none"
19	)]
20	pub external_id: Option<Option<String>>,
21	/// The first name to assign to the user
22	#[serde(
23		rename = "first_name",
24		default,
25		with = "::serde_with::rust::double_option",
26		skip_serializing_if = "Option::is_none"
27	)]
28	pub first_name: Option<Option<String>>,
29	/// The last name to assign to the user
30	#[serde(
31		rename = "last_name",
32		default,
33		with = "::serde_with::rust::double_option",
34		skip_serializing_if = "Option::is_none"
35	)]
36	pub last_name: Option<Option<String>>,
37	/// The ID of the email address to set as primary. It must be verified, and present on the current user.
38	#[serde(rename = "primary_email_address_id", skip_serializing_if = "Option::is_none")]
39	pub primary_email_address_id: Option<String>,
40	/// If set to `true`, the user will be notified that their primary email address has changed. By default, no notification is sent.
41	#[serde(rename = "notify_primary_email_address_changed", skip_serializing_if = "Option::is_none")]
42	pub notify_primary_email_address_changed: Option<bool>,
43	/// The ID of the phone number to set as primary. It must be verified, and present on the current user.
44	#[serde(rename = "primary_phone_number_id", skip_serializing_if = "Option::is_none")]
45	pub primary_phone_number_id: Option<String>,
46	/// The ID of the web3 wallets to set as primary. It must be verified, and present on the current user.
47	#[serde(rename = "primary_web3_wallet_id", skip_serializing_if = "Option::is_none")]
48	pub primary_web3_wallet_id: Option<String>,
49	/// The username to give to the user. It must be unique across your instance.
50	#[serde(
51		rename = "username",
52		default,
53		with = "::serde_with::rust::double_option",
54		skip_serializing_if = "Option::is_none"
55	)]
56	pub username: Option<Option<String>>,
57	/// The ID of the image to set as the user's profile image
58	#[serde(
59		rename = "profile_image_id",
60		default,
61		with = "::serde_with::rust::double_option",
62		skip_serializing_if = "Option::is_none"
63	)]
64	pub profile_image_id: Option<Option<String>>,
65	/// The plaintext password to give the user. Must be at least 8 characters long, and can not be in any list of hacked passwords.
66	#[serde(
67		rename = "password",
68		default,
69		with = "::serde_with::rust::double_option",
70		skip_serializing_if = "Option::is_none"
71	)]
72	pub password: Option<Option<String>>,
73	/// Set it to `true` if you're updating the user's password and want to skip any password policy settings check. This parameter can only be used when providing a `password`.
74	#[serde(
75		rename = "skip_password_checks",
76		default,
77		with = "::serde_with::rust::double_option",
78		skip_serializing_if = "Option::is_none"
79	)]
80	pub skip_password_checks: Option<Option<bool>>,
81	/// Set to `true` to sign out the user from all their active sessions once their password is updated. This parameter can only be used when providing a `password`.
82	#[serde(
83		rename = "sign_out_of_other_sessions",
84		default,
85		with = "::serde_with::rust::double_option",
86		skip_serializing_if = "Option::is_none"
87	)]
88	pub sign_out_of_other_sessions: Option<Option<bool>>,
89	/// 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
90	#[serde(rename = "totp_secret", skip_serializing_if = "Option::is_none")]
91	pub totp_secret: Option<String>,
92	/// 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.
93	#[serde(rename = "backup_codes", skip_serializing_if = "Option::is_none")]
94	pub backup_codes: Option<Vec<String>>,
95	/// Metadata saved on the user, that is visible to both your Frontend and Backend APIs
96	#[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
97	pub public_metadata: Option<serde_json::Value>,
98	/// Metadata saved on the user, that is only visible to your Backend API
99	#[serde(rename = "private_metadata", skip_serializing_if = "Option::is_none")]
100	pub private_metadata: Option<serde_json::Value>,
101	/// 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.
102	#[serde(rename = "unsafe_metadata", skip_serializing_if = "Option::is_none")]
103	pub unsafe_metadata: Option<serde_json::Value>,
104	/// If true, the user can delete themselves with the Frontend API.
105	#[serde(
106		rename = "delete_self_enabled",
107		default,
108		with = "::serde_with::rust::double_option",
109		skip_serializing_if = "Option::is_none"
110	)]
111	pub delete_self_enabled: Option<Option<bool>>,
112	/// If true, the user can create organizations with the Frontend API.
113	#[serde(
114		rename = "create_organization_enabled",
115		default,
116		with = "::serde_with::rust::double_option",
117		skip_serializing_if = "Option::is_none"
118	)]
119	pub create_organization_enabled: Option<Option<bool>>,
120	/// 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`).
121	#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
122	pub created_at: Option<String>,
123}
124
125impl UpdateUserRequest {
126	pub fn new() -> UpdateUserRequest {
127		UpdateUserRequest {
128			external_id: None,
129			first_name: None,
130			last_name: None,
131			primary_email_address_id: None,
132			notify_primary_email_address_changed: None,
133			primary_phone_number_id: None,
134			primary_web3_wallet_id: None,
135			username: None,
136			profile_image_id: None,
137			password: None,
138			skip_password_checks: None,
139			sign_out_of_other_sessions: None,
140			totp_secret: None,
141			backup_codes: None,
142			public_metadata: None,
143			private_metadata: None,
144			unsafe_metadata: None,
145			delete_self_enabled: None,
146			create_organization_enabled: None,
147			created_at: None,
148		}
149	}
150}