// UnmarshalJSON helps unmarshal a Cloud Controller /v3 response.
559398
func (resources ResourceLinks) UnmarshalJSON(data []byte) error {
	var ccResourceLinks struct {
		Links map[string]APILink `json:"links"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccResourceLinks)
	if err != nil {
		return err
	}

	for key, val := range ccResourceLinks.Links {
		resources[key] = val
	}

	return nil
}
587268
func (s *ProbeDetailsDTO) UnmarshalJSON(b []byte) (err error) {
	s.data = b
	return nil
}
475296
func (l *APIGatewayMethodIntegrationResponseList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := APIGatewayMethodIntegrationResponse{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = APIGatewayMethodIntegrationResponseList{item}
		return nil
	}
	list := []APIGatewayMethodIntegrationResponse{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = APIGatewayMethodIntegrationResponseList(list)
		return nil
	}
	return err
}
958241
func (v *bulkUpdateRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson1ed00e60DecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
948159
func (r *Raw) UnmarshalJSON(data []byte) error {
	if r == nil {
		return errors.New("Raw: UnmarshalJSON on nil pointer")
	}
	*r = append((*r)[0:0], data...)
	return nil
}
289044
func (o *RouteTable) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realRouteTable
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = RouteTable(r)
	return nil
}
375184
func (v *bulkUpdateRequestCommandData) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson1ed00e60DecodeGithubComOlivereElastic1(&r, v)
	return r.Error()
}
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
}
874843
func (c *TaxID) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		c.ID = id
		return nil
	}

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

	*c = TaxID(v)
	return nil
}
1317912
func (l *CloudFrontDistributionCustomErrorResponseList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := CloudFrontDistributionCustomErrorResponse{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = CloudFrontDistributionCustomErrorResponseList{item}
		return nil
	}
	list := []CloudFrontDistributionCustomErrorResponse{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = CloudFrontDistributionCustomErrorResponseList(list)
		return nil
	}
	return err
}
692498
func (o *StorageObjectAcl) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realStorageObjectAcl
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = StorageObjectAcl(r)
	return nil
}
1086871
func (servicePlan *ServicePlan) UnmarshalJSON(data []byte) error {
	var ccServicePlan struct {
		Metadata internal.Metadata
		Entity   struct {
			Name        string `json:"name"`
			ServiceGUID string `json:"service_guid"`
			Public      bool   `json:"public"`
			Description string `json:"description"`
			Free        bool   `json:"free"`
		}
	}
	err := cloudcontroller.DecodeJSON(data, &ccServicePlan)
	if err != nil {
		return err
	}

	servicePlan.GUID = ccServicePlan.Metadata.GUID
	servicePlan.Name = ccServicePlan.Entity.Name
	servicePlan.ServiceGUID = ccServicePlan.Entity.ServiceGUID
	servicePlan.Public = ccServicePlan.Entity.Public
	servicePlan.Description = ccServicePlan.Entity.Description
	servicePlan.Free = ccServicePlan.Entity.Free
	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
}
954486
func (v *Uint64) UnmarshalJSON(data []byte) error {
	l := jlexer.Lexer{Data: data}
	v.UnmarshalEasyJSON(&l)
	return l.Error()
}
388182
func (us *UnreachableStrategy) UnmarshalJSON(b []byte) error {
	var u unreachableStrategy
	var errEnabledUS, errNonEnabledUS error
	if errEnabledUS = json.Unmarshal(b, &u); errEnabledUS == nil {
		*us = UnreachableStrategy(u)
		return nil
	}

	if errNonEnabledUS = json.Unmarshal(b, &us.AbsenceReason); errNonEnabledUS == nil {
		return nil
	}

	return fmt.Errorf("failed to unmarshal unreachable strategy: unmarshaling into enabled returned error '%s'; unmarshaling into non-enabled returned error '%s'", errEnabledUS, errNonEnabledUS)
}
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)
}
1294058
func (o *LoadBalancer) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

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