// UnmarshalJSON helps unmarshal a Cloud Controller organization quota response.
186242
func (application *OrganizationQuota) UnmarshalJSON(data []byte) error {
	var ccOrgQuota struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			Name string `json:"name"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccOrgQuota)
	if err != nil {
		return err
	}

	application.GUID = ccOrgQuota.Metadata.GUID
	application.Name = ccOrgQuota.Entity.Name

	return nil
}
1223434
func (instance *ApplicationInstance) UnmarshalJSON(data []byte) error {
	var ccInstance struct {
		Details string  `json:"details"`
		Since   float64 `json:"since"`
		State   string  `json:"state"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccInstance)
	if err != nil {
		return err
	}

	instance.Details = ccInstance.Details
	instance.State = constant.ApplicationInstanceState(ccInstance.State)
	instance.Since = ccInstance.Since

	return nil
}
1310138
func (v *bulkDeleteRequestCommandOp) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson8092efb6DecodeGithubComOlivereElastic(&r, v)
	return r.Error()
}
1276512
func (v *Storage) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents(&r, v)
	return r.Error()
}
907222
func (k *Key) UnmarshalJSON(data []byte) error {
	var key string
	if err := json.Unmarshal(data, &key); err != nil {
		return err
	}
	*k = NewKey(key)
	return nil
}
319004
func (v *InputAnnotation) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson3b0ebf6aDecodeGithubComSignalfxGatewayProtocolSignalfxFormat5(&r, v)
	return r.Error()
}
353840
func (s *Strings) UnmarshalJSON(data []byte) error {
	if len(data) == 0 {
		return nil
	}
	var stringVar string
	if err := json.Unmarshal(data, &stringVar); err == nil {
		*s = []string{stringVar}
		return nil
	}
	var stringsVar []string
	if err := json.Unmarshal(data, &stringsVar); err != nil {
		return trace.Wrap(err)
	}
	*s = stringsVar
	return nil
}
907455
func (o *InstanceGroupManager) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realInstanceGroupManager
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = InstanceGroupManager(r)
	return nil
}
167317
func (v *Stats) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonE3ab7953DecodeGithubComCloudfoundryCommunityFirehoseToSyslogStats(&r, v)
	return r.Error()
}
610387
func (o *ScalingGroup) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realScalingGroup
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = ScalingGroup(r)
	return nil
}
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
}
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
}
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
}
893351
func (o *RouteTableAssociation) UnmarshalJSON(data []byte) error {
	var jsonName string
	if err := json.Unmarshal(data, &jsonName); err == nil {
		o.Name = &jsonName
		return nil
	}

	var r realRouteTableAssociation
	if err := json.Unmarshal(data, &r); err != nil {
		return err
	}
	*o = RouteTableAssociation(r)
	return nil
}
245654
func (s *WebAccelCertResponseBody) UnmarshalJSON(data []byte) error {
	targetData := strings.Replace(strings.Replace(string(data), " ", "", -1), "\n", "", -1)
	if targetData == `[]` {
		return nil
	}

	tmp := &struct {
		Current *WebAccelCert   `json:",omitempty"`
		Old     []*WebAccelCert `json:",omitempty"`
	}{}
	if err := json.Unmarshal(data, &tmp); err != nil {
		return err
	}

	s.Current = tmp.Current
	s.Old = tmp.Old
	return nil
}
908858
func (v *MediumPayload) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonB0500db0DecodeGithubComFrancoispqtGojayBenchmarks(&r, v)
	return r.Error()
}
1173475
func (space *Space) UnmarshalJSON(data []byte) error {
	var ccSpace struct {
		Metadata internal.Metadata `json:"metadata"`
		Entity   struct {
			Name                     string `json:"name"`
			AllowSSH                 bool   `json:"allow_ssh"`
			SpaceQuotaDefinitionGUID string `json:"space_quota_definition_guid"`
			OrganizationGUID         string `json:"organization_guid"`
		} `json:"entity"`
	}
	err := cloudcontroller.DecodeJSON(data, &ccSpace)
	if err != nil {
		return err
	}

	space.GUID = ccSpace.Metadata.GUID
	space.Name = ccSpace.Entity.Name
	space.AllowSSH = ccSpace.Entity.AllowSSH
	space.SpaceQuotaDefinitionGUID = ccSpace.Entity.SpaceQuotaDefinitionGUID
	space.OrganizationGUID = ccSpace.Entity.OrganizationGUID
	return nil
}