File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ type TextMessage struct {
4343 Text string `json:"text" validate:"required,min=1,max=65535" example:"Hello World!"`
4444}
4545
46+ // HashedMessage represents an SMS message with a hashed payload.
47+ //
48+ // Hash is the SHA256 hash of the message content (text or data).
49+ type HashedMessage struct {
50+ Hash string `json:"hash" validate:"required,sha256" example:"1d4b6e3b1b6e3b1b6e3b1b6e3b1b6e3b1b6e3b1b"`
51+ }
52+
4653// DataMessage represents an SMS message with a binary payload.
4754//
4855// Data is the base64-encoded payload.
@@ -155,6 +162,11 @@ type MessageState struct {
155162 IsEncrypted bool `json:"isEncrypted" example:"false"` // Encrypted
156163 Recipients []RecipientState `json:"recipients" validate:"required,min=1,dive"` // Recipients states
157164 States map [string ]time.Time `json:"states"` // History of states
165+
166+ TextMessage * TextMessage `json:"textMessage,omitempty"` // Present only when `includeContent=true` and the message type is text.
167+ DataMessage * DataMessage `json:"dataMessage,omitempty"` // Present only when `includeContent=true` and the message type is data.
168+ HashedMessage * HashedMessage `json:"hashedMessage,omitempty"` // Hashed message content, if isHashed is true
169+
158170}
159171
160172func (m MessageState ) Validate () error {
You can’t perform that action at this time.
0 commit comments