// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: iov/configuration/v1beta1/types.proto
//
// For information on using the generated types, please see the documentation:
//   https://github.com/apple/swift-protobuf/

import Foundation
import SwiftProtobuf

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  typealias Version = _2
}

/// Config is the configuration of the network
struct Starnamed_X_Configuration_V1beta1_Config {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  /// Configurer is the configuration owner, the addresses allowed to handle fees and register domains with no superuser
  var configurer: String {
    get {return _storage._configurer}
    set {_uniqueStorage()._configurer = newValue}
  }

  /// ValidDomainName defines a regexp that determines if a domain name is valid or not
  var validDomainName: String {
    get {return _storage._validDomainName}
    set {_uniqueStorage()._validDomainName = newValue}
  }

  /// ValidAccountName defines a regexp that determines if an account name is valid or not
  var validAccountName: String {
    get {return _storage._validAccountName}
    set {_uniqueStorage()._validAccountName = newValue}
  }

  /// ValidURI defines a regexp that determines if resource uri is valid or not
  var validUri: String {
    get {return _storage._validUri}
    set {_uniqueStorage()._validUri = newValue}
  }

  /// ValidResource determines a regexp for a resource content
  var validResource: String {
    get {return _storage._validResource}
    set {_uniqueStorage()._validResource = newValue}
  }

