// UnmarshalJSON rebuilds a DNSCache from serialized JSON.
// Note: This is destructive to any currect data. Use UpdateFromCache for bulk
// updates.
770157
func (c *DNSCache) UnmarshalJSON(raw []byte) error {
	lookups := make([]*cacheEntry, 0)
	if err := json.Unmarshal(raw, &lookups); err != nil {
		return err
	}

	c.Lock()
	defer c.Unlock()

	c.forward = make(map[string]ipEntries)
	c.reverse = make(map[string]nameEntries)

	for _, newLookup := range lookups {
		c.updateWithEntry(newLookup)
	}

	return nil
}
380818
func (o *RouterInterface) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realRouterInterface
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = RouterInterface(r)
	return nil
}
1264024
func (i *IPAMData) UnmarshalJSON(data []byte) error {
	var (
		m   map[string]interface{}
		err error
	)
	if err := json.Unmarshal(data, &m); err != nil {
		return err
	}
	i.AddressSpace = m["AddressSpace"].(string)
	if v, ok := m["Pool"]; ok {
		if i.Pool, err = types.ParseCIDR(v.(string)); err != nil {
			return err
		}
	}
	if v, ok := m["Gateway"]; ok {
		if i.Gateway, err = types.ParseCIDR(v.(string)); err != nil {
			return err
		}
	}
	if v, ok := m["AuxAddresses"]; ok {
		b, _ := json.Marshal(v)
		var am map[string]string
		if err = json.Unmarshal(b, &am); err != nil {
			return err
		}
		i.AuxAddresses = make(map[string]*net.IPNet, len(am))
		for k, v := range am {
			if i.AuxAddresses[k], err = types.ParseCIDR(v); err != nil {
				return err
			}
		}
	}
	return nil
}
1164123
func (j *Json) UnmarshalJSON(p []byte) error {
	dec := json.NewDecoder(bytes.NewBuffer(p))
	dec.UseNumber()
	return dec.Decode(&j.data)
}
960790
func (s *SubscriptionScheduleRevision) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		s.ID = id
		return nil
	}

	type revision SubscriptionScheduleRevision
	var v revision
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}

	*s = SubscriptionScheduleRevision(v)
	return nil
}
1248948
func (h *Headers) UnmarshalJSON(data []byte) error {
	if h == nil {
		return errors.New("network.Headers: UnmarshalJSON on nil pointer")
	}
	*h = append((*h)[0:0], data...)
	return nil
}
773632
func (o *Instance) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realInstance
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = Instance(r)
	return nil
}
850813
func (jb *JSONBuffer) UnmarshalJSON(data []byte) (err error) {
	var str string
	err = json.Unmarshal(data, &str)
	if err != nil {
		return err
	}
	*jb, err = base64URLDecode(str)
	return
}
188319
func (a *Address) UnmarshalJSON(input []byte) error {
	return hexutil.UnmarshalFixedJSON(addressT, input, a[:])
}
1320598
func (s *SerializableNamed) UnmarshalJSON(b []byte) error {
	var raw string
	if err := json.Unmarshal(b, &raw); err != nil {
		return errors.Wrapf(err, "invalid named reference bytes: %s", b)
	}
	var err error
	s.Named, err = reference.ParseNamed(raw)
	return err
}
1260140
func (n *ACIdentifier) UnmarshalJSON(data []byte) error {
	var s string
	if err := json.Unmarshal(data, &s); err != nil {
		return err
	}
	nn, err := NewACIdentifier(s)
	if err != nil {
		return err
	}
	*n = *nn
	return nil
}
724374
func (s *Syncing) UnmarshalJSON(data []byte) error {
	proxy := new(proxySyncing)
	if err := json.Unmarshal(data, proxy); err != nil {
		return err
	}

	proxy.IsSyncing = true
	*s = *(*Syncing)(unsafe.Pointer(proxy))

	return nil
}
635445
func (o *Route) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realRoute
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = Route(r)
	return nil
}
1176565
func (v *VolumeSnapshotData) UnmarshalJSON(data []byte) error {
	tmp := VolumeSnapshotDataCopy{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	tmp2 := VolumeSnapshotData(tmp)
	*v = tmp2
	return nil
}
62776
func (s *String) UnmarshalJSON(data []byte) error {
	var ss pq.StringArray
	if err := json.Unmarshal(data, &ss); err != nil {
		return err
	}
	*s = String(ss)
	return nil
}
677034
func (v *Annotation) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat3(&r, v)
	return r.Error()
}
968078
func (o *LoadBalancerListener) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realLoadBalancerListener
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = LoadBalancerListener(r)
	return nil
}