// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.

package eas

import (
	json "encoding/json"
	easyjson "github.com/mailru/easyjson"
	jlexer "github.com/mailru/easyjson/jlexer"
	jwriter "github.com/mailru/easyjson/jwriter"
)

// suppress unused package warning
var (
	_ *json.RawMessage
	_ *jlexer.Lexer
	_ *jwriter.Writer
	_ easyjson.Marshaler
)

func easyjson57a09e85DecodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas(in *jlexer.Lexer, out *alinkFMResponseList) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		in.Skip()
		*out = nil
	} else {
		in.Delim('[')
		if *out == nil {
			if !in.IsDelim(']') {
				*out = make(alinkFMResponseList, 0, 8)
			} else {
				*out = alinkFMResponseList{}
			}
		} else {
			*out = (*out)[:0]
		}
		for !in.IsDelim(']') {
			var v1 *alinkFMResponse
			if in.IsNull() {
				in.Skip()
				v1 = nil
			} else {
				if v1 == nil {
					v1 = new(alinkFMResponse)
				}
				(*v1).UnmarshalEasyJSON(in)
			}
			*out = append(*out, v1)
			in.WantComma()
		}
		in.Delim(']')
	}
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson57a09e85EncodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas(out *jwriter.Writer, in alinkFMResponseList) {
	if in == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
		out.RawString("null")
	} else {
		out.RawByte('[')
		for v2, v3 := range in {
			if v2 > 0 {
				out.RawByte(',')
			}
			if v3 == nil {
				out.RawString("null")
			} else {
				(*v3).MarshalEasyJSON(out)
			}
		}
		out.RawByte(']')
	}
}

// MarshalJSON supports json.Marshaler interface
func (v alinkFMResponseList) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson57a09e85EncodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}

// MarshalEasyJSON supports easyjson.Marshaler interface
func (v alinkFMResponseList) MarshalEasyJSON(w *jwriter.Writer) {
	easyjson57a09e85EncodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas(w, v)
}

// UnmarshalJSON supports json.Unmarshaler interface
func (v *alinkFMResponseList) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson57a09e85DecodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas(&r, v)
	return r.Error()
}

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *alinkFMResponseList) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson57a09e85DecodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas(l, v)
}
func easyjson57a09e85DecodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas1(in *jlexer.Lexer, out *alinkFMResponse) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeFieldName(false)
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "prediction_result":
			out.Result = float64(in.Float64())
		case "prediction_score":
			out.Score = float64(in.Float64())
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson57a09e85EncodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas1(out *jwriter.Writer, in alinkFMResponse) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"prediction_result\":"
		out.RawString(prefix[1:])
		out.Float64(float64(in.Result))
	}
	{
		const prefix string = ",\"prediction_score\":"
		out.RawString(prefix)
		out.Float64(float64(in.Score))
	}
	out.RawByte('}')
}

// MarshalJSON supports json.Marshaler interface
func (v alinkFMResponse) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson57a09e85EncodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas1(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}

// MarshalEasyJSON supports easyjson.Marshaler interface
func (v alinkFMResponse) MarshalEasyJSON(w *jwriter.Writer) {
	easyjson57a09e85EncodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas1(w, v)
}

// UnmarshalJSON supports json.Unmarshaler interface
func (v *alinkFMResponse) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjson57a09e85DecodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas1(&r, v)
	return r.Error()
}

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *alinkFMResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson57a09e85DecodeGitlabAlibabaIncComPaiBizArchPairecAlgorithmEas1(l, v)
}
