// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: injective/auction/v1beta1/genesis.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
}

/// GenesisState defines the auction module's genesis state.
struct Injective_Auction_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.

  /// params defines all the parameters of related to auction.
  var params: Injective_Auction_V1beta1_Params {
    get {return _params ?? Injective_Auction_V1beta1_Params()}
    set {_params = newValue}
  }
  /// Returns true if `params` has been explicitly set.
  var hasParams: Bool {return self._params != nil}
  /// Clears the value of `params`. Subsequent reads from it will return its default value.
  mutating func clearParams() {self._params = nil}

  /// current auction round
  var auctionRound: UInt64 = 0

  /// current highest bid
  var highestBid: Injective_Auction_V1beta1_Bid {
    get {return _highestBid ?? Injective_Auction_V1beta1_Bid()}
    set {_highestBid = newValue}
  }
  /// Returns true if `highestBid` has been explicitly set.
  var hasHighestBid: Bool {return self._highestBid != nil}
  /// Clears the value of `highestBid`. Subsequent reads from it will return its default value.
  mutating func clearHighestBid() {self._highestBid = nil}

  /// auction ending timestamp
  var auctionEndingTimestamp: Int64 = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _params: Injective_Auction_V1beta1_Params? = nil
  fileprivate var _highestBid: Injective_Auction_V1beta1_Bid? = nil
}

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

fileprivate let _protobuf_package = "injective.auction.v1beta1"

extension Injective_Auction_V1beta1_GenesisState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".GenesisState"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "params"),
    2: .standard(proto: "auction_round"),
    3: .standard(proto: "highest_bid"),
    4: .standard(proto: "auction_ending_timestamp"),
  ]

  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._params) }()
      case 2: try { try decoder.decodeSingularUInt64Field(value: &self.auctionRound) }()
      case 3: try { try decoder.decodeSingularMessageField(value: &self._highestBid) }()
      case 4: try { try decoder.decodeSingularInt64Field(value: &self.auctionEndingTimestamp) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._params {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
    }
    if self.auctionRound != 0 {
      try visitor.visitSingularUInt64Field(value: self.auctionRound, fieldNumber: 2)
    }
    if let v = self._highestBid {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
    }
    if self.auctionEndingTimestamp != 0 {
      try visitor.visitSingularInt64Field(value: self.auctionEndingTimestamp, fieldNumber: 4)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Injective_Auction_V1beta1_GenesisState, rhs: Injective_Auction_V1beta1_GenesisState) -> Bool {
    if lhs._params != rhs._params {return false}
    if lhs.auctionRound != rhs.auctionRound {return false}
    if lhs._highestBid != rhs._highestBid {return false}
    if lhs.auctionEndingTimestamp != rhs.auctionEndingTimestamp {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
