forked from ebhomengo/niki
1
0
Fork 0
niki/vendor/github.com/kavenegar/kavenegar-go/message_countPostalCode.go

29 lines
711 B
Go
Raw Normal View History

2024-08-29 03:26:59 +00:00
package kavenegar
import (
"net/url"
"strconv"
)
//MessageCountPostalCode ...
type MessageCountPostalCode struct {
Section string `json:"section"`
Value int `json:"value"`
}
//MessageCountPostalCodeResult ...
type MessageCountPostalCodeResult struct {
*Return `json:"return"`
Entries []MessageCountPostalCode `json:"entries"`
}
//CountPostalCode ...
func (message *MessageService) CountPostalCode(postalcode int64) ([]MessageCountPostalCode, error) {
u := message.client.EndPoint("sms", "countpostalcode")
m := new(MessageCountPostalCodeResult)
v := url.Values{}
v.Set("postalcode", strconv.FormatInt(postalcode, 10))
err := message.client.Execute(u.String(), v, m)
return m.Entries, err
}