// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: get_account_response.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 your 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
}

public struct Org_Interledger_Stream_Proto_GetAccountResponse {
  // 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.

  public var accountRelationship: String {
    get {return _storage._accountRelationship}
    set {_uniqueStorage()._accountRelationship = newValue}
  }

  public var assetCode: String {
    get {return _storage._assetCode}
    set {_uniqueStorage()._assetCode = newValue}
  }

  public var assetScale: Int32 {
    get {return _storage._assetScale}
    set {_uniqueStorage()._assetScale = newValue}
  }

  public var maximumPacketAmount: UInt64 {
    get {return _storage._maximumPacketAmount}
    set {_uniqueStorage()._maximumPacketAmount = newValue}
  }

  /// TODO: What should protobuf :value type be?
  public var customSettings: Dictionary<String,String> {
    get {return _storage._customSettings}
    set {_uniqueStorage()._customSettings = newValue}
  }

  public var accountID: String {
    get {return _storage._accountID}
    set {_uniqueStorage()._accountID = newValue}
  }

  public var createdAt: String {
    get {return _storage._createdAt}
    set {_uniqueStorage()._createdAt = newValue}
  }

  public var modifiedAt: String {
    get {return _storage._modifiedAt}
    set {_uniqueStorage()._modifiedAt = newValue}
  }

  public var description_p: String {
    get {return _storage._description_p}
    set {_uniqueStorage()._description_p = newValue}
  }

  public var linkType: String {
    get {return _storage._linkType}
    set {_uniqueStorage()._linkType = newValue}
  }

  public var isInternal: Bool {
    get {return _storage._isInternal}
    set {_uniqueStorage()._isInternal = newValue}
  }

  public var isConnectionInitiator: Bool {
    get {return _storage._isConnectionInitiator}
    set {_uniqueStorage()._isConnectionInitiator = newValue}
  }

  public var ilpAddressSegment: String {
    get {return _storage._ilpAddressSegment}
    set {_uniqueStorage()._ilpAddressSegment = newValue}
  }

  public var isSendRoutes: Bool {
    get {return _storage._isSendRoutes}
    set {_uniqueStorage()._isSendRoutes = newValue}
  }

  public var isReceiveRoutes: Bool {
    get {return _storage._isReceiveRoutes}
    set {_uniqueStorage()._isReceiveRoutes = newValue}
  }

  public var balanceSettings: Org_Interledger_Stream_Proto_GetAccountResponse.BalanceSettings {
    get {return _storage._balanceSettings ?? Org_Interledger_Stream_Proto_GetAccountResponse.BalanceSettings()}
    set {_uniqueStorage()._balanceSettings = newValue}
  }
  /// Returns true if `balanceSettings` has been explicitly set.
  public var hasBalanceSettings: Bool {return _storage._balanceSettings != nil}
  /// Clears the value of `balanceSettings`. Subsequent reads from it will return its default value.
  public mutating func clearBalanceSettings() {_uniqueStorage()._balanceSettings = nil}

  public var maxPacketsPerSecond: Int32 {
    get {return _storage._maxPacketsPerSecond}
    set {_uniqueStorage()._maxPacketsPerSecond = newValue}
  }

  public var settlementEngineDetails: Org_Interledger_Stream_Proto_GetAccountResponse.SettlementEngineDetails {
    get {return _storage._settlementEngineDetails ?? Org_Interledger_Stream_Proto_GetAccountResponse.SettlementEngineDetails()}
    set {_uniqueStorage()._settlementEngineDetails = newValue}
  }
  /// Returns true if `settlementEngineDetails` has been explicitly set.
  public var hasSettlementEngineDetails: Bool {return _storage._settlementEngineDetails != nil}
  /// Clears the value of `settlementEngineDetails`. Subsequent reads from it will return its default value.
  public mutating func clearSettlementEngineDetails() {_uniqueStorage()._settlementEngineDetails = nil}

  public var isParentAccount: Bool {
    get {return _storage._isParentAccount}
    set {_uniqueStorage()._isParentAccount = newValue}
  }

  public var isChildAccount: Bool {
    get {return _storage._isChildAccount}
    set {_uniqueStorage()._isChildAccount = newValue}
  }

  public var isPeerAccount: Bool {
    get {return _storage._isPeerAccount}
    set {_uniqueStorage()._isPeerAccount = newValue}
  }

  public var isPeerOrParentAccount: Bool {
    get {return _storage._isPeerOrParentAccount}
    set {_uniqueStorage()._isPeerOrParentAccount = newValue}
  }

