63 lines
1.5 KiB
Go
63 lines
1.5 KiB
Go
package sigmasms
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type RecepientData struct {
|
|
MCC string `json:"mcc"`
|
|
MNC string `json:"mnc"`
|
|
Code string `json:"code"`
|
|
Type string `json:"type"`
|
|
Group string `json:"group"`
|
|
Operator string `json:"operator"`
|
|
}
|
|
|
|
type Billing struct {
|
|
ID string `json:"id"`
|
|
Amount float64 `json:"amount"`
|
|
Refunded bool `json:"refunded"`
|
|
TariffID string `json:"TariffId"`
|
|
}
|
|
|
|
type Billings struct {
|
|
IDs []uuid.UUID `json:"ids"`
|
|
}
|
|
|
|
type Stats struct {
|
|
Segments int `json:"segments"`
|
|
Characters int `json:"characters"`
|
|
}
|
|
|
|
type Meta struct {
|
|
Billing Billing `json:"billing"`
|
|
Billings Billings `json:"billings"`
|
|
Stats Stats `json:"stats"`
|
|
PatternID bool `json:"patternId"`
|
|
RecepientData RecepientData `json:"_recipientData"`
|
|
}
|
|
|
|
type State struct {
|
|
Status string `json:"status"`
|
|
Error bool `json:"error"`
|
|
ExtendedStatus string `json:"extendedStatus"`
|
|
}
|
|
|
|
type StatusResponse struct {
|
|
ID uuid.UUID `json:"id"`
|
|
ChainID uuid.UUID `json:"chainId"`
|
|
Type string `json:"type"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UpdatedAt string `json:"updatedAt"`
|
|
State State `json:"state"`
|
|
Meta *Meta `json:"meta"`
|
|
OwnerID uuid.UUID `json:"OwnerId"`
|
|
}
|
|
|
|
// 9987bf00-c082-4dec-b25f-875eb528cf34
|
|
func RequestStatus(id uuid.UUID, apiKey string) (resp *StatusResponse, err error) {
|
|
url := "https://user.sigmasms.ru/api/sendings/" + id.String()
|
|
err = requestGet(url, apiKey, nil, &resp)
|
|
return
|
|
}
|