package openrtb

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

var (
	_ *json.RawMessage
	_ *jlexer.Lexer
	_ *jwriter.Writer
	_ easyjson.Marshaler
)

func easyjson10eb023eDecodeGithubComKrecuOpenrtb(in *jlexer.Lexer, out *BidResponse) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "id":
			out.ID = string(in.String())
		case "seatbid":
			if in.IsNull() {
				in.Skip()
				out.SeatBid = nil
			} else {
				in.Delim('[')
				if out.SeatBid == nil {
					if !in.IsDelim(']') {
						out.SeatBid = make([]SeatBid, 0, 1)
					} else {
						out.SeatBid = []SeatBid{}
					}
				} else {
					out.SeatBid = (out.SeatBid)[:0]
				}
				for !in.IsDelim(']') {
					var v1 SeatBid
					easyjson10eb023eDecodeGithubComKrecuOpenrtb1(in, &v1)
					out.SeatBid = append(out.SeatBid, v1)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "bidid":
			out.BidID = string(in.String())
		case "cur":
			out.Currency = string(in.String())
		case "customdata":
			out.CustomData = string(in.String())
		case "nbr":
			out.NBR = int(in.Int())
		case "ext":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.Ext).UnmarshalJSON(data))
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson10eb023eEncodeGithubComKrecuOpenrtb(out *jwriter.Writer, in BidResponse) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ID))
	}
	{
		const prefix string = ",\"seatbid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		if in.SeatBid == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
			out.RawString("null")
		} else {
			out.RawByte('[')
			for v2, v3 := range in.SeatBid {
				if v2 > 0 {
					out.RawByte(',')
				}
				easyjson10eb023eEncodeGithubComKrecuOpenrtb1(out, v3)
			}
			out.RawByte(']')
		}
	}
	if in.BidID != "" {
		const prefix string = ",\"bidid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.BidID))
	}
	if in.Currency != "" {
		const prefix string = ",\"cur\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Currency))
	}
	if in.CustomData != "" {
		const prefix string = ",\"customdata\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.CustomData))
	}
	if in.NBR != 0 {
		const prefix string = ",\"nbr\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.NBR))
	}
	if len(in.Ext) != 0 {
		const prefix string = ",\"ext\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Raw((in.Ext).MarshalJSON())
	}
	out.RawByte('}')
}

func (v BidResponse) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson10eb023eEncodeGithubComKrecuOpenrtb(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}

func (v BidResponse) MarshalEasyJSON(w *jwriter.Writer) {
	easyjson10eb023eEncodeGithubComKrecuOpenrtb(w, v)
}

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

