Skip to content

Commit

Permalink
Populate by name for Client object.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Oct 14, 2024
1 parent 1e3f3cd commit 8fd2fd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion py3xui/client/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""This module contains the Client class which represents a client in the XUI API."""

from pydantic import BaseModel, Field
from pydantic import BaseModel, ConfigDict, Field


# pylint: disable=too-few-public-methods
Expand Down Expand Up @@ -67,3 +67,7 @@ class Client(BaseModel):
sub_id: str = Field(default="", alias=ClientFields.SUB_ID) # type: ignore
tg_id: int | str | None = Field(default="", alias=ClientFields.TG_ID) # type: ignore
total_gb: int = Field(default=0, alias=ClientFields.TOTAL_GB) # type: ignore

model_config = ConfigDict(
populate_by_name=True,
)

0 comments on commit 8fd2fd2

Please sign in to comment.