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

/// Minter represents the minting state.
struct Stargaze_Mint_V1beta1_Minter {
  // 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.

  /// current annual expected provisions
  var annualProvisions: String = String()

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

/// Params holds parameters for the mint module.
struct Stargaze_Mint_V1beta1_Params {
  // 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.

  /// type of coin to mint
  var mintDenom: String = String()

  /// the time the chain starts
  var startTime: SwiftProtobuf.Google_Protobuf_Timestamp {
    get {return _startTime ?? SwiftProtobuf.Google_Protobuf_Timestamp()}
    set {_startTime = newValue}
  }
  /// Returns true if `startTime` has been explicitly set.
  var hasStartTime: Bool {return self._startTime != nil}
  /// Clears the value of `startTime`. Subsequent reads from it will return its default value.
  mutating func clearStartTime() {self._startTime = nil}

  /// initial annual provisions
  var initialAnnualProvisions: String = String()

  /// factor to reduce inflation by each year
  var reductionFactor: String = String()

  /// expected blocks per year
  var blocksPerYear: UInt64 = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _startTime: SwiftProtobuf.Google_Protobuf_Timestamp? = nil
}

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

fileprivate let _protobuf_package = "stargaze.mint.v1beta1"

extension Stargaze_Mint_V1beta1_Minter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Minter"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "annual_provisions"),
  ]

  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.decodeSingularStringField(value: &self.annualProvisions) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.annualProvisions.isEmpty {
      try visitor.visitSingularStringField(value: self.annualProvisions, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

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

extension Stargaze_Mint_V1beta1_Params: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Params"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "mint_denom"),
    2: .standard(proto: "start_time"),
    3: .standard(proto: "initial_annual_provisions"),
    4: .standard(proto: "reduction_factor"),
    5: .standard(proto: "blocks_per_year"),
  ]

  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.decodeSingularStringField(value: &self.mintDenom) }()
      case 2: try { try decoder.decodeSingularMessageField(value: &self._startTime) }()
      case 3: try { try decoder.decodeSingularStringField(value: &self.initialAnnualProvisions) }()
      case 4: try { try decoder.decodeSingularStringField(value: &self.reductionFactor) }()
      case 5: try { try decoder.decodeSingularUInt64Field(value: &self.blocksPerYear) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.mintDenom.isEmpty {
      try visitor.visitSingularStringField(value: self.mintDenom, fieldNumber: 1)
    }
    if let v = self._startTime {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
    }
    if !self.initialAnnualProvisions.isEmpty {
      try visitor.visitSingularStringField(value: self.initialAnnualProvisions, fieldNumber: 3)
    }
    if !self.reductionFactor.isEmpty {
      try visitor.visitSingularStringField(value: self.reductionFactor, fieldNumber: 4)
    }
    if self.blocksPerYear != 0 {
      try visitor.visitSingularUInt64Field(value: self.blocksPerYear, fieldNumber: 5)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: Stargaze_Mint_V1beta1_Params, rhs: Stargaze_Mint_V1beta1_Params) -> Bool {
    if lhs.mintDenom != rhs.mintDenom {return false}
    if lhs._startTime != rhs._startTime {return false}
    if lhs.initialAnnualProvisions != rhs.initialAnnualProvisions {return false}
    if lhs.reductionFactor != rhs.reductionFactor {return false}
    if lhs.blocksPerYear != rhs.blocksPerYear {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
