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

package esi

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 easyjson315d323dDecodeGithubComAntihaxGoesiEsi(in *jlexer.Lexer, out *GetDogmaEffectsEffectIdOkList) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		in.Skip()
		*out = nil
	} else {
		in.Delim('[')
		if *out == nil {
			if !in.IsDelim(']') {
				*out = make(GetDogmaEffectsEffectIdOkList, 0, 0)
			} else {
				*out = GetDogmaEffectsEffectIdOkList{}
			}
		} else {
			*out = (*out)[:0]
		}
		for !in.IsDelim(']') {
			var v1 GetDogmaEffectsEffectIdOk
			(v1).UnmarshalEasyJSON(in)
			*out = append(*out, v1)
			in.WantComma()
		}
		in.Delim(']')
	}
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson315d323dEncodeGithubComAntihaxGoesiEsi(out *jwriter.Writer, in GetDogmaEffectsEffectIdOkList) {
	if in == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
		out.RawString("null")
	} else {
		out.RawByte('[')
		for v2, v3 := range in {
			if v2 > 0 {
				out.RawByte(',')
			}
			(v3).MarshalEasyJSON(out)
		}
		out.RawByte(']')
	}
}

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

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

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

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDogmaEffectsEffectIdOkList) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson315d323dDecodeGithubComAntihaxGoesiEsi(l, v)
}
func easyjson315d323dDecodeGithubComAntihaxGoesiEsi1(in *jlexer.Lexer, out *GetDogmaEffectsEffectIdOk) {
	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 "description":
			out.Description = string(in.String())
		case "disallow_auto_repeat":
			out.DisallowAutoRepeat = bool(in.Bool())
		case "discharge_attribute_id":
			out.DischargeAttributeId = int32(in.Int32())
		case "display_name":
			out.DisplayName = string(in.String())
		case "duration_attribute_id":
			out.DurationAttributeId = int32(in.Int32())
		case "effect_category":
			out.EffectCategory = int32(in.Int32())
		case "effect_id":
			out.EffectId = int32(in.Int32())
		case "electronic_chance":
			out.ElectronicChance = bool(in.Bool())
		case "falloff_attribute_id":
			out.FalloffAttributeId = int32(in.Int32())
		case "icon_id":
			out.IconId = int32(in.Int32())
		case "is_assistance":
			out.IsAssistance = bool(in.Bool())
		case "is_offensive":
			out.IsOffensive = bool(in.Bool())
		case "is_warp_safe":
			out.IsWarpSafe = bool(in.Bool())
		case "modifiers":
			if in.IsNull() {
				in.Skip()
				out.Modifiers = nil
			} else {
				in.Delim('[')
				if out.Modifiers == nil {
					if !in.IsDelim(']') {
						out.Modifiers = make([]GetDogmaEffectsEffectIdModifier, 0, 1)
					} else {
						out.Modifiers = []GetDogmaEffectsEffectIdModifier{}
					}
				} else {
					out.Modifiers = (out.Modifiers)[:0]
				}
				for !in.IsDelim(']') {
					var v4 GetDogmaEffectsEffectIdModifier
					easyjson315d323dDecodeGithubComAntihaxGoesiEsi2(in, &v4)
					out.Modifiers = append(out.Modifiers, v4)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "name":
			out.Name = string(in.String())
		case "post_expression":
			out.PostExpression = int32(in.Int32())
		case "pre_expression":
			out.PreExpression = int32(in.Int32())
		case "published":
			out.Published = bool(in.Bool())
		case "range_attribute_id":
			out.RangeAttributeId = int32(in.Int32())
		case "range_chance":
			out.RangeChance = bool(in.Bool())
		case "tracking_speed_attribute_id":
			out.TrackingSpeedAttributeId = int32(in.Int32())
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson315d323dEncodeGithubComAntihaxGoesiEsi1(out *jwriter.Writer, in GetDogmaEffectsEffectIdOk) {
	out.RawByte('{')
	first := true
	_ = first
	if in.Description != "" {
		const prefix string = ",\"description\":"
		first = false
		out.RawString(prefix[1:])
		out.String(string(in.Description))
	}
	if in.DisallowAutoRepeat {
		const prefix string = ",\"disallow_auto_repeat\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(in.DisallowAutoRepeat))
	}
	if in.DischargeAttributeId != 0 {
		const prefix string = ",\"discharge_attribute_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.DischargeAttributeId))
	}
	if in.DisplayName != "" {
		const prefix string = ",\"display_name\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.DisplayName))
	}
	if in.DurationAttributeId != 0 {
		const prefix string = ",\"duration_attribute_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.DurationAttributeId))
	}
	if in.EffectCategory != 0 {
		const prefix string = ",\"effect_category\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.EffectCategory))
	}
	if in.EffectId != 0 {
		const prefix string = ",\"effect_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.EffectId))
	}
	if in.ElectronicChance {
		const prefix string = ",\"electronic_chance\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(in.ElectronicChance))
	}
	if in.FalloffAttributeId != 0 {
		const prefix string = ",\"falloff_attribute_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.FalloffAttributeId))
	}
	if in.IconId != 0 {
		const prefix string = ",\"icon_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.IconId))
	}
	if in.IsAssistance {
		const prefix string = ",\"is_assistance\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(in.IsAssistance))
	}
	if in.IsOffensive {
		const prefix string = ",\"is_offensive\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(in.IsOffensive))
	}
	if in.IsWarpSafe {
		const prefix string = ",\"is_warp_safe\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(in.IsWarpSafe))
	}
	if len(in.Modifiers) != 0 {
		const prefix string = ",\"modifiers\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		{
			out.RawByte('[')
			for v5, v6 := range in.Modifiers {
				if v5 > 0 {
					out.RawByte(',')
				}
				easyjson315d323dEncodeGithubComAntihaxGoesiEsi2(out, v6)
			}
			out.RawByte(']')
		}
	}
	if in.Name != "" {
		const prefix string = ",\"name\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Name))
	}
	if in.PostExpression != 0 {
		const prefix string = ",\"post_expression\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.PostExpression))
	}
	if in.PreExpression != 0 {
		const prefix string = ",\"pre_expression\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.PreExpression))
	}
	if in.Published {
		const prefix string = ",\"published\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(in.Published))
	}
	if in.RangeAttributeId != 0 {
		const prefix string = ",\"range_attribute_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.RangeAttributeId))
	}
	if in.RangeChance {
		const prefix string = ",\"range_chance\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Bool(bool(in.RangeChance))
	}
	if in.TrackingSpeedAttributeId != 0 {
		const prefix string = ",\"tracking_speed_attribute_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.TrackingSpeedAttributeId))
	}
	out.RawByte('}')
}

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

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

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

// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetDogmaEffectsEffectIdOk) UnmarshalEasyJSON(l *jlexer.Lexer) {
	easyjson315d323dDecodeGithubComAntihaxGoesiEsi1(l, v)
}
func easyjson315d323dDecodeGithubComAntihaxGoesiEsi2(in *jlexer.Lexer, out *GetDogmaEffectsEffectIdModifier) {
	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 "domain":
			out.Domain = string(in.String())
		case "effect_id":
			out.EffectId = int32(in.Int32())
		case "func":
			out.Func_ = string(in.String())
		case "modified_attribute_id":
			out.ModifiedAttributeId = int32(in.Int32())
		case "modifying_attribute_id":
			out.ModifyingAttributeId = int32(in.Int32())
		case "operator":
			out.Operator = int32(in.Int32())
		default:
			in.SkipRecursive()
		}
		in.WantComma()
	}
	in.Delim('}')
	if isTopLevel {
		in.Consumed()
	}
}
func easyjson315d323dEncodeGithubComAntihaxGoesiEsi2(out *jwriter.Writer, in GetDogmaEffectsEffectIdModifier) {
	out.RawByte('{')
	first := true
	_ = first
	if in.Domain != "" {
		const prefix string = ",\"domain\":"
		first = false
		out.RawString(prefix[1:])
		out.String(string(in.Domain))
	}
	if in.EffectId != 0 {
		const prefix string = ",\"effect_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.EffectId))
	}
	if in.Func_ != "" {
		const prefix string = ",\"func\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.String(string(in.Func_))
	}
	if in.ModifiedAttributeId != 0 {
		const prefix string = ",\"modified_attribute_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.ModifiedAttributeId))
	}
	if in.ModifyingAttributeId != 0 {
		const prefix string = ",\"modifying_attribute_id\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.ModifyingAttributeId))
	}
	if in.Operator != 0 {
		const prefix string = ",\"operator\":"
		if first {
			first = false
			out.RawString(prefix[1:])
		} else {
			out.RawString(prefix)
		}
		out.Int32(int32(in.Operator))
	}
	out.RawByte('}')
}