  public var paymentPointer: String {
    get {return _storage._paymentPointer}
    set {_uniqueStorage()._paymentPointer = newValue}
  }

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public struct SettlementEngineDetails {
    // 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.

    public var settlementEngineAccountID: String = String()

    public var baseURL: String = String()

    public var customSettings: Dictionary<String,String> = [:]

    public var unknownFields = SwiftProtobuf.UnknownStorage()

    public init() {}
  }

  public struct BalanceSettings {
    // 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.

    public var minBalance: Int64 = 0

    public var settleThreshold: Int64 = 0

    public var settleTo: Int64 = 0

    public var unknownFields = SwiftProtobuf.UnknownStorage()

    public init() {}
  }

  public init() {}

  fileprivate var _storage = _StorageClass.defaultInstance
}

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

fileprivate let _protobuf_package = "org.interledger.stream.proto"

extension Org_Interledger_Stream_Proto_GetAccountResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".GetAccountResponse"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "account_relationship"),
    2: .standard(proto: "asset_code"),
    3: .standard(proto: "asset_scale"),
    4: .standard(proto: "maximum_packet_amount"),
    5: .standard(proto: "custom_settings"),
    6: .standard(proto: "account_id"),
    7: .standard(proto: "created_at"),
    8: .standard(proto: "modified_at"),
    9: .same(proto: "description"),
    10: .standard(proto: "link_type"),
    11: .standard(proto: "is_internal"),
    12: .standard(proto: "is_connection_initiator"),
    13: .standard(proto: "ilp_address_segment"),
    14: .standard(proto: "is_send_routes"),
    15: .standard(proto: "is_receive_routes"),
    16: .standard(proto: "balance_settings"),
    17: .standard(proto: "max_packets_per_second"),
    18: .standard(proto: "settlement_engine_details"),
    19: .standard(proto: "is_parent_account"),
    20: .standard(proto: "is_child_account"),
    21: .standard(proto: "is_peer_account"),
    22: .standard(proto: "is_peer_or_parent_account"),
    23: .same(proto: "paymentPointer"),
  ]

  fileprivate class _StorageClass {
    var _accountRelationship: String = String()
    var _assetCode: String = String()
    var _assetScale: Int32 = 0
    var _maximumPacketAmount: UInt64 = 0
    var _customSettings: Dictionary<String,String> = [:]
    var _accountID: String = String()
    var _createdAt: String = String()
    var _modifiedAt: String = String()
    var _description_p: String = String()
    var _linkType: String = String()
    var _isInternal: Bool = false
    var _isConnectionInitiator: Bool = false
    var _ilpAddressSegment: String = String()
    var _isSendRoutes: Bool = false
    var _isReceiveRoutes: Bool = false
    var _balanceSettings: Org_Interledger_Stream_Proto_GetAccountResponse.BalanceSettings? = nil
    var _maxPacketsPerSecond: Int32 = 0
    var _settlementEngineDetails: Org_Interledger_Stream_Proto_GetAccountResponse.SettlementEngineDetails? = nil
    var _isParentAccount: Bool = false
    var _isChildAccount: Bool = false
    var _isPeerAccount: Bool = false
    var _isPeerOrParentAccount: Bool = false
    var _paymentPointer: String = String()

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _accountRelationship = source._accountRelationship
      _assetCode = source._assetCode
      _assetScale = source._assetScale
      _maximumPacketAmount = source._maximumPacketAmount
      _customSettings = source._customSettings
      _accountID = source._accountID
      _createdAt = source._createdAt
      _modifiedAt = source._modifiedAt
      _description_p = source._description_p
      _linkType = source._linkType
      _isInternal = source._isInternal
      _isConnectionInitiator = source._isConnectionInitiator
      _ilpAddressSegment = source._ilpAddressSegment
      _isSendRoutes = source._isSendRoutes
      _isReceiveRoutes = source._isReceiveRoutes
      _balanceSettings = source._balanceSettings
      _maxPacketsPerSecond = source._maxPacketsPerSecond
      _settlementEngineDetails = source._settlementEngineDetails
      _isParentAccount = source._isParentAccount
      _isChildAccount = source._isChildAccount
      _isPeerAccount = source._isPeerAccount
      _isPeerOrParentAccount = source._isPeerOrParentAccount
      _paymentPointer = source._paymentPointer
    }
  }

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

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 1: try decoder.decodeSingularStringField(value: &_storage._accountRelationship)
        case 2: try decoder.decodeSingularStringField(value: &_storage._assetCode)
        case 3: try decoder.decodeSingularInt32Field(value: &_storage._assetScale)
        case 4: try decoder.decodeSingularUInt64Field(value: &_storage._maximumPacketAmount)
        case 5: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._customSettings)
        case 6: try decoder.decodeSingularStringField(value: &_storage._accountID)
        case 7: try decoder.decodeSingularStringField(value: &_storage._createdAt)
        case 8: try decoder.decodeSingularStringField(value: &_storage._modifiedAt)
        case 9: try decoder.decodeSingularStringField(value: &_storage._description_p)
        case 10: try decoder.decodeSingularStringField(value: &_storage._linkType)
        case 11: try decoder.decodeSingularBoolField(value: &_storage._isInternal)
        case 12: try decoder.decodeSingularBoolField(value: &_storage._isConnectionInitiator)
        case 13: try decoder.decodeSingularStringField(value: &_storage._ilpAddressSegment)
        case 14: try decoder.decodeSingularBoolField(value: &_storage._isSendRoutes)
        case 15: try decoder.decodeSingularBoolField(value: &_storage._isReceiveRoutes)
        case 16: try decoder.decodeSingularMessageField(value: &_storage._balanceSettings)
        case 17: try decoder.decodeSingularInt32Field(value: &_storage._maxPacketsPerSecond)
        case 18: try decoder.decodeSingularMessageField(value: &_storage._settlementEngineDetails)
        case 19: try decoder.decodeSingularBoolField(value: &_storage._isParentAccount)
        case 20: try decoder.decodeSingularBoolField(value: &_storage._isChildAccount)
        case 21: try decoder.decodeSingularBoolField(value: &_storage._isPeerAccount)
        case 22: try decoder.decodeSingularBoolField(value: &_storage._isPeerOrParentAccount)
        case 23: try decoder.decodeSingularStringField(value: &_storage._paymentPointer)
        default: break
        }
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if !_storage._accountRelationship.isEmpty {
        try visitor.visitSingularStringField(value: _storage._accountRelationship, fieldNumber: 1)
      }
      if !_storage._assetCode.isEmpty {
        try visitor.visitSingularStringField(value: _storage._assetCode, fieldNumber: 2)
      }
      if _storage._assetScale != 0 {
        try visitor.visitSingularInt32Field(value: _storage._assetScale, fieldNumber: 3)
      }
      if _storage._maximumPacketAmount != 0 {
        try visitor.visitSingularUInt64Field(value: _storage._maximumPacketAmount, fieldNumber: 4)
      }
      if !_storage._customSettings.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._customSettings, fieldNumber: 5)
      }
      if !_storage._accountID.isEmpty {
        try visitor.visitSingularStringField(value: _storage._accountID, fieldNumber: 6)
      }
      if !_storage._createdAt.isEmpty {
        try visitor.visitSingularStringField(value: _storage._createdAt, fieldNumber: 7)
      }
      if !_storage._modifiedAt.isEmpty {
        try visitor.visitSingularStringField(value: _storage._modifiedAt, fieldNumber: 8)
      }
      if !_storage._description_p.isEmpty {
        try visitor.visitSingularStringField(value: _storage._description_p, fieldNumber: 9)
      }
      if !_storage._linkType.isEmpty {
        try visitor.visitSingularStringField(value: _storage._linkType, fieldNumber: 10)
      }
      if _storage._isInternal != false {
        try visitor.visitSingularBoolField(value: _storage._isInternal, fieldNumber: 11)
      }
      if _storage._isConnectionInitiator != false {
        try visitor.visitSingularBoolField(value: _storage._isConnectionInitiator, fieldNumber: 12)
      }
      if !_storage._ilpAddressSegment.isEmpty {
        try visitor.visitSingularStringField(value: _storage._ilpAddressSegment, fieldNumber: 13)
      }
      if _storage._isSendRoutes != false {
        try visitor.visitSingularBoolField(value: _storage._isSendRoutes, fieldNumber: 14)
      }
      if _storage._isReceiveRoutes != false {
        try visitor.visitSingularBoolField(value: _storage._isReceiveRoutes, fieldNumber: 15)
      }
      if let v = _storage._balanceSettings {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 16)
      }
      if _storage._maxPacketsPerSecond != 0 {
        try visitor.visitSingularInt32Field(value: _storage._maxPacketsPerSecond, fieldNumber: 17)
      }
      if let v = _storage._settlementEngineDetails {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
      }
      if _storage._isParentAccount != false {
        try visitor.visitSingularBoolField(value: _storage._isParentAccount, fieldNumber: 19)
      }
      if _storage._isChildAccount != false {
        try visitor.visitSingularBoolField(value: _storage._isChildAccount, fieldNumber: 20)
      }
      if _storage._isPeerAccount != false {
        try visitor.visitSingularBoolField(value: _storage._isPeerAccount, fieldNumber: 21)
      }
      if _storage._isPeerOrParentAccount != false {
        try visitor.visitSingularBoolField(value: _storage._isPeerOrParentAccount, fieldNumber: 22)
      }
      if !_storage._paymentPointer.isEmpty {
        try visitor.visitSingularStringField(value: _storage._paymentPointer, fieldNumber: 23)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Org_Interledger_Stream_Proto_GetAccountResponse, rhs: Org_Interledger_Stream_Proto_GetAccountResponse) -> 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._accountRelationship != rhs_storage._accountRelationship {return false}
        if _storage._assetCode != rhs_storage._assetCode {return false}
        if _storage._assetScale != rhs_storage._assetScale {return false}
        if _storage._maximumPacketAmount != rhs_storage._maximumPacketAmount {return false}
        if _storage._customSettings != rhs_storage._customSettings {return false}
        if _storage._accountID != rhs_storage._accountID {return false}
        if _storage._createdAt != rhs_storage._createdAt {return false}
        if _storage._modifiedAt != rhs_storage._modifiedAt {return false}
        if _storage._description_p != rhs_storage._description_p {return false}
        if _storage._linkType != rhs_storage._linkType {return false}
        if _storage._isInternal != rhs_storage._isInternal {return false}
        if _storage._isConnectionInitiator != rhs_storage._isConnectionInitiator {return false}
        if _storage._ilpAddressSegment != rhs_storage._ilpAddressSegment {return false}
        if _storage._isSendRoutes != rhs_storage._isSendRoutes {return false}
        if _storage._isReceiveRoutes != rhs_storage._isReceiveRoutes {return false}
        if _storage._balanceSettings != rhs_storage._balanceSettings {return false}
        if _storage._maxPacketsPerSecond != rhs_storage._maxPacketsPerSecond {return false}
        if _storage._settlementEngineDetails != rhs_storage._settlementEngineDetails {return false}
        if _storage._isParentAccount != rhs_storage._isParentAccount {return false}
        if _storage._isChildAccount != rhs_storage._isChildAccount {return false}
        if _storage._isPeerAccount != rhs_storage._isPeerAccount {return false}
        if _storage._isPeerOrParentAccount != rhs_storage._isPeerOrParentAccount {return false}
        if _storage._paymentPointer != rhs_storage._paymentPointer {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Org_Interledger_Stream_Proto_GetAccountResponse.SettlementEngineDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = Org_Interledger_Stream_Proto_GetAccountResponse.protoMessageName + ".SettlementEngineDetails"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "settlement_engine_account_id"),
    2: .standard(proto: "base_url"),
    3: .standard(proto: "custom_settings"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.settlementEngineAccountID)
      case 2: try decoder.decodeSingularStringField(value: &self.baseURL)
      case 3: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.customSettings)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.settlementEngineAccountID.isEmpty {
      try visitor.visitSingularStringField(value: self.settlementEngineAccountID, fieldNumber: 1)
    }
    if !self.baseURL.isEmpty {
      try visitor.visitSingularStringField(value: self.baseURL, fieldNumber: 2)
    }
    if !self.customSettings.isEmpty {
      try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.customSettings, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Org_Interledger_Stream_Proto_GetAccountResponse.SettlementEngineDetails, rhs: Org_Interledger_Stream_Proto_GetAccountResponse.SettlementEngineDetails) -> Bool {
    if lhs.settlementEngineAccountID != rhs.settlementEngineAccountID {return false}
    if lhs.baseURL != rhs.baseURL {return false}
    if lhs.customSettings != rhs.customSettings {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension Org_Interledger_Stream_Proto_GetAccountResponse.BalanceSettings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = Org_Interledger_Stream_Proto_GetAccountResponse.protoMessageName + ".BalanceSettings"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "min_balance"),
    2: .standard(proto: "settle_threshold"),
    3: .standard(proto: "settle_to"),
  ]

  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularInt64Field(value: &self.minBalance)
      case 2: try decoder.decodeSingularInt64Field(value: &self.settleThreshold)
      case 3: try decoder.decodeSingularInt64Field(value: &self.settleTo)
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.minBalance != 0 {
      try visitor.visitSingularInt64Field(value: self.minBalance, fieldNumber: 1)
    }
    if self.settleThreshold != 0 {
      try visitor.visitSingularInt64Field(value: self.settleThreshold, fieldNumber: 2)
    }
    if self.settleTo != 0 {
      try visitor.visitSingularInt64Field(value: self.settleTo, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: Org_Interledger_Stream_Proto_GetAccountResponse.BalanceSettings, rhs: Org_Interledger_Stream_Proto_GetAccountResponse.BalanceSettings) -> Bool {
    if lhs.minBalance != rhs.minBalance {return false}
    if lhs.settleThreshold != rhs.settleThreshold {return false}
    if lhs.settleTo != rhs.settleTo {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
