2024-02-18 10:42:21 +00:00
|
|
|
package kavenegar
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/url"
|
|
|
|
"strconv"
|
|
|
|
)
|
|
|
|
|
2024-04-26 19:30:35 +00:00
|
|
|
// LatestOutbox ...
|
2024-02-18 10:42:21 +00:00
|
|
|
func (message *MessageService) LatestOutbox(sender string, pagesize int) ([]Message, error) {
|
|
|
|
v := url.Values{}
|
|
|
|
v.Set("sender", sender)
|
|
|
|
v.Set("pagesize", strconv.Itoa(pagesize))
|
|
|
|
return message.CreateLatestOutbox(v)
|
|
|
|
}
|
|
|
|
|
2024-04-26 19:30:35 +00:00
|
|
|
// CreateLatestOutbox ...
|
2024-02-18 10:42:21 +00:00
|
|
|
func (message *MessageService) CreateLatestOutbox(v url.Values) ([]Message, error) {
|
|
|
|
u := message.client.EndPoint("sms", "latestoutbox")
|
|
|
|
vc := url.Values{}
|
|
|
|
if v.Get("sender") != "" {
|
|
|
|
vc.Set("sender", v.Get("sender"))
|
|
|
|
}
|
|
|
|
if v.Get("pagesize") != "" {
|
|
|
|
vc.Set("pagesize", v.Get("pagesize"))
|
|
|
|
}
|
|
|
|
m := new(MessageResult)
|
|
|
|
err := message.client.Execute(u.String(), v, m)
|
|
|
|
return m.Entries, err
|
|
|
|
}
|