Initial AS213905 SDK release
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
package as213905
|
||||
|
||||
import "time"
|
||||
|
||||
type Organization struct {
|
||||
ID string `json:"id"`
|
||||
ASN int64 `json:"asn"`
|
||||
Name string `json:"name"`
|
||||
Status string `json:"status"`
|
||||
CommitKbps int64 `json:"commit_kbps"`
|
||||
}
|
||||
|
||||
type Invoice struct {
|
||||
ID string `json:"id"`
|
||||
Number string `json:"number"`
|
||||
Status string `json:"status"`
|
||||
Currency string `json:"currency"`
|
||||
TotalCents int64 `json:"total_cents"`
|
||||
PeriodFrom *string `json:"period_from,omitempty"`
|
||||
PeriodTo *string `json:"period_to,omitempty"`
|
||||
IssuedAt *time.Time `json:"issued_at,omitempty"`
|
||||
DueAt *time.Time `json:"due_at,omitempty"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
ID string `json:"id"`
|
||||
Kind string `json:"kind"`
|
||||
Label string `json:"label"`
|
||||
Status string `json:"status"`
|
||||
MonthlyCents int64 `json:"monthly_cents"`
|
||||
NextDueOn *string `json:"next_due_on,omitempty"`
|
||||
Controllable bool `json:"controllable,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
Configuration map[string]any `json:"configuration,omitempty"`
|
||||
}
|
||||
|
||||
type MetricPoint struct {
|
||||
Time time.Time `json:"t"`
|
||||
Value *float64 `json:"v,omitempty"`
|
||||
}
|
||||
|
||||
type MetricSeries struct {
|
||||
Metric string `json:"metric"`
|
||||
Target string `json:"target"`
|
||||
Range string `json:"range"`
|
||||
Points []MetricPoint `json:"points"`
|
||||
}
|
||||
|
||||
type Period struct {
|
||||
From time.Time `json:"from"`
|
||||
To time.Time `json:"to"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
type Traffic struct {
|
||||
P95Kbps int64 `json:"p95_kbps"`
|
||||
CommitKbps int64 `json:"commit_kbps,omitempty"`
|
||||
OverCommit bool `json:"over_commit,omitempty"`
|
||||
TotalBytes int64 `json:"total_bytes"`
|
||||
TotalGB float64 `json:"total_gb"`
|
||||
Period Period `json:"period"`
|
||||
}
|
||||
|
||||
type Tunnel struct {
|
||||
ID string `json:"id"`
|
||||
Status string `json:"status"`
|
||||
Label string `json:"label,omitempty"`
|
||||
Location string `json:"location"`
|
||||
PeerEndpoint string `json:"peer_endpoint"`
|
||||
IfName string `json:"ifname,omitempty"`
|
||||
InnerV4 string `json:"inner_v4,omitempty"`
|
||||
InnerV6 string `json:"inner_v6,omitempty"`
|
||||
Announce bool `json:"announce,omitempty"`
|
||||
}
|
||||
|
||||
type TrafficQuery struct {
|
||||
Days int
|
||||
From string
|
||||
To string
|
||||
}
|
||||
|
||||
type CreateTunnelRequest struct {
|
||||
PeerEndpoint string `json:"peer_endpoint"`
|
||||
Location string `json:"location"`
|
||||
Label string `json:"label,omitempty"`
|
||||
Announce bool `json:"announce,omitempty"`
|
||||
}
|
||||
|
||||
type Geofeed struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Slug string `json:"slug"`
|
||||
RecordCount int `json:"record_count"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Records []GeofeedRecord `json:"records,omitempty"`
|
||||
}
|
||||
|
||||
type GeofeedRecord struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Prefix string `json:"prefix"`
|
||||
CountryCode string `json:"country_code"`
|
||||
RegionCode string `json:"region_code,omitempty"`
|
||||
City string `json:"city,omitempty"`
|
||||
PostalCode string `json:"postal_code,omitempty"`
|
||||
}
|
||||
|
||||
type GeofeedList struct {
|
||||
Geofeeds []Geofeed `json:"geofeeds"`
|
||||
Limit int `json:"limit"`
|
||||
}
|
||||
Reference in New Issue
Block a user