niki/vendor/github.com/kavenegar/kavenegar-go/message_statusLocal.go

32 lines
715 B
Go
Raw Permalink Normal View History

2024-02-18 10:42:21 +00:00
package kavenegar
import (
"net/url"
"strconv"
)
2024-06-14 08:41:36 +00:00
// MessageStatusLocal ...
2024-02-18 10:42:21 +00:00
type MessageStatusLocal struct {
*MessageStatus
LocalID string `json:"localid"`
}
2024-06-14 08:41:36 +00:00
// MessageStatusLocalResult ...
2024-02-18 10:42:21 +00:00
type MessageStatusLocalResult struct {
*Return `json:"return"`
Entries []MessageStatusLocal `json:"entries"`
}
2024-06-14 08:41:36 +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-06-14 08:41:36 +00:00
if err != nil {
2024-02-18 10:42:21 +00:00
return MessageStatusLocal{}, err
}
return m.Entries[0], err
}