2024-02-18 10:42:21 +00:00
|
|
|
package kavenegar
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/url"
|
|
|
|
"strconv"
|
|
|
|
)
|
|
|
|
|
2024-04-26 19:30:35 +00:00
|
|
|
// MessageStatusLocal ...
|
2024-02-18 10:42:21 +00:00
|
|
|
type MessageStatusLocal struct {
|
|
|
|
*MessageStatus
|
|
|
|
LocalID string `json:"localid"`
|
|
|
|
}
|
|
|
|
|
2024-04-26 19:30:35 +00:00
|
|
|
// MessageStatusLocalResult ...
|
2024-02-18 10:42:21 +00:00
|
|
|
type MessageStatusLocalResult struct {
|
|
|
|
*Return `json:"return"`
|
|
|
|
Entries []MessageStatusLocal `json:"entries"`
|
|
|
|
}
|
|
|
|
|
2024-04-26 19:30:35 +00:00
|
|
|
// StatusLocal ...
|
2024-02-18 10:42:21 +00:00
|
|
|
func (message *MessageService) StatusLocal(localid int64) (MessageStatusLocal, error) {
|
|
|
|
u := message.client.EndPoint("sms", "statuslocalmessageid")
|
|
|
|
m := new(MessageStatusLocalResult)
|
|
|
|
v := url.Values{}
|
|
|
|
v.Set("localid", strconv.FormatInt(localid, 10))
|
|
|
|
err := message.client.Execute(u.String(), v, m)
|
2024-04-26 19:30:35 +00:00
|
|
|
if err != nil {
|
2024-02-18 10:42:21 +00:00
|
|
|
return MessageStatusLocal{}, err
|
|
|
|
}
|
|
|
|
return m.Entries[0], err
|
|
|
|
}
|