Esempio n. 1
0
func toContactInfo(res map[string]interface{}) *ContactInfo {
	return &ContactInfo{
		Admin:    toContactDetails(util.ToXmlrpcStruct(res["admin"])),
		Bill:     toContactDetails(util.ToXmlrpcStruct(res["bill"])),
		Owner:    toContactDetails(util.ToXmlrpcStruct(res["owner"])),
		Reseller: toContactDetails(util.ToXmlrpcStruct(res["reseller"])),
		Tech:     toContactDetails(util.ToXmlrpcStruct(res["tech"])),
	}
}
Esempio n. 2
0
func ToDomainInfoExtra(res map[string]interface{}) *DomainInfoExtra {
	return &DomainInfoExtra{
		DateDelete:           util.ToTime(res["date_delete"]),
		DateHoldBegin:        util.ToTime(res["date_hold_begin"]),
		DateHoldEnd:          util.ToTime(res["date_hold_end"]),
		DatePendingDeleteEnd: util.ToTime(res["date_pending_delete_end"]),
		DateRenewBegin:       util.ToTime(res["date_renew_begin"]),
		DateRestoreEnd:       util.ToTime(res["date_restore_end"]),
		Nameservers:          util.ToStringSlice(util.ToInterfaceSlice(res["nameservers"])),
		Services:             util.ToStringSlice(util.ToInterfaceSlice(res["services"])),
		ZoneId:               util.ToInt64(res["zone_id"]),
		Autorenew:            toAutorenewInfo(util.ToXmlrpcStruct(res["autorenew"])),
		Contacts:             toContactInfo(util.ToXmlrpcStruct(res["contacts"])),
	}
}
Esempio n. 3
0
func ToOperationInfo(res map[string]interface{}) *OperationInfo {
	return &OperationInfo{
		DateCreated:      util.ToTime(res["date_created"]),
		DateStart:        util.ToTime(res["date_start"]),
		DateUpdated:      util.ToTime(res["date_updated"]),
		Eta:              util.ToString(res["eta"]),
		Id:               util.ToInt64(res["id"]),
		LastError:        util.ToString(res["last_error"]),
		SessionId:        util.ToInt64(res["session_id"]),
		Source:           util.ToString(res["source"]),
		Step:             util.ToString(res["step"]),
		Type:             util.ToString(res["type"]),
		OperationDetails: ToOperationDetails(util.ToXmlrpcStruct(res["infos"])),
		Params:           util.ToXmlrpcStruct(res["params"]),
	}
}
Esempio n. 4
0
func toBalanceInformation(res map[string]interface{}) *BalanceInformation {
	return &BalanceInformation{
		AnnualBalance:     util.ToString(res["annual_balance"]),
		Grid:              util.ToString(res["grid"]),
		OutstandingAmount: util.ToFloat64(res["outstanding_amount"]),
		Prepaid:           toPrepaidInformation(util.ToXmlrpcStruct(res["prepaid"])),
	}
}