github.com/antihax/goesi@v0.0.0-20240126031043-6c54d0cb7f95/esi/model_get_characters_character_id_industry_jobs_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 easyjsonA76eed41DecodeGithubComAntihaxGoesiEsi(in *jlexer.Lexer, out *GetCharactersCharacterIdIndustryJobs200OkList) { 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(GetCharactersCharacterIdIndustryJobs200OkList, 0, 0) 31 } else { 32 *out = GetCharactersCharacterIdIndustryJobs200OkList{} 33 } 34 } else { 35 *out = (*out)[:0] 36 } 37 for !in.IsDelim(']') { 38 var v1 GetCharactersCharacterIdIndustryJobs200Ok 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 easyjsonA76eed41EncodeGithubComAntihaxGoesiEsi(out *jwriter.Writer, in GetCharactersCharacterIdIndustryJobs200OkList) { 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 GetCharactersCharacterIdIndustryJobs200OkList) MarshalJSON() ([]byte, error) { 66 w := jwriter.Writer{} 67 easyjsonA76eed41EncodeGithubComAntihaxGoesiEsi(&w, v) 68 return w.Buffer.BuildBytes(), w.Error 69 } 70 71 // MarshalEasyJSON supports easyjson.Marshaler interface 72 func (v GetCharactersCharacterIdIndustryJobs200OkList) MarshalEasyJSON(w *jwriter.Writer) { 73 easyjsonA76eed41EncodeGithubComAntihaxGoesiEsi(w, v) 74 } 75 76 // UnmarshalJSON supports json.Unmarshaler interface 77 func (v *GetCharactersCharacterIdIndustryJobs200OkList) UnmarshalJSON(data []byte) error { 78 r := jlexer.Lexer{Data: data} 79 easyjsonA76eed41DecodeGithubComAntihaxGoesiEsi(&r, v) 80 return r.Error() 81 } 82 83 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 84 func (v *GetCharactersCharacterIdIndustryJobs200OkList) UnmarshalEasyJSON(l *jlexer.Lexer) { 85 easyjsonA76eed41DecodeGithubComAntihaxGoesiEsi(l, v) 86 } 87 func easyjsonA76eed41DecodeGithubComAntihaxGoesiEsi1(in *jlexer.Lexer, out *GetCharactersCharacterIdIndustryJobs200Ok) { 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 "activity_id": 107 out.ActivityId = int32(in.Int32()) 108 case "blueprint_id": 109 out.BlueprintId = int64(in.Int64()) 110 case "blueprint_location_id": 111 out.BlueprintLocationId = int64(in.Int64()) 112 case "blueprint_type_id": 113 out.BlueprintTypeId = int32(in.Int32()) 114 case "completed_character_id": 115 out.CompletedCharacterId = int32(in.Int32()) 116 case "completed_date": 117 if data := in.Raw(); in.Ok() { 118 in.AddError((out.CompletedDate).UnmarshalJSON(data)) 119 } 120 case "cost": 121 out.Cost = float64(in.Float64()) 122 case "duration": 123 out.Duration = int32(in.Int32()) 124 case "end_date": 125 if data := in.Raw(); in.Ok() { 126 in.AddError((out.EndDate).UnmarshalJSON(data)) 127 } 128 case "facility_id": 129 out.FacilityId = int64(in.Int64()) 130 case "installer_id": 131 out.InstallerId = int32(in.Int32()) 132 case "job_id": 133 out.JobId = int32(in.Int32()) 134 case "licensed_runs": 135 out.LicensedRuns = int32(in.Int32()) 136 case "output_location_id": 137 out.OutputLocationId = int64(in.Int64()) 138 case "pause_date": 139 if data := in.Raw(); in.Ok() { 140 in.AddError((out.PauseDate).UnmarshalJSON(data)) 141 } 142 case "probability": 143 out.Probability = float32(in.Float32()) 144 case "product_type_id": 145 out.ProductTypeId = int32(in.Int32()) 146 case "runs": 147 out.Runs = int32(in.Int32()) 148 case "start_date": 149 if data := in.Raw(); in.Ok() { 150 in.AddError((out.StartDate).UnmarshalJSON(data)) 151 } 152 case "station_id": 153 out.StationId = int64(in.Int64()) 154 case "status": 155 out.Status = string(in.String()) 156 case "successful_runs": 157 out.SuccessfulRuns = int32(in.Int32()) 158 default: 159 in.SkipRecursive() 160 } 161 in.WantComma() 162 } 163 in.Delim('}') 164 if isTopLevel { 165 in.Consumed() 166 } 167 } 168 func easyjsonA76eed41EncodeGithubComAntihaxGoesiEsi1(out *jwriter.Writer, in GetCharactersCharacterIdIndustryJobs200Ok) { 169 out.RawByte('{') 170 first := true 171 _ = first 172 if in.ActivityId != 0 { 173 const prefix string = ",\"activity_id\":" 174 first = false 175 out.RawString(prefix[1:]) 176 out.Int32(int32(in.ActivityId)) 177 } 178 if in.BlueprintId != 0 { 179 const prefix string = ",\"blueprint_id\":" 180 if first { 181 first = false 182 out.RawString(prefix[1:]) 183 } else { 184 out.RawString(prefix) 185 } 186 out.Int64(int64(in.BlueprintId)) 187 } 188 if in.BlueprintLocationId != 0 { 189 const prefix string = ",\"blueprint_location_id\":" 190 if first { 191 first = false 192 out.RawString(prefix[1:]) 193 } else { 194 out.RawString(prefix) 195 } 196 out.Int64(int64(in.BlueprintLocationId)) 197 } 198 if in.BlueprintTypeId != 0 { 199 const prefix string = ",\"blueprint_type_id\":" 200 if first { 201 first = false 202 out.RawString(prefix[1:]) 203 } else { 204 out.RawString(prefix) 205 } 206 out.Int32(int32(in.BlueprintTypeId)) 207 } 208 if in.CompletedCharacterId != 0 { 209 const prefix string = ",\"completed_character_id\":" 210 if first { 211 first = false 212 out.RawString(prefix[1:]) 213 } else { 214 out.RawString(prefix) 215 } 216 out.Int32(int32(in.CompletedCharacterId)) 217 } 218 if true { 219 const prefix string = ",\"completed_date\":" 220 if first { 221 first = false 222 out.RawString(prefix[1:]) 223 } else { 224 out.RawString(prefix) 225 } 226 out.Raw((in.CompletedDate).MarshalJSON()) 227 } 228 if in.Cost != 0 { 229 const prefix string = ",\"cost\":" 230 if first { 231 first = false 232 out.RawString(prefix[1:]) 233 } else { 234 out.RawString(prefix) 235 } 236 out.Float64(float64(in.Cost)) 237 } 238 if in.Duration != 0 { 239 const prefix string = ",\"duration\":" 240 if first { 241 first = false 242 out.RawString(prefix[1:]) 243 } else { 244 out.RawString(prefix) 245 } 246 out.Int32(int32(in.Duration)) 247 } 248 if true { 249 const prefix string = ",\"end_date\":" 250 if first { 251 first = false 252 out.RawString(prefix[1:]) 253 } else { 254 out.RawString(prefix) 255 } 256 out.Raw((in.EndDate).MarshalJSON()) 257 } 258 if in.FacilityId != 0 { 259 const prefix string = ",\"facility_id\":" 260 if first { 261 first = false 262 out.RawString(prefix[1:]) 263 } else { 264 out.RawString(prefix) 265 } 266 out.Int64(int64(in.FacilityId)) 267 } 268 if in.InstallerId != 0 { 269 const prefix string = ",\"installer_id\":" 270 if first { 271 first = false 272 out.RawString(prefix[1:]) 273 } else { 274 out.RawString(prefix) 275 } 276 out.Int32(int32(in.InstallerId)) 277 } 278 if in.JobId != 0 { 279 const prefix string = ",\"job_id\":" 280 if first { 281 first = false 282 out.RawString(prefix[1:]) 283 } else { 284 out.RawString(prefix) 285 } 286 out.Int32(int32(in.JobId)) 287 } 288 if in.LicensedRuns != 0 { 289 const prefix string = ",\"licensed_runs\":" 290 if first { 291 first = false 292 out.RawString(prefix[1:]) 293 } else { 294 out.RawString(prefix) 295 } 296 out.Int32(int32(in.LicensedRuns)) 297 } 298 if in.OutputLocationId != 0 { 299 const prefix string = ",\"output_location_id\":" 300 if first { 301 first = false 302 out.RawString(prefix[1:]) 303 } else { 304 out.RawString(prefix) 305 } 306 out.Int64(int64(in.OutputLocationId)) 307 } 308 if true { 309 const prefix string = ",\"pause_date\":" 310 if first { 311 first = false 312 out.RawString(prefix[1:]) 313 } else { 314 out.RawString(prefix) 315 } 316 out.Raw((in.PauseDate).MarshalJSON()) 317 } 318 if in.Probability != 0 { 319 const prefix string = ",\"probability\":" 320 if first { 321 first = false 322 out.RawString(prefix[1:]) 323 } else { 324 out.RawString(prefix) 325 } 326 out.Float32(float32(in.Probability)) 327 } 328 if in.ProductTypeId != 0 { 329 const prefix string = ",\"product_type_id\":" 330 if first { 331 first = false 332 out.RawString(prefix[1:]) 333 } else { 334 out.RawString(prefix) 335 } 336 out.Int32(int32(in.ProductTypeId)) 337 } 338 if in.Runs != 0 { 339 const prefix string = ",\"runs\":" 340 if first { 341 first = false 342 out.RawString(prefix[1:]) 343 } else { 344 out.RawString(prefix) 345 } 346 out.Int32(int32(in.Runs)) 347 } 348 if true { 349 const prefix string = ",\"start_date\":" 350 if first { 351 first = false 352 out.RawString(prefix[1:]) 353 } else { 354 out.RawString(prefix) 355 } 356 out.Raw((in.StartDate).MarshalJSON()) 357 } 358 if in.StationId != 0 { 359 const prefix string = ",\"station_id\":" 360 if first { 361 first = false 362 out.RawString(prefix[1:]) 363 } else { 364 out.RawString(prefix) 365 } 366 out.Int64(int64(in.StationId)) 367 } 368 if in.Status != "" { 369 const prefix string = ",\"status\":" 370 if first { 371 first = false 372 out.RawString(prefix[1:]) 373 } else { 374 out.RawString(prefix) 375 } 376 out.String(string(in.Status)) 377 } 378 if in.SuccessfulRuns != 0 { 379 const prefix string = ",\"successful_runs\":" 380 if first { 381 first = false 382 out.RawString(prefix[1:]) 383 } else { 384 out.RawString(prefix) 385 } 386 out.Int32(int32(in.SuccessfulRuns)) 387 } 388 out.RawByte('}') 389 } 390 391 // MarshalJSON supports json.Marshaler interface 392 func (v GetCharactersCharacterIdIndustryJobs200Ok) MarshalJSON() ([]byte, error) { 393 w := jwriter.Writer{} 394 easyjsonA76eed41EncodeGithubComAntihaxGoesiEsi1(&w, v) 395 return w.Buffer.BuildBytes(), w.Error 396 } 397 398 // MarshalEasyJSON supports easyjson.Marshaler interface 399 func (v GetCharactersCharacterIdIndustryJobs200Ok) MarshalEasyJSON(w *jwriter.Writer) { 400 easyjsonA76eed41EncodeGithubComAntihaxGoesiEsi1(w, v) 401 } 402 403 // UnmarshalJSON supports json.Unmarshaler interface 404 func (v *GetCharactersCharacterIdIndustryJobs200Ok) UnmarshalJSON(data []byte) error { 405 r := jlexer.Lexer{Data: data} 406 easyjsonA76eed41DecodeGithubComAntihaxGoesiEsi1(&r, v) 407 return r.Error() 408 } 409 410 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 411 func (v *GetCharactersCharacterIdIndustryJobs200Ok) UnmarshalEasyJSON(l *jlexer.Lexer) { 412 easyjsonA76eed41DecodeGithubComAntihaxGoesiEsi1(l, v) 413 }