Skip to content

Commit 9b64b25

Browse files
committed
update WasenderSuccessResponse and WasenderMessageSentData
1 parent aa9a1d4 commit 9b64b25

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

wasenderapi/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.1"
1+
__version__ = "0.3.3"

wasenderapi/models.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Optional, List, Dict, Any, Union
2+
from typing import Literal
23
from pydantic import BaseModel, Field, HttpUrl
34
from datetime import datetime
45

@@ -82,17 +83,16 @@ class LocationPinMessage(BaseMessage):
8283
LocationPin = LocationPinPayload
8384

8485
class WasenderMessageSentData(BaseModel):
85-
message_id: str = Field(alias="messageId")
86-
status: Optional[str] = None # e.g., "PENDING", "SENT"
87-
# Add other fields if the API returns more for a successful send
88-
89-
# Define other potential data types for success responses if needed
90-
# class OtherSuccessData(BaseModel):
91-
# some_field: str
86+
message_id: Union[str, int] = Field(alias="msgId")
87+
jid: str = Field(
88+
alias="jid",
89+
description='The WhatsApp JID (e.g., "<user_id>@s.whatsapp.net")'
90+
)
91+
status: Optional[Literal['in_progress', 'sent']] = None
9292

9393
class WasenderSuccessResponse(BaseModel):
9494
success: bool = True
95-
message: str
95+
message: Optional[str] = None
9696
# Make data a Union of possible successful data structures or Any
9797
data: Optional[Union[WasenderMessageSentData, Dict[str, Any], List[Any], str, None]] = None
9898

0 commit comments

Comments
 (0)