// PostUnmarshalJSON is called after UnmarshalJSON to setup the
// structs internal state. The CustomOverrides.Complete channel is utilized
// to communicate full completion.
771284
func (overrides *CustomOverrides) PostUnmarshalJSON() error {
	overrides.Init()

	for key, override := range overrides.CustomOverrides.Items {
		overrides.CustomOverrides.Items[key].parent = overrides

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

	overrides.Complete <- true

	return nil
}
1094838
func (b *Bound) UnmarshalJSON(data []byte) error {
	var points []*Point

	err := json.Unmarshal(data, &points)
	if err != nil {
		return err
	}

	if len(points) > 2 {
		return errors.New("geo: too many points to unmarshal into bound")
	}

	if len(points) < 2 {
		return errors.New("geo: not enough points to unmarshal into bound")
	}

	b.sw = points[0]
	b.ne = points[0].Clone()
	b.Extend(points[1])

	return nil
}
56368
func (e *Error) UnmarshalJSON(b []byte) (err error) {
	ee := new(errEncode)
	err = json.Unmarshal(b, ee)
	e.Code = ee.Code
	e.Msg = ee.Msg
	e.Op = ee.Op
	e.Err = decodeInternalError(ee.Err)
	return err
}
321611
func (r *PURuntime) UnmarshalJSON(param []byte) error {
	a := &PURuntimeJSON{}
	if err := json.Unmarshal(param, &a); err != nil {
		return err
	}
	r.pid = a.Pid
	r.nsPath = a.NSPath
	r.name = a.Name
	r.ips = a.IPAddresses
	r.tags = a.Tags
	r.options = a.Options
	r.puType = a.PUType
	return nil
}
485604
func (v *Endpoint) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat2(&r, v)
	return r.Error()
}
336752
func (r *Request) UnmarshalJSON(rawData []byte) error {
	var requestJSON updateRequestJSON
	if err := json.Unmarshal(rawData, &requestJSON); err != nil {
		return err
	}
	return r.fromJSON(&requestJSON)
}
707396
func (p *AuthoritativeType) UnmarshalJSON(data []byte) error {
	var s string
	if err := json.Unmarshal(data, &s); err != nil {
		return err
	}
	*p = ParseAuthoritativeType(s)
	return nil
}
1265506
func (contracts *Contracts) PostUnmarshalJSON() error {
	contracts.Init()

	for key, contract := range contracts.Contracts.Items {
		contracts.Contracts.Items[key].parent = contracts

		if err := contract.PostUnmarshalJSON(); err != nil {
			return err
		}
	}
	contracts.Complete <- true

	return nil
}
329235
func (v *bulkIndexRequestCommand) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson9de0fcbfDecodeGithubComOlivereElastic1(&r, v)
	return r.Error()
}
842496
func (v *LargePayload) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCfe4e5f0DecodeGithubComFrancoispqtGojayBenchmarks(&r, v)
	return r.Error()
}
1252374
func (s *SerializableError) UnmarshalJSON(text []byte) (err error) {
	var x struct{ Name string }
	err = json.Unmarshal(text, &x)
	if err != nil {
		return
	}
	var theError error
	switch x.Name {
	case "ErrValidation":
		var e struct{ Error ErrValidation }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadHierarchy":
		var e struct{ Error ErrBadHierarchy }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadRoot":
		var e struct{ Error ErrBadRoot }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadTargets":
		var e struct{ Error ErrBadTargets }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	case "ErrBadSnapshot":
		var e struct{ Error ErrBadSnapshot }
		err = json.Unmarshal(text, &e)
		theError = e.Error
	default:
		err = fmt.Errorf("do not know how to unmarshal %s", x.Name)
		return
	}
	if err != nil {
		return
	}
	s.Name = x.Name
	s.Error = theError
	return nil
}
453728
func (t *TemplateRequest) UnmarshalJSON(data []byte) error {
	type templateRequest TemplateRequest

	request := (*templateRequest)(t)
	if err := json.Unmarshal(data, &request); err != nil {
		return err
	}

	// The SigOpLimit field can only be nil, bool, or int64.
	val, err := convertTemplateRequestField("sigoplimit", request.SigOpLimit)
	if err != nil {
		return err
	}
	request.SigOpLimit = val

	// The SizeLimit field can only be nil, bool, or int64.
	val, err = convertTemplateRequestField("sizelimit", request.SizeLimit)
	if err != nil {
		return err
	}
	request.SizeLimit = val

	return nil
}
1293202
func (p *PID) UnmarshalJSON(data []byte) (err error) {
	p.UPID, err = upid.Parse(string(bytes.Trim(data, `" `)))
	return err
}
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
}
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
}
608296
func (r *Receipt) UnmarshalJSON(input []byte) error {
	type Receipt struct {
		PostState         *hexutil.Bytes  `json:"root"`
		Status            *hexutil.Uint64 `json:"status"`
		CumulativeGasUsed *hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"`
		Bloom             *Bloom          `json:"logsBloom"         gencodec:"required"`
		Logs              []*Log          `json:"logs"              gencodec:"required"`
		TxHash            *common.Hash    `json:"transactionHash" gencodec:"required"`
		ContractAddress   *common.Address `json:"contractAddress"`
		GasUsed           *hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
		BlockHash         *common.Hash    `json:"blockHash,omitempty"`
		BlockNumber       *hexutil.Big    `json:"blockNumber,omitempty"`
		TransactionIndex  *hexutil.Uint   `json:"transactionIndex"`
	}
	var dec Receipt
	if err := json.Unmarshal(input, &dec); err != nil {
		return err
	}
	if dec.PostState != nil {
		r.PostState = *dec.PostState
	}
	if dec.Status != nil {
		r.Status = uint64(*dec.Status)
	}
	if dec.CumulativeGasUsed == nil {
		return errors.New("missing required field 'cumulativeGasUsed' for Receipt")
	}
	r.CumulativeGasUsed = uint64(*dec.CumulativeGasUsed)
	if dec.Bloom == nil {
		return errors.New("missing required field 'logsBloom' for Receipt")
	}
	r.Bloom = *dec.Bloom
	if dec.Logs == nil {
		return errors.New("missing required field 'logs' for Receipt")
	}
	r.Logs = dec.Logs
	if dec.TxHash == nil {
		return errors.New("missing required field 'transactionHash' for Receipt")
	}
	r.TxHash = *dec.TxHash
	if dec.ContractAddress != nil {
		r.ContractAddress = *dec.ContractAddress
	}
	if dec.GasUsed == nil {
		return errors.New("missing required field 'gasUsed' for Receipt")
	}
	r.GasUsed = uint64(*dec.GasUsed)
	if dec.BlockHash != nil {
		r.BlockHash = *dec.BlockHash
	}
	if dec.BlockNumber != nil {
		r.BlockNumber = (*big.Int)(dec.BlockNumber)
	}
	if dec.TransactionIndex != nil {
		r.TransactionIndex = uint(*dec.TransactionIndex)
	}
	return nil
}
358522
func (p *postIndexRequest) UnmarshalJSON(b []byte) error {

	// m is an overflow map used to capture additional, unexpected keys.
	m := make(map[string]interface{})
	if err := json.Unmarshal(b, &m); err != nil {
		return errors.Wrap(err, "unmarshalling unexpected values")
	}

	validIndexOptions := getValidOptions(pilosa.IndexOptions{})
	err := validateOptions(m, validIndexOptions)
	if err != nil {
		return err
	}
	// Unmarshal expected values.
	_p := _postIndexRequest{
		Options: pilosa.IndexOptions{
			Keys:           false,
			TrackExistence: true,
		},
	}
	if err := json.Unmarshal(b, &_p); err != nil {
		return errors.Wrap(err, "unmarshalling expected values")
	}

	p.Options = _p.Options

	return nil
}