//
// UnmarshalJSON is defined for proper JSON decoding of a BaseType
//
553829
func (e *BaseType) UnmarshalJSON(b []byte) error {
	var j string
	err := json.Unmarshal(b, &j)
	if err == nil {
		s := string(j)
		for v, s2 := range namesBaseType {
			if s == s2 {
				*e = BaseType(v)
				return nil
			}
		}
		err = fmt.Errorf("Bad enum symbol for type BaseType: %s", s)
	}
	return err
}
802978
func (t *TraceV1Pretty) UnmarshalJSON(b []byte) error {
	var s []string
	if err := json.Unmarshal(b, &s); err != nil {
		return err
	}
	*t = TraceV1Pretty(s)
	return nil
}
907222
func (k *Key) UnmarshalJSON(data []byte) error {
	var key string
	if err := json.Unmarshal(data, &key); err != nil {
		return err
	}
	*k = NewKey(key)
	return nil
}
1016238
func (self *BytesTypeDef) UnmarshalJSON(b []byte) error {
	var m rawBytesTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := BytesTypeDef(m)
		*self = o
		err = self.Validate()
	}
	return err
}
979566
func (v *CBGravatar) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonB0500db0DecodeGithubComFrancoispqtGojayBenchmarks3(&r, v)
	return r.Error()
}
735403
func (j *Json) UnmarshalJSON(p []byte) error {
	return json.Unmarshal(p, &j.data)
}
73308
func (c *Client) UnmarshalJSON(b []byte) error {
	temp := struct {
		Config  Config   `json:"config"`
		Cluster *Cluster `json:"cluster"`
	}{}
	err := json.Unmarshal(b, &temp)
	if err != nil {
		return err
	}

	c.Cluster = temp.Cluster
	c.Config = temp.Config
	return nil
}
124438
func (s *ReleaseSpec) UnmarshalJSON(b []byte) error {
	type T ReleaseSpec
	t := (*T)(s)
	if err := json.Unmarshal(b, t); err != nil {
		return err
	}

	switch t.Type {
	case "":
		r := &update.ReleaseImageSpec{}
		if err := json.Unmarshal(b, r); err != nil {
			return err
		}
		s.Type = ReleaseImageSpecType
		s.ReleaseImageSpec = r

	case ReleaseImageSpecType, ReleaseContainersSpecType:
		// all good
	default:
		return errors.New("unknown ReleaseSpec type")
	}
	return nil
}
782120
func (s *StreamName) UnmarshalJSON(data []byte) error {
	v := ""
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	if err := StreamName(v).Validate(); err != nil {
		return err
	}
	*s = StreamName(v)
	return nil
}
1297626
func (b *Buffer) UnmarshalJSON(data []byte) error {
	var x string
	if err := json.Unmarshal(data, &x); err != nil {
		return errors.Wrap(err, "failed to unmarshal JSON")
	}
	return b.Base64Decode([]byte(x))
}
1250366
func (o *AutoscalingGroup) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realAutoscalingGroup
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = AutoscalingGroup(r)
	return nil
}
762776
func (pTypeDef *UUIDTest) UnmarshalJSON(b []byte) error {
	var r rawUUIDTest
	err := json.Unmarshal(b, &r)
	if err == nil {
		o := UUIDTest(r)
		*pTypeDef = o
		err = pTypeDef.Validate()
	}
	return err
}
1042333
func (i *Ref) UnmarshalJSON(data []byte) (err error) {
	var str string
	if err := json.Unmarshal(data, &str); err != nil {
		return err
	}
	*i, err = ParseRef(string(str))
	return err
}
579943
func (b *Uint64) UnmarshalJSON(input []byte) error {
	if !isString(input) {
		return errNonString(uint64T)
	}
	return wrapTypeError(b.UnmarshalText(input[1:len(input)-1]), uint64T)
}
360076
func (t *JSONTime) UnmarshalJSON(data []byte) error {
	ts, err := strconv.ParseInt(string(data), 10, 64)
	if err != nil {
		return err
	}
	*t = JSONTime(time.Unix(0, ts*1000))
	return nil
}
1137736
func (self *UnionTypeDef) UnmarshalJSON(b []byte) error {
	var m rawUnionTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := UnionTypeDef(m)
		*self = *((&o).Init())
		err = self.Validate()
	}
	return err
}
1188998
func (ua *Uint64Array) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		ua.Valid = false
		return nil
	}
	if data == nil {
		ua.Uint64Array, ua.Valid = nil, false
		return nil
	}
	ua.Valid = true
	return json.Unmarshal(data, &ua.Uint64Array)
}