// UnmarshalJSON handles deserialization of a SubscriptionScheduleRevision.
// This custom unmarshaling is needed because the resulting
// property may be an id or the full struct if it was expanded.
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
}
1029051
func (o *Order) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		o.ID = id
		return nil
	}

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

	*o = Order(v)
	return nil
}
360076
func (t *JSONTime) UnmarshalJSON(data []byte) error {
	ts, err := strconv.ParseInt(string(data), 10, 64)
	if err != nil {
		return err
	}
	*t = JSONTime(time.Unix(0, ts*1000))
	return nil
}
1025294
func (x *Subscription) UnmarshalJSON(data []byte) (err error) {
	x2 := subscription{}
	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 = Subscription(x2)
		return x.checkResourceType()
	}
	return
}
198038
func (u *UpdateTime) UnmarshalJSON(b []byte) error {
	s := strings.Trim(string(b), "\"")
	if s == "none" {
		*u = UpdateTime{&time.Time{}}
		return nil
	}
	t, err := time.Parse("2006-01-02T15:04:05", s)
	if err != nil {
		return err
	}
	*u = UpdateTime{&t}
	return nil
}
1266193
func (i *Invoice) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		i.ID = id
		return nil
	}

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

	*i = Invoice(v)
	return nil
}
254869
func (d *TransferDestination) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		d.ID = id
		return nil
	}

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

	*d = TransferDestination(v)
	return json.Unmarshal(data, &d.Account)
}
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
}
384317
func (r *AWSServerlessFunction_Properties) UnmarshalJSON(b []byte) error {

	// Unmarshal into interface{} to check it's type
	var typecheck interface{}
	if err := json.Unmarshal(b, &typecheck); err != nil {
		return err
	}

	switch val := typecheck.(type) {

	case map[string]interface{}:
		val = val // This ensures val is used to stop an error

		json.Unmarshal(b, &r.S3Event)

		json.Unmarshal(b, &r.SNSEvent)

		json.Unmarshal(b, &r.SQSEvent)

		json.Unmarshal(b, &r.KinesisEvent)

		json.Unmarshal(b, &r.DynamoDBEvent)

		json.Unmarshal(b, &r.ApiEvent)

		json.Unmarshal(b, &r.ScheduleEvent)

		json.Unmarshal(b, &r.CloudWatchEventEvent)

		json.Unmarshal(b, &r.IoTRuleEvent)

		json.Unmarshal(b, &r.AlexaSkillEvent)

	case []interface{}:

	}

	return nil
}
977902
func (i *ID) UnmarshalJSON(b []byte) error {
	if b[0] == '"' {
		b = b[1:]
	}

	if b[len(b)-1] == '"' {
		b = b[:len(b)-1]
	}

	return i.Decode(b)
}
785566
func (node *TableIdent) UnmarshalJSON(b []byte) error {
	var result string
	err := json.Unmarshal(b, &result)
	if err != nil {
		return err
	}
	node.v = result
	return nil
}
995811
func (resp *IndicesSyncedFlushResponse) UnmarshalJSON(data []byte) error {
	m := make(map[string]json.RawMessage)
	err := json.Unmarshal(data, &m)
	if err != nil {
		return err
	}
	resp.Index = make(map[string]*IndicesShardsSyncedFlushResult)
	for k, v := range m {
		if k == "_shards" {
			if err := json.Unmarshal(v, &resp.Shards); err != nil {
				return err
			}
		} else {
			ix := new(IndicesShardsSyncedFlushResult)
			if err := json.Unmarshal(v, &ix); err != nil {
				return err
			}
			resp.Index[k] = ix
		}
	}
	return nil
}
65067
func (s *SKU) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		s.ID = id
		return nil
	}

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

	*s = SKU(v)
	return nil
}
333075
func (v *Unsubscribed) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents(&r, v)
	return r.Error()
}
80581
func (v *Paging) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents4(&r, v)
	return r.Error()
}
646814
func (servicePlanVisibility *ServicePlanVisibility) UnmarshalJSON(data []byte) error {
	var ccServicePlanVisibility struct {
		Metadata internal.Metadata
		Entity   struct {
			ServicePlanGUID  string `json:"service_plan_guid"`
			OrganizationGUID string `json:"organization_guid"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccServicePlanVisibility)
	if err != nil {
		return err
	}

	servicePlanVisibility.GUID = ccServicePlanVisibility.Metadata.GUID
	servicePlanVisibility.ServicePlanGUID = ccServicePlanVisibility.Entity.ServicePlanGUID
	servicePlanVisibility.OrganizationGUID = ccServicePlanVisibility.Entity.OrganizationGUID
	return nil
}
873043
func (g *GUID) UnmarshalJSON(data []byte) error {
	g2, err := FromString(strings.Trim(string(data), "\""))
	if err != nil {
		return err
	}
	*g = *g2
	return nil
}