func awsAwsjson11_deserializeOpDocumentGetDomainDetailOutput()

in service/route53domains/deserializers.go [6347:6585]


func awsAwsjson11_deserializeOpDocumentGetDomainDetailOutput(v **GetDomainDetailOutput, value interface{}) error {
	if v == nil {
		return fmt.Errorf("unexpected nil of type %T", v)
	}
	if value == nil {
		return nil
	}

	shape, ok := value.(map[string]interface{})
	if !ok {
		return fmt.Errorf("unexpected JSON type %v", value)
	}

	var sv *GetDomainDetailOutput
	if *v == nil {
		sv = &GetDomainDetailOutput{}
	} else {
		sv = *v
	}

	for key, value := range shape {
		switch key {
		case "AbuseContactEmail":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected Email to be of type string, got %T instead", value)
				}
				sv.AbuseContactEmail = ptr.String(jtv)
			}

		case "AbuseContactPhone":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected ContactNumber to be of type string, got %T instead", value)
				}
				sv.AbuseContactPhone = ptr.String(jtv)
			}

		case "AdminContact":
			if err := awsAwsjson11_deserializeDocumentContactDetail(&sv.AdminContact, value); err != nil {
				return err
			}

		case "AdminPrivacy":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
				}
				sv.AdminPrivacy = ptr.Bool(jtv)
			}

		case "AutoRenew":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
				}
				sv.AutoRenew = ptr.Bool(jtv)
			}

		case "BillingContact":
			if err := awsAwsjson11_deserializeDocumentContactDetail(&sv.BillingContact, value); err != nil {
				return err
			}

		case "BillingPrivacy":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
				}
				sv.BillingPrivacy = ptr.Bool(jtv)
			}

		case "CreationDate":
			if value != nil {
				switch jtv := value.(type) {
				case json.Number:
					f64, err := jtv.Float64()
					if err != nil {
						return err
					}
					sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))

				default:
					return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)

				}
			}

		case "DnsSec":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DNSSec to be of type string, got %T instead", value)
				}
				sv.DnsSec = ptr.String(jtv)
			}

		case "DnssecKeys":
			if err := awsAwsjson11_deserializeDocumentDnssecKeyList(&sv.DnssecKeys, value); err != nil {
				return err
			}

		case "DomainName":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DomainName to be of type string, got %T instead", value)
				}
				sv.DomainName = ptr.String(jtv)
			}

		case "ExpirationDate":
			if value != nil {
				switch jtv := value.(type) {
				case json.Number:
					f64, err := jtv.Float64()
					if err != nil {
						return err
					}
					sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64))

				default:
					return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)

				}
			}

		case "Nameservers":
			if err := awsAwsjson11_deserializeDocumentNameserverList(&sv.Nameservers, value); err != nil {
				return err
			}

		case "RegistrantContact":
			if err := awsAwsjson11_deserializeDocumentContactDetail(&sv.RegistrantContact, value); err != nil {
				return err
			}

		case "RegistrantPrivacy":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
				}
				sv.RegistrantPrivacy = ptr.Bool(jtv)
			}

		case "RegistrarName":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected RegistrarName to be of type string, got %T instead", value)
				}
				sv.RegistrarName = ptr.String(jtv)
			}

		case "RegistrarUrl":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected RegistrarUrl to be of type string, got %T instead", value)
				}
				sv.RegistrarUrl = ptr.String(jtv)
			}

		case "RegistryDomainId":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected RegistryDomainId to be of type string, got %T instead", value)
				}
				sv.RegistryDomainId = ptr.String(jtv)
			}

		case "Reseller":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected Reseller to be of type string, got %T instead", value)
				}
				sv.Reseller = ptr.String(jtv)
			}

		case "StatusList":
			if err := awsAwsjson11_deserializeDocumentDomainStatusList(&sv.StatusList, value); err != nil {
				return err
			}

		case "TechContact":
			if err := awsAwsjson11_deserializeDocumentContactDetail(&sv.TechContact, value); err != nil {
				return err
			}

		case "TechPrivacy":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
				}
				sv.TechPrivacy = ptr.Bool(jtv)
			}

		case "UpdatedDate":
			if value != nil {
				switch jtv := value.(type) {
				case json.Number:
					f64, err := jtv.Float64()
					if err != nil {
						return err
					}
					sv.UpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))

				default:
					return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)

				}
			}

		case "WhoIsServer":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected RegistrarWhoIsServer to be of type string, got %T instead", value)
				}
				sv.WhoIsServer = ptr.String(jtv)
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}