  /// DomainRenewalPeriod defines the duration of the domain renewal period in seconds
  var domainRenewalPeriod: SwiftProtobuf.Google_Protobuf_Duration {
    get {return _storage._domainRenewalPeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
    set {_uniqueStorage()._domainRenewalPeriod = newValue}
  }
  /// Returns true if `domainRenewalPeriod` has been explicitly set.
  var hasDomainRenewalPeriod: Bool {return _storage._domainRenewalPeriod != nil}
  /// Clears the value of `domainRenewalPeriod`. Subsequent reads from it will return its default value.
  mutating func clearDomainRenewalPeriod() {_uniqueStorage()._domainRenewalPeriod = nil}

  /// DomainRenewalCountMax defines maximum number of domain renewals a user can do
  var domainRenewalCountMax: UInt32 {
    get {return _storage._domainRenewalCountMax}
    set {_uniqueStorage()._domainRenewalCountMax = newValue}
  }

  /// DomainGracePeriod defines the grace period for a domain deletion in seconds
  var domainGracePeriod: SwiftProtobuf.Google_Protobuf_Duration {
    get {return _storage._domainGracePeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
    set {_uniqueStorage()._domainGracePeriod = newValue}
  }
  /// Returns true if `domainGracePeriod` has been explicitly set.
  var hasDomainGracePeriod: Bool {return _storage._domainGracePeriod != nil}
  /// Clears the value of `domainGracePeriod`. Subsequent reads from it will return its default value.
  mutating func clearDomainGracePeriod() {_uniqueStorage()._domainGracePeriod = nil}

  /// AccountRenewalPeriod defines the duration of the account renewal period in seconds
  var accountRenewalPeriod: SwiftProtobuf.Google_Protobuf_Duration {
    get {return _storage._accountRenewalPeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
    set {_uniqueStorage()._accountRenewalPeriod = newValue}
  }
  /// Returns true if `accountRenewalPeriod` has been explicitly set.
  var hasAccountRenewalPeriod: Bool {return _storage._accountRenewalPeriod != nil}
  /// Clears the value of `accountRenewalPeriod`. Subsequent reads from it will return its default value.
  mutating func clearAccountRenewalPeriod() {_uniqueStorage()._accountRenewalPeriod = nil}

  /// AccountRenewalCountMax defines maximum number of account renewals a user can do
  var accountRenewalCountMax: UInt32 {
    get {return _storage._accountRenewalCountMax}
    set {_uniqueStorage()._accountRenewalCountMax = newValue}
  }

  /// DomainGracePeriod defines the grace period for a domain deletion in seconds
  var accountGracePeriod: SwiftProtobuf.Google_Protobuf_Duration {
    get {return _storage._accountGracePeriod ?? SwiftProtobuf.Google_Protobuf_Duration()}
    set {_uniqueStorage()._accountGracePeriod = newValue}
  }
  /// Returns true if `accountGracePeriod` has been explicitly set.
  var hasAccountGracePeriod: Bool {return _storage._accountGracePeriod != nil}
  /// Clears the value of `accountGracePeriod`. Subsequent reads from it will return its default value.
  mutating func clearAccountGracePeriod() {_uniqueStorage()._accountGracePeriod = nil}

  /// ResourcesMax defines maximum number of resources could be saved under an account
  var resourcesMax: UInt32 {
    get {return _storage._resourcesMax}
    set {_uniqueStorage()._resourcesMax = newValue}
  }

  /// CertificateSizeMax defines maximum size of a certificate that could be saved under an account
  var certificateSizeMax: UInt64 {
    get {return _storage._certificateSizeMax}
    set {_uniqueStorage()._certificateSizeMax = newValue}
  }

  /// CertificateCountMax defines maximum number of certificates that could be saved under an account
  var certificateCountMax: UInt32 {
    get {return _storage._certificateCountMax}
    set {_uniqueStorage()._certificateCountMax = newValue}
  }

  /// MetadataSizeMax defines maximum size of metadata that could be saved under an account
  var metadataSizeMax: UInt64 {
    get {return _storage._metadataSizeMax}
    set {_uniqueStorage()._metadataSizeMax = newValue}
  }

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _storage = _StorageClass.defaultInstance
}

/// Fees contains different type of fees to calculate coins to detract when processing different messages
struct Starnamed_X_Configuration_V1beta1_Fees {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  /// FeeCoinDenom defines the denominator of the coin used to process fees
  var feeCoinDenom: String {
    get {return _storage._feeCoinDenom}
    set {_uniqueStorage()._feeCoinDenom = newValue}
  }

  /// FeeCoinPrice defines the price of the coin
  var feeCoinPrice: String {
    get {return _storage._feeCoinPrice}
    set {_uniqueStorage()._feeCoinPrice = newValue}
  }

  /// FeeDefault is the parameter defining the default fee
  var feeDefault: String {
    get {return _storage._feeDefault}
    set {_uniqueStorage()._feeDefault = newValue}
  }

  /// RegisterAccountClosed is the fee to be paid to register an account in a closed domain
  var registerAccountClosed: String {
    get {return _storage._registerAccountClosed}
    set {_uniqueStorage()._registerAccountClosed = newValue}
  }

  /// RegisterAccountOpen is the fee to be paid to register an account in an open domain
  var registerAccountOpen: String {
    get {return _storage._registerAccountOpen}
    set {_uniqueStorage()._registerAccountOpen = newValue}
  }

  /// TransferAccountClosed is the fee to be paid to register an account in a closed domain
  var transferAccountClosed: String {
    get {return _storage._transferAccountClosed}
    set {_uniqueStorage()._transferAccountClosed = newValue}
  }

  /// TransferAccountOpen is the fee to be paid to register an account in an open domain
  var transferAccountOpen: String {
    get {return _storage._transferAccountOpen}
    set {_uniqueStorage()._transferAccountOpen = newValue}
  }

  /// ReplaceAccountResources is the fee to be paid to replace account's resources
  var replaceAccountResources: String {
    get {return _storage._replaceAccountResources}
    set {_uniqueStorage()._replaceAccountResources = newValue}
  }

  /// AddAccountCertificate is the fee to be paid to add a certificate to an account
  var addAccountCertificate: String {
    get {return _storage._addAccountCertificate}
    set {_uniqueStorage()._addAccountCertificate = newValue}
  }

  /// DelAccountCertificate is the feed to be paid to delete a certificate in an account
  var delAccountCertificate: String {
    get {return _storage._delAccountCertificate}
    set {_uniqueStorage()._delAccountCertificate = newValue}
  }

  /// SetAccountMetadata is the fee to be paid to set account's metadata
  var setAccountMetadata: String {
    get {return _storage._setAccountMetadata}
    set {_uniqueStorage()._setAccountMetadata = newValue}
  }

  /// RegisterDomain1 is the fee to be paid to register a domain with one character
  var registerDomain1: String {
    get {return _storage._registerDomain1}
    set {_uniqueStorage()._registerDomain1 = newValue}
  }

  /// RegisterDomain2 is the fee to be paid to register a domain with two characters
  var registerDomain2: String {
    get {return _storage._registerDomain2}
    set {_uniqueStorage()._registerDomain2 = newValue}
  }

  /// RegisterDomain3 is the fee to be paid to register a domain with three characters
  var registerDomain3: String {
    get {return _storage._registerDomain3}
    set {_uniqueStorage()._registerDomain3 = newValue}
  }

  /// RegisterDomain4 is the fee to be paid to register a domain with four characters
  var registerDomain4: String {
    get {return _storage._registerDomain4}
    set {_uniqueStorage()._registerDomain4 = newValue}
  }

  /// RegisterDomain5 is the fee to be paid to register a domain with five characters
  var registerDomain5: String {
    get {return _storage._registerDomain5}
    set {_uniqueStorage()._registerDomain5 = newValue}
  }

  /// RegisterDomainDefault is the fee to be paid to register a domain with more than five characters
  var registerDomainDefault: String {
    get {return _storage._registerDomainDefault}
    set {_uniqueStorage()._registerDomainDefault = newValue}
  }

  /// register_open_domain_multiplier is the multiplication applied to fees in register domain operations if they're of open type
  var registerOpenDomainMultiplier: String {
    get {return _storage._registerOpenDomainMultiplier}
    set {_uniqueStorage()._registerOpenDomainMultiplier = newValue}
  }

  /// transfer_domain_closed is the fee to be paid to transfer a closed domain
  var transferDomainClosed: String {
    get {return _storage._transferDomainClosed}
    set {_uniqueStorage()._transferDomainClosed = newValue}
  }

  /// transfer_domain_open is the fee to be paid to transfer open domains
  var transferDomainOpen: String {
    get {return _storage._transferDomainOpen}
    set {_uniqueStorage()._transferDomainOpen = newValue}
  }

  /// renew_domain_open is the fee to be paid to renew an open domain
  var renewDomainOpen: String {
    get {return _storage._renewDomainOpen}
    set {_uniqueStorage()._renewDomainOpen = newValue}
  }

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _storage = _StorageClass.defaultInstance
}

/// GenesisState - genesis state of x/configuration
struct Starnamed_X_Configuration_V1beta1_GenesisState {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var config: Starnamed_X_Configuration_V1beta1_Config {
    get {return _config ?? Starnamed_X_Configuration_V1beta1_Config()}
    set {_config = newValue}
  }
  /// Returns true if `config` has been explicitly set.
  var hasConfig: Bool {return self._config != nil}
  /// Clears the value of `config`. Subsequent reads from it will return its default value.
  mutating func clearConfig() {self._config = nil}

  var fees: Starnamed_X_Configuration_V1beta1_Fees {
    get {return _fees ?? Starnamed_X_Configuration_V1beta1_Fees()}
    set {_fees = newValue}
  }
  /// Returns true if `fees` has been explicitly set.
  var hasFees: Bool {return self._fees != nil}
  /// Clears the value of `fees`. Subsequent reads from it will return its default value.
  mutating func clearFees() {self._fees = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _config: Starnamed_X_Configuration_V1beta1_Config? = nil
  fileprivate var _fees: Starnamed_X_Configuration_V1beta1_Fees? = nil
}

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "starnamed.x.configuration.v1beta1"

extension Starnamed_X_Configuration_V1beta1_Config: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Config"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "configurer"),
    2: .standard(proto: "valid_domain_name"),
    3: .standard(proto: "valid_account_name"),
    4: .standard(proto: "valid_uri"),
    5: .standard(proto: "valid_resource"),
    6: .standard(proto: "domain_renewal_period"),
    7: .standard(proto: "domain_renewal_count_max"),
    8: .standard(proto: "domain_grace_period"),
    9: .standard(proto: "account_renewal_period"),
    10: .standard(proto: "account_renewal_count_max"),
    11: .standard(proto: "account_grace_period"),
    12: .standard(proto: "resources_max"),
    13: .standard(proto: "certificate_size_max"),
    14: .standard(proto: "certificate_count_max"),
    15: .standard(proto: "metadata_size_max"),
  ]

  fileprivate class _StorageClass {
    var _configurer: String = String()
    var _validDomainName: String = String()
    var _validAccountName: String = String()
    var _validUri: String = String()
    var _validResource: String = String()
    var _domainRenewalPeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
    var _domainRenewalCountMax: UInt32 = 0
    var _domainGracePeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
    var _accountRenewalPeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
    var _accountRenewalCountMax: UInt32 = 0
    var _accountGracePeriod: SwiftProtobuf.Google_Protobuf_Duration? = nil
    var _resourcesMax: UInt32 = 0
    var _certificateSizeMax: UInt64 = 0
    var _certificateCountMax: UInt32 = 0
    var _metadataSizeMax: UInt64 = 0

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _configurer = source._configurer
      _validDomainName = source._validDomainName
      _validAccountName = source._validAccountName
      _validUri = source._validUri
      _validResource = source._validResource
      _domainRenewalPeriod = source._domainRenewalPeriod
      _domainRenewalCountMax = source._domainRenewalCountMax
      _domainGracePeriod = source._domainGracePeriod
      _accountRenewalPeriod = source._accountRenewalPeriod
      _accountRenewalCountMax = source._accountRenewalCountMax
      _accountGracePeriod = source._accountGracePeriod
      _resourcesMax = source._resourcesMax
      _certificateSizeMax = source._certificateSizeMax
      _certificateCountMax = source._certificateCountMax
      _metadataSizeMax = source._metadataSizeMax
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        // The use of inline closures is to circumvent an issue where the compiler
        // allocates stack space for every case branch when no optimizations are
        // enabled. https://github.com/apple/swift-protobuf/issues/1034
        switch fieldNumber {
        case 1: try { try decoder.decodeSingularStringField(value: &_storage._configurer) }()
        case 2: try { try decoder.decodeSingularStringField(value: &_storage._validDomainName) }()
        case 3: try { try decoder.decodeSingularStringField(value: &_storage._validAccountName) }()
        case 4: try { try decoder.decodeSingularStringField(value: &_storage._validUri) }()
        case 5: try { try decoder.decodeSingularStringField(value: &_storage._validResource) }()
        case 6: try { try decoder.decodeSingularMessageField(value: &_storage._domainRenewalPeriod) }()
        case 7: try { try decoder.decodeSingularUInt32Field(value: &_storage._domainRenewalCountMax) }()
        case 8: try { try decoder.decodeSingularMessageField(value: &_storage._domainGracePeriod) }()
        case 9: try { try decoder.decodeSingularMessageField(value: &_storage._accountRenewalPeriod) }()
        case 10: try { try decoder.decodeSingularUInt32Field(value: &_storage._accountRenewalCountMax) }()
        case 11: try { try decoder.decodeSingularMessageField(value: &_storage._accountGracePeriod) }()
        case 12: try { try decoder.decodeSingularUInt32Field(value: &_storage._resourcesMax) }()
        case 13: try { try decoder.decodeSingularUInt64Field(value: &_storage._certificateSizeMax) }()
        case 14: try { try decoder.decodeSingularUInt32Field(value: &_storage._certificateCountMax) }()
        case 15: try { try decoder.decodeSingularUInt64Field(value: &_storage._metadataSizeMax) }()
        default: break
        }
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if !_storage._configurer.isEmpty {
        try visitor.visitSingularStringField(value: _storage._configurer, fieldNumber: 1)
      }
      if !_storage._validDomainName.isEmpty {
        try visitor.visitSingularStringField(value: _storage._validDomainName, fieldNumber: 2)
      }
      if !_storage._validAccountName.isEmpty {
        try visitor.visitSingularStringField(value: _storage._validAccountName, fieldNumber: 3)
      }
      if !_storage._validUri.isEmpty {
        try visitor.visitSingularStringField(value: _storage._validUri, fieldNumber: 4)
      }
      if !_storage._validResource.isEmpty {
        try visitor.visitSingularStringField(value: _storage._validResource, fieldNumber: 5)
      }
      if let v = _storage._domainRenewalPeriod {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
      }
      if _storage._domainRenewalCountMax != 0 {
        try visitor.visitSingularUInt32Field(value: _storage._domainRenewalCountMax, fieldNumber: 7)
      }
      if let v = _storage._domainGracePeriod {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
      }
      if let v = _storage._accountRenewalPeriod {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 9)
      }
      if _storage._accountRenewalCountMax != 0 {
        try visitor.visitSingularUInt32Field(value: _storage._accountRenewalCountMax, fieldNumber: 10)
      }
      if let v = _storage._accountGracePeriod {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 11)
      }
      if _storage._resourcesMax != 0 {
        try visitor.visitSingularUInt32Field(value: _storage._resourcesMax, fieldNumber: 12)
      }
      if _storage._certificateSizeMax != 0 {
        try visitor.visitSingularUInt64Field(value: _storage._certificateSizeMax, fieldNumber: 13)
      }
      if _storage._certificateCountMax != 0 {
        try visitor.visitSingularUInt32Field(value: _storage._certificateCountMax, fieldNumber: 14)
      }
      if _storage._metadataSizeMax != 0 {
        try visitor.visitSingularUInt64Field(value: _storage._metadataSizeMax, fieldNumber: 15)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Starnamed_X_Configuration_V1beta1_Config, rhs: Starnamed_X_Configuration_V1beta1_Config) -> Bool {
    if lhs._storage !== rhs._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let rhs_storage = _args.1
        if _storage._configurer != rhs_storage._configurer {return false}
        if _storage._validDomainName != rhs_storage._validDomainName {return false}
        if _storage._validAccountName != rhs_storage._validAccountName {return false}
        if _storage._validUri != rhs_storage._validUri {return false}
        if _storage._validResource != rhs_storage._validResource {return false}
        if _storage._domainRenewalPeriod != rhs_storage._domainRenewalPeriod {return false}
        if _storage._domainRenewalCountMax != rhs_storage._domainRenewalCountMax {return false}
        if _storage._domainGracePeriod != rhs_storage._domainGracePeriod {return false}
        if _storage._accountRenewalPeriod != rhs_storage._accountRenewalPeriod {return false}
        if _storage._accountRenewalCountMax != rhs_storage._accountRenewalCountMax {return false}
        if _storage._accountGracePeriod != rhs_storage._accountGracePeriod {return false}
        if _storage._resourcesMax != rhs_storage._resourcesMax {return false}
        if _storage._certificateSizeMax != rhs_storage._certificateSizeMax {return false}
        if _storage._certificateCountMax != rhs_storage._certificateCountMax {return false}
        if _storage._metadataSizeMax != rhs_storage._metadataSizeMax {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Starnamed_X_Configuration_V1beta1_Fees: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Fees"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "fee_coin_denom"),
    2: .standard(proto: "fee_coin_price"),
    3: .standard(proto: "fee_default"),
    4: .standard(proto: "register_account_closed"),
    5: .standard(proto: "register_account_open"),
    6: .standard(proto: "transfer_account_closed"),
    7: .standard(proto: "transfer_account_open"),
    8: .standard(proto: "replace_account_resources"),
    9: .standard(proto: "add_account_certificate"),
    10: .standard(proto: "del_account_certificate"),
    11: .standard(proto: "set_account_metadata"),
    12: .standard(proto: "register_domain_1"),
    13: .standard(proto: "register_domain_2"),
    14: .standard(proto: "register_domain_3"),
    15: .standard(proto: "register_domain_4"),
    16: .standard(proto: "register_domain_5"),
    17: .standard(proto: "register_domain_default"),
    18: .standard(proto: "register_open_domain_multiplier"),
    19: .standard(proto: "transfer_domain_closed"),
    20: .standard(proto: "transfer_domain_open"),
    21: .standard(proto: "renew_domain_open"),
  ]

  fileprivate class _StorageClass {
    var _feeCoinDenom: String = String()
    var _feeCoinPrice: String = String()
    var _feeDefault: String = String()
    var _registerAccountClosed: String = String()
    var _registerAccountOpen: String = String()
    var _transferAccountClosed: String = String()
    var _transferAccountOpen: String = String()
    var _replaceAccountResources: String = String()
    var _addAccountCertificate: String = String()
    var _delAccountCertificate: String = String()
    var _setAccountMetadata: String = String()
    var _registerDomain1: String = String()
    var _registerDomain2: String = String()
    var _registerDomain3: String = String()
    var _registerDomain4: String = String()
    var _registerDomain5: String = String()
    var _registerDomainDefault: String = String()
    var _registerOpenDomainMultiplier: String = String()
    var _transferDomainClosed: String = String()
    var _transferDomainOpen: String = String()
    var _renewDomainOpen: String = String()

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _feeCoinDenom = source._feeCoinDenom
      _feeCoinPrice = source._feeCoinPrice
      _feeDefault = source._feeDefault
      _registerAccountClosed = source._registerAccountClosed
      _registerAccountOpen = source._registerAccountOpen
      _transferAccountClosed = source._transferAccountClosed
      _transferAccountOpen = source._transferAccountOpen
      _replaceAccountResources = source._replaceAccountResources
      _addAccountCertificate = source._addAccountCertificate
      _delAccountCertificate = source._delAccountCertificate
      _setAccountMetadata = source._setAccountMetadata
      _registerDomain1 = source._registerDomain1
      _registerDomain2 = source._registerDomain2
      _registerDomain3 = source._registerDomain3
      _registerDomain4 = source._registerDomain4
      _registerDomain5 = source._registerDomain5
      _registerDomainDefault = source._registerDomainDefault
      _registerOpenDomainMultiplier = source._registerOpenDomainMultiplier
      _transferDomainClosed = source._transferDomainClosed
      _transferDomainOpen = source._transferDomainOpen
      _renewDomainOpen = source._renewDomainOpen
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        // The use of inline closures is to circumvent an issue where the compiler
        // allocates stack space for every case branch when no optimizations are
        // enabled. https://github.com/apple/swift-protobuf/issues/1034
        switch fieldNumber {
        case 1: try { try decoder.decodeSingularStringField(value: &_storage._feeCoinDenom) }()
        case 2: try { try decoder.decodeSingularStringField(value: &_storage._feeCoinPrice) }()
        case 3: try { try decoder.decodeSingularStringField(value: &_storage._feeDefault) }()
        case 4: try { try decoder.decodeSingularStringField(value: &_storage._registerAccountClosed) }()
        case 5: try { try decoder.decodeSingularStringField(value: &_storage._registerAccountOpen) }()
        case 6: try { try decoder.decodeSingularStringField(value: &_storage._transferAccountClosed) }()
        case 7: try { try decoder.decodeSingularStringField(value: &_storage._transferAccountOpen) }()
        case 8: try { try decoder.decodeSingularStringField(value: &_storage._replaceAccountResources) }()
        case 9: try { try decoder.decodeSingularStringField(value: &_storage._addAccountCertificate) }()
        case 10: try { try decoder.decodeSingularStringField(value: &_storage._delAccountCertificate) }()
        case 11: try { try decoder.decodeSingularStringField(value: &_storage._setAccountMetadata) }()
        case 12: try { try decoder.decodeSingularStringField(value: &_storage._registerDomain1) }()
        case 13: try { try decoder.decodeSingularStringField(value: &_storage._registerDomain2) }()
        case 14: try { try decoder.decodeSingularStringField(value: &_storage._registerDomain3) }()
        case 15: try { try decoder.decodeSingularStringField(value: &_storage._registerDomain4) }()
        case 16: try { try decoder.decodeSingularStringField(value: &_storage._registerDomain5) }()
        case 17: try { try decoder.decodeSingularStringField(value: &_storage._registerDomainDefault) }()
        case 18: try { try decoder.decodeSingularStringField(value: &_storage._registerOpenDomainMultiplier) }()
        case 19: try { try decoder.decodeSingularStringField(value: &_storage._transferDomainClosed) }()
        case 20: try { try decoder.decodeSingularStringField(value: &_storage._transferDomainOpen) }()
        case 21: try { try decoder.decodeSingularStringField(value: &_storage._renewDomainOpen) }()
        default: break
        }
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if !_storage._feeCoinDenom.isEmpty {
        try visitor.visitSingularStringField(value: _storage._feeCoinDenom, fieldNumber: 1)
      }
      if !_storage._feeCoinPrice.isEmpty {
        try visitor.visitSingularStringField(value: _storage._feeCoinPrice, fieldNumber: 2)
      }
      if !_storage._feeDefault.isEmpty {
        try visitor.visitSingularStringField(value: _storage._feeDefault, fieldNumber: 3)
      }
      if !_storage._registerAccountClosed.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerAccountClosed, fieldNumber: 4)
      }
      if !_storage._registerAccountOpen.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerAccountOpen, fieldNumber: 5)
      }
      if !_storage._transferAccountClosed.isEmpty {
        try visitor.visitSingularStringField(value: _storage._transferAccountClosed, fieldNumber: 6)
      }
      if !_storage._transferAccountOpen.isEmpty {
        try visitor.visitSingularStringField(value: _storage._transferAccountOpen, fieldNumber: 7)
      }
      if !_storage._replaceAccountResources.isEmpty {
        try visitor.visitSingularStringField(value: _storage._replaceAccountResources, fieldNumber: 8)
      }
      if !_storage._addAccountCertificate.isEmpty {
        try visitor.visitSingularStringField(value: _storage._addAccountCertificate, fieldNumber: 9)
      }
      if !_storage._delAccountCertificate.isEmpty {
        try visitor.visitSingularStringField(value: _storage._delAccountCertificate, fieldNumber: 10)
      }
      if !_storage._setAccountMetadata.isEmpty {
        try visitor.visitSingularStringField(value: _storage._setAccountMetadata, fieldNumber: 11)
      }
      if !_storage._registerDomain1.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerDomain1, fieldNumber: 12)
      }
      if !_storage._registerDomain2.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerDomain2, fieldNumber: 13)
      }
      if !_storage._registerDomain3.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerDomain3, fieldNumber: 14)
      }
      if !_storage._registerDomain4.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerDomain4, fieldNumber: 15)
      }
      if !_storage._registerDomain5.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerDomain5, fieldNumber: 16)
      }
      if !_storage._registerDomainDefault.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerDomainDefault, fieldNumber: 17)
      }
      if !_storage._registerOpenDomainMultiplier.isEmpty {
        try visitor.visitSingularStringField(value: _storage._registerOpenDomainMultiplier, fieldNumber: 18)
      }
      if !_storage._transferDomainClosed.isEmpty {
        try visitor.visitSingularStringField(value: _storage._transferDomainClosed, fieldNumber: 19)
      }
      if !_storage._transferDomainOpen.isEmpty {
        try visitor.visitSingularStringField(value: _storage._transferDomainOpen, fieldNumber: 20)
      }
      if !_storage._renewDomainOpen.isEmpty {
        try visitor.visitSingularStringField(value: _storage._renewDomainOpen, fieldNumber: 21)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Starnamed_X_Configuration_V1beta1_Fees, rhs: Starnamed_X_Configuration_V1beta1_Fees) -> Bool {
    if lhs._storage !== rhs._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let rhs_storage = _args.1
        if _storage._feeCoinDenom != rhs_storage._feeCoinDenom {return false}
        if _storage._feeCoinPrice != rhs_storage._feeCoinPrice {return false}
        if _storage._feeDefault != rhs_storage._feeDefault {return false}
        if _storage._registerAccountClosed != rhs_storage._registerAccountClosed {return false}
        if _storage._registerAccountOpen != rhs_storage._registerAccountOpen {return false}
        if _storage._transferAccountClosed != rhs_storage._transferAccountClosed {return false}
        if _storage._transferAccountOpen != rhs_storage._transferAccountOpen {return false}
        if _storage._replaceAccountResources != rhs_storage._replaceAccountResources {return false}
        if _storage._addAccountCertificate != rhs_storage._addAccountCertificate {return false}
        if _storage._delAccountCertificate != rhs_storage._delAccountCertificate {return false}
        if _storage._setAccountMetadata != rhs_storage._setAccountMetadata {return false}
        if _storage._registerDomain1 != rhs_storage._registerDomain1 {return false}
        if _storage._registerDomain2 != rhs_storage._registerDomain2 {return false}
        if _storage._registerDomain3 != rhs_storage._registerDomain3 {return false}
        if _storage._registerDomain4 != rhs_storage._registerDomain4 {return false}
        if _storage._registerDomain5 != rhs_storage._registerDomain5 {return false}
        if _storage._registerDomainDefault != rhs_storage._registerDomainDefault {return false}
        if _storage._registerOpenDomainMultiplier != rhs_storage._registerOpenDomainMultiplier {return false}
        if _storage._transferDomainClosed != rhs_storage._transferDomainClosed {return false}
        if _storage._transferDomainOpen != rhs_storage._transferDomainOpen {return false}
        if _storage._renewDomainOpen != rhs_storage._renewDomainOpen {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Starnamed_X_Configuration_V1beta1_GenesisState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".GenesisState"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "config"),
    2: .same(proto: "fees"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      // The use of inline closures is to circumvent an issue where the compiler
      // allocates stack space for every case branch when no optimizations are
      // enabled. https://github.com/apple/swift-protobuf/issues/1034
      switch fieldNumber {
      case 1: try { try decoder.decodeSingularMessageField(value: &self._config) }()
      case 2: try { try decoder.decodeSingularMessageField(value: &self._fees) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._config {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
    }
    if let v = self._fees {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Starnamed_X_Configuration_V1beta1_GenesisState, rhs: Starnamed_X_Configuration_V1beta1_GenesisState) -> Bool {
    if lhs._config != rhs._config {return false}
    if lhs._fees != rhs._fees {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
