github.com/antihax/goesi@v0.0.0-20240126031043-6c54d0cb7f95/esi/model_get_alliances_alliance_id_contacts_200_ok_easyjson.go (about) 1 // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. 2 3 package esi 4 5 import ( 6 json "encoding/json" 7 8 easyjson "github.com/mailru/easyjson" 9 jlexer "github.com/mailru/easyjson/jlexer" 10 jwriter "github.com/mailru/easyjson/jwriter" 11 ) 12 13 // suppress unused package warning 14 var ( 15 _ *json.RawMessage 16 _ *jlexer.Lexer 17 _ *jwriter.Writer 18 _ easyjson.Marshaler 19 ) 20 21 func easyjson8f4a097DecodeGithubComAntihaxGoesiEsi(in *jlexer.Lexer, out *GetAlliancesAllianceIdContacts200OkList) { 22 isTopLevel := in.IsStart() 23 if in.IsNull() { 24 in.Skip() 25 *out = nil 26 } else { 27 in.Delim('[') 28 if *out == nil { 29 if !in.IsDelim(']') { 30 *out = make(GetAlliancesAllianceIdContacts200OkList, 0, 1) 31 } else { 32 *out = GetAlliancesAllianceIdContacts200OkList{} 33 } 34 } else { 35 *out = (*out)[:0] 36 } 37 for !in.IsDelim(']') { 38 var v1 GetAlliancesAllianceIdContacts200Ok 39 (v1).UnmarshalEasyJSON(in) 40 *out = append(*out, v1) 41 in.WantComma() 42 } 43 in.Delim(']') 44 } 45 if isTopLevel { 46 in.Consumed() 47 } 48 } 49 func easyjson8f4a097EncodeGithubComAntihaxGoesiEsi(out *jwriter.Writer, in GetAlliancesAllianceIdContacts200OkList) { 50 if in == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { 51 out.RawString("null") 52 } else { 53 out.RawByte('[') 54 for v2, v3 := range in { 55 if v2 > 0 { 56 out.RawByte(',') 57 } 58 (v3).MarshalEasyJSON(out) 59 } 60 out.RawByte(']') 61 } 62 } 63 64 // MarshalJSON supports json.Marshaler interface 65 func (v GetAlliancesAllianceIdContacts200OkList) MarshalJSON() ([]byte, error) { 66 w := jwriter.Writer{} 67 easyjson8f4a097EncodeGithubComAntihaxGoesiEsi(&w, v) 68 return w.Buffer.BuildBytes(), w.Error 69 } 70 71 // MarshalEasyJSON supports easyjson.Marshaler interface 72 func (v GetAlliancesAllianceIdContacts200OkList) MarshalEasyJSON(w *jwriter.Writer) { 73 easyjson8f4a097EncodeGithubComAntihaxGoesiEsi(w, v) 74 } 75 76 // UnmarshalJSON supports json.Unmarshaler interface 77 func (v *GetAlliancesAllianceIdContacts200OkList) UnmarshalJSON(data []byte) error { 78 r := jlexer.Lexer{Data: data} 79 easyjson8f4a097DecodeGithubComAntihaxGoesiEsi(&r, v) 80 return r.Error() 81 } 82 83 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 84 func (v *GetAlliancesAllianceIdContacts200OkList) UnmarshalEasyJSON(l *jlexer.Lexer) { 85 easyjson8f4a097DecodeGithubComAntihaxGoesiEsi(l, v) 86 } 87 func easyjson8f4a097DecodeGithubComAntihaxGoesiEsi1(in *jlexer.Lexer, out *GetAlliancesAllianceIdContacts200Ok) { 88 isTopLevel := in.IsStart() 89 if in.IsNull() { 90 if isTopLevel { 91 in.Consumed() 92 } 93 in.Skip() 94 return 95 } 96 in.Delim('{') 97 for !in.IsDelim('}') { 98 key := in.UnsafeFieldName(false) 99 in.WantColon() 100 if in.IsNull() { 101 in.Skip() 102 in.WantComma() 103 continue 104 } 105 switch key { 106 case "contact_id": 107 out.ContactId = int32(in.Int32()) 108 case "contact_type": 109 out.ContactType = string(in.String()) 110 case "label_ids": 111 if in.IsNull() { 112 in.Skip() 113 out.LabelIds = nil 114 } else { 115 in.Delim('[') 116 if out.LabelIds == nil { 117 if !in.IsDelim(']') { 118 out.LabelIds = make([]int64, 0, 8) 119 } else { 120 out.LabelIds = []int64{} 121 } 122 } else { 123 out.LabelIds = (out.LabelIds)[:0] 124 } 125 for !in.IsDelim(']') { 126 var v4 int64 127 v4 = int64(in.Int64()) 128 out.LabelIds = append(out.LabelIds, v4) 129 in.WantComma() 130 } 131 in.Delim(']') 132 } 133 case "standing": 134 out.Standing = float32(in.Float32()) 135 default: 136 in.SkipRecursive() 137 } 138 in.WantComma() 139 } 140 in.Delim('}') 141 if isTopLevel { 142 in.Consumed() 143 } 144 } 145 func easyjson8f4a097EncodeGithubComAntihaxGoesiEsi1(out *jwriter.Writer, in GetAlliancesAllianceIdContacts200Ok) { 146 out.RawByte('{') 147 first := true 148 _ = first 149 if in.ContactId != 0 { 150 const prefix string = ",\"contact_id\":" 151 first = false 152 out.RawString(prefix[1:]) 153 out.Int32(int32(in.ContactId)) 154 } 155 if in.ContactType != "" { 156 const prefix string = ",\"contact_type\":" 157 if first { 158 first = false 159 out.RawString(prefix[1:]) 160 } else { 161 out.RawString(prefix) 162 } 163 out.String(string(in.ContactType)) 164 } 165 if len(in.LabelIds) != 0 { 166 const prefix string = ",\"label_ids\":" 167 if first { 168 first = false 169 out.RawString(prefix[1:]) 170 } else { 171 out.RawString(prefix) 172 } 173 { 174 out.RawByte('[') 175 for v5, v6 := range in.LabelIds { 176 if v5 > 0 { 177 out.RawByte(',') 178 } 179 out.Int64(int64(v6)) 180 } 181 out.RawByte(']') 182 } 183 } 184 if in.Standing != 0 { 185 const prefix string = ",\"standing\":" 186 if first { 187 first = false 188 out.RawString(prefix[1:]) 189 } else { 190 out.RawString(prefix) 191 } 192 out.Float32(float32(in.Standing)) 193 } 194 out.RawByte('}') 195 } 196 197 // MarshalJSON supports json.Marshaler interface 198 func (v GetAlliancesAllianceIdContacts200Ok) MarshalJSON() ([]byte, error) { 199 w := jwriter.Writer{} 200 easyjson8f4a097EncodeGithubComAntihaxGoesiEsi1(&w, v) 201 return w.Buffer.BuildBytes(), w.Error 202 } 203 204 // MarshalEasyJSON supports easyjson.Marshaler interface 205 func (v GetAlliancesAllianceIdContacts200Ok) MarshalEasyJSON(w *jwriter.Writer) { 206 easyjson8f4a097EncodeGithubComAntihaxGoesiEsi1(w, v) 207 } 208 209 // UnmarshalJSON supports json.Unmarshaler interface 210 func (v *GetAlliancesAllianceIdContacts200Ok) UnmarshalJSON(data []byte) error { 211 r := jlexer.Lexer{Data: data} 212 easyjson8f4a097DecodeGithubComAntihaxGoesiEsi1(&r, v) 213 return r.Error() 214 } 215 216 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 217 func (v *GetAlliancesAllianceIdContacts200Ok) UnmarshalEasyJSON(l *jlexer.Lexer) { 218 easyjson8f4a097DecodeGithubComAntihaxGoesiEsi1(l, v) 219 }