Esempio n. 1
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"])),
	}
}
Esempio n. 2
0
func ToRecordInfo(res map[string]interface{}) *RecordInfo {
	return &RecordInfo{
		Id:    util.ToInt64(res["id"]),
		Name:  util.ToString(res["name"]),
		Ttl:   util.ToInt64(res["ttl"]),
		Type:  util.ToString(res["type"]),
		Value: util.ToString(res["value"]),
	}
}
Esempio n. 3
0
func toPrepaidInformation(res map[string]interface{}) *PrepaidInformation {
	return &PrepaidInformation{
		Id:          util.ToInt64(res["id"]),
		Amount:      util.ToString(res["amount"]),
		Currency:    util.ToString(res["currency"]),
		DateCreated: util.ToTime(res["date_created"]),
		DateUpdated: util.ToTime(res["date_updated"]),
	}
}
Esempio n. 4
0
func ToOperationDetails(res map[string]interface{}) *OperationDetails {
	return &OperationDetails{
		Id:            util.ToString(res["id"]),
		Label:         util.ToString(res["label"]),
		ProductAction: util.ToString(res["product_action"]),
		ProductName:   util.ToString(res["product_name"]),
		ProductType:   util.ToString(res["product_type"]),
		Quantity:      util.ToInt64(res["quantity"]),
	}
}
Esempio n. 5
0
func ToDomainInfoBase(res map[string]interface{}) *DomainInfoBase {
	return &DomainInfoBase{
		AuthInfo:             util.ToString(res["authinfo"]),
		DateCreated:          util.ToTime(res["date_created"]),
		DateRegistryCreation: util.ToTime(res["date_registry_creation"]),
		DateRegistryEnd:      util.ToTime(res["date_registry_end"]),
		DateUpdated:          util.ToTime(res["date_updated"]),
		Fqdn:                 util.ToString(res["fqdn"]),
		Id:                   util.ToInt64(res["id"]),
		Status:               util.ToStringSlice(util.ToInterfaceSlice(res["status"])),
		Tld:                  util.ToString(res["tld"]),
	}
}
Esempio n. 6
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. 7
0
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"])),
	}
}
Esempio n. 8
0
func toContactInformation(res map[string]interface{}) *ContactInformation {
	return &ContactInformation{
		Firstname:   util.ToString(res["given"]),
		Lastname:    util.ToString(res["family"]),
		Email:       util.ToString(res["email"]),
		Address:     util.ToString(res["streetaddr"]),
		Zipcode:     util.ToString(res["zip"]),
		City:        util.ToString(res["city"]),
		Country:     util.ToString(res["country"]),
		Phone:       util.ToString(res["phone"]),
		ContactType: util.ToInt64(res["type"]),
		Handle:      util.ToString(res["handle"]),
	}
}
Esempio n. 9
0
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"]),
	}
}
Esempio n. 10
0
func toAutorenewInfo(res map[string]interface{}) *AutorenewInfo {
	return &AutorenewInfo{
		Active:        util.ToBool(res["active"]),
		Contact:       util.ToString(res["contact"]),
		Id:            util.ToInt64(res["id"]),
		ProductId:     util.ToInt64(res["product_id"]),
		ProductTypeId: util.ToInt64(res["product_type_id"]),
	}
}
Esempio n. 11
0
func toContactDetails(res map[string]interface{}) *ContactDetails {
	return &ContactDetails{
		Handle: util.ToString(res["handle"]),
		Id:     util.ToInt64(res["id"]),
	}
}