Skip to content

Commit 9535030

Browse files
committed
Refactor UserEntity to use BaseModel and enhance attributes
- Updated UserEntity to inherit from BaseModel instead of User. - Added new fields: user_id, full_name, status, and explicit_webauthn_id for improved user representation. - Removed outdated fields 'updated' and 'updatedMs' to streamline the model.
1 parent 34d0f29 commit 9535030

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/corbado_python_sdk/entities/user_entity.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
from pydantic import ConfigDict
1+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2+
from typing import Optional
23

34
from corbado_python_sdk.generated.models.user import User
5+
from corbado_python_sdk.generated.models.user_status import UserStatus
46

57

6-
class UserEntity(User):
8+
class UserEntity(BaseModel):
79
"""Represents a user entity."""
810

11+
user_id: StrictStr = Field(alias="userID")
12+
full_name: Optional[StrictStr] = Field(default=None, alias="fullName")
13+
status: UserStatus
14+
explicit_webauthn_id: Optional[StrictStr] = Field(default=None, alias="explicitWebauthnID")
15+
916
model_config = ConfigDict(populate_by_name=True, from_attributes=True, arbitrary_types_allowed=True)
1017

1118
@classmethod
@@ -23,6 +30,4 @@ def from_user(cls, user: User) -> "UserEntity":
2330
status=user.status,
2431
explicitWebauthnID=user.explicit_webauthn_id,
2532
fullName=user.full_name,
26-
updated=user.updated,
27-
updatedMs=user.updated_ms,
2833
)

0 commit comments

Comments
 (0)