func (v *BidResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson10eb023eDecodeGithubComKrecuOpenrtb(l, v)
}
func easyjson10eb023eDecodeGithubComKrecuOpenrtb1(in *jlexer.Lexer, out *SeatBid) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "bid":
			if in.IsNull() {
				in.Skip()
				out.Bid = nil
			} else {
				in.Delim('[')
				if out.Bid == nil {
					if !in.IsDelim(']') {
						out.Bid = make([]Bid, 0, 1)
					} else {
						out.Bid = []Bid{}
					}
				} else {
					out.Bid = (out.Bid)[:0]
				}
				for !in.IsDelim(']') {
					var v4 Bid
					easyjson10eb023eDecodeGithubComKrecuOpenrtb2(in, &v4)
					out.Bid = append(out.Bid, v4)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "seat":
			out.Seat = string(in.String())
		case "group":
			out.Group = int(in.Int())
		case "ext":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.Ext).UnmarshalJSON(data))
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson10eb023eEncodeGithubComKrecuOpenrtb1(out *jwriter.Writer, in SeatBid) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"bid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		if in.Bid == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
			out.RawString("null")
		} else {
			out.RawByte('[')
			for v5, v6 := range in.Bid {
				if v5 > 0 {
					out.RawByte(',')
				}
				easyjson10eb023eEncodeGithubComKrecuOpenrtb2(out, v6)
			}
			out.RawByte(']')
		}
	}
	if in.Seat != "" {
		const prefix string = ",\"seat\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Seat))
	}
	if in.Group != 0 {
		const prefix string = ",\"group\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.Group))
	}
	if len(in.Ext) != 0 {
		const prefix string = ",\"ext\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Raw((in.Ext).MarshalJSON())
	}
	out.RawByte('}')
}
func easyjson10eb023eDecodeGithubComKrecuOpenrtb2(in *jlexer.Lexer, out *Bid) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "id":
			out.ID = string(in.String())
		case "impid":
			out.ImpID = string(in.String())
		case "price":
			out.Price = float64(in.Float64())
		case "adid":
			out.AdID = string(in.String())
		case "nurl":
			out.NURL = string(in.String())
		case "burl":
			out.BURL = string(in.String())
		case "lurl":
			out.LURL = string(in.String())
		case "adm":
			out.AdMarkup = string(in.String())
		case "adomain":
			if in.IsNull() {
				in.Skip()
				out.AdvDomain = nil
			} else {
				in.Delim('[')
				if out.AdvDomain == nil {
					if !in.IsDelim(']') {
						out.AdvDomain = make([]string, 0, 4)
					} else {
						out.AdvDomain = []string{}
					}
				} else {
					out.AdvDomain = (out.AdvDomain)[:0]
				}
				for !in.IsDelim(']') {
					var v7 string
					v7 = string(in.String())
					out.AdvDomain = append(out.AdvDomain, v7)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "bundle":
			out.Bundle = string(in.String())
		case "iurl":
			out.IURL = string(in.String())
		case "cid":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.CampaignID).UnmarshalJSON(data))
			}
		case "crid":
			out.CreativeID = string(in.String())
		case "tactic":
			out.Tactic = string(in.String())
		case "cat":
			if in.IsNull() {
				in.Skip()
				out.Cat = nil
			} else {
				in.Delim('[')
				if out.Cat == nil {
					if !in.IsDelim(']') {
						out.Cat = make([]string, 0, 4)
					} else {
						out.Cat = []string{}
					}
				} else {
					out.Cat = (out.Cat)[:0]
				}
				for !in.IsDelim(']') {
					var v8 string
					v8 = string(in.String())
					out.Cat = append(out.Cat, v8)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "attr":
			if in.IsNull() {
				in.Skip()
				out.Attr = nil
			} else {
				in.Delim('[')
				if out.Attr == nil {
					if !in.IsDelim(']') {
						out.Attr = make([]int, 0, 8)
					} else {
						out.Attr = []int{}
					}
				} else {
					out.Attr = (out.Attr)[:0]
				}
				for !in.IsDelim(']') {
					var v9 int
					v9 = int(in.Int())
					out.Attr = append(out.Attr, v9)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "api":
			out.API = int(in.Int())
		case "protocol":
			out.Protocol = int(in.Int())
		case "qagmediarating":
			out.QAGMediaRating = int(in.Int())
		case "language":
			out.Language = string(in.String())
		case "dealid":
			out.DealID = string(in.String())
		case "h":
			out.H = int(in.Int())
		case "w":
			out.W = int(in.Int())
		case "wratio":
			out.WRatio = int(in.Int())
		case "hratio":
			out.HRatio = int(in.Int())
		case "exp":
			out.Exp = int(in.Int())
		case "ext":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.Ext).UnmarshalJSON(data))
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson10eb023eEncodeGithubComKrecuOpenrtb2(out *jwriter.Writer, in Bid) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ID))
	}
	{
		const prefix string = ",\"impid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ImpID))
	}
	{
		const prefix string = ",\"price\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Float64(float64(in.Price))
	}
	if in.AdID != "" {
		const prefix string = ",\"adid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.AdID))
	}
	if in.NURL != "" {
		const prefix string = ",\"nurl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.NURL))
	}
	if in.BURL != "" {
		const prefix string = ",\"burl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.BURL))
	}
	if in.LURL != "" {
		const prefix string = ",\"lurl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.LURL))
	}
	if in.AdMarkup != "" {
		const prefix string = ",\"adm\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.AdMarkup))
	}
	if len(in.AdvDomain) != 0 {
		const prefix string = ",\"adomain\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v10, v11 := range in.AdvDomain {
				if v10 > 0 {
					out.RawByte(',')
				}
				out.String(string(v11))
			}
			out.RawByte(']')
		}
	}
	if in.Bundle != "" {
		const prefix string = ",\"bundle\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Bundle))
	}
	if in.IURL != "" {
		const prefix string = ",\"iurl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.IURL))
	}
	if in.CampaignID != "" {
		const prefix string = ",\"cid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.CampaignID))
	}
	if in.CreativeID != "" {
		const prefix string = ",\"crid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.CreativeID))
	}
	if in.Tactic != "" {
		const prefix string = ",\"tactic\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Tactic))
	}
	if len(in.Cat) != 0 {
		const prefix string = ",\"cat\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v12, v13 := range in.Cat {
				if v12 > 0 {
					out.RawByte(',')
				}
				out.String(string(v13))
			}
			out.RawByte(']')
		}
	}
	if len(in.Attr) != 0 {
		const prefix string = ",\"attr\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v14, v15 := range in.Attr {
				if v14 > 0 {
					out.RawByte(',')
				}
				out.Int(int(v15))
			}
			out.RawByte(']')
		}
	}
	if in.API != 0 {
		const prefix string = ",\"api\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.API))
	}
	if in.Protocol != 0 {
		const prefix string = ",\"protocol\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.Protocol))
	}
	if in.QAGMediaRating != 0 {
		const prefix string = ",\"qagmediarating\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.QAGMediaRating))
	}
	if in.Language != "" {
		const prefix string = ",\"language\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Language))
	}
	if in.DealID != "" {
		const prefix string = ",\"dealid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.DealID))
	}
	if in.H != 0 {
		const prefix string = ",\"h\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.H))
	}
	if in.W != 0 {
		const prefix string = ",\"w\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.W))
	}
	if in.WRatio != 0 {
		const prefix string = ",\"wratio\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.WRatio))
	}
	if in.HRatio != 0 {
		const prefix string = ",\"hratio\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.HRatio))
	}
	if in.Exp != 0 {
		const prefix string = ",\"exp\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.Exp))
	}
	if len(in.Ext) != 0 {
		const prefix string = ",\"ext\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Raw((in.Ext).MarshalJSON())
	}
	out.RawByte('}')
}
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.

