// UnmarshalJSON marshals the InstanceID to JSON.
555661
func (i *InstanceID) UnmarshalJSON(data []byte) error {

	iid := &struct {
		ID       string            `json:"id"`
		Driver   string            `json:"driver"`
		Service  string            `json:"service"`
		Fields   map[string]string `json:"fields,omitempty"`
		Metadata json.RawMessage   `json:"metadata,omitempty"`
	}{}

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

	i.ID = iid.ID
	i.Driver = iid.Driver
	i.Service = iid.Service
	i.Fields = iid.Fields
	i.metadata = iid.Metadata

	return nil
}
1197964
func (vd *VolumeSnapshotDataList) UnmarshalJSON(data []byte) error {
	tmp := VolumeSnapshotDataListCopy{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	tmp2 := VolumeSnapshotDataList(tmp)
	*vd = tmp2
	return nil
}
1196121
func (l *EC2InstancePrivateIPAddressSpecificationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := EC2InstancePrivateIPAddressSpecification{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = EC2InstancePrivateIPAddressSpecificationList{item}
		return nil
	}
	list := []EC2InstancePrivateIPAddressSpecification{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = EC2InstancePrivateIPAddressSpecificationList(list)
		return nil
	}
	return err
}
557654
func (c *Person) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		c.ID = id
		return nil
	}

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

	*c = Person(v)
	return nil
}
466695
func (id *ID) UnmarshalJSON(b []byte) error {
	if len(b) < 2 || b[0] != byte('"') || b[len(b)-1] != byte('"') {
		return errors.New("value is not a string")
	}

	return id.fillID(b[1 : len(b)-1])
}
28483
func (id *ID) UnmarshalJSON(b []byte) error {
	s := string(b)
	if s == "null" {
		*id = nilID
		return nil
	}
	return id.UnmarshalText(b[1 : len(b)-1])
}
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
}
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)
}
228131
func (tid *TargetID) UnmarshalJSON(data []byte) error {
	var s string
	if err := json.Unmarshal(data, &s); err != nil {
		return err
	}

	targetID, err := parseTargetID(s)
	if err != nil {
		return err
	}

	*tid = *targetID
	return nil
}
366609
func (spaceQuota *SpaceQuota) UnmarshalJSON(data []byte) error {
	var ccSpaceQuota struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			Name string `json:"name"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccSpaceQuota)
	if err != nil {
		return err
	}

	spaceQuota.GUID = ccSpaceQuota.Metadata.GUID
	spaceQuota.Name = ccSpaceQuota.Entity.Name
	return nil
}
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
}
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
}
548492
func (u *Unstructured) UnmarshalJSON(b []byte) error {
	_, _, err := UnstructuredJSONScheme.Decode(b, nil, u)
	return err
}
832452
func (id *ID) UnmarshalJSON(data []byte) error {
	i, err := parseJSONString(data)
	if err == nil {
		*id = i
		return nil
	}

	i, err = parseJSONInt(data)
	if err == nil {
		*id = i
		return nil
	}

	return fmt.Errorf("%s is not a valid ID", data)
}
8434
func (v *Subscriber) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson639f989aDecodeCodeCloudfoundryOrgGorouterMbus1(&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
}
22288
func (l *DynamoDBTableStreamSpecificationList) UnmarshalJSON(buf []byte) error {
	// Cloudformation allows a single object when a list of objects is expected
	item := DynamoDBTableStreamSpecification{}
	if err := json.Unmarshal(buf, &item); err == nil {
		*l = DynamoDBTableStreamSpecificationList{item}
		return nil
	}
	list := []DynamoDBTableStreamSpecification{}
	err := json.Unmarshal(buf, &list)
	if err == nil {
		*l = DynamoDBTableStreamSpecificationList(list)
		return nil
	}
	return err
}