Skip to content

Commit 282ba26

Browse files
Add user properties to the create/migrate/update APIs (#8)
1 parent df0c9c3 commit 282ba26

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "propelauth"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
authors = ["support@propelauth.com"]
55
description = "A Rust crate for managing authentication and authorization with support for multi-tenant / B2B products, powered by PropelAuth"
66
keywords = ["authentication", "auth", "authorization", "b2b", "tenant"]

src/models/create_user_request.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212

1313

14+
use std::collections::HashMap;
15+
use serde_json::Value;
16+
1417
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
1518
pub struct CreateUserRequest {
1619
#[serde(rename = "email")]
@@ -27,6 +30,8 @@ pub struct CreateUserRequest {
2730
pub first_name: Option<String>,
2831
#[serde(rename = "last_name", skip_serializing_if = "Option::is_none")]
2932
pub last_name: Option<String>,
33+
#[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
34+
pub properties: Option<HashMap<String, Value>>,
3035
}
3136

3237
impl CreateUserRequest {
@@ -39,6 +44,7 @@ impl CreateUserRequest {
3944
username: None,
4045
first_name: None,
4146
last_name: None,
47+
properties: None,
4248
}
4349
}
4450
}

src/models/migrate_user_request.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212

1313

14+
use std::collections::HashMap;
15+
use serde_json::Value;
16+
1417
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
1518
pub struct MigrateUserRequest {
1619
#[serde(rename = "email")]
@@ -31,6 +34,8 @@ pub struct MigrateUserRequest {
3134
pub first_name: Option<String>,
3235
#[serde(rename = "last_name", skip_serializing_if = "Option::is_none")]
3336
pub last_name: Option<String>,
37+
#[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
38+
pub properties: Option<HashMap<String, Value>>,
3439
}
3540

3641
impl MigrateUserRequest {
@@ -45,6 +50,7 @@ impl MigrateUserRequest {
4550
username: None,
4651
first_name: None,
4752
last_name: None,
53+
properties: None,
4854
}
4955
}
5056
}

src/models/update_metadata_request.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ pub struct UpdateMetadataRequest {
2727
pub picture_url: Option<String>,
2828
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
2929
pub metadata: Option<HashMap<String, Value>>,
30+
#[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
31+
pub properties: Option<HashMap<String, Value>>,
3032
}
3133

3234
impl UpdateMetadataRequest {
@@ -37,6 +39,7 @@ impl UpdateMetadataRequest {
3739
last_name: None,
3840
picture_url: None,
3941
metadata: None,
42+
properties: None,
4043
}
4144
}
4245
}

src/models/user_metadata.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pub struct UserMetadata {
5151
pub impersonated_user_id: Option<String>,
5252
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
5353
pub metadata: Option<HashMap<String, Value>>,
54+
#[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
55+
pub properties: Option<HashMap<String, Value>>,
5456
}
5557

5658
impl UserMetadata {
@@ -73,6 +75,7 @@ impl UserMetadata {
7375
legacy_user_id: None,
7476
impersonated_user_id: None,
7577
metadata: None,
78+
properties: None,
7679
}
7780
}
7881
}

0 commit comments

Comments
 (0)