1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00
Files
stackexchange-dnscontrol/vendor/github.com/prasmussen/gandi-api/domain/zone/util.go
2020-05-30 11:06:13 -04:00

31 lines
754 B
Go

package zone
import (
"github.com/prasmussen/gandi-api/util"
)
func ToZoneInfoBase(res map[string]interface{}) *ZoneInfoBase {
return &ZoneInfoBase{
DateUpdated: util.ToTime(res["date_updated"]),
Id: util.ToInt64(res["id"]),
Name: util.ToString(res["name"]),
Public: util.ToBool(res["public"]),
Version: util.ToInt64(res["version"]),
}
}
func ToZoneInfoExtra(res map[string]interface{}) *ZoneInfoExtra {
return &ZoneInfoExtra{
Domains: util.ToInt64(res["domains"]),
Owner: util.ToString(res["owner"]),
Versions: util.ToIntSlice(util.ToInterfaceSlice(res["versions"])),
}
}
func ToZoneInfo(res map[string]interface{}) *ZoneInfo {
return &ZoneInfo{
ToZoneInfoBase(res),
ToZoneInfoExtra(res),
}
}