func (u AccountEntryExt) ArmForSwitch(sw int32) (string, bool) {
switch int32(sw) {
    case 0:
      return "", true
    case 1:
      return "V1", true
}
return "-", false
}
ArmForSwitch returns which field name should be used for storing
the value for an instance of AccountEntryExt
          package xdr
          import (
            "io"
            "fmt"
            "github.com/nullstyle/go-xdr/xdr3"
          )
          func Unmarshal(r io.Reader, v interface{}) (int, error) {
          	return xdr.Unmarshal(r, v)
          }
          func Marshal(w io.Writer, v interface{}) (int, error) {
            return xdr.Marshal(w, v)
          }
type Value []byte
type ScpBallot struct {
  Counter Uint32 
  Value Value 
}
type ScpStatementType int32
const (
  ScpStatementTypeScpStPrepare ScpStatementType = 0
  ScpStatementTypeScpStConfirm ScpStatementType = 1
  ScpStatementTypeScpStExternalize ScpStatementType = 2
  ScpStatementTypeScpStNominate ScpStatementType = 3
)
var scpStatementTypeMap = map[int32]string{
  0: "ScpStatementTypeScpStPrepare",
  1: "ScpStatementTypeScpStConfirm",
  2: "ScpStatementTypeScpStExternalize",
  3: "ScpStatementTypeScpStNominate",
}
func (e ScpStatementType) ValidEnum(v int32) bool {
  _, ok := scpStatementTypeMap[v]
  return ok
}
func (e ScpStatementType) String() string {
  name, _ := scpStatementTypeMap[int32(e)]
  return name
}
type ScpNomination struct {
  QuorumSetHash Hash 
  Votes []Value 
  Accepted []Value 
}
type ScpStatementPrepare struct {
  QuorumSetHash Hash 
  Ballot ScpBallot 
  Prepared *ScpBallot 
  PreparedPrime *ScpBallot 
  NC Uint32 
  NH Uint32 
}
type ScpStatementConfirm struct {
  Ballot ScpBallot 
  NPrepared Uint32 
  NCommit Uint32 
  NH Uint32 
  QuorumSetHash Hash 
}
type ScpStatementExternalize struct {
  Commit ScpBallot 
  NH Uint32 
  CommitQuorumSetHash Hash 
}
type ScpStatementPledges struct{
  Type ScpStatementType
  Prepare *ScpStatementPrepare 
  Confirm *ScpStatementConfirm 
  Externalize *ScpStatementExternalize 
  Nominate *ScpNomination 
}
func (u ScpStatementPledges) SwitchFieldName() string {
  return "Type"
}
func (u ScpStatementPledges) ArmForSwitch(sw int32) (string, bool) {
switch ScpStatementType(sw) {
    case ScpStatementTypeScpStPrepare:
      return "Prepare", true
    case ScpStatementTypeScpStConfirm:
      return "Confirm", true
    case ScpStatementTypeScpStExternalize:
      return "Externalize", true
    case ScpStatementTypeScpStNominate:
      return "Nominate", true
}
return "-", false
}
func NewScpStatementPledges(aType ScpStatementType, value interface{}) (result ScpStatementPledges, err error) {
  result.Type = aType
switch ScpStatementType(aType) {
    case ScpStatementTypeScpStPrepare:
                  tv, ok := value.(ScpStatementPrepare)
            if !ok {
              err = fmt.Errorf("invalid value, must be ScpStatementPrepare")
              return
            }
            result.Prepare = &tv
    case ScpStatementTypeScpStConfirm:
                  tv, ok := value.(ScpStatementConfirm)
            if !ok {
              err = fmt.Errorf("invalid value, must be ScpStatementConfirm")
              return
            }
            result.Confirm = &tv
    case ScpStatementTypeScpStExternalize:
                  tv, ok := value.(ScpStatementExternalize)
            if !ok {
              err = fmt.Errorf("invalid value, must be ScpStatementExternalize")
              return
            }
            result.Externalize = &tv
    case ScpStatementTypeScpStNominate:
                  tv, ok := value.(ScpNomination)
            if !ok {
              err = fmt.Errorf("invalid value, must be ScpNomination")
              return
            }
            result.Nominate = &tv
}
  return
}
func (u ScpStatementPledges) MustPrepare() ScpStatementPrepare {
  val, ok := u.GetPrepare()
  if !ok {
    panic("arm Prepare is not set")
  }
  return val
}
func (u ScpStatementPledges) GetPrepare() (result ScpStatementPrepare, ok bool) {
  armName, _ := u.ArmForSwitch(int32(u.Type))
  if armName == "Prepare" {
    result = *u.Prepare
    ok = true
  }
  return
}
func (u ScpStatementPledges) MustConfirm() ScpStatementConfirm {
  val, ok := u.GetConfirm()
  if !ok {
    panic("arm Confirm is not set")
  }
  return val
}
func (u ScpStatementPledges) GetConfirm() (result ScpStatementConfirm, ok bool) {
  armName, _ := u.ArmForSwitch(int32(u.Type))
  if armName == "Confirm" {
    result = *u.Confirm
    ok = true
  }
  return
}
func (u ScpStatementPledges) MustExternalize() ScpStatementExternalize {
  val, ok := u.GetExternalize()
  if !ok {
    panic("arm Externalize is not set")
  }
  return val
}
func (u ScpStatementPledges) GetExternalize() (result ScpStatementExternalize, ok bool) {
  armName, _ := u.ArmForSwitch(int32(u.Type))
  if armName == "Externalize" {
    result = *u.Externalize
    ok = true
  }
  return
}
func (u ScpStatementPledges) MustNominate() ScpNomination {
  val, ok := u.GetNominate()
  if !ok {
    panic("arm Nominate is not set")
  }
  return val
}
func (u ScpStatementPledges) GetNominate() (result ScpNomination, ok bool) {
  armName, _ := u.ArmForSwitch(int32(u.Type))
  if armName == "Nominate" {
    result = *u.Nominate
    ok = true
  }
  return
}
type ScpStatement struct {
  NodeId NodeId 
  SlotIndex Uint64 
  Pledges ScpStatementPledges 
}
type ScpEnvelope struct {
  Statement ScpStatement 
  Signature Signature 
}
type ScpQuorumSet struct {
  Threshold Uint32 
  Validators []PublicKey 
  InnerSets []ScpQuorumSet 
}
type AccountId PublicKey
func (u AccountId) SwitchFieldName() string {
  return PublicKey(u).SwitchFieldName()
}
func (u AccountId) ArmForSwitch(sw int32) (string, bool) {
  return PublicKey(u).ArmForSwitch(sw)
}
func NewAccountId(aType PublicKeyType, value interface{}) (result AccountId, err error) {
  u, err := NewPublicKey(aType, value)
  result = AccountId(u)
  return
}
func (u AccountId) MustEd25519() Uint256 {
  return PublicKey(u).MustEd25519()
}
func (u AccountId) GetEd25519() (result Uint256, ok bool) {
  return PublicKey(u).GetEd25519()
}
type Thresholds [4]byte
func (e Thresholds) XDRMaxSize() int {
  return 4
}
type String32 string
func (e String32) XDRMaxSize() int {
  return 32
}
type String64 string
func (e String64) XDRMaxSize() int {
  return 64
}
type SequenceNumber Int64
type DataValue []byte
func (e DataValue) XDRMaxSize() int {
  return 64
}
type AssetType int32
const (
  AssetTypeAssetTypeNative AssetType = 0
  AssetTypeAssetTypeCreditAlphanum4 AssetType = 1
  AssetTypeAssetTypeCreditAlphanum12 AssetType = 2
)
var assetTypeMap = map[int32]string{
  0: "AssetTypeAssetTypeNative",
  1: "AssetTypeAssetTypeCreditAlphanum4",
  2: "AssetTypeAssetTypeCreditAlphanum12",
}
func (e AssetType) ValidEnum(v int32) bool {
  _, ok := assetTypeMap[v]
  return ok
}
func (e AssetType) String() string {
  name, _ := assetTypeMap[int32(e)]
  return name
}
type AssetAlphaNum4 struct {
  AssetCode [4]byte `xdrmaxsize:"4"`
  Issuer AccountId 
}
type AssetAlphaNum12 struct {
  AssetCode [12]byte `xdrmaxsize:"12"`
  Issuer AccountId 
}
type Asset struct{
  Type AssetType
  AlphaNum4 *AssetAlphaNum4 
  AlphaNum12 *AssetAlphaNum12 
}
func (u Asset) SwitchFieldName() string {
  return "Type"
}
func (u Asset) ArmForSwitch(sw int32) (string, bool) {
switch AssetType(sw) {
    case AssetTypeAssetTypeNative:
      return "", true
    case AssetTypeAssetTypeCreditAlphanum4:
      return "AlphaNum4", true
    case AssetTypeAssetTypeCreditAlphanum12:
      return "AlphaNum12", true
}
return "-", false
}
func NewAsset(aType AssetType, value interface{}) (result Asset, err error) {
  result.Type = aType
switch AssetType(aType) {
    case AssetTypeAssetTypeNative:
    case AssetTypeAssetTypeCreditAlphanum4:
                  tv, ok := value.(AssetAlphaNum4)
            if !ok {
              err = fmt.Errorf("invalid value, must be AssetAlphaNum4")
              return
            }
            result.AlphaNum4 = &tv
    case AssetTypeAssetTypeCreditAlphanum12:
                  tv, ok := value.(AssetAlphaNum12)
            if !ok {
              err = fmt.Errorf("invalid value, must be AssetAlphaNum12")
              return
            }
            result.AlphaNum12 = &tv
}
  return
}
func (u Asset) MustAlphaNum4() AssetAlphaNum4 {
  val, ok := u.GetAlphaNum4()
  if !ok {
    panic("arm AlphaNum4 is not set")
  }
  return val
}
func (u Asset) GetAlphaNum4() (result AssetAlphaNum4, ok bool) {
  armName, _ := u.ArmForSwitch(int32(u.Type))
  if armName == "AlphaNum4" {
    result = *u.AlphaNum4
    ok = true
  }
  return
}
func (u Asset) MustAlphaNum12() AssetAlphaNum12 {
  val, ok := u.GetAlphaNum12()
  if !ok {
    panic("arm AlphaNum12 is not set")
  }
  return val
}
func (u Asset) GetAlphaNum12() (result AssetAlphaNum12, ok bool) {
  armName, _ := u.ArmForSwitch(int32(u.Type))
  if armName == "AlphaNum12" {
    result = *u.AlphaNum12
    ok = true
  }
  return
}
type Price struct {
  N Int32 
  D Int32 
}
type Liabilities struct {
  Buying Int64 
  Selling Int64 
}
type ThresholdIndexes int32
const (
  ThresholdIndexesThresholdMasterWeight ThresholdIndexes = 0
  ThresholdIndexesThresholdLow ThresholdIndexes = 1
  ThresholdIndexesThresholdMed ThresholdIndexes = 2
  ThresholdIndexesThresholdHigh ThresholdIndexes = 3
)
var thresholdIndexesMap = map[int32]string{
  0: "ThresholdIndexesThresholdMasterWeight",
  1: "ThresholdIndexesThresholdLow",
  2: "ThresholdIndexesThresholdMed",
  3: "ThresholdIndexesThresholdHigh",
}
func (e ThresholdIndexes) ValidEnum(v int32) bool {
  _, ok := thresholdIndexesMap[v]
  return ok
}
func (e ThresholdIndexes) String() string {
  name, _ := thresholdIndexesMap[int32(e)]
  return name
}
type LedgerEntryType int32
const (
  LedgerEntryTypeAccount LedgerEntryType = 0
  LedgerEntryTypeTrustline LedgerEntryType = 1
  LedgerEntryTypeOffer LedgerEntryType = 2
  LedgerEntryTypeData LedgerEntryType = 3
)
var ledgerEntryTypeMap = map[int32]string{
  0: "LedgerEntryTypeAccount",
  1: "LedgerEntryTypeTrustline",
  2: "LedgerEntryTypeOffer",
  3: "LedgerEntryTypeData",
}
func (e LedgerEntryType) ValidEnum(v int32) bool {
  _, ok := ledgerEntryTypeMap[v]
  return ok
}
func (e LedgerEntryType) String() string {
  name, _ := ledgerEntryTypeMap[int32(e)]
  return name
}
type Signer struct {
  Key SignerKey 
  Weight Uint32 
}
type AccountFlags int32
const (
  AccountFlagsAuthRequiredFlag AccountFlags = 1
  AccountFlagsAuthRevocableFlag AccountFlags = 2
  AccountFlagsAuthImmutableFlag AccountFlags = 4
)
var accountFlagsMap = map[int32]string{
  1: "AccountFlagsAuthRequiredFlag",
  2: "AccountFlagsAuthRevocableFlag",
  4: "AccountFlagsAuthImmutableFlag",
}
func (e AccountFlags) ValidEnum(v int32) bool {
  _, ok := accountFlagsMap[v]
  return ok
}
func (e AccountFlags) String() string {
  name, _ := accountFlagsMap[int32(e)]
  return name
}
const MaskAccountFlags = 0x7
type AccountEntryV1Ext struct{
  V int32
}
func (u AccountEntryV1Ext) SwitchFieldName() string {
  return "V"
}
func (u AccountEntryV1Ext) ArmForSwitch(sw int32) (string, bool) {
switch int32(sw) {
    case 0:
      return "", true
}
return "-", false
}
func NewAccountEntryV1Ext(v int32, value interface{}) (result AccountEntryV1Ext, err error) {
  result.V = v
switch int32(v) {
    case 0:
}
  return
}
type AccountEntryV1 struct {
  Liabilities Liabilities 
  Ext AccountEntryV1Ext 
}
type AccountEntryExt struct{
  V int32
  V1 *AccountEntryV1 
}
func (u AccountEntryExt) SwitchFieldName() string {
  return "V"
}