// UnmarshalJSON helps unmarshal a Cloud Controller Domain response.
975308
func (domain *Domain) UnmarshalJSON(data []byte) error {
	var ccDomain struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			Name            string `json:"name"`
			RouterGroupGUID string `json:"router_group_guid"`
			RouterGroupType string `json:"router_group_type"`
			Internal        bool   `json:"internal"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccDomain)
	if err != nil {
		return err
	}

	domain.GUID = ccDomain.Metadata.GUID
	domain.Name = ccDomain.Entity.Name
	domain.RouterGroupGUID = ccDomain.Entity.RouterGroupGUID
	domain.RouterGroupType = constant.RouterGroupType(ccDomain.Entity.RouterGroupType)
	domain.Internal = ccDomain.Entity.Internal
	return nil
}
953406
func (o *SecurityGroupRule) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.ID = &jsonName
		return nil
	}

	var r realSecurityGroupRule
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = SecurityGroupRule(r)
	return nil
}
209612
func (v *App) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson633f8c25DecodeGithubComCloudfoundryCommunityFirehoseToSyslogCaching(&r, v)
	return r.Error()
}
557348
func (routeMapping *RouteMapping) UnmarshalJSON(data []byte) error {
	var ccRouteMapping struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			AppGUID   string `json:"app_guid"`
			RouteGUID string `json:"route_guid"`
		} `json:"entity"`
	}

	err := cloudcontroller.DecodeJSON(data, &ccRouteMapping)
	if err != nil {
		return err
	}

	routeMapping.GUID = ccRouteMapping.Metadata.GUID
	routeMapping.AppGUID = ccRouteMapping.Entity.AppGUID
	routeMapping.RouteGUID = ccRouteMapping.Entity.RouteGUID
	return nil
}
1310138
func (v *bulkDeleteRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson8092efb6DecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
1101964
func (v *Generic) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents11(&r, v)
	return r.Error()
}
1054873
func (route *Route) UnmarshalJSON(data []byte) error {
	var ccRoute struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			Host       string        `json:"host"`
			Path       string        `json:"path"`
			Port       types.NullInt `json:"port"`
			DomainGUID string        `json:"domain_guid"`
			SpaceGUID  string        `json:"space_guid"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccRoute)
	if err != nil {
		return err
	}

	route.GUID = ccRoute.Metadata.GUID
	route.Host = ccRoute.Entity.Host
	route.Path = ccRoute.Entity.Path
	route.Port = ccRoute.Entity.Port
	route.DomainGUID = ccRoute.Entity.DomainGUID
	route.SpaceGUID = ccRoute.Entity.SpaceGUID
	return nil
}
135845
func (v *BodySendFormatV2) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson3b0ebf6aDecodeGithubComSignalfxGatewayProtocolSignalfxFormat7(&r, v)
	return r.Error()
}
873043
func (g *GUID) UnmarshalJSON(data []byte) error {
	g2, err := FromString(strings.Trim(string(data), "\""))
	if err != nil {
		return err
	}
	*g = *g2
	return nil
}
550666
func (u *UUID) UnmarshalJSON(b []byte) (err error) {
	var ovsUUID []string
	if err := json.Unmarshal(b, &ovsUUID); err == nil {
		u.GoUUID = ovsUUID[1]
	}
	return err
}
934852
func (p *CheckoutSession) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		p.ID = id
		return nil
	}

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

	*p = CheckoutSession(v)
	return nil
}
1162891
func (u *Uint64) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		u.Valid = false
		return nil
	}
	if err := json.Unmarshal(data, &u.Uint64); err != nil {
		return err
	}
	u.Valid = true
	return nil
}
332437
func (host *Host) UnmarshalJSON(data []byte) (err error) {
	var s string
	if err = json.Unmarshal(data, &s); err != nil {
		return err
	}

	// Allow empty string
	if s == "" {
		*host = Host{}
		return nil
	}

	var h *Host
	if h, err = ParseHost(s); err != nil {
		return err
	}

	*host = *h
	return nil
}
897602
func (v *Accepted) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents17(&r, v)
	return r.Error()
}
1316835
func (ipnet *NetIPNet) UnmarshalJSON(b []byte) (err error) {
	var ipnetStr string
	if err = json.Unmarshal(b, &ipnetStr); err == nil {
		var cidr *net.IPNet
		if _, cidr, err = net.ParseCIDR(ipnetStr); err == nil {
			*ipnet = NetIPNet(*cidr)
		}
	}
	return
}
192101
func (r *Result) UnmarshalJSON(data []byte) error {
	var result struct {
		MessageID      string `json:"message_id"`
		RegistrationID string `json:"registration_id"`
		Error          string `json:"error"`
	}

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

	r.MessageID = result.MessageID
	r.RegistrationID = result.RegistrationID
	r.Error = toFirebaseErr(result.Error)

	return nil
}
542967
func (v *Span) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson72863a49DecodeGithubComSignalfxGolibTraceFormat1(&r, v)
	return r.Error()
}