Skip to content

Commit

Permalink
Add type hints for item attributes (#86)
Browse files Browse the repository at this point in the history
* Add type hints for item attributes

* Add attribute_update to Enum
  • Loading branch information
tr4nt0r authored Sep 24, 2024
1 parent 9f05fa5 commit ea0daab
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bring_api/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ class BringList(TypedDict):
theme: str


class BringAttribute(TypedDict):
"""An attribute class. Represents a single item attribute."""

type: str
content: dict[str, bool]


class BringPurchase(TypedDict):
"""A purchase class. Represents a single item."""

uuid: str
itemId: str
specification: str
attributes: list[BringAttribute]


class BringListItemDetails(TypedDict):
Expand Down Expand Up @@ -133,6 +141,7 @@ class BringItemOperation(StrEnum):
ADD = "TO_PURCHASE"
COMPLETE = "TO_RECENTLY"
REMOVE = "REMOVE"
ATTRIBUTE_UPDATE = "ATTRIBUTE_UPDATE"


class BringItem(TypedDict):
Expand All @@ -142,8 +151,15 @@ class BringItem(TypedDict):
spec: str
uuid: str
operation: NotRequired[
BringItemOperation | Literal["TO_PURCHASE", "TO_RECENTLY", "REMOVE"]
BringItemOperation
| Literal[
"TO_PURCHASE",
"TO_RECENTLY",
"REMOVE",
"ATTRIBUTE_UPDATE",
]
]
attribute: NotRequired[BringAttribute]


class BringAuthTokenResponse(TypedDict):
Expand Down

0 comments on commit ea0daab

Please sign in to comment.