github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/cmd/batch-job-common-types_gen.go (about) 1 package cmd 2 3 // Code generated by github.com/tinylib/msgp DO NOT EDIT. 4 5 import ( 6 "github.com/tinylib/msgp/msgp" 7 ) 8 9 // DecodeMsg implements msgp.Decodable 10 func (z *BatchJobKV) DecodeMsg(dc *msgp.Reader) (err error) { 11 var field []byte 12 _ = field 13 var zb0001 uint32 14 zb0001, err = dc.ReadMapHeader() 15 if err != nil { 16 err = msgp.WrapError(err) 17 return 18 } 19 for zb0001 > 0 { 20 zb0001-- 21 field, err = dc.ReadMapKeyPtr() 22 if err != nil { 23 err = msgp.WrapError(err) 24 return 25 } 26 switch msgp.UnsafeString(field) { 27 case "Key": 28 z.Key, err = dc.ReadString() 29 if err != nil { 30 err = msgp.WrapError(err, "Key") 31 return 32 } 33 case "Value": 34 z.Value, err = dc.ReadString() 35 if err != nil { 36 err = msgp.WrapError(err, "Value") 37 return 38 } 39 default: 40 err = dc.Skip() 41 if err != nil { 42 err = msgp.WrapError(err) 43 return 44 } 45 } 46 } 47 return 48 } 49 50 // EncodeMsg implements msgp.Encodable 51 func (z BatchJobKV) EncodeMsg(en *msgp.Writer) (err error) { 52 // map header, size 2 53 // write "Key" 54 err = en.Append(0x82, 0xa3, 0x4b, 0x65, 0x79) 55 if err != nil { 56 return 57 } 58 err = en.WriteString(z.Key) 59 if err != nil { 60 err = msgp.WrapError(err, "Key") 61 return 62 } 63 // write "Value" 64 err = en.Append(0xa5, 0x56, 0x61, 0x6c, 0x75, 0x65) 65 if err != nil { 66 return 67 } 68 err = en.WriteString(z.Value) 69 if err != nil { 70 err = msgp.WrapError(err, "Value") 71 return 72 } 73 return 74 } 75 76 // MarshalMsg implements msgp.Marshaler 77 func (z BatchJobKV) MarshalMsg(b []byte) (o []byte, err error) { 78 o = msgp.Require(b, z.Msgsize()) 79 // map header, size 2 80 // string "Key" 81 o = append(o, 0x82, 0xa3, 0x4b, 0x65, 0x79) 82 o = msgp.AppendString(o, z.Key) 83 // string "Value" 84 o = append(o, 0xa5, 0x56, 0x61, 0x6c, 0x75, 0x65) 85 o = msgp.AppendString(o, z.Value) 86 return 87 } 88 89 // UnmarshalMsg implements msgp.Unmarshaler 90 func (z *BatchJobKV) UnmarshalMsg(bts []byte) (o []byte, err error) { 91 var field []byte 92 _ = field 93 var zb0001 uint32 94 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 95 if err != nil { 96 err = msgp.WrapError(err) 97 return 98 } 99 for zb0001 > 0 { 100 zb0001-- 101 field, bts, err = msgp.ReadMapKeyZC(bts) 102 if err != nil { 103 err = msgp.WrapError(err) 104 return 105 } 106 switch msgp.UnsafeString(field) { 107 case "Key": 108 z.Key, bts, err = msgp.ReadStringBytes(bts) 109 if err != nil { 110 err = msgp.WrapError(err, "Key") 111 return 112 } 113 case "Value": 114 z.Value, bts, err = msgp.ReadStringBytes(bts) 115 if err != nil { 116 err = msgp.WrapError(err, "Value") 117 return 118 } 119 default: 120 bts, err = msgp.Skip(bts) 121 if err != nil { 122 err = msgp.WrapError(err) 123 return 124 } 125 } 126 } 127 o = bts 128 return 129 } 130 131 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 132 func (z BatchJobKV) Msgsize() (s int) { 133 s = 1 + 4 + msgp.StringPrefixSize + len(z.Key) + 6 + msgp.StringPrefixSize + len(z.Value) 134 return 135 } 136 137 // DecodeMsg implements msgp.Decodable 138 func (z *BatchJobNotification) DecodeMsg(dc *msgp.Reader) (err error) { 139 var field []byte 140 _ = field 141 var zb0001 uint32 142 zb0001, err = dc.ReadMapHeader() 143 if err != nil { 144 err = msgp.WrapError(err) 145 return 146 } 147 for zb0001 > 0 { 148 zb0001-- 149 field, err = dc.ReadMapKeyPtr() 150 if err != nil { 151 err = msgp.WrapError(err) 152 return 153 } 154 switch msgp.UnsafeString(field) { 155 case "Endpoint": 156 z.Endpoint, err = dc.ReadString() 157 if err != nil { 158 err = msgp.WrapError(err, "Endpoint") 159 return 160 } 161 case "Token": 162 z.Token, err = dc.ReadString() 163 if err != nil { 164 err = msgp.WrapError(err, "Token") 165 return 166 } 167 default: 168 err = dc.Skip() 169 if err != nil { 170 err = msgp.WrapError(err) 171 return 172 } 173 } 174 } 175 return 176 } 177 178 // EncodeMsg implements msgp.Encodable 179 func (z BatchJobNotification) EncodeMsg(en *msgp.Writer) (err error) { 180 // map header, size 2 181 // write "Endpoint" 182 err = en.Append(0x82, 0xa8, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) 183 if err != nil { 184 return 185 } 186 err = en.WriteString(z.Endpoint) 187 if err != nil { 188 err = msgp.WrapError(err, "Endpoint") 189 return 190 } 191 // write "Token" 192 err = en.Append(0xa5, 0x54, 0x6f, 0x6b, 0x65, 0x6e) 193 if err != nil { 194 return 195 } 196 err = en.WriteString(z.Token) 197 if err != nil { 198 err = msgp.WrapError(err, "Token") 199 return 200 } 201 return 202 } 203 204 // MarshalMsg implements msgp.Marshaler 205 func (z BatchJobNotification) MarshalMsg(b []byte) (o []byte, err error) { 206 o = msgp.Require(b, z.Msgsize()) 207 // map header, size 2 208 // string "Endpoint" 209 o = append(o, 0x82, 0xa8, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74) 210 o = msgp.AppendString(o, z.Endpoint) 211 // string "Token" 212 o = append(o, 0xa5, 0x54, 0x6f, 0x6b, 0x65, 0x6e) 213 o = msgp.AppendString(o, z.Token) 214 return 215 } 216 217 // UnmarshalMsg implements msgp.Unmarshaler 218 func (z *BatchJobNotification) UnmarshalMsg(bts []byte) (o []byte, err error) { 219 var field []byte 220 _ = field 221 var zb0001 uint32 222 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 223 if err != nil { 224 err = msgp.WrapError(err) 225 return 226 } 227 for zb0001 > 0 { 228 zb0001-- 229 field, bts, err = msgp.ReadMapKeyZC(bts) 230 if err != nil { 231 err = msgp.WrapError(err) 232 return 233 } 234 switch msgp.UnsafeString(field) { 235 case "Endpoint": 236 z.Endpoint, bts, err = msgp.ReadStringBytes(bts) 237 if err != nil { 238 err = msgp.WrapError(err, "Endpoint") 239 return 240 } 241 case "Token": 242 z.Token, bts, err = msgp.ReadStringBytes(bts) 243 if err != nil { 244 err = msgp.WrapError(err, "Token") 245 return 246 } 247 default: 248 bts, err = msgp.Skip(bts) 249 if err != nil { 250 err = msgp.WrapError(err) 251 return 252 } 253 } 254 } 255 o = bts 256 return 257 } 258 259 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 260 func (z BatchJobNotification) Msgsize() (s int) { 261 s = 1 + 9 + msgp.StringPrefixSize + len(z.Endpoint) + 6 + msgp.StringPrefixSize + len(z.Token) 262 return 263 } 264 265 // DecodeMsg implements msgp.Decodable 266 func (z *BatchJobRetry) DecodeMsg(dc *msgp.Reader) (err error) { 267 var field []byte 268 _ = field 269 var zb0001 uint32 270 zb0001, err = dc.ReadMapHeader() 271 if err != nil { 272 err = msgp.WrapError(err) 273 return 274 } 275 for zb0001 > 0 { 276 zb0001-- 277 field, err = dc.ReadMapKeyPtr() 278 if err != nil { 279 err = msgp.WrapError(err) 280 return 281 } 282 switch msgp.UnsafeString(field) { 283 case "Attempts": 284 z.Attempts, err = dc.ReadInt() 285 if err != nil { 286 err = msgp.WrapError(err, "Attempts") 287 return 288 } 289 case "Delay": 290 z.Delay, err = dc.ReadDuration() 291 if err != nil { 292 err = msgp.WrapError(err, "Delay") 293 return 294 } 295 default: 296 err = dc.Skip() 297 if err != nil { 298 err = msgp.WrapError(err) 299 return 300 } 301 } 302 } 303 return 304 } 305 306 // EncodeMsg implements msgp.Encodable 307 func (z BatchJobRetry) EncodeMsg(en *msgp.Writer) (err error) { 308 // map header, size 2 309 // write "Attempts" 310 err = en.Append(0x82, 0xa8, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73) 311 if err != nil { 312 return 313 } 314 err = en.WriteInt(z.Attempts) 315 if err != nil { 316 err = msgp.WrapError(err, "Attempts") 317 return 318 } 319 // write "Delay" 320 err = en.Append(0xa5, 0x44, 0x65, 0x6c, 0x61, 0x79) 321 if err != nil { 322 return 323 } 324 err = en.WriteDuration(z.Delay) 325 if err != nil { 326 err = msgp.WrapError(err, "Delay") 327 return 328 } 329 return 330 } 331 332 // MarshalMsg implements msgp.Marshaler 333 func (z BatchJobRetry) MarshalMsg(b []byte) (o []byte, err error) { 334 o = msgp.Require(b, z.Msgsize()) 335 // map header, size 2 336 // string "Attempts" 337 o = append(o, 0x82, 0xa8, 0x41, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73) 338 o = msgp.AppendInt(o, z.Attempts) 339 // string "Delay" 340 o = append(o, 0xa5, 0x44, 0x65, 0x6c, 0x61, 0x79) 341 o = msgp.AppendDuration(o, z.Delay) 342 return 343 } 344 345 // UnmarshalMsg implements msgp.Unmarshaler 346 func (z *BatchJobRetry) UnmarshalMsg(bts []byte) (o []byte, err error) { 347 var field []byte 348 _ = field 349 var zb0001 uint32 350 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 351 if err != nil { 352 err = msgp.WrapError(err) 353 return 354 } 355 for zb0001 > 0 { 356 zb0001-- 357 field, bts, err = msgp.ReadMapKeyZC(bts) 358 if err != nil { 359 err = msgp.WrapError(err) 360 return 361 } 362 switch msgp.UnsafeString(field) { 363 case "Attempts": 364 z.Attempts, bts, err = msgp.ReadIntBytes(bts) 365 if err != nil { 366 err = msgp.WrapError(err, "Attempts") 367 return 368 } 369 case "Delay": 370 z.Delay, bts, err = msgp.ReadDurationBytes(bts) 371 if err != nil { 372 err = msgp.WrapError(err, "Delay") 373 return 374 } 375 default: 376 bts, err = msgp.Skip(bts) 377 if err != nil { 378 err = msgp.WrapError(err) 379 return 380 } 381 } 382 } 383 o = bts 384 return 385 } 386 387 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 388 func (z BatchJobRetry) Msgsize() (s int) { 389 s = 1 + 9 + msgp.IntSize + 6 + msgp.DurationSize 390 return 391 } 392 393 // DecodeMsg implements msgp.Decodable 394 func (z *BatchJobSize) DecodeMsg(dc *msgp.Reader) (err error) { 395 { 396 var zb0001 int64 397 zb0001, err = dc.ReadInt64() 398 if err != nil { 399 err = msgp.WrapError(err) 400 return 401 } 402 (*z) = BatchJobSize(zb0001) 403 } 404 return 405 } 406 407 // EncodeMsg implements msgp.Encodable 408 func (z BatchJobSize) EncodeMsg(en *msgp.Writer) (err error) { 409 err = en.WriteInt64(int64(z)) 410 if err != nil { 411 err = msgp.WrapError(err) 412 return 413 } 414 return 415 } 416 417 // MarshalMsg implements msgp.Marshaler 418 func (z BatchJobSize) MarshalMsg(b []byte) (o []byte, err error) { 419 o = msgp.Require(b, z.Msgsize()) 420 o = msgp.AppendInt64(o, int64(z)) 421 return 422 } 423 424 // UnmarshalMsg implements msgp.Unmarshaler 425 func (z *BatchJobSize) UnmarshalMsg(bts []byte) (o []byte, err error) { 426 { 427 var zb0001 int64 428 zb0001, bts, err = msgp.ReadInt64Bytes(bts) 429 if err != nil { 430 err = msgp.WrapError(err) 431 return 432 } 433 (*z) = BatchJobSize(zb0001) 434 } 435 o = bts 436 return 437 } 438 439 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 440 func (z BatchJobSize) Msgsize() (s int) { 441 s = msgp.Int64Size 442 return 443 } 444 445 // DecodeMsg implements msgp.Decodable 446 func (z *BatchJobSizeFilter) DecodeMsg(dc *msgp.Reader) (err error) { 447 var field []byte 448 _ = field 449 var zb0001 uint32 450 zb0001, err = dc.ReadMapHeader() 451 if err != nil { 452 err = msgp.WrapError(err) 453 return 454 } 455 for zb0001 > 0 { 456 zb0001-- 457 field, err = dc.ReadMapKeyPtr() 458 if err != nil { 459 err = msgp.WrapError(err) 460 return 461 } 462 switch msgp.UnsafeString(field) { 463 case "UpperBound": 464 { 465 var zb0002 int64 466 zb0002, err = dc.ReadInt64() 467 if err != nil { 468 err = msgp.WrapError(err, "UpperBound") 469 return 470 } 471 z.UpperBound = BatchJobSize(zb0002) 472 } 473 case "LowerBound": 474 { 475 var zb0003 int64 476 zb0003, err = dc.ReadInt64() 477 if err != nil { 478 err = msgp.WrapError(err, "LowerBound") 479 return 480 } 481 z.LowerBound = BatchJobSize(zb0003) 482 } 483 default: 484 err = dc.Skip() 485 if err != nil { 486 err = msgp.WrapError(err) 487 return 488 } 489 } 490 } 491 return 492 } 493 494 // EncodeMsg implements msgp.Encodable 495 func (z BatchJobSizeFilter) EncodeMsg(en *msgp.Writer) (err error) { 496 // map header, size 2 497 // write "UpperBound" 498 err = en.Append(0x82, 0xaa, 0x55, 0x70, 0x70, 0x65, 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64) 499 if err != nil { 500 return 501 } 502 err = en.WriteInt64(int64(z.UpperBound)) 503 if err != nil { 504 err = msgp.WrapError(err, "UpperBound") 505 return 506 } 507 // write "LowerBound" 508 err = en.Append(0xaa, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64) 509 if err != nil { 510 return 511 } 512 err = en.WriteInt64(int64(z.LowerBound)) 513 if err != nil { 514 err = msgp.WrapError(err, "LowerBound") 515 return 516 } 517 return 518 } 519 520 // MarshalMsg implements msgp.Marshaler 521 func (z BatchJobSizeFilter) MarshalMsg(b []byte) (o []byte, err error) { 522 o = msgp.Require(b, z.Msgsize()) 523 // map header, size 2 524 // string "UpperBound" 525 o = append(o, 0x82, 0xaa, 0x55, 0x70, 0x70, 0x65, 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64) 526 o = msgp.AppendInt64(o, int64(z.UpperBound)) 527 // string "LowerBound" 528 o = append(o, 0xaa, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64) 529 o = msgp.AppendInt64(o, int64(z.LowerBound)) 530 return 531 } 532 533 // UnmarshalMsg implements msgp.Unmarshaler 534 func (z *BatchJobSizeFilter) UnmarshalMsg(bts []byte) (o []byte, err error) { 535 var field []byte 536 _ = field 537 var zb0001 uint32 538 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 539 if err != nil { 540 err = msgp.WrapError(err) 541 return 542 } 543 for zb0001 > 0 { 544 zb0001-- 545 field, bts, err = msgp.ReadMapKeyZC(bts) 546 if err != nil { 547 err = msgp.WrapError(err) 548 return 549 } 550 switch msgp.UnsafeString(field) { 551 case "UpperBound": 552 { 553 var zb0002 int64 554 zb0002, bts, err = msgp.ReadInt64Bytes(bts) 555 if err != nil { 556 err = msgp.WrapError(err, "UpperBound") 557 return 558 } 559 z.UpperBound = BatchJobSize(zb0002) 560 } 561 case "LowerBound": 562 { 563 var zb0003 int64 564 zb0003, bts, err = msgp.ReadInt64Bytes(bts) 565 if err != nil { 566 err = msgp.WrapError(err, "LowerBound") 567 return 568 } 569 z.LowerBound = BatchJobSize(zb0003) 570 } 571 default: 572 bts, err = msgp.Skip(bts) 573 if err != nil { 574 err = msgp.WrapError(err) 575 return 576 } 577 } 578 } 579 o = bts 580 return 581 } 582 583 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 584 func (z BatchJobSizeFilter) Msgsize() (s int) { 585 s = 1 + 11 + msgp.Int64Size + 11 + msgp.Int64Size 586 return 587 } 588 589 // DecodeMsg implements msgp.Decodable 590 func (z *BatchJobSnowball) DecodeMsg(dc *msgp.Reader) (err error) { 591 var field []byte 592 _ = field 593 var zb0001 uint32 594 zb0001, err = dc.ReadMapHeader() 595 if err != nil { 596 err = msgp.WrapError(err) 597 return 598 } 599 for zb0001 > 0 { 600 zb0001-- 601 field, err = dc.ReadMapKeyPtr() 602 if err != nil { 603 err = msgp.WrapError(err) 604 return 605 } 606 switch msgp.UnsafeString(field) { 607 case "Disable": 608 if dc.IsNil() { 609 err = dc.ReadNil() 610 if err != nil { 611 err = msgp.WrapError(err, "Disable") 612 return 613 } 614 z.Disable = nil 615 } else { 616 if z.Disable == nil { 617 z.Disable = new(bool) 618 } 619 *z.Disable, err = dc.ReadBool() 620 if err != nil { 621 err = msgp.WrapError(err, "Disable") 622 return 623 } 624 } 625 case "Batch": 626 if dc.IsNil() { 627 err = dc.ReadNil() 628 if err != nil { 629 err = msgp.WrapError(err, "Batch") 630 return 631 } 632 z.Batch = nil 633 } else { 634 if z.Batch == nil { 635 z.Batch = new(int) 636 } 637 *z.Batch, err = dc.ReadInt() 638 if err != nil { 639 err = msgp.WrapError(err, "Batch") 640 return 641 } 642 } 643 case "InMemory": 644 if dc.IsNil() { 645 err = dc.ReadNil() 646 if err != nil { 647 err = msgp.WrapError(err, "InMemory") 648 return 649 } 650 z.InMemory = nil 651 } else { 652 if z.InMemory == nil { 653 z.InMemory = new(bool) 654 } 655 *z.InMemory, err = dc.ReadBool() 656 if err != nil { 657 err = msgp.WrapError(err, "InMemory") 658 return 659 } 660 } 661 case "Compress": 662 if dc.IsNil() { 663 err = dc.ReadNil() 664 if err != nil { 665 err = msgp.WrapError(err, "Compress") 666 return 667 } 668 z.Compress = nil 669 } else { 670 if z.Compress == nil { 671 z.Compress = new(bool) 672 } 673 *z.Compress, err = dc.ReadBool() 674 if err != nil { 675 err = msgp.WrapError(err, "Compress") 676 return 677 } 678 } 679 case "SmallerThan": 680 if dc.IsNil() { 681 err = dc.ReadNil() 682 if err != nil { 683 err = msgp.WrapError(err, "SmallerThan") 684 return 685 } 686 z.SmallerThan = nil 687 } else { 688 if z.SmallerThan == nil { 689 z.SmallerThan = new(string) 690 } 691 *z.SmallerThan, err = dc.ReadString() 692 if err != nil { 693 err = msgp.WrapError(err, "SmallerThan") 694 return 695 } 696 } 697 case "SkipErrs": 698 if dc.IsNil() { 699 err = dc.ReadNil() 700 if err != nil { 701 err = msgp.WrapError(err, "SkipErrs") 702 return 703 } 704 z.SkipErrs = nil 705 } else { 706 if z.SkipErrs == nil { 707 z.SkipErrs = new(bool) 708 } 709 *z.SkipErrs, err = dc.ReadBool() 710 if err != nil { 711 err = msgp.WrapError(err, "SkipErrs") 712 return 713 } 714 } 715 default: 716 err = dc.Skip() 717 if err != nil { 718 err = msgp.WrapError(err) 719 return 720 } 721 } 722 } 723 return 724 } 725 726 // EncodeMsg implements msgp.Encodable 727 func (z *BatchJobSnowball) EncodeMsg(en *msgp.Writer) (err error) { 728 // map header, size 6 729 // write "Disable" 730 err = en.Append(0x86, 0xa7, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65) 731 if err != nil { 732 return 733 } 734 if z.Disable == nil { 735 err = en.WriteNil() 736 if err != nil { 737 return 738 } 739 } else { 740 err = en.WriteBool(*z.Disable) 741 if err != nil { 742 err = msgp.WrapError(err, "Disable") 743 return 744 } 745 } 746 // write "Batch" 747 err = en.Append(0xa5, 0x42, 0x61, 0x74, 0x63, 0x68) 748 if err != nil { 749 return 750 } 751 if z.Batch == nil { 752 err = en.WriteNil() 753 if err != nil { 754 return 755 } 756 } else { 757 err = en.WriteInt(*z.Batch) 758 if err != nil { 759 err = msgp.WrapError(err, "Batch") 760 return 761 } 762 } 763 // write "InMemory" 764 err = en.Append(0xa8, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79) 765 if err != nil { 766 return 767 } 768 if z.InMemory == nil { 769 err = en.WriteNil() 770 if err != nil { 771 return 772 } 773 } else { 774 err = en.WriteBool(*z.InMemory) 775 if err != nil { 776 err = msgp.WrapError(err, "InMemory") 777 return 778 } 779 } 780 // write "Compress" 781 err = en.Append(0xa8, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73) 782 if err != nil { 783 return 784 } 785 if z.Compress == nil { 786 err = en.WriteNil() 787 if err != nil { 788 return 789 } 790 } else { 791 err = en.WriteBool(*z.Compress) 792 if err != nil { 793 err = msgp.WrapError(err, "Compress") 794 return 795 } 796 } 797 // write "SmallerThan" 798 err = en.Append(0xab, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e) 799 if err != nil { 800 return 801 } 802 if z.SmallerThan == nil { 803 err = en.WriteNil() 804 if err != nil { 805 return 806 } 807 } else { 808 err = en.WriteString(*z.SmallerThan) 809 if err != nil { 810 err = msgp.WrapError(err, "SmallerThan") 811 return 812 } 813 } 814 // write "SkipErrs" 815 err = en.Append(0xa8, 0x53, 0x6b, 0x69, 0x70, 0x45, 0x72, 0x72, 0x73) 816 if err != nil { 817 return 818 } 819 if z.SkipErrs == nil { 820 err = en.WriteNil() 821 if err != nil { 822 return 823 } 824 } else { 825 err = en.WriteBool(*z.SkipErrs) 826 if err != nil { 827 err = msgp.WrapError(err, "SkipErrs") 828 return 829 } 830 } 831 return 832 } 833 834 // MarshalMsg implements msgp.Marshaler 835 func (z *BatchJobSnowball) MarshalMsg(b []byte) (o []byte, err error) { 836 o = msgp.Require(b, z.Msgsize()) 837 // map header, size 6 838 // string "Disable" 839 o = append(o, 0x86, 0xa7, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65) 840 if z.Disable == nil { 841 o = msgp.AppendNil(o) 842 } else { 843 o = msgp.AppendBool(o, *z.Disable) 844 } 845 // string "Batch" 846 o = append(o, 0xa5, 0x42, 0x61, 0x74, 0x63, 0x68) 847 if z.Batch == nil { 848 o = msgp.AppendNil(o) 849 } else { 850 o = msgp.AppendInt(o, *z.Batch) 851 } 852 // string "InMemory" 853 o = append(o, 0xa8, 0x49, 0x6e, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79) 854 if z.InMemory == nil { 855 o = msgp.AppendNil(o) 856 } else { 857 o = msgp.AppendBool(o, *z.InMemory) 858 } 859 // string "Compress" 860 o = append(o, 0xa8, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73) 861 if z.Compress == nil { 862 o = msgp.AppendNil(o) 863 } else { 864 o = msgp.AppendBool(o, *z.Compress) 865 } 866 // string "SmallerThan" 867 o = append(o, 0xab, 0x53, 0x6d, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e) 868 if z.SmallerThan == nil { 869 o = msgp.AppendNil(o) 870 } else { 871 o = msgp.AppendString(o, *z.SmallerThan) 872 } 873 // string "SkipErrs" 874 o = append(o, 0xa8, 0x53, 0x6b, 0x69, 0x70, 0x45, 0x72, 0x72, 0x73) 875 if z.SkipErrs == nil { 876 o = msgp.AppendNil(o) 877 } else { 878 o = msgp.AppendBool(o, *z.SkipErrs) 879 } 880 return 881 } 882 883 // UnmarshalMsg implements msgp.Unmarshaler 884 func (z *BatchJobSnowball) UnmarshalMsg(bts []byte) (o []byte, err error) { 885 var field []byte 886 _ = field 887 var zb0001 uint32 888 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 889 if err != nil { 890 err = msgp.WrapError(err) 891 return 892 } 893 for zb0001 > 0 { 894 zb0001-- 895 field, bts, err = msgp.ReadMapKeyZC(bts) 896 if err != nil { 897 err = msgp.WrapError(err) 898 return 899 } 900 switch msgp.UnsafeString(field) { 901 case "Disable": 902 if msgp.IsNil(bts) { 903 bts, err = msgp.ReadNilBytes(bts) 904 if err != nil { 905 return 906 } 907 z.Disable = nil 908 } else { 909 if z.Disable == nil { 910 z.Disable = new(bool) 911 } 912 *z.Disable, bts, err = msgp.ReadBoolBytes(bts) 913 if err != nil { 914 err = msgp.WrapError(err, "Disable") 915 return 916 } 917 } 918 case "Batch": 919 if msgp.IsNil(bts) { 920 bts, err = msgp.ReadNilBytes(bts) 921 if err != nil { 922 return 923 } 924 z.Batch = nil 925 } else { 926 if z.Batch == nil { 927 z.Batch = new(int) 928 } 929 *z.Batch, bts, err = msgp.ReadIntBytes(bts) 930 if err != nil { 931 err = msgp.WrapError(err, "Batch") 932 return 933 } 934 } 935 case "InMemory": 936 if msgp.IsNil(bts) { 937 bts, err = msgp.ReadNilBytes(bts) 938 if err != nil { 939 return 940 } 941 z.InMemory = nil 942 } else { 943 if z.InMemory == nil { 944 z.InMemory = new(bool) 945 } 946 *z.InMemory, bts, err = msgp.ReadBoolBytes(bts) 947 if err != nil { 948 err = msgp.WrapError(err, "InMemory") 949 return 950 } 951 } 952 case "Compress": 953 if msgp.IsNil(bts) { 954 bts, err = msgp.ReadNilBytes(bts) 955 if err != nil { 956 return 957 } 958 z.Compress = nil 959 } else { 960 if z.Compress == nil { 961 z.Compress = new(bool) 962 } 963 *z.Compress, bts, err = msgp.ReadBoolBytes(bts) 964 if err != nil { 965 err = msgp.WrapError(err, "Compress") 966 return 967 } 968 } 969 case "SmallerThan": 970 if msgp.IsNil(bts) { 971 bts, err = msgp.ReadNilBytes(bts) 972 if err != nil { 973 return 974 } 975 z.SmallerThan = nil 976 } else { 977 if z.SmallerThan == nil { 978 z.SmallerThan = new(string) 979 } 980 *z.SmallerThan, bts, err = msgp.ReadStringBytes(bts) 981 if err != nil { 982 err = msgp.WrapError(err, "SmallerThan") 983 return 984 } 985 } 986 case "SkipErrs": 987 if msgp.IsNil(bts) { 988 bts, err = msgp.ReadNilBytes(bts) 989 if err != nil { 990 return 991 } 992 z.SkipErrs = nil 993 } else { 994 if z.SkipErrs == nil { 995 z.SkipErrs = new(bool) 996 } 997 *z.SkipErrs, bts, err = msgp.ReadBoolBytes(bts) 998 if err != nil { 999 err = msgp.WrapError(err, "SkipErrs") 1000 return 1001 } 1002 } 1003 default: 1004 bts, err = msgp.Skip(bts) 1005 if err != nil { 1006 err = msgp.WrapError(err) 1007 return 1008 } 1009 } 1010 } 1011 o = bts 1012 return 1013 } 1014 1015 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1016 func (z *BatchJobSnowball) Msgsize() (s int) { 1017 s = 1 + 8 1018 if z.Disable == nil { 1019 s += msgp.NilSize 1020 } else { 1021 s += msgp.BoolSize 1022 } 1023 s += 6 1024 if z.Batch == nil { 1025 s += msgp.NilSize 1026 } else { 1027 s += msgp.IntSize 1028 } 1029 s += 9 1030 if z.InMemory == nil { 1031 s += msgp.NilSize 1032 } else { 1033 s += msgp.BoolSize 1034 } 1035 s += 9 1036 if z.Compress == nil { 1037 s += msgp.NilSize 1038 } else { 1039 s += msgp.BoolSize 1040 } 1041 s += 12 1042 if z.SmallerThan == nil { 1043 s += msgp.NilSize 1044 } else { 1045 s += msgp.StringPrefixSize + len(*z.SmallerThan) 1046 } 1047 s += 9 1048 if z.SkipErrs == nil { 1049 s += msgp.NilSize 1050 } else { 1051 s += msgp.BoolSize 1052 } 1053 return 1054 }