github.com/mailgun/mailgun-go/v3@v3.6.4/events/objects_easyjson.go (about) 1 // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. 2 3 package events 4 5 import ( 6 json "encoding/json" 7 easyjson "github.com/mailru/easyjson" 8 jlexer "github.com/mailru/easyjson/jlexer" 9 jwriter "github.com/mailru/easyjson/jwriter" 10 ) 11 12 // suppress unused package warning 13 var ( 14 _ *json.RawMessage 15 _ *jlexer.Lexer 16 _ *jwriter.Writer 17 _ easyjson.Marshaler 18 ) 19 20 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents(in *jlexer.Lexer, out *Storage) { 21 isTopLevel := in.IsStart() 22 if in.IsNull() { 23 if isTopLevel { 24 in.Consumed() 25 } 26 in.Skip() 27 return 28 } 29 in.Delim('{') 30 for !in.IsDelim('}') { 31 key := in.UnsafeString() 32 in.WantColon() 33 if in.IsNull() { 34 in.Skip() 35 in.WantComma() 36 continue 37 } 38 switch key { 39 case "key": 40 out.Key = string(in.String()) 41 case "url": 42 out.URL = string(in.String()) 43 default: 44 in.SkipRecursive() 45 } 46 in.WantComma() 47 } 48 in.Delim('}') 49 if isTopLevel { 50 in.Consumed() 51 } 52 } 53 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents(out *jwriter.Writer, in Storage) { 54 out.RawByte('{') 55 first := true 56 _ = first 57 { 58 const prefix string = ",\"key\":" 59 if first { 60 first = false 61 out.RawString(prefix[1:]) 62 } else { 63 out.RawString(prefix) 64 } 65 out.String(string(in.Key)) 66 } 67 { 68 const prefix string = ",\"url\":" 69 if first { 70 first = false 71 out.RawString(prefix[1:]) 72 } else { 73 out.RawString(prefix) 74 } 75 out.String(string(in.URL)) 76 } 77 out.RawByte('}') 78 } 79 80 // MarshalJSON supports json.Marshaler interface 81 func (v Storage) MarshalJSON() ([]byte, error) { 82 w := jwriter.Writer{} 83 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents(&w, v) 84 return w.Buffer.BuildBytes(), w.Error 85 } 86 87 // MarshalEasyJSON supports easyjson.Marshaler interface 88 func (v Storage) MarshalEasyJSON(w *jwriter.Writer) { 89 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents(w, v) 90 } 91 92 // UnmarshalJSON supports json.Unmarshaler interface 93 func (v *Storage) UnmarshalJSON(data []byte) error { 94 r := jlexer.Lexer{Data: data} 95 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents(&r, v) 96 return r.Error() 97 } 98 99 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 100 func (v *Storage) UnmarshalEasyJSON(l *jlexer.Lexer) { 101 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents(l, v) 102 } 103 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents1(in *jlexer.Lexer, out *MessageHeaders) { 104 isTopLevel := in.IsStart() 105 if in.IsNull() { 106 if isTopLevel { 107 in.Consumed() 108 } 109 in.Skip() 110 return 111 } 112 in.Delim('{') 113 for !in.IsDelim('}') { 114 key := in.UnsafeString() 115 in.WantColon() 116 if in.IsNull() { 117 in.Skip() 118 in.WantComma() 119 continue 120 } 121 switch key { 122 case "to": 123 out.To = string(in.String()) 124 case "message-id": 125 out.MessageID = string(in.String()) 126 case "from": 127 out.From = string(in.String()) 128 case "subject": 129 out.Subject = string(in.String()) 130 default: 131 in.SkipRecursive() 132 } 133 in.WantComma() 134 } 135 in.Delim('}') 136 if isTopLevel { 137 in.Consumed() 138 } 139 } 140 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents1(out *jwriter.Writer, in MessageHeaders) { 141 out.RawByte('{') 142 first := true 143 _ = first 144 { 145 const prefix string = ",\"to\":" 146 if first { 147 first = false 148 out.RawString(prefix[1:]) 149 } else { 150 out.RawString(prefix) 151 } 152 out.String(string(in.To)) 153 } 154 { 155 const prefix string = ",\"message-id\":" 156 if first { 157 first = false 158 out.RawString(prefix[1:]) 159 } else { 160 out.RawString(prefix) 161 } 162 out.String(string(in.MessageID)) 163 } 164 { 165 const prefix string = ",\"from\":" 166 if first { 167 first = false 168 out.RawString(prefix[1:]) 169 } else { 170 out.RawString(prefix) 171 } 172 out.String(string(in.From)) 173 } 174 { 175 const prefix string = ",\"subject\":" 176 if first { 177 first = false 178 out.RawString(prefix[1:]) 179 } else { 180 out.RawString(prefix) 181 } 182 out.String(string(in.Subject)) 183 } 184 out.RawByte('}') 185 } 186 187 // MarshalJSON supports json.Marshaler interface 188 func (v MessageHeaders) MarshalJSON() ([]byte, error) { 189 w := jwriter.Writer{} 190 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents1(&w, v) 191 return w.Buffer.BuildBytes(), w.Error 192 } 193 194 // MarshalEasyJSON supports easyjson.Marshaler interface 195 func (v MessageHeaders) MarshalEasyJSON(w *jwriter.Writer) { 196 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents1(w, v) 197 } 198 199 // UnmarshalJSON supports json.Unmarshaler interface 200 func (v *MessageHeaders) UnmarshalJSON(data []byte) error { 201 r := jlexer.Lexer{Data: data} 202 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents1(&r, v) 203 return r.Error() 204 } 205 206 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 207 func (v *MessageHeaders) UnmarshalEasyJSON(l *jlexer.Lexer) { 208 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents1(l, v) 209 } 210 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents2(in *jlexer.Lexer, out *Message) { 211 isTopLevel := in.IsStart() 212 if in.IsNull() { 213 if isTopLevel { 214 in.Consumed() 215 } 216 in.Skip() 217 return 218 } 219 in.Delim('{') 220 for !in.IsDelim('}') { 221 key := in.UnsafeString() 222 in.WantColon() 223 if in.IsNull() { 224 in.Skip() 225 in.WantComma() 226 continue 227 } 228 switch key { 229 case "headers": 230 if data := in.Raw(); in.Ok() { 231 in.AddError((out.Headers).UnmarshalJSON(data)) 232 } 233 case "attachments": 234 if in.IsNull() { 235 in.Skip() 236 out.Attachments = nil 237 } else { 238 in.Delim('[') 239 if out.Attachments == nil { 240 if !in.IsDelim(']') { 241 out.Attachments = make([]Attachment, 0, 1) 242 } else { 243 out.Attachments = []Attachment{} 244 } 245 } else { 246 out.Attachments = (out.Attachments)[:0] 247 } 248 for !in.IsDelim(']') { 249 var v1 Attachment 250 if data := in.Raw(); in.Ok() { 251 in.AddError((v1).UnmarshalJSON(data)) 252 } 253 out.Attachments = append(out.Attachments, v1) 254 in.WantComma() 255 } 256 in.Delim(']') 257 } 258 case "recipients": 259 if in.IsNull() { 260 in.Skip() 261 out.Recipients = nil 262 } else { 263 in.Delim('[') 264 if out.Recipients == nil { 265 if !in.IsDelim(']') { 266 out.Recipients = make([]string, 0, 4) 267 } else { 268 out.Recipients = []string{} 269 } 270 } else { 271 out.Recipients = (out.Recipients)[:0] 272 } 273 for !in.IsDelim(']') { 274 var v2 string 275 v2 = string(in.String()) 276 out.Recipients = append(out.Recipients, v2) 277 in.WantComma() 278 } 279 in.Delim(']') 280 } 281 case "size": 282 out.Size = int(in.Int()) 283 default: 284 in.SkipRecursive() 285 } 286 in.WantComma() 287 } 288 in.Delim('}') 289 if isTopLevel { 290 in.Consumed() 291 } 292 } 293 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents2(out *jwriter.Writer, in Message) { 294 out.RawByte('{') 295 first := true 296 _ = first 297 { 298 const prefix string = ",\"headers\":" 299 if first { 300 first = false 301 out.RawString(prefix[1:]) 302 } else { 303 out.RawString(prefix) 304 } 305 out.Raw((in.Headers).MarshalJSON()) 306 } 307 { 308 const prefix string = ",\"attachments\":" 309 if first { 310 first = false 311 out.RawString(prefix[1:]) 312 } else { 313 out.RawString(prefix) 314 } 315 if in.Attachments == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { 316 out.RawString("null") 317 } else { 318 out.RawByte('[') 319 for v3, v4 := range in.Attachments { 320 if v3 > 0 { 321 out.RawByte(',') 322 } 323 out.Raw((v4).MarshalJSON()) 324 } 325 out.RawByte(']') 326 } 327 } 328 { 329 const prefix string = ",\"recipients\":" 330 if first { 331 first = false 332 out.RawString(prefix[1:]) 333 } else { 334 out.RawString(prefix) 335 } 336 if in.Recipients == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { 337 out.RawString("null") 338 } else { 339 out.RawByte('[') 340 for v5, v6 := range in.Recipients { 341 if v5 > 0 { 342 out.RawByte(',') 343 } 344 out.String(string(v6)) 345 } 346 out.RawByte(']') 347 } 348 } 349 { 350 const prefix string = ",\"size\":" 351 if first { 352 first = false 353 out.RawString(prefix[1:]) 354 } else { 355 out.RawString(prefix) 356 } 357 out.Int(int(in.Size)) 358 } 359 out.RawByte('}') 360 } 361 362 // MarshalJSON supports json.Marshaler interface 363 func (v Message) MarshalJSON() ([]byte, error) { 364 w := jwriter.Writer{} 365 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents2(&w, v) 366 return w.Buffer.BuildBytes(), w.Error 367 } 368 369 // MarshalEasyJSON supports easyjson.Marshaler interface 370 func (v Message) MarshalEasyJSON(w *jwriter.Writer) { 371 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents2(w, v) 372 } 373 374 // UnmarshalJSON supports json.Unmarshaler interface 375 func (v *Message) UnmarshalJSON(data []byte) error { 376 r := jlexer.Lexer{Data: data} 377 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents2(&r, v) 378 return r.Error() 379 } 380 381 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 382 func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer) { 383 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents2(l, v) 384 } 385 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents3(in *jlexer.Lexer, out *MailingList) { 386 isTopLevel := in.IsStart() 387 if in.IsNull() { 388 if isTopLevel { 389 in.Consumed() 390 } 391 in.Skip() 392 return 393 } 394 in.Delim('{') 395 for !in.IsDelim('}') { 396 key := in.UnsafeString() 397 in.WantColon() 398 if in.IsNull() { 399 in.Skip() 400 in.WantComma() 401 continue 402 } 403 switch key { 404 case "address": 405 out.Address = string(in.String()) 406 case "list-id": 407 out.ListID = string(in.String()) 408 case "sid": 409 out.SID = string(in.String()) 410 default: 411 in.SkipRecursive() 412 } 413 in.WantComma() 414 } 415 in.Delim('}') 416 if isTopLevel { 417 in.Consumed() 418 } 419 } 420 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents3(out *jwriter.Writer, in MailingList) { 421 out.RawByte('{') 422 first := true 423 _ = first 424 { 425 const prefix string = ",\"address\":" 426 if first { 427 first = false 428 out.RawString(prefix[1:]) 429 } else { 430 out.RawString(prefix) 431 } 432 out.String(string(in.Address)) 433 } 434 { 435 const prefix string = ",\"list-id\":" 436 if first { 437 first = false 438 out.RawString(prefix[1:]) 439 } else { 440 out.RawString(prefix) 441 } 442 out.String(string(in.ListID)) 443 } 444 { 445 const prefix string = ",\"sid\":" 446 if first { 447 first = false 448 out.RawString(prefix[1:]) 449 } else { 450 out.RawString(prefix) 451 } 452 out.String(string(in.SID)) 453 } 454 out.RawByte('}') 455 } 456 457 // MarshalJSON supports json.Marshaler interface 458 func (v MailingList) MarshalJSON() ([]byte, error) { 459 w := jwriter.Writer{} 460 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents3(&w, v) 461 return w.Buffer.BuildBytes(), w.Error 462 } 463 464 // MarshalEasyJSON supports easyjson.Marshaler interface 465 func (v MailingList) MarshalEasyJSON(w *jwriter.Writer) { 466 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents3(w, v) 467 } 468 469 // UnmarshalJSON supports json.Unmarshaler interface 470 func (v *MailingList) UnmarshalJSON(data []byte) error { 471 r := jlexer.Lexer{Data: data} 472 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents3(&r, v) 473 return r.Error() 474 } 475 476 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 477 func (v *MailingList) UnmarshalEasyJSON(l *jlexer.Lexer) { 478 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents3(l, v) 479 } 480 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents4(in *jlexer.Lexer, out *GeoLocation) { 481 isTopLevel := in.IsStart() 482 if in.IsNull() { 483 if isTopLevel { 484 in.Consumed() 485 } 486 in.Skip() 487 return 488 } 489 in.Delim('{') 490 for !in.IsDelim('}') { 491 key := in.UnsafeString() 492 in.WantColon() 493 if in.IsNull() { 494 in.Skip() 495 in.WantComma() 496 continue 497 } 498 switch key { 499 case "city": 500 out.City = string(in.String()) 501 case "country": 502 out.Country = string(in.String()) 503 case "region": 504 out.Region = string(in.String()) 505 default: 506 in.SkipRecursive() 507 } 508 in.WantComma() 509 } 510 in.Delim('}') 511 if isTopLevel { 512 in.Consumed() 513 } 514 } 515 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents4(out *jwriter.Writer, in GeoLocation) { 516 out.RawByte('{') 517 first := true 518 _ = first 519 { 520 const prefix string = ",\"city\":" 521 if first { 522 first = false 523 out.RawString(prefix[1:]) 524 } else { 525 out.RawString(prefix) 526 } 527 out.String(string(in.City)) 528 } 529 { 530 const prefix string = ",\"country\":" 531 if first { 532 first = false 533 out.RawString(prefix[1:]) 534 } else { 535 out.RawString(prefix) 536 } 537 out.String(string(in.Country)) 538 } 539 { 540 const prefix string = ",\"region\":" 541 if first { 542 first = false 543 out.RawString(prefix[1:]) 544 } else { 545 out.RawString(prefix) 546 } 547 out.String(string(in.Region)) 548 } 549 out.RawByte('}') 550 } 551 552 // MarshalJSON supports json.Marshaler interface 553 func (v GeoLocation) MarshalJSON() ([]byte, error) { 554 w := jwriter.Writer{} 555 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents4(&w, v) 556 return w.Buffer.BuildBytes(), w.Error 557 } 558 559 // MarshalEasyJSON supports easyjson.Marshaler interface 560 func (v GeoLocation) MarshalEasyJSON(w *jwriter.Writer) { 561 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents4(w, v) 562 } 563 564 // UnmarshalJSON supports json.Unmarshaler interface 565 func (v *GeoLocation) UnmarshalJSON(data []byte) error { 566 r := jlexer.Lexer{Data: data} 567 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents4(&r, v) 568 return r.Error() 569 } 570 571 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 572 func (v *GeoLocation) UnmarshalEasyJSON(l *jlexer.Lexer) { 573 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents4(l, v) 574 } 575 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents5(in *jlexer.Lexer, out *Flags) { 576 isTopLevel := in.IsStart() 577 if in.IsNull() { 578 if isTopLevel { 579 in.Consumed() 580 } 581 in.Skip() 582 return 583 } 584 in.Delim('{') 585 for !in.IsDelim('}') { 586 key := in.UnsafeString() 587 in.WantColon() 588 if in.IsNull() { 589 in.Skip() 590 in.WantComma() 591 continue 592 } 593 switch key { 594 case "is-authenticated": 595 out.IsAuthenticated = bool(in.Bool()) 596 case "is-big": 597 out.IsBig = bool(in.Bool()) 598 case "is-system-test": 599 out.IsSystemTest = bool(in.Bool()) 600 case "is-test-mode": 601 out.IsTestMode = bool(in.Bool()) 602 case "is-delayed-bounce": 603 out.IsDelayedBounce = bool(in.Bool()) 604 default: 605 in.SkipRecursive() 606 } 607 in.WantComma() 608 } 609 in.Delim('}') 610 if isTopLevel { 611 in.Consumed() 612 } 613 } 614 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents5(out *jwriter.Writer, in Flags) { 615 out.RawByte('{') 616 first := true 617 _ = first 618 { 619 const prefix string = ",\"is-authenticated\":" 620 if first { 621 first = false 622 out.RawString(prefix[1:]) 623 } else { 624 out.RawString(prefix) 625 } 626 out.Bool(bool(in.IsAuthenticated)) 627 } 628 { 629 const prefix string = ",\"is-big\":" 630 if first { 631 first = false 632 out.RawString(prefix[1:]) 633 } else { 634 out.RawString(prefix) 635 } 636 out.Bool(bool(in.IsBig)) 637 } 638 { 639 const prefix string = ",\"is-system-test\":" 640 if first { 641 first = false 642 out.RawString(prefix[1:]) 643 } else { 644 out.RawString(prefix) 645 } 646 out.Bool(bool(in.IsSystemTest)) 647 } 648 { 649 const prefix string = ",\"is-test-mode\":" 650 if first { 651 first = false 652 out.RawString(prefix[1:]) 653 } else { 654 out.RawString(prefix) 655 } 656 out.Bool(bool(in.IsTestMode)) 657 } 658 { 659 const prefix string = ",\"is-delayed-bounce\":" 660 if first { 661 first = false 662 out.RawString(prefix[1:]) 663 } else { 664 out.RawString(prefix) 665 } 666 out.Bool(bool(in.IsDelayedBounce)) 667 } 668 out.RawByte('}') 669 } 670 671 // MarshalJSON supports json.Marshaler interface 672 func (v Flags) MarshalJSON() ([]byte, error) { 673 w := jwriter.Writer{} 674 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents5(&w, v) 675 return w.Buffer.BuildBytes(), w.Error 676 } 677 678 // MarshalEasyJSON supports easyjson.Marshaler interface 679 func (v Flags) MarshalEasyJSON(w *jwriter.Writer) { 680 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents5(w, v) 681 } 682 683 // UnmarshalJSON supports json.Unmarshaler interface 684 func (v *Flags) UnmarshalJSON(data []byte) error { 685 r := jlexer.Lexer{Data: data} 686 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents5(&r, v) 687 return r.Error() 688 } 689 690 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 691 func (v *Flags) UnmarshalEasyJSON(l *jlexer.Lexer) { 692 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents5(l, v) 693 } 694 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents6(in *jlexer.Lexer, out *Envelope) { 695 isTopLevel := in.IsStart() 696 if in.IsNull() { 697 if isTopLevel { 698 in.Consumed() 699 } 700 in.Skip() 701 return 702 } 703 in.Delim('{') 704 for !in.IsDelim('}') { 705 key := in.UnsafeString() 706 in.WantColon() 707 if in.IsNull() { 708 in.Skip() 709 in.WantComma() 710 continue 711 } 712 switch key { 713 case "mail-from": 714 out.MailFrom = string(in.String()) 715 case "sender": 716 out.Sender = string(in.String()) 717 case "transport": 718 out.Transport = string(in.String()) 719 case "targets": 720 out.Targets = string(in.String()) 721 case "sending-host": 722 out.SendingHost = string(in.String()) 723 case "sending-ip": 724 out.SendingIP = string(in.String()) 725 default: 726 in.SkipRecursive() 727 } 728 in.WantComma() 729 } 730 in.Delim('}') 731 if isTopLevel { 732 in.Consumed() 733 } 734 } 735 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents6(out *jwriter.Writer, in Envelope) { 736 out.RawByte('{') 737 first := true 738 _ = first 739 { 740 const prefix string = ",\"mail-from\":" 741 if first { 742 first = false 743 out.RawString(prefix[1:]) 744 } else { 745 out.RawString(prefix) 746 } 747 out.String(string(in.MailFrom)) 748 } 749 { 750 const prefix string = ",\"sender\":" 751 if first { 752 first = false 753 out.RawString(prefix[1:]) 754 } else { 755 out.RawString(prefix) 756 } 757 out.String(string(in.Sender)) 758 } 759 { 760 const prefix string = ",\"transport\":" 761 if first { 762 first = false 763 out.RawString(prefix[1:]) 764 } else { 765 out.RawString(prefix) 766 } 767 out.String(string(in.Transport)) 768 } 769 { 770 const prefix string = ",\"targets\":" 771 if first { 772 first = false 773 out.RawString(prefix[1:]) 774 } else { 775 out.RawString(prefix) 776 } 777 out.String(string(in.Targets)) 778 } 779 { 780 const prefix string = ",\"sending-host\":" 781 if first { 782 first = false 783 out.RawString(prefix[1:]) 784 } else { 785 out.RawString(prefix) 786 } 787 out.String(string(in.SendingHost)) 788 } 789 { 790 const prefix string = ",\"sending-ip\":" 791 if first { 792 first = false 793 out.RawString(prefix[1:]) 794 } else { 795 out.RawString(prefix) 796 } 797 out.String(string(in.SendingIP)) 798 } 799 out.RawByte('}') 800 } 801 802 // MarshalJSON supports json.Marshaler interface 803 func (v Envelope) MarshalJSON() ([]byte, error) { 804 w := jwriter.Writer{} 805 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents6(&w, v) 806 return w.Buffer.BuildBytes(), w.Error 807 } 808 809 // MarshalEasyJSON supports easyjson.Marshaler interface 810 func (v Envelope) MarshalEasyJSON(w *jwriter.Writer) { 811 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents6(w, v) 812 } 813 814 // UnmarshalJSON supports json.Unmarshaler interface 815 func (v *Envelope) UnmarshalJSON(data []byte) error { 816 r := jlexer.Lexer{Data: data} 817 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents6(&r, v) 818 return r.Error() 819 } 820 821 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 822 func (v *Envelope) UnmarshalEasyJSON(l *jlexer.Lexer) { 823 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents6(l, v) 824 } 825 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents7(in *jlexer.Lexer, out *DeliveryStatus) { 826 isTopLevel := in.IsStart() 827 if in.IsNull() { 828 if isTopLevel { 829 in.Consumed() 830 } 831 in.Skip() 832 return 833 } 834 in.Delim('{') 835 for !in.IsDelim('}') { 836 key := in.UnsafeString() 837 in.WantColon() 838 if in.IsNull() { 839 in.Skip() 840 in.WantComma() 841 continue 842 } 843 switch key { 844 case "code": 845 out.Code = int(in.Int()) 846 case "attempt-no": 847 out.AttemptNo = int(in.Int()) 848 case "description": 849 out.Description = string(in.String()) 850 case "message": 851 out.Message = string(in.String()) 852 case "session-seconds": 853 out.SessionSeconds = float64(in.Float64()) 854 default: 855 in.SkipRecursive() 856 } 857 in.WantComma() 858 } 859 in.Delim('}') 860 if isTopLevel { 861 in.Consumed() 862 } 863 } 864 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents7(out *jwriter.Writer, in DeliveryStatus) { 865 out.RawByte('{') 866 first := true 867 _ = first 868 { 869 const prefix string = ",\"code\":" 870 if first { 871 first = false 872 out.RawString(prefix[1:]) 873 } else { 874 out.RawString(prefix) 875 } 876 out.Int(int(in.Code)) 877 } 878 { 879 const prefix string = ",\"attempt-no\":" 880 if first { 881 first = false 882 out.RawString(prefix[1:]) 883 } else { 884 out.RawString(prefix) 885 } 886 out.Int(int(in.AttemptNo)) 887 } 888 { 889 const prefix string = ",\"description\":" 890 if first { 891 first = false 892 out.RawString(prefix[1:]) 893 } else { 894 out.RawString(prefix) 895 } 896 out.String(string(in.Description)) 897 } 898 { 899 const prefix string = ",\"message\":" 900 if first { 901 first = false 902 out.RawString(prefix[1:]) 903 } else { 904 out.RawString(prefix) 905 } 906 out.String(string(in.Message)) 907 } 908 { 909 const prefix string = ",\"session-seconds\":" 910 if first { 911 first = false 912 out.RawString(prefix[1:]) 913 } else { 914 out.RawString(prefix) 915 } 916 out.Float64(float64(in.SessionSeconds)) 917 } 918 out.RawByte('}') 919 } 920 921 // MarshalJSON supports json.Marshaler interface 922 func (v DeliveryStatus) MarshalJSON() ([]byte, error) { 923 w := jwriter.Writer{} 924 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents7(&w, v) 925 return w.Buffer.BuildBytes(), w.Error 926 } 927 928 // MarshalEasyJSON supports easyjson.Marshaler interface 929 func (v DeliveryStatus) MarshalEasyJSON(w *jwriter.Writer) { 930 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents7(w, v) 931 } 932 933 // UnmarshalJSON supports json.Unmarshaler interface 934 func (v *DeliveryStatus) UnmarshalJSON(data []byte) error { 935 r := jlexer.Lexer{Data: data} 936 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents7(&r, v) 937 return r.Error() 938 } 939 940 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 941 func (v *DeliveryStatus) UnmarshalEasyJSON(l *jlexer.Lexer) { 942 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents7(l, v) 943 } 944 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents8(in *jlexer.Lexer, out *ClientInfo) { 945 isTopLevel := in.IsStart() 946 if in.IsNull() { 947 if isTopLevel { 948 in.Consumed() 949 } 950 in.Skip() 951 return 952 } 953 in.Delim('{') 954 for !in.IsDelim('}') { 955 key := in.UnsafeString() 956 in.WantColon() 957 if in.IsNull() { 958 in.Skip() 959 in.WantComma() 960 continue 961 } 962 switch key { 963 case "accept-language": 964 out.AcceptLanguage = string(in.String()) 965 case "client-name": 966 out.ClientName = string(in.String()) 967 case "client-os": 968 out.ClientOS = string(in.String()) 969 case "client-type": 970 out.ClientType = string(in.String()) 971 case "device-type": 972 out.DeviceType = string(in.String()) 973 case "ip": 974 out.IP = string(in.String()) 975 case "user-agent": 976 out.UserAgent = string(in.String()) 977 default: 978 in.SkipRecursive() 979 } 980 in.WantComma() 981 } 982 in.Delim('}') 983 if isTopLevel { 984 in.Consumed() 985 } 986 } 987 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents8(out *jwriter.Writer, in ClientInfo) { 988 out.RawByte('{') 989 first := true 990 _ = first 991 { 992 const prefix string = ",\"accept-language\":" 993 if first { 994 first = false 995 out.RawString(prefix[1:]) 996 } else { 997 out.RawString(prefix) 998 } 999 out.String(string(in.AcceptLanguage)) 1000 } 1001 { 1002 const prefix string = ",\"client-name\":" 1003 if first { 1004 first = false 1005 out.RawString(prefix[1:]) 1006 } else { 1007 out.RawString(prefix) 1008 } 1009 out.String(string(in.ClientName)) 1010 } 1011 { 1012 const prefix string = ",\"client-os\":" 1013 if first { 1014 first = false 1015 out.RawString(prefix[1:]) 1016 } else { 1017 out.RawString(prefix) 1018 } 1019 out.String(string(in.ClientOS)) 1020 } 1021 { 1022 const prefix string = ",\"client-type\":" 1023 if first { 1024 first = false 1025 out.RawString(prefix[1:]) 1026 } else { 1027 out.RawString(prefix) 1028 } 1029 out.String(string(in.ClientType)) 1030 } 1031 { 1032 const prefix string = ",\"device-type\":" 1033 if first { 1034 first = false 1035 out.RawString(prefix[1:]) 1036 } else { 1037 out.RawString(prefix) 1038 } 1039 out.String(string(in.DeviceType)) 1040 } 1041 { 1042 const prefix string = ",\"ip\":" 1043 if first { 1044 first = false 1045 out.RawString(prefix[1:]) 1046 } else { 1047 out.RawString(prefix) 1048 } 1049 out.String(string(in.IP)) 1050 } 1051 { 1052 const prefix string = ",\"user-agent\":" 1053 if first { 1054 first = false 1055 out.RawString(prefix[1:]) 1056 } else { 1057 out.RawString(prefix) 1058 } 1059 out.String(string(in.UserAgent)) 1060 } 1061 out.RawByte('}') 1062 } 1063 1064 // MarshalJSON supports json.Marshaler interface 1065 func (v ClientInfo) MarshalJSON() ([]byte, error) { 1066 w := jwriter.Writer{} 1067 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents8(&w, v) 1068 return w.Buffer.BuildBytes(), w.Error 1069 } 1070 1071 // MarshalEasyJSON supports easyjson.Marshaler interface 1072 func (v ClientInfo) MarshalEasyJSON(w *jwriter.Writer) { 1073 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents8(w, v) 1074 } 1075 1076 // UnmarshalJSON supports json.Unmarshaler interface 1077 func (v *ClientInfo) UnmarshalJSON(data []byte) error { 1078 r := jlexer.Lexer{Data: data} 1079 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents8(&r, v) 1080 return r.Error() 1081 } 1082 1083 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 1084 func (v *ClientInfo) UnmarshalEasyJSON(l *jlexer.Lexer) { 1085 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents8(l, v) 1086 } 1087 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents9(in *jlexer.Lexer, out *Campaign) { 1088 isTopLevel := in.IsStart() 1089 if in.IsNull() { 1090 if isTopLevel { 1091 in.Consumed() 1092 } 1093 in.Skip() 1094 return 1095 } 1096 in.Delim('{') 1097 for !in.IsDelim('}') { 1098 key := in.UnsafeString() 1099 in.WantColon() 1100 if in.IsNull() { 1101 in.Skip() 1102 in.WantComma() 1103 continue 1104 } 1105 switch key { 1106 case "id": 1107 out.ID = string(in.String()) 1108 case "name": 1109 out.Name = string(in.String()) 1110 default: 1111 in.SkipRecursive() 1112 } 1113 in.WantComma() 1114 } 1115 in.Delim('}') 1116 if isTopLevel { 1117 in.Consumed() 1118 } 1119 } 1120 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents9(out *jwriter.Writer, in Campaign) { 1121 out.RawByte('{') 1122 first := true 1123 _ = first 1124 { 1125 const prefix string = ",\"id\":" 1126 if first { 1127 first = false 1128 out.RawString(prefix[1:]) 1129 } else { 1130 out.RawString(prefix) 1131 } 1132 out.String(string(in.ID)) 1133 } 1134 { 1135 const prefix string = ",\"name\":" 1136 if first { 1137 first = false 1138 out.RawString(prefix[1:]) 1139 } else { 1140 out.RawString(prefix) 1141 } 1142 out.String(string(in.Name)) 1143 } 1144 out.RawByte('}') 1145 } 1146 1147 // MarshalJSON supports json.Marshaler interface 1148 func (v Campaign) MarshalJSON() ([]byte, error) { 1149 w := jwriter.Writer{} 1150 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents9(&w, v) 1151 return w.Buffer.BuildBytes(), w.Error 1152 } 1153 1154 // MarshalEasyJSON supports easyjson.Marshaler interface 1155 func (v Campaign) MarshalEasyJSON(w *jwriter.Writer) { 1156 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents9(w, v) 1157 } 1158 1159 // UnmarshalJSON supports json.Unmarshaler interface 1160 func (v *Campaign) UnmarshalJSON(data []byte) error { 1161 r := jlexer.Lexer{Data: data} 1162 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents9(&r, v) 1163 return r.Error() 1164 } 1165 1166 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 1167 func (v *Campaign) UnmarshalEasyJSON(l *jlexer.Lexer) { 1168 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents9(l, v) 1169 } 1170 func easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents10(in *jlexer.Lexer, out *Attachment) { 1171 isTopLevel := in.IsStart() 1172 if in.IsNull() { 1173 if isTopLevel { 1174 in.Consumed() 1175 } 1176 in.Skip() 1177 return 1178 } 1179 in.Delim('{') 1180 for !in.IsDelim('}') { 1181 key := in.UnsafeString() 1182 in.WantColon() 1183 if in.IsNull() { 1184 in.Skip() 1185 in.WantComma() 1186 continue 1187 } 1188 switch key { 1189 case "filename": 1190 out.FileName = string(in.String()) 1191 case "content-type": 1192 out.ContentType = string(in.String()) 1193 case "size": 1194 out.Size = int(in.Int()) 1195 default: 1196 in.SkipRecursive() 1197 } 1198 in.WantComma() 1199 } 1200 in.Delim('}') 1201 if isTopLevel { 1202 in.Consumed() 1203 } 1204 } 1205 func easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents10(out *jwriter.Writer, in Attachment) { 1206 out.RawByte('{') 1207 first := true 1208 _ = first 1209 { 1210 const prefix string = ",\"filename\":" 1211 if first { 1212 first = false 1213 out.RawString(prefix[1:]) 1214 } else { 1215 out.RawString(prefix) 1216 } 1217 out.String(string(in.FileName)) 1218 } 1219 { 1220 const prefix string = ",\"content-type\":" 1221 if first { 1222 first = false 1223 out.RawString(prefix[1:]) 1224 } else { 1225 out.RawString(prefix) 1226 } 1227 out.String(string(in.ContentType)) 1228 } 1229 { 1230 const prefix string = ",\"size\":" 1231 if first { 1232 first = false 1233 out.RawString(prefix[1:]) 1234 } else { 1235 out.RawString(prefix) 1236 } 1237 out.Int(int(in.Size)) 1238 } 1239 out.RawByte('}') 1240 } 1241 1242 // MarshalJSON supports json.Marshaler interface 1243 func (v Attachment) MarshalJSON() ([]byte, error) { 1244 w := jwriter.Writer{} 1245 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents10(&w, v) 1246 return w.Buffer.BuildBytes(), w.Error 1247 } 1248 1249 // MarshalEasyJSON supports easyjson.Marshaler interface 1250 func (v Attachment) MarshalEasyJSON(w *jwriter.Writer) { 1251 easyjsonCce3d1beEncodeGithubComMailgunMailgunGoEvents10(w, v) 1252 } 1253 1254 // UnmarshalJSON supports json.Unmarshaler interface 1255 func (v *Attachment) UnmarshalJSON(data []byte) error { 1256 r := jlexer.Lexer{Data: data} 1257 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents10(&r, v) 1258 return r.Error() 1259 } 1260 1261 // UnmarshalEasyJSON supports easyjson.Unmarshaler interface 1262 func (v *Attachment) UnmarshalEasyJSON(l *jlexer.Lexer) { 1263 easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents10(l, v) 1264 }