package openrtb

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 easyjson10eb023eDecodeGithubComKrecuOpenrtb(in *jlexer.Lexer, out *BidResponse) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "id":
			out.ID = string(in.String())
		case "seatbid":
			if in.IsNull() {
				in.Skip()
				out.SeatBid = nil
			} else {
				in.Delim('[')
				if out.SeatBid == nil {
					if !in.IsDelim(']') {
						out.SeatBid = make([]SeatBid, 0, 1)
					} else {
						out.SeatBid = []SeatBid{}
					}
				} else {
					out.SeatBid = (out.SeatBid)[:0]
				}
				for !in.IsDelim(']') {
					var v1 SeatBid
					easyjson10eb023eDecodeGithubComKrecuOpenrtb1(in, &v1)
					out.SeatBid = append(out.SeatBid, v1)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "bidid":
			out.BidID = string(in.String())
		case "cur":
			out.Currency = string(in.String())
		case "customdata":
			out.CustomData = string(in.String())
		case "nbr":
			out.NBR = int(in.Int())
		case "ext":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.Ext).UnmarshalJSON(data))
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson10eb023eEncodeGithubComKrecuOpenrtb(out *jwriter.Writer, in BidResponse) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ID))
	}
	{
		const prefix string = ",\"seatbid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		if in.SeatBid == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
			out.RawString("null")
		} else {
			out.RawByte('[')
			for v2, v3 := range in.SeatBid {
				if v2 > 0 {
					out.RawByte(',')
				}
				easyjson10eb023eEncodeGithubComKrecuOpenrtb1(out, v3)
			}
			out.RawByte(']')
		}
	}
	if in.BidID != "" {
		const prefix string = ",\"bidid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.BidID))
	}
	if in.Currency != "" {
		const prefix string = ",\"cur\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Currency))
	}
	if in.CustomData != "" {
		const prefix string = ",\"customdata\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.CustomData))
	}
	if in.NBR != 0 {
		const prefix string = ",\"nbr\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.NBR))
	}
	if len(in.Ext) != 0 {
		const prefix string = ",\"ext\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Raw((in.Ext).MarshalJSON())
	}
	out.RawByte('}')
}

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

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

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

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *BidResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson10eb023eDecodeGithubComKrecuOpenrtb(l, v)
}
func easyjson10eb023eDecodeGithubComKrecuOpenrtb1(in *jlexer.Lexer, out *SeatBid) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "bid":
			if in.IsNull() {
				in.Skip()
				out.Bid = nil
			} else {
				in.Delim('[')
				if out.Bid == nil {
					if !in.IsDelim(']') {
						out.Bid = make([]Bid, 0, 1)
					} else {
						out.Bid = []Bid{}
					}
				} else {
					out.Bid = (out.Bid)[:0]
				}
				for !in.IsDelim(']') {
					var v4 Bid
					easyjson10eb023eDecodeGithubComKrecuOpenrtb2(in, &v4)
					out.Bid = append(out.Bid, v4)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "seat":
			out.Seat = string(in.String())
		case "group":
			out.Group = int(in.Int())
		case "ext":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.Ext).UnmarshalJSON(data))
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson10eb023eEncodeGithubComKrecuOpenrtb1(out *jwriter.Writer, in SeatBid) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"bid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		if in.Bid == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
			out.RawString("null")
		} else {
			out.RawByte('[')
			for v5, v6 := range in.Bid {
				if v5 > 0 {
					out.RawByte(',')
				}
				easyjson10eb023eEncodeGithubComKrecuOpenrtb2(out, v6)
			}
			out.RawByte(']')
		}
	}
	if in.Seat != "" {
		const prefix string = ",\"seat\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Seat))
	}
	if in.Group != 0 {
		const prefix string = ",\"group\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.Group))
	}
	if len(in.Ext) != 0 {
		const prefix string = ",\"ext\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Raw((in.Ext).MarshalJSON())
	}
	out.RawByte('}')
}
func easyjson10eb023eDecodeGithubComKrecuOpenrtb2(in *jlexer.Lexer, out *Bid) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeString()
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "id":
			out.ID = string(in.String())
		case "impid":
			out.ImpID = string(in.String())
		case "price":
			out.Price = float64(in.Float64())
		case "adid":
			out.AdID = string(in.String())
		case "nurl":
			out.NURL = string(in.String())
		case "burl":
			out.BURL = string(in.String())
		case "lurl":
			out.LURL = string(in.String())
		case "adm":
			out.AdMarkup = string(in.String())
		case "adomain":
			if in.IsNull() {
				in.Skip()
				out.AdvDomain = nil
			} else {
				in.Delim('[')
				if out.AdvDomain == nil {
					if !in.IsDelim(']') {
						out.AdvDomain = make([]string, 0, 4)
					} else {
						out.AdvDomain = []string{}
					}
				} else {
					out.AdvDomain = (out.AdvDomain)[:0]
				}
				for !in.IsDelim(']') {
					var v7 string
					v7 = string(in.String())
					out.AdvDomain = append(out.AdvDomain, v7)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "bundle":
			out.Bundle = string(in.String())
		case "iurl":
			out.IURL = string(in.String())
		case "cid":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.CampaignID).UnmarshalJSON(data))
			}
		case "crid":
			out.CreativeID = string(in.String())
		case "tactic":
			out.Tactic = string(in.String())
		case "cat":
			if in.IsNull() {
				in.Skip()
				out.Cat = nil
			} else {
				in.Delim('[')
				if out.Cat == nil {
					if !in.IsDelim(']') {
						out.Cat = make([]string, 0, 4)
					} else {
						out.Cat = []string{}
					}
				} else {
					out.Cat = (out.Cat)[:0]
				}
				for !in.IsDelim(']') {
					var v8 string
					v8 = string(in.String())
					out.Cat = append(out.Cat, v8)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "attr":
			if in.IsNull() {
				in.Skip()
				out.Attr = nil
			} else {
				in.Delim('[')
				if out.Attr == nil {
					if !in.IsDelim(']') {
						out.Attr = make([]int, 0, 8)
					} else {
						out.Attr = []int{}
					}
				} else {
					out.Attr = (out.Attr)[:0]
				}
				for !in.IsDelim(']') {
					var v9 int
					v9 = int(in.Int())
					out.Attr = append(out.Attr, v9)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "api":
			out.API = int(in.Int())
		case "protocol":
			out.Protocol = int(in.Int())
		case "qagmediarating":
			out.QAGMediaRating = int(in.Int())
		case "language":
			out.Language = string(in.String())
		case "dealid":
			out.DealID = string(in.String())
		case "h":
			out.H = int(in.Int())
		case "w":
			out.W = int(in.Int())
		case "wratio":
			out.WRatio = int(in.Int())
		case "hratio":
			out.HRatio = int(in.Int())
		case "exp":
			out.Exp = int(in.Int())
		case "ext":
			if data := in.Raw(); in.Ok() {
				in.AddError((out.Ext).UnmarshalJSON(data))
			}
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson10eb023eEncodeGithubComKrecuOpenrtb2(out *jwriter.Writer, in Bid) {
	out.RawByte('{')
	first := true
	_ = first
	{
		const prefix string = ",\"id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ID))
	}
	{
		const prefix string = ",\"impid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.ImpID))
	}
	{
		const prefix string = ",\"price\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Float64(float64(in.Price))
	}
	if in.AdID != "" {
		const prefix string = ",\"adid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.AdID))
	}
	if in.NURL != "" {
		const prefix string = ",\"nurl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.NURL))
	}
	if in.BURL != "" {
		const prefix string = ",\"burl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.BURL))
	}
	if in.LURL != "" {
		const prefix string = ",\"lurl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.LURL))
	}
	if in.AdMarkup != "" {
		const prefix string = ",\"adm\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.AdMarkup))
	}
	if len(in.AdvDomain) != 0 {
		const prefix string = ",\"adomain\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v10, v11 := range in.AdvDomain {
				if v10 > 0 {
					out.RawByte(',')
				}
				out.String(string(v11))
			}
			out.RawByte(']')
		}
	}
	if in.Bundle != "" {
		const prefix string = ",\"bundle\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Bundle))
	}
	if in.IURL != "" {
		const prefix string = ",\"iurl\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.IURL))
	}
	if in.CampaignID != "" {
		const prefix string = ",\"cid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.CampaignID))
	}
	if in.CreativeID != "" {
		const prefix string = ",\"crid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.CreativeID))
	}
	if in.Tactic != "" {
		const prefix string = ",\"tactic\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Tactic))
	}
	if len(in.Cat) != 0 {
		const prefix string = ",\"cat\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v12, v13 := range in.Cat {
				if v12 > 0 {
					out.RawByte(',')
				}
				out.String(string(v13))
			}
			out.RawByte(']')
		}
	}
	if len(in.Attr) != 0 {
		const prefix string = ",\"attr\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v14, v15 := range in.Attr {
				if v14 > 0 {
					out.RawByte(',')
				}
				out.Int(int(v15))
			}
			out.RawByte(']')
		}
	}
	if in.API != 0 {
		const prefix string = ",\"api\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.API))
	}
	if in.Protocol != 0 {
		const prefix string = ",\"protocol\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.Protocol))
	}
	if in.QAGMediaRating != 0 {
		const prefix string = ",\"qagmediarating\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.QAGMediaRating))
	}
	if in.Language != "" {
		const prefix string = ",\"language\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Language))
	}
	if in.DealID != "" {
		const prefix string = ",\"dealid\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.DealID))
	}
	if in.H != 0 {
		const prefix string = ",\"h\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.H))
	}
	if in.W != 0 {
		const prefix string = ",\"w\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.W))
	}
	if in.WRatio != 0 {
		const prefix string = ",\"wratio\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.WRatio))
	}
	if in.HRatio != 0 {
		const prefix string = ",\"hratio\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.HRatio))
	}
	if in.Exp != 0 {
		const prefix string = ",\"exp\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int(int(in.Exp))
	}
	if len(in.Ext) != 0 {
		const prefix string = ",\"ext\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Raw((in.Ext).MarshalJSON())
	}
	out.RawByte('}')
}
