All Downloads are FREE. Search and download functionalities are using the official Maven repository.

verrpc.Version.scala Maven / Gradle / Ivy

The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package verrpc

/** @param commit
  *   A verbose description of the daemon's commit.
  * @param commitHash
  *   The SHA1 commit hash that the daemon is compiled with.
  * @param version
  *   The semantic version.
  * @param appMajor
  *   The major application version.
  * @param appMinor
  *   The minor application version.
  * @param appPatch
  *   The application patch number.
  * @param appPreRelease
  *   The application pre-release modifier, possibly empty.
  * @param buildTags
  *   The list of build tags that were supplied during compilation.
  * @param goVersion
  *   The version of go that compiled the executable.
  */
@SerialVersionUID(0L)
final case class Version(
    commit: _root_.scala.Predef.String = "",
    commitHash: _root_.scala.Predef.String = "",
    version: _root_.scala.Predef.String = "",
    appMajor: _root_.scala.Int = 0,
    appMinor: _root_.scala.Int = 0,
    appPatch: _root_.scala.Int = 0,
    appPreRelease: _root_.scala.Predef.String = "",
    buildTags: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty,
    goVersion: _root_.scala.Predef.String = "",
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Version] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = commit
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
        }
      };
      
      {
        val __value = commitHash
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value)
        }
      };
      
      {
        val __value = version
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value)
        }
      };
      
      {
        val __value = appMajor
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(4, __value)
        }
      };
      
      {
        val __value = appMinor
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(5, __value)
        }
      };
      
      {
        val __value = appPatch
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(6, __value)
        }
      };
      
      {
        val __value = appPreRelease
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(7, __value)
        }
      };
      buildTags.foreach { __item =>
        val __value = __item
        __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(8, __value)
      }
      
      {
        val __value = goVersion
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(9, __value)
        }
      };
      __size += unknownFields.serializedSize
      __size
    }
    override def serializedSize: _root_.scala.Int = {
      var __size = __serializedSizeMemoized
      if (__size == 0) {
        __size = __computeSerializedSize() + 1
        __serializedSizeMemoized = __size
      }
      __size - 1
      
    }
    def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
      {
        val __v = commit
        if (!__v.isEmpty) {
          _output__.writeString(1, __v)
        }
      };
      {
        val __v = commitHash
        if (!__v.isEmpty) {
          _output__.writeString(2, __v)
        }
      };
      {
        val __v = version
        if (!__v.isEmpty) {
          _output__.writeString(3, __v)
        }
      };
      {
        val __v = appMajor
        if (__v != 0) {
          _output__.writeUInt32(4, __v)
        }
      };
      {
        val __v = appMinor
        if (__v != 0) {
          _output__.writeUInt32(5, __v)
        }
      };
      {
        val __v = appPatch
        if (__v != 0) {
          _output__.writeUInt32(6, __v)
        }
      };
      {
        val __v = appPreRelease
        if (!__v.isEmpty) {
          _output__.writeString(7, __v)
        }
      };
      buildTags.foreach { __v =>
        val __m = __v
        _output__.writeString(8, __m)
      };
      {
        val __v = goVersion
        if (!__v.isEmpty) {
          _output__.writeString(9, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withCommit(__v: _root_.scala.Predef.String): Version = copy(commit = __v)
    def withCommitHash(__v: _root_.scala.Predef.String): Version = copy(commitHash = __v)
    def withVersion(__v: _root_.scala.Predef.String): Version = copy(version = __v)
    def withAppMajor(__v: _root_.scala.Int): Version = copy(appMajor = __v)
    def withAppMinor(__v: _root_.scala.Int): Version = copy(appMinor = __v)
    def withAppPatch(__v: _root_.scala.Int): Version = copy(appPatch = __v)
    def withAppPreRelease(__v: _root_.scala.Predef.String): Version = copy(appPreRelease = __v)
    def clearBuildTags = copy(buildTags = _root_.scala.Seq.empty)
    def addBuildTags(__vs: _root_.scala.Predef.String *): Version = addAllBuildTags(__vs)
    def addAllBuildTags(__vs: Iterable[_root_.scala.Predef.String]): Version = copy(buildTags = buildTags ++ __vs)
    def withBuildTags(__v: _root_.scala.Seq[_root_.scala.Predef.String]): Version = copy(buildTags = __v)
    def withGoVersion(__v: _root_.scala.Predef.String): Version = copy(goVersion = __v)
    def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
    def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
    def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 1 => {
          val __t = commit
          if (__t != "") __t else null
        }
        case 2 => {
          val __t = commitHash
          if (__t != "") __t else null
        }
        case 3 => {
          val __t = version
          if (__t != "") __t else null
        }
        case 4 => {
          val __t = appMajor
          if (__t != 0) __t else null
        }
        case 5 => {
          val __t = appMinor
          if (__t != 0) __t else null
        }
        case 6 => {
          val __t = appPatch
          if (__t != 0) __t else null
        }
        case 7 => {
          val __t = appPreRelease
          if (__t != "") __t else null
        }
        case 8 => buildTags
        case 9 => {
          val __t = goVersion
          if (__t != "") __t else null
        }
      }
    }
    def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
      _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
      (__field.number: @_root_.scala.unchecked) match {
        case 1 => _root_.scalapb.descriptors.PString(commit)
        case 2 => _root_.scalapb.descriptors.PString(commitHash)
        case 3 => _root_.scalapb.descriptors.PString(version)
        case 4 => _root_.scalapb.descriptors.PInt(appMajor)
        case 5 => _root_.scalapb.descriptors.PInt(appMinor)
        case 6 => _root_.scalapb.descriptors.PInt(appPatch)
        case 7 => _root_.scalapb.descriptors.PString(appPreRelease)
        case 8 => _root_.scalapb.descriptors.PRepeated(buildTags.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector)
        case 9 => _root_.scalapb.descriptors.PString(goVersion)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: verrpc.Version.type = verrpc.Version
    // @@protoc_insertion_point(GeneratedMessage[verrpc.Version])
}

object Version extends scalapb.GeneratedMessageCompanion[verrpc.Version] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[verrpc.Version] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): verrpc.Version = {
    var __commit: _root_.scala.Predef.String = ""
    var __commitHash: _root_.scala.Predef.String = ""
    var __version: _root_.scala.Predef.String = ""
    var __appMajor: _root_.scala.Int = 0
    var __appMinor: _root_.scala.Int = 0
    var __appPatch: _root_.scala.Int = 0
    var __appPreRelease: _root_.scala.Predef.String = ""
    val __buildTags: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String]
    var __goVersion: _root_.scala.Predef.String = ""
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __commit = _input__.readStringRequireUtf8()
        case 18 =>
          __commitHash = _input__.readStringRequireUtf8()
        case 26 =>
          __version = _input__.readStringRequireUtf8()
        case 32 =>
          __appMajor = _input__.readUInt32()
        case 40 =>
          __appMinor = _input__.readUInt32()
        case 48 =>
          __appPatch = _input__.readUInt32()
        case 58 =>
          __appPreRelease = _input__.readStringRequireUtf8()
        case 66 =>
          __buildTags += _input__.readStringRequireUtf8()
        case 74 =>
          __goVersion = _input__.readStringRequireUtf8()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    verrpc.Version(
        commit = __commit,
        commitHash = __commitHash,
        version = __version,
        appMajor = __appMajor,
        appMinor = __appMinor,
        appPatch = __appPatch,
        appPreRelease = __appPreRelease,
        buildTags = __buildTags.result(),
        goVersion = __goVersion,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[verrpc.Version] = _root_.scalapb.descriptors.Reads{
    case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
      _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
      verrpc.Version(
        commit = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        commitHash = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        version = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        appMajor = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        appMinor = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        appPatch = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        appPreRelease = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        buildTags = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty),
        goVersion = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = VerrpcProto.javaDescriptor.getMessageTypes().get(1)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = VerrpcProto.scalaDescriptor.messages(1)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = throw new MatchError(__number)
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = verrpc.Version(
    commit = "",
    commitHash = "",
    version = "",
    appMajor = 0,
    appMinor = 0,
    appPatch = 0,
    appPreRelease = "",
    buildTags = _root_.scala.Seq.empty,
    goVersion = ""
  )
  implicit class VersionLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, verrpc.Version]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, verrpc.Version](_l) {
    def commit: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.commit)((c_, f_) => c_.copy(commit = f_))
    def commitHash: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.commitHash)((c_, f_) => c_.copy(commitHash = f_))
    def version: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.version)((c_, f_) => c_.copy(version = f_))
    def appMajor: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.appMajor)((c_, f_) => c_.copy(appMajor = f_))
    def appMinor: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.appMinor)((c_, f_) => c_.copy(appMinor = f_))
    def appPatch: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.appPatch)((c_, f_) => c_.copy(appPatch = f_))
    def appPreRelease: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.appPreRelease)((c_, f_) => c_.copy(appPreRelease = f_))
    def buildTags: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.buildTags)((c_, f_) => c_.copy(buildTags = f_))
    def goVersion: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.goVersion)((c_, f_) => c_.copy(goVersion = f_))
  }
  final val COMMIT_FIELD_NUMBER = 1
  final val COMMIT_HASH_FIELD_NUMBER = 2
  final val VERSION_FIELD_NUMBER = 3
  final val APP_MAJOR_FIELD_NUMBER = 4
  final val APP_MINOR_FIELD_NUMBER = 5
  final val APP_PATCH_FIELD_NUMBER = 6
  final val APP_PRE_RELEASE_FIELD_NUMBER = 7
  final val BUILD_TAGS_FIELD_NUMBER = 8
  final val GO_VERSION_FIELD_NUMBER = 9
  def of(
    commit: _root_.scala.Predef.String,
    commitHash: _root_.scala.Predef.String,
    version: _root_.scala.Predef.String,
    appMajor: _root_.scala.Int,
    appMinor: _root_.scala.Int,
    appPatch: _root_.scala.Int,
    appPreRelease: _root_.scala.Predef.String,
    buildTags: _root_.scala.Seq[_root_.scala.Predef.String],
    goVersion: _root_.scala.Predef.String
  ): _root_.verrpc.Version = _root_.verrpc.Version(
    commit,
    commitHash,
    version,
    appMajor,
    appMinor,
    appPatch,
    appPreRelease,
    buildTags,
    goVersion
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[verrpc.Version])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy