// PostUnmarshalJSON is called after JSON unmarshaling into EdgeHostnames
//
// See: jsonhooks-v1/jsonhooks.Unmarshal()
559932
func (products *Products) PostUnmarshalJSON() error {
	products.Init()

	for key, product := range products.Products.Items {
		products.Products.Items[key].parent = products
		if err := product.PostUnmarshalJSON(); err != nil {
			return err
		}
	}

	return nil
}
428730
func (x *Parameters) UnmarshalJSON(data []byte) (err error) {
	x2 := parameters{}
	if err = json.Unmarshal(data, &x2); err == nil {
		*x = Parameters(x2)
		return x.checkResourceType()
	}
	return
}
1145393
func (x *OrderResponse) UnmarshalJSON(data []byte) (err error) {
	x2 := orderResponse{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = OrderResponse(x2)
		return x.checkResourceType()
	}
	return
}
354169
func (c *WebhookEndpoint) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		c.ID = id
		return nil
	}

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

	*c = WebhookEndpoint(v)
	return nil
}
1356241
func (that *JSONNode) UnmarshalJSON(data []byte) error {
	if len(data) == 0 {
		return nil
	}
	if that.dontExpand && that.t == TypeUndefined {
		return nil
	}
	if that.t == TypeValue {
		return that.unmarshalValue(data)
	}
	if data[0] == '{' {
		if that.t != TypeMap && that.t != TypeUndefined {
			return ErrorTypeUnmarshaling
		}
		return that.unmarshalMap(data)
	}
	if data[0] == '[' {
		if that.t != TypeArray && that.t != TypeUndefined {
			return ErrorTypeUnmarshaling
		}
		return that.unmarshalArray(data)

	}
	if that.t == TypeUndefined {
		return that.unmarshalValue(data)
	}
	return ErrorTypeUnmarshaling
}
1214362
func (cpcodes *CpCodes) PostUnmarshalJSON() error {
	cpcodes.Init()

	cpcodes.Contract = NewContract(NewContracts())
	cpcodes.Contract.ContractID = cpcodes.ContractID

	cpcodes.Group = NewGroup(NewGroups())
	cpcodes.Group.GroupID = cpcodes.GroupID

	go cpcodes.Group.GetGroup()
	go cpcodes.Contract.GetContract()

	go (func(cpcodes *CpCodes) {
		contractComplete := <-cpcodes.Contract.Complete
		groupComplete := <-cpcodes.Group.Complete
		cpcodes.Complete <- (contractComplete && groupComplete)
	})(cpcodes)

	for key, cpcode := range cpcodes.CpCodes.Items {
		cpcodes.CpCodes.Items[key].parent = cpcodes

		if err := cpcode.PostUnmarshalJSON(); err != nil {
			return err
		}
	}

	return nil
}
99092
func (rc *RequestContext) UnmarshalJSON(data []byte) error {
	var jrc jsonRequestContext
	if err := json.Unmarshal(data, &jrc); err != nil {
		return err
	}

	*rc = *(*RequestContext)(jrc.requestContextAlias)
	rc.Authorizer = jrc.Authorizer

	return nil
}
524281
func (l *Link) UnmarshalJSON(payload []byte) error {
	// Links may be null in certain cases, mainly noted in the JSONAPI spec
	// with pagination links (http://jsonapi.org/format/#fetching-pagination).
	if len(payload) == 4 && string(payload) == "null" {
		return nil
	}

	if bytes.HasPrefix(payload, stringSuffix) {
		return json.Unmarshal(payload, &l.Href)
	}

	if bytes.HasPrefix(payload, objectSuffix) {
		obj := make(map[string]interface{})
		err := json.Unmarshal(payload, &obj)
		if err != nil {
			return err
		}
		var ok bool
		l.Href, ok = obj["href"].(string)
		if !ok {
			return errors.New(`link object expects a "href" key`)
		}

		l.Meta, _ = obj["meta"].(map[string]interface{})
		return nil
	}

	return errors.New("expected a JSON encoded string or object")
}
898827
func (d *Datapoint) UnmarshalJSON(b []byte) error {
	dp := datapointJSON{}
	err := json.Unmarshal(b, &dp)
	if err != nil {
		return err
	}

	*d = Datapoint(dp.datapoint)
	d.Timestamp = FromUnixMilli(dp.Ts)

	return nil
}
1014834
func (v *bulkIndexRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson9de0fcbfDecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
1003693
func (mp *MultiPoint) UnmarshalJSON(data []byte) error {
	g := &Geometry{}
	err := json.Unmarshal(data, &g)
	if err != nil {
		return err
	}

	multiPoint, ok := g.Coordinates.(orb.MultiPoint)
	if !ok {
		return errors.New("geojson: not a MultiPoint type")
	}

	*mp = MultiPoint(multiPoint)
	return nil
}
364392
func (property *Property) PostUnmarshalJSON() error {
	property.Init()

	property.Contract = NewContract(NewContracts())
	property.Contract.ContractID = property.ContractID

	property.Group = NewGroup(NewGroups())
	property.Group.GroupID = property.GroupID

	go property.Group.GetGroup()
	go property.Contract.GetContract()

	go (func(property *Property) {
		contractComplete := <-property.Contract.Complete
		groupComplete := <-property.Group.Complete
		property.Complete <- (contractComplete && groupComplete)
	})(property)

	return nil
}
526254
func (v *EventSendFormatV2) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson3b0ebf6aDecodeGithubComSignalfxGatewayProtocolSignalfxFormat6(&r, v)
	return r.Error()
}
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
}
186827
func (v *startMessageParams) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson639f989aDecodeCodeCloudfoundryOrgGorouterMbus(&r, v)
	return r.Error()
}
37822
func (o *Subnet) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realSubnet
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = Subnet(r)
	return nil
}
958241
func (v *bulkUpdateRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson1ed00e60DecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}