// UnmarshalJSON - decodes JSON data.
340404
func (a *OpaArgs) UnmarshalJSON(data []byte) error {
	// subtype to avoid recursive call to UnmarshalJSON()
	type subOpaArgs OpaArgs
	var so subOpaArgs

	if opaURL, ok := os.LookupEnv("MINIO_IAM_OPA_URL"); ok {
		u, err := xnet.ParseURL(opaURL)
		if err != nil {
			return err
		}
		so.URL = u
		so.AuthToken = os.Getenv("MINIO_IAM_OPA_AUTHTOKEN")
	} else {
		if err := json.Unmarshal(data, &so); err != nil {
			return err
		}
	}

	oa := OpaArgs(so)
	if oa.URL == nil || oa.URL.String() == "" {
		*a = oa
		return nil
	}

	if err := oa.Validate(); err != nil {
		return err
	}

	*a = oa
	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
}
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
}
928347
func (v *Stored) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents1(&r, v)
	return r.Error()
}
985877
func (fa *Float32Array) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		fa.Valid = false
		return nil
	}
	if data == nil {
		fa.Float32Array, fa.Valid = nil, false
		return nil
	}
	fa.Valid = true
	return json.Unmarshal(data, &fa.Float32Array)
}
824684
func (bj *BinaryJSON) UnmarshalJSON(data []byte) error {
	var decoder = json.NewDecoder(bytes.NewReader(data))
	decoder.UseNumber()
	var in interface{}
	err := decoder.Decode(&in)
	if err != nil {
		return errors.Trace(err)
	}
	buf := make([]byte, 0, len(data))
	var typeCode TypeCode
	typeCode, buf, err = appendBinary(buf, in)
	if err != nil {
		return errors.Trace(err)
	}
	bj.TypeCode = typeCode
	bj.Value = buf
	return nil
}
259031
func (sa *StringArray) UnmarshalJSON(data []byte) error {
	if isNull(data) {
		sa.Valid = false
		return nil
	}
	if data == nil {
		sa.StringArray, sa.Valid = nil, false
		return nil
	}

	sa.Valid = true

	return json.Unmarshal(data, &sa.StringArray)
}
218736
func (s *Subscription) UnmarshalJSON(data []byte) error {
	if id, ok := ParseID(data); ok {
		s.ID = id
		return nil
	}

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

	*s = Subscription(v)
	return nil
}
225891
func (l *Level) UnmarshalJSON(b []byte) error {
	v, err := ParseLevel(string(bytes.Trim(b, `"`)))
	if err != nil {
		return err
	}

	*l = v
	return nil
}
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
}
979566
func (v *CBGravatar) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonB0500db0DecodeGithubComFrancoispqtGojayBenchmarks3(&r, v)
	return r.Error()
}
815758
func (t *StreamType) UnmarshalJSON(data []byte) error {
	return StreamTypeFlagEnum.JSONUnmarshal(t, data)
}
12440
func (v *Complained) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson692db02bDecodeGithubComMailgunMailgunGoEvents15(&r, v)
	return r.Error()
}
217563
func (to *TimeOnly) UnmarshalJSON(b []byte) error {
	ts, err := time.Parse(timeOnlyFmtTicked, string(b))
	if err != nil {
		return err
	}

	*to = TimeOnly(ts)
	return nil
}
469494
func (u *UUID) UnmarshalJSON(data []byte) error {
	return u.ReadBytes(data[1 : len(data)-1])
}
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
}
192120
func (bz *HexBytes) UnmarshalJSON(data []byte) error {
	if len(data) < 2 || data[0] != '"' || data[len(data)-1] != '"' {
		return fmt.Errorf("Invalid hex string: %s", data)
	}
	bz2, err := hex.DecodeString(string(data[1 : len(data)-1]))
	if err != nil {
		return err
	}
	*bz = bz2
	return nil
}