github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/stellar1/bundle.go (about) 1 // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) 2 // Input file: avdl/stellar1/bundle.avdl 3 4 package stellar1 5 6 import ( 7 "errors" 8 "fmt" 9 keybase1 "github.com/keybase/client/go/protocol/keybase1" 10 "github.com/keybase/go-framed-msgpack-rpc/rpc" 11 ) 12 13 type BundleRevision uint64 14 15 func (o BundleRevision) DeepCopy() BundleRevision { 16 return o 17 } 18 19 type EncryptedBundle struct { 20 V int `codec:"v" json:"v"` 21 E []byte `codec:"e" json:"e"` 22 N keybase1.BoxNonce `codec:"n" json:"n"` 23 Gen keybase1.PerUserKeyGeneration `codec:"gen" json:"gen"` 24 } 25 26 func (o EncryptedBundle) DeepCopy() EncryptedBundle { 27 return EncryptedBundle{ 28 V: o.V, 29 E: (func(x []byte) []byte { 30 if x == nil { 31 return nil 32 } 33 return append([]byte{}, x...) 34 })(o.E), 35 N: o.N.DeepCopy(), 36 Gen: o.Gen.DeepCopy(), 37 } 38 } 39 40 type BundleVersion int 41 42 const ( 43 BundleVersion_V1 BundleVersion = 1 44 BundleVersion_V2 BundleVersion = 2 45 BundleVersion_V3 BundleVersion = 3 46 BundleVersion_V4 BundleVersion = 4 47 BundleVersion_V5 BundleVersion = 5 48 BundleVersion_V6 BundleVersion = 6 49 BundleVersion_V7 BundleVersion = 7 50 BundleVersion_V8 BundleVersion = 8 51 BundleVersion_V9 BundleVersion = 9 52 BundleVersion_V10 BundleVersion = 10 53 ) 54 55 func (o BundleVersion) DeepCopy() BundleVersion { return o } 56 57 var BundleVersionMap = map[string]BundleVersion{ 58 "V1": 1, 59 "V2": 2, 60 "V3": 3, 61 "V4": 4, 62 "V5": 5, 63 "V6": 6, 64 "V7": 7, 65 "V8": 8, 66 "V9": 9, 67 "V10": 10, 68 } 69 70 var BundleVersionRevMap = map[BundleVersion]string{ 71 1: "V1", 72 2: "V2", 73 3: "V3", 74 4: "V4", 75 5: "V5", 76 6: "V6", 77 7: "V7", 78 8: "V8", 79 9: "V9", 80 10: "V10", 81 } 82 83 func (e BundleVersion) String() string { 84 if v, ok := BundleVersionRevMap[e]; ok { 85 return v 86 } 87 return fmt.Sprintf("%v", int(e)) 88 } 89 90 type BundleSecretVersioned struct { 91 Version__ BundleVersion `codec:"version" json:"version"` 92 V1__ *BundleSecretUnsupported `codec:"v1,omitempty" json:"v1,omitempty"` 93 V2__ *BundleSecretV2 `codec:"v2,omitempty" json:"v2,omitempty"` 94 V3__ *BundleSecretUnsupported `codec:"v3,omitempty" json:"v3,omitempty"` 95 V4__ *BundleSecretUnsupported `codec:"v4,omitempty" json:"v4,omitempty"` 96 V5__ *BundleSecretUnsupported `codec:"v5,omitempty" json:"v5,omitempty"` 97 V6__ *BundleSecretUnsupported `codec:"v6,omitempty" json:"v6,omitempty"` 98 V7__ *BundleSecretUnsupported `codec:"v7,omitempty" json:"v7,omitempty"` 99 V8__ *BundleSecretUnsupported `codec:"v8,omitempty" json:"v8,omitempty"` 100 V9__ *BundleSecretUnsupported `codec:"v9,omitempty" json:"v9,omitempty"` 101 V10__ *BundleSecretUnsupported `codec:"v10,omitempty" json:"v10,omitempty"` 102 } 103 104 func (o *BundleSecretVersioned) Version() (ret BundleVersion, err error) { 105 switch o.Version__ { 106 case BundleVersion_V1: 107 if o.V1__ == nil { 108 err = errors.New("unexpected nil value for V1__") 109 return ret, err 110 } 111 case BundleVersion_V2: 112 if o.V2__ == nil { 113 err = errors.New("unexpected nil value for V2__") 114 return ret, err 115 } 116 case BundleVersion_V3: 117 if o.V3__ == nil { 118 err = errors.New("unexpected nil value for V3__") 119 return ret, err 120 } 121 case BundleVersion_V4: 122 if o.V4__ == nil { 123 err = errors.New("unexpected nil value for V4__") 124 return ret, err 125 } 126 case BundleVersion_V5: 127 if o.V5__ == nil { 128 err = errors.New("unexpected nil value for V5__") 129 return ret, err 130 } 131 case BundleVersion_V6: 132 if o.V6__ == nil { 133 err = errors.New("unexpected nil value for V6__") 134 return ret, err 135 } 136 case BundleVersion_V7: 137 if o.V7__ == nil { 138 err = errors.New("unexpected nil value for V7__") 139 return ret, err 140 } 141 case BundleVersion_V8: 142 if o.V8__ == nil { 143 err = errors.New("unexpected nil value for V8__") 144 return ret, err 145 } 146 case BundleVersion_V9: 147 if o.V9__ == nil { 148 err = errors.New("unexpected nil value for V9__") 149 return ret, err 150 } 151 case BundleVersion_V10: 152 if o.V10__ == nil { 153 err = errors.New("unexpected nil value for V10__") 154 return ret, err 155 } 156 } 157 return o.Version__, nil 158 } 159 160 func (o BundleSecretVersioned) V1() (res BundleSecretUnsupported) { 161 if o.Version__ != BundleVersion_V1 { 162 panic("wrong case accessed") 163 } 164 if o.V1__ == nil { 165 return 166 } 167 return *o.V1__ 168 } 169 170 func (o BundleSecretVersioned) V2() (res BundleSecretV2) { 171 if o.Version__ != BundleVersion_V2 { 172 panic("wrong case accessed") 173 } 174 if o.V2__ == nil { 175 return 176 } 177 return *o.V2__ 178 } 179 180 func (o BundleSecretVersioned) V3() (res BundleSecretUnsupported) { 181 if o.Version__ != BundleVersion_V3 { 182 panic("wrong case accessed") 183 } 184 if o.V3__ == nil { 185 return 186 } 187 return *o.V3__ 188 } 189 190 func (o BundleSecretVersioned) V4() (res BundleSecretUnsupported) { 191 if o.Version__ != BundleVersion_V4 { 192 panic("wrong case accessed") 193 } 194 if o.V4__ == nil { 195 return 196 } 197 return *o.V4__ 198 } 199 200 func (o BundleSecretVersioned) V5() (res BundleSecretUnsupported) { 201 if o.Version__ != BundleVersion_V5 { 202 panic("wrong case accessed") 203 } 204 if o.V5__ == nil { 205 return 206 } 207 return *o.V5__ 208 } 209 210 func (o BundleSecretVersioned) V6() (res BundleSecretUnsupported) { 211 if o.Version__ != BundleVersion_V6 { 212 panic("wrong case accessed") 213 } 214 if o.V6__ == nil { 215 return 216 } 217 return *o.V6__ 218 } 219 220 func (o BundleSecretVersioned) V7() (res BundleSecretUnsupported) { 221 if o.Version__ != BundleVersion_V7 { 222 panic("wrong case accessed") 223 } 224 if o.V7__ == nil { 225 return 226 } 227 return *o.V7__ 228 } 229 230 func (o BundleSecretVersioned) V8() (res BundleSecretUnsupported) { 231 if o.Version__ != BundleVersion_V8 { 232 panic("wrong case accessed") 233 } 234 if o.V8__ == nil { 235 return 236 } 237 return *o.V8__ 238 } 239 240 func (o BundleSecretVersioned) V9() (res BundleSecretUnsupported) { 241 if o.Version__ != BundleVersion_V9 { 242 panic("wrong case accessed") 243 } 244 if o.V9__ == nil { 245 return 246 } 247 return *o.V9__ 248 } 249 250 func (o BundleSecretVersioned) V10() (res BundleSecretUnsupported) { 251 if o.Version__ != BundleVersion_V10 { 252 panic("wrong case accessed") 253 } 254 if o.V10__ == nil { 255 return 256 } 257 return *o.V10__ 258 } 259 260 func NewBundleSecretVersionedWithV1(v BundleSecretUnsupported) BundleSecretVersioned { 261 return BundleSecretVersioned{ 262 Version__: BundleVersion_V1, 263 V1__: &v, 264 } 265 } 266 267 func NewBundleSecretVersionedWithV2(v BundleSecretV2) BundleSecretVersioned { 268 return BundleSecretVersioned{ 269 Version__: BundleVersion_V2, 270 V2__: &v, 271 } 272 } 273 274 func NewBundleSecretVersionedWithV3(v BundleSecretUnsupported) BundleSecretVersioned { 275 return BundleSecretVersioned{ 276 Version__: BundleVersion_V3, 277 V3__: &v, 278 } 279 } 280 281 func NewBundleSecretVersionedWithV4(v BundleSecretUnsupported) BundleSecretVersioned { 282 return BundleSecretVersioned{ 283 Version__: BundleVersion_V4, 284 V4__: &v, 285 } 286 } 287 288 func NewBundleSecretVersionedWithV5(v BundleSecretUnsupported) BundleSecretVersioned { 289 return BundleSecretVersioned{ 290 Version__: BundleVersion_V5, 291 V5__: &v, 292 } 293 } 294 295 func NewBundleSecretVersionedWithV6(v BundleSecretUnsupported) BundleSecretVersioned { 296 return BundleSecretVersioned{ 297 Version__: BundleVersion_V6, 298 V6__: &v, 299 } 300 } 301 302 func NewBundleSecretVersionedWithV7(v BundleSecretUnsupported) BundleSecretVersioned { 303 return BundleSecretVersioned{ 304 Version__: BundleVersion_V7, 305 V7__: &v, 306 } 307 } 308 309 func NewBundleSecretVersionedWithV8(v BundleSecretUnsupported) BundleSecretVersioned { 310 return BundleSecretVersioned{ 311 Version__: BundleVersion_V8, 312 V8__: &v, 313 } 314 } 315 316 func NewBundleSecretVersionedWithV9(v BundleSecretUnsupported) BundleSecretVersioned { 317 return BundleSecretVersioned{ 318 Version__: BundleVersion_V9, 319 V9__: &v, 320 } 321 } 322 323 func NewBundleSecretVersionedWithV10(v BundleSecretUnsupported) BundleSecretVersioned { 324 return BundleSecretVersioned{ 325 Version__: BundleVersion_V10, 326 V10__: &v, 327 } 328 } 329 330 func (o BundleSecretVersioned) DeepCopy() BundleSecretVersioned { 331 return BundleSecretVersioned{ 332 Version__: o.Version__.DeepCopy(), 333 V1__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 334 if x == nil { 335 return nil 336 } 337 tmp := (*x).DeepCopy() 338 return &tmp 339 })(o.V1__), 340 V2__: (func(x *BundleSecretV2) *BundleSecretV2 { 341 if x == nil { 342 return nil 343 } 344 tmp := (*x).DeepCopy() 345 return &tmp 346 })(o.V2__), 347 V3__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 348 if x == nil { 349 return nil 350 } 351 tmp := (*x).DeepCopy() 352 return &tmp 353 })(o.V3__), 354 V4__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 355 if x == nil { 356 return nil 357 } 358 tmp := (*x).DeepCopy() 359 return &tmp 360 })(o.V4__), 361 V5__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 362 if x == nil { 363 return nil 364 } 365 tmp := (*x).DeepCopy() 366 return &tmp 367 })(o.V5__), 368 V6__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 369 if x == nil { 370 return nil 371 } 372 tmp := (*x).DeepCopy() 373 return &tmp 374 })(o.V6__), 375 V7__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 376 if x == nil { 377 return nil 378 } 379 tmp := (*x).DeepCopy() 380 return &tmp 381 })(o.V7__), 382 V8__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 383 if x == nil { 384 return nil 385 } 386 tmp := (*x).DeepCopy() 387 return &tmp 388 })(o.V8__), 389 V9__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 390 if x == nil { 391 return nil 392 } 393 tmp := (*x).DeepCopy() 394 return &tmp 395 })(o.V9__), 396 V10__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { 397 if x == nil { 398 return nil 399 } 400 tmp := (*x).DeepCopy() 401 return &tmp 402 })(o.V10__), 403 } 404 } 405 406 type BundleVisibleV2 struct { 407 Revision BundleRevision `codec:"revision" json:"revision"` 408 Prev Hash `codec:"prev" json:"prev"` 409 Accounts []BundleVisibleEntryV2 `codec:"accounts" json:"accounts"` 410 } 411 412 func (o BundleVisibleV2) DeepCopy() BundleVisibleV2 { 413 return BundleVisibleV2{ 414 Revision: o.Revision.DeepCopy(), 415 Prev: o.Prev.DeepCopy(), 416 Accounts: (func(x []BundleVisibleEntryV2) []BundleVisibleEntryV2 { 417 if x == nil { 418 return nil 419 } 420 ret := make([]BundleVisibleEntryV2, len(x)) 421 for i, v := range x { 422 vCopy := v.DeepCopy() 423 ret[i] = vCopy 424 } 425 return ret 426 })(o.Accounts), 427 } 428 } 429 430 type BundleSecretV2 struct { 431 VisibleHash Hash `codec:"visibleHash" json:"visibleHash"` 432 Accounts []BundleSecretEntryV2 `codec:"accounts" json:"accounts"` 433 } 434 435 func (o BundleSecretV2) DeepCopy() BundleSecretV2 { 436 return BundleSecretV2{ 437 VisibleHash: o.VisibleHash.DeepCopy(), 438 Accounts: (func(x []BundleSecretEntryV2) []BundleSecretEntryV2 { 439 if x == nil { 440 return nil 441 } 442 ret := make([]BundleSecretEntryV2, len(x)) 443 for i, v := range x { 444 vCopy := v.DeepCopy() 445 ret[i] = vCopy 446 } 447 return ret 448 })(o.Accounts), 449 } 450 } 451 452 type BundleVisibleEntryV2 struct { 453 AccountID AccountID `codec:"accountID" json:"accountID"` 454 Mode AccountMode `codec:"mode" json:"mode"` 455 IsPrimary bool `codec:"isPrimary" json:"isPrimary"` 456 AcctBundleRevision BundleRevision `codec:"acctBundleRevision" json:"acctBundleRevision"` 457 EncAcctBundleHash Hash `codec:"encAcctBundleHash" json:"encAcctBundleHash"` 458 } 459 460 func (o BundleVisibleEntryV2) DeepCopy() BundleVisibleEntryV2 { 461 return BundleVisibleEntryV2{ 462 AccountID: o.AccountID.DeepCopy(), 463 Mode: o.Mode.DeepCopy(), 464 IsPrimary: o.IsPrimary, 465 AcctBundleRevision: o.AcctBundleRevision.DeepCopy(), 466 EncAcctBundleHash: o.EncAcctBundleHash.DeepCopy(), 467 } 468 } 469 470 type BundleSecretEntryV2 struct { 471 AccountID AccountID `codec:"accountID" json:"accountID"` 472 Name string `codec:"name" json:"name"` 473 } 474 475 func (o BundleSecretEntryV2) DeepCopy() BundleSecretEntryV2 { 476 return BundleSecretEntryV2{ 477 AccountID: o.AccountID.DeepCopy(), 478 Name: o.Name, 479 } 480 } 481 482 type BundleSecretUnsupported struct { 483 } 484 485 func (o BundleSecretUnsupported) DeepCopy() BundleSecretUnsupported { 486 return BundleSecretUnsupported{} 487 } 488 489 type EncryptedAccountBundle struct { 490 V int `codec:"v" json:"v"` 491 E []byte `codec:"e" json:"e"` 492 N keybase1.BoxNonce `codec:"n" json:"n"` 493 Gen keybase1.PerUserKeyGeneration `codec:"gen" json:"gen"` 494 } 495 496 func (o EncryptedAccountBundle) DeepCopy() EncryptedAccountBundle { 497 return EncryptedAccountBundle{ 498 V: o.V, 499 E: (func(x []byte) []byte { 500 if x == nil { 501 return nil 502 } 503 return append([]byte{}, x...) 504 })(o.E), 505 N: o.N.DeepCopy(), 506 Gen: o.Gen.DeepCopy(), 507 } 508 } 509 510 type AccountBundleVersion int 511 512 const ( 513 AccountBundleVersion_V1 AccountBundleVersion = 1 514 AccountBundleVersion_V2 AccountBundleVersion = 2 515 AccountBundleVersion_V3 AccountBundleVersion = 3 516 AccountBundleVersion_V4 AccountBundleVersion = 4 517 AccountBundleVersion_V5 AccountBundleVersion = 5 518 AccountBundleVersion_V6 AccountBundleVersion = 6 519 AccountBundleVersion_V7 AccountBundleVersion = 7 520 AccountBundleVersion_V8 AccountBundleVersion = 8 521 AccountBundleVersion_V9 AccountBundleVersion = 9 522 AccountBundleVersion_V10 AccountBundleVersion = 10 523 ) 524 525 func (o AccountBundleVersion) DeepCopy() AccountBundleVersion { return o } 526 527 var AccountBundleVersionMap = map[string]AccountBundleVersion{ 528 "V1": 1, 529 "V2": 2, 530 "V3": 3, 531 "V4": 4, 532 "V5": 5, 533 "V6": 6, 534 "V7": 7, 535 "V8": 8, 536 "V9": 9, 537 "V10": 10, 538 } 539 540 var AccountBundleVersionRevMap = map[AccountBundleVersion]string{ 541 1: "V1", 542 2: "V2", 543 3: "V3", 544 4: "V4", 545 5: "V5", 546 6: "V6", 547 7: "V7", 548 8: "V8", 549 9: "V9", 550 10: "V10", 551 } 552 553 func (e AccountBundleVersion) String() string { 554 if v, ok := AccountBundleVersionRevMap[e]; ok { 555 return v 556 } 557 return fmt.Sprintf("%v", int(e)) 558 } 559 560 type AccountBundleSecretVersioned struct { 561 Version__ AccountBundleVersion `codec:"version" json:"version"` 562 V1__ *AccountBundleSecretV1 `codec:"v1,omitempty" json:"v1,omitempty"` 563 V2__ *AccountBundleSecretUnsupported `codec:"v2,omitempty" json:"v2,omitempty"` 564 V3__ *AccountBundleSecretUnsupported `codec:"v3,omitempty" json:"v3,omitempty"` 565 V4__ *AccountBundleSecretUnsupported `codec:"v4,omitempty" json:"v4,omitempty"` 566 V5__ *AccountBundleSecretUnsupported `codec:"v5,omitempty" json:"v5,omitempty"` 567 V6__ *AccountBundleSecretUnsupported `codec:"v6,omitempty" json:"v6,omitempty"` 568 V7__ *AccountBundleSecretUnsupported `codec:"v7,omitempty" json:"v7,omitempty"` 569 V8__ *AccountBundleSecretUnsupported `codec:"v8,omitempty" json:"v8,omitempty"` 570 V9__ *AccountBundleSecretUnsupported `codec:"v9,omitempty" json:"v9,omitempty"` 571 V10__ *AccountBundleSecretUnsupported `codec:"v10,omitempty" json:"v10,omitempty"` 572 } 573 574 func (o *AccountBundleSecretVersioned) Version() (ret AccountBundleVersion, err error) { 575 switch o.Version__ { 576 case AccountBundleVersion_V1: 577 if o.V1__ == nil { 578 err = errors.New("unexpected nil value for V1__") 579 return ret, err 580 } 581 case AccountBundleVersion_V2: 582 if o.V2__ == nil { 583 err = errors.New("unexpected nil value for V2__") 584 return ret, err 585 } 586 case AccountBundleVersion_V3: 587 if o.V3__ == nil { 588 err = errors.New("unexpected nil value for V3__") 589 return ret, err 590 } 591 case AccountBundleVersion_V4: 592 if o.V4__ == nil { 593 err = errors.New("unexpected nil value for V4__") 594 return ret, err 595 } 596 case AccountBundleVersion_V5: 597 if o.V5__ == nil { 598 err = errors.New("unexpected nil value for V5__") 599 return ret, err 600 } 601 case AccountBundleVersion_V6: 602 if o.V6__ == nil { 603 err = errors.New("unexpected nil value for V6__") 604 return ret, err 605 } 606 case AccountBundleVersion_V7: 607 if o.V7__ == nil { 608 err = errors.New("unexpected nil value for V7__") 609 return ret, err 610 } 611 case AccountBundleVersion_V8: 612 if o.V8__ == nil { 613 err = errors.New("unexpected nil value for V8__") 614 return ret, err 615 } 616 case AccountBundleVersion_V9: 617 if o.V9__ == nil { 618 err = errors.New("unexpected nil value for V9__") 619 return ret, err 620 } 621 case AccountBundleVersion_V10: 622 if o.V10__ == nil { 623 err = errors.New("unexpected nil value for V10__") 624 return ret, err 625 } 626 } 627 return o.Version__, nil 628 } 629 630 func (o AccountBundleSecretVersioned) V1() (res AccountBundleSecretV1) { 631 if o.Version__ != AccountBundleVersion_V1 { 632 panic("wrong case accessed") 633 } 634 if o.V1__ == nil { 635 return 636 } 637 return *o.V1__ 638 } 639 640 func (o AccountBundleSecretVersioned) V2() (res AccountBundleSecretUnsupported) { 641 if o.Version__ != AccountBundleVersion_V2 { 642 panic("wrong case accessed") 643 } 644 if o.V2__ == nil { 645 return 646 } 647 return *o.V2__ 648 } 649 650 func (o AccountBundleSecretVersioned) V3() (res AccountBundleSecretUnsupported) { 651 if o.Version__ != AccountBundleVersion_V3 { 652 panic("wrong case accessed") 653 } 654 if o.V3__ == nil { 655 return 656 } 657 return *o.V3__ 658 } 659 660 func (o AccountBundleSecretVersioned) V4() (res AccountBundleSecretUnsupported) { 661 if o.Version__ != AccountBundleVersion_V4 { 662 panic("wrong case accessed") 663 } 664 if o.V4__ == nil { 665 return 666 } 667 return *o.V4__ 668 } 669 670 func (o AccountBundleSecretVersioned) V5() (res AccountBundleSecretUnsupported) { 671 if o.Version__ != AccountBundleVersion_V5 { 672 panic("wrong case accessed") 673 } 674 if o.V5__ == nil { 675 return 676 } 677 return *o.V5__ 678 } 679 680 func (o AccountBundleSecretVersioned) V6() (res AccountBundleSecretUnsupported) { 681 if o.Version__ != AccountBundleVersion_V6 { 682 panic("wrong case accessed") 683 } 684 if o.V6__ == nil { 685 return 686 } 687 return *o.V6__ 688 } 689 690 func (o AccountBundleSecretVersioned) V7() (res AccountBundleSecretUnsupported) { 691 if o.Version__ != AccountBundleVersion_V7 { 692 panic("wrong case accessed") 693 } 694 if o.V7__ == nil { 695 return 696 } 697 return *o.V7__ 698 } 699 700 func (o AccountBundleSecretVersioned) V8() (res AccountBundleSecretUnsupported) { 701 if o.Version__ != AccountBundleVersion_V8 { 702 panic("wrong case accessed") 703 } 704 if o.V8__ == nil { 705 return 706 } 707 return *o.V8__ 708 } 709 710 func (o AccountBundleSecretVersioned) V9() (res AccountBundleSecretUnsupported) { 711 if o.Version__ != AccountBundleVersion_V9 { 712 panic("wrong case accessed") 713 } 714 if o.V9__ == nil { 715 return 716 } 717 return *o.V9__ 718 } 719 720 func (o AccountBundleSecretVersioned) V10() (res AccountBundleSecretUnsupported) { 721 if o.Version__ != AccountBundleVersion_V10 { 722 panic("wrong case accessed") 723 } 724 if o.V10__ == nil { 725 return 726 } 727 return *o.V10__ 728 } 729 730 func NewAccountBundleSecretVersionedWithV1(v AccountBundleSecretV1) AccountBundleSecretVersioned { 731 return AccountBundleSecretVersioned{ 732 Version__: AccountBundleVersion_V1, 733 V1__: &v, 734 } 735 } 736 737 func NewAccountBundleSecretVersionedWithV2(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 738 return AccountBundleSecretVersioned{ 739 Version__: AccountBundleVersion_V2, 740 V2__: &v, 741 } 742 } 743 744 func NewAccountBundleSecretVersionedWithV3(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 745 return AccountBundleSecretVersioned{ 746 Version__: AccountBundleVersion_V3, 747 V3__: &v, 748 } 749 } 750 751 func NewAccountBundleSecretVersionedWithV4(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 752 return AccountBundleSecretVersioned{ 753 Version__: AccountBundleVersion_V4, 754 V4__: &v, 755 } 756 } 757 758 func NewAccountBundleSecretVersionedWithV5(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 759 return AccountBundleSecretVersioned{ 760 Version__: AccountBundleVersion_V5, 761 V5__: &v, 762 } 763 } 764 765 func NewAccountBundleSecretVersionedWithV6(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 766 return AccountBundleSecretVersioned{ 767 Version__: AccountBundleVersion_V6, 768 V6__: &v, 769 } 770 } 771 772 func NewAccountBundleSecretVersionedWithV7(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 773 return AccountBundleSecretVersioned{ 774 Version__: AccountBundleVersion_V7, 775 V7__: &v, 776 } 777 } 778 779 func NewAccountBundleSecretVersionedWithV8(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 780 return AccountBundleSecretVersioned{ 781 Version__: AccountBundleVersion_V8, 782 V8__: &v, 783 } 784 } 785 786 func NewAccountBundleSecretVersionedWithV9(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 787 return AccountBundleSecretVersioned{ 788 Version__: AccountBundleVersion_V9, 789 V9__: &v, 790 } 791 } 792 793 func NewAccountBundleSecretVersionedWithV10(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { 794 return AccountBundleSecretVersioned{ 795 Version__: AccountBundleVersion_V10, 796 V10__: &v, 797 } 798 } 799 800 func (o AccountBundleSecretVersioned) DeepCopy() AccountBundleSecretVersioned { 801 return AccountBundleSecretVersioned{ 802 Version__: o.Version__.DeepCopy(), 803 V1__: (func(x *AccountBundleSecretV1) *AccountBundleSecretV1 { 804 if x == nil { 805 return nil 806 } 807 tmp := (*x).DeepCopy() 808 return &tmp 809 })(o.V1__), 810 V2__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 811 if x == nil { 812 return nil 813 } 814 tmp := (*x).DeepCopy() 815 return &tmp 816 })(o.V2__), 817 V3__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 818 if x == nil { 819 return nil 820 } 821 tmp := (*x).DeepCopy() 822 return &tmp 823 })(o.V3__), 824 V4__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 825 if x == nil { 826 return nil 827 } 828 tmp := (*x).DeepCopy() 829 return &tmp 830 })(o.V4__), 831 V5__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 832 if x == nil { 833 return nil 834 } 835 tmp := (*x).DeepCopy() 836 return &tmp 837 })(o.V5__), 838 V6__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 839 if x == nil { 840 return nil 841 } 842 tmp := (*x).DeepCopy() 843 return &tmp 844 })(o.V6__), 845 V7__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 846 if x == nil { 847 return nil 848 } 849 tmp := (*x).DeepCopy() 850 return &tmp 851 })(o.V7__), 852 V8__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 853 if x == nil { 854 return nil 855 } 856 tmp := (*x).DeepCopy() 857 return &tmp 858 })(o.V8__), 859 V9__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 860 if x == nil { 861 return nil 862 } 863 tmp := (*x).DeepCopy() 864 return &tmp 865 })(o.V9__), 866 V10__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { 867 if x == nil { 868 return nil 869 } 870 tmp := (*x).DeepCopy() 871 return &tmp 872 })(o.V10__), 873 } 874 } 875 876 type AccountBundleSecretV1 struct { 877 AccountID AccountID `codec:"accountID" json:"accountID"` 878 Signers []SecretKey `codec:"signers" json:"signers"` 879 } 880 881 func (o AccountBundleSecretV1) DeepCopy() AccountBundleSecretV1 { 882 return AccountBundleSecretV1{ 883 AccountID: o.AccountID.DeepCopy(), 884 Signers: (func(x []SecretKey) []SecretKey { 885 if x == nil { 886 return nil 887 } 888 ret := make([]SecretKey, len(x)) 889 for i, v := range x { 890 vCopy := v.DeepCopy() 891 ret[i] = vCopy 892 } 893 return ret 894 })(o.Signers), 895 } 896 } 897 898 type AccountBundleSecretUnsupported struct { 899 } 900 901 func (o AccountBundleSecretUnsupported) DeepCopy() AccountBundleSecretUnsupported { 902 return AccountBundleSecretUnsupported{} 903 } 904 905 type Bundle struct { 906 Revision BundleRevision `codec:"revision" json:"revision"` 907 Prev Hash `codec:"prev" json:"prev"` 908 OwnHash Hash `codec:"ownHash" json:"ownHash"` 909 Accounts []BundleEntry `codec:"accounts" json:"accounts"` 910 AccountBundles map[AccountID]AccountBundle `codec:"accountBundles" json:"accountBundles"` 911 } 912 913 func (o Bundle) DeepCopy() Bundle { 914 return Bundle{ 915 Revision: o.Revision.DeepCopy(), 916 Prev: o.Prev.DeepCopy(), 917 OwnHash: o.OwnHash.DeepCopy(), 918 Accounts: (func(x []BundleEntry) []BundleEntry { 919 if x == nil { 920 return nil 921 } 922 ret := make([]BundleEntry, len(x)) 923 for i, v := range x { 924 vCopy := v.DeepCopy() 925 ret[i] = vCopy 926 } 927 return ret 928 })(o.Accounts), 929 AccountBundles: (func(x map[AccountID]AccountBundle) map[AccountID]AccountBundle { 930 if x == nil { 931 return nil 932 } 933 ret := make(map[AccountID]AccountBundle, len(x)) 934 for k, v := range x { 935 kCopy := k.DeepCopy() 936 vCopy := v.DeepCopy() 937 ret[kCopy] = vCopy 938 } 939 return ret 940 })(o.AccountBundles), 941 } 942 } 943 944 type BundleEntry struct { 945 AccountID AccountID `codec:"accountID" json:"accountID"` 946 Mode AccountMode `codec:"mode" json:"mode"` 947 IsPrimary bool `codec:"isPrimary" json:"isPrimary"` 948 Name string `codec:"name" json:"name"` 949 AcctBundleRevision BundleRevision `codec:"acctBundleRevision" json:"acctBundleRevision"` 950 EncAcctBundleHash Hash `codec:"encAcctBundleHash" json:"encAcctBundleHash"` 951 } 952 953 func (o BundleEntry) DeepCopy() BundleEntry { 954 return BundleEntry{ 955 AccountID: o.AccountID.DeepCopy(), 956 Mode: o.Mode.DeepCopy(), 957 IsPrimary: o.IsPrimary, 958 Name: o.Name, 959 AcctBundleRevision: o.AcctBundleRevision.DeepCopy(), 960 EncAcctBundleHash: o.EncAcctBundleHash.DeepCopy(), 961 } 962 } 963 964 type AccountBundle struct { 965 Prev Hash `codec:"prev" json:"prev"` 966 OwnHash Hash `codec:"ownHash" json:"ownHash"` 967 AccountID AccountID `codec:"accountID" json:"accountID"` 968 Signers []SecretKey `codec:"signers" json:"signers"` 969 } 970 971 func (o AccountBundle) DeepCopy() AccountBundle { 972 return AccountBundle{ 973 Prev: o.Prev.DeepCopy(), 974 OwnHash: o.OwnHash.DeepCopy(), 975 AccountID: o.AccountID.DeepCopy(), 976 Signers: (func(x []SecretKey) []SecretKey { 977 if x == nil { 978 return nil 979 } 980 ret := make([]SecretKey, len(x)) 981 for i, v := range x { 982 vCopy := v.DeepCopy() 983 ret[i] = vCopy 984 } 985 return ret 986 })(o.Signers), 987 } 988 } 989 990 type BundleInterface interface { 991 } 992 993 func BundleProtocol(i BundleInterface) rpc.Protocol { 994 return rpc.Protocol{ 995 Name: "stellar.1.bundle", 996 Methods: map[string]rpc.ServeHandlerDescription{}, 997 } 998 } 999 1000 type BundleClient struct { 1001 Cli rpc.GenericClient 1002 }