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

scalapb.mdg.engine.proto.reports.ReportHeader.scala Maven / Gradle / Ivy

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

package mdg.engine.proto.reports

/** The `service` value embedded within the header key is not guaranteed to contain an actual service,
  * and, in most cases, the service information is trusted to come from upstream processing. If the
  * service _is_ specified in this header, then it is checked to match the context that is reporting it.
  * Otherwise, the service information is deduced from the token context of the reporter and then sent
  * along via other mechanisms (in Kafka, the `ReportKafkaKey). The other information (hostname,
  * agent_version, etc.) is sent by the Apollo Engine Reporting agent, but we do not currently save that
  * information to any of our persistent storage.
  *
  * @param hostname
  *   eg "host-01.example.com"
  * @param agentVersion
  *   eg "engineproxy 0.1.0"
  *   required
  * @param serviceVersion
  *   eg "prod-4279-20160804T065423Z-5-g3cf0aa8" (taken from `git describe --tags`)
  * @param runtimeVersion
  *   eg "node v4.6.0"
  * @param uname
  *   eg "Linux box 4.6.5-1-ec2 #1 SMP Mon Aug 1 02:31:38 PDT 2016 x86_64 GNU/Linux"
  * @param schemaTag
  *   eg "current", "prod"
  * @param executableSchemaId
  *   An id that is used to represent the schema to Apollo Graph Manager
  *   Using this in place of what used to be schema_hash, since that is no longer
  *   attached to a schema in the backend.
  */
@SerialVersionUID(0L)
final case class ReportHeader(
    hostname: _root_.scala.Predef.String = "",
    agentVersion: _root_.scala.Predef.String = "",
    serviceVersion: _root_.scala.Predef.String = "",
    runtimeVersion: _root_.scala.Predef.String = "",
    uname: _root_.scala.Predef.String = "",
    schemaTag: _root_.scala.Predef.String = "",
    executableSchemaId: _root_.scala.Predef.String = "",
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ReportHeader] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = hostname
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __value)
        }
      };
      
      {
        val __value = agentVersion
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(6, __value)
        }
      };
      
      {
        val __value = serviceVersion
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(7, __value)
        }
      };
      
      {
        val __value = runtimeVersion
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(8, __value)
        }
      };
      
      {
        val __value = uname
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(9, __value)
        }
      };
      
      {
        val __value = schemaTag
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(10, __value)
        }
      };
      
      {
        val __value = executableSchemaId
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(11, __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 = hostname
        if (!__v.isEmpty) {
          _output__.writeString(5, __v)
        }
      };
      {
        val __v = agentVersion
        if (!__v.isEmpty) {
          _output__.writeString(6, __v)
        }
      };
      {
        val __v = serviceVersion
        if (!__v.isEmpty) {
          _output__.writeString(7, __v)
        }
      };
      {
        val __v = runtimeVersion
        if (!__v.isEmpty) {
          _output__.writeString(8, __v)
        }
      };
      {
        val __v = uname
        if (!__v.isEmpty) {
          _output__.writeString(9, __v)
        }
      };
      {
        val __v = schemaTag
        if (!__v.isEmpty) {
          _output__.writeString(10, __v)
        }
      };
      {
        val __v = executableSchemaId
        if (!__v.isEmpty) {
          _output__.writeString(11, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withHostname(__v: _root_.scala.Predef.String): ReportHeader = copy(hostname = __v)
    def withAgentVersion(__v: _root_.scala.Predef.String): ReportHeader = copy(agentVersion = __v)
    def withServiceVersion(__v: _root_.scala.Predef.String): ReportHeader = copy(serviceVersion = __v)
    def withRuntimeVersion(__v: _root_.scala.Predef.String): ReportHeader = copy(runtimeVersion = __v)
    def withUname(__v: _root_.scala.Predef.String): ReportHeader = copy(uname = __v)
    def withSchemaTag(__v: _root_.scala.Predef.String): ReportHeader = copy(schemaTag = __v)
    def withExecutableSchemaId(__v: _root_.scala.Predef.String): ReportHeader = copy(executableSchemaId = __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 5 => {
          val __t = hostname
          if (__t != "") __t else null
        }
        case 6 => {
          val __t = agentVersion
          if (__t != "") __t else null
        }
        case 7 => {
          val __t = serviceVersion
          if (__t != "") __t else null
        }
        case 8 => {
          val __t = runtimeVersion
          if (__t != "") __t else null
        }
        case 9 => {
          val __t = uname
          if (__t != "") __t else null
        }
        case 10 => {
          val __t = schemaTag
          if (__t != "") __t else null
        }
        case 11 => {
          val __t = executableSchemaId
          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 5 => _root_.scalapb.descriptors.PString(hostname)
        case 6 => _root_.scalapb.descriptors.PString(agentVersion)
        case 7 => _root_.scalapb.descriptors.PString(serviceVersion)
        case 8 => _root_.scalapb.descriptors.PString(runtimeVersion)
        case 9 => _root_.scalapb.descriptors.PString(uname)
        case 10 => _root_.scalapb.descriptors.PString(schemaTag)
        case 11 => _root_.scalapb.descriptors.PString(executableSchemaId)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: mdg.engine.proto.reports.ReportHeader.type = mdg.engine.proto.reports.ReportHeader
    // @@protoc_insertion_point(GeneratedMessage[mdg.engine.proto.ReportHeader])
}

object ReportHeader extends scalapb.GeneratedMessageCompanion[mdg.engine.proto.reports.ReportHeader] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[mdg.engine.proto.reports.ReportHeader] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): mdg.engine.proto.reports.ReportHeader = {
    var __hostname: _root_.scala.Predef.String = ""
    var __agentVersion: _root_.scala.Predef.String = ""
    var __serviceVersion: _root_.scala.Predef.String = ""
    var __runtimeVersion: _root_.scala.Predef.String = ""
    var __uname: _root_.scala.Predef.String = ""
    var __schemaTag: _root_.scala.Predef.String = ""
    var __executableSchemaId: _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 42 =>
          __hostname = _input__.readStringRequireUtf8()
        case 50 =>
          __agentVersion = _input__.readStringRequireUtf8()
        case 58 =>
          __serviceVersion = _input__.readStringRequireUtf8()
        case 66 =>
          __runtimeVersion = _input__.readStringRequireUtf8()
        case 74 =>
          __uname = _input__.readStringRequireUtf8()
        case 82 =>
          __schemaTag = _input__.readStringRequireUtf8()
        case 90 =>
          __executableSchemaId = _input__.readStringRequireUtf8()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    mdg.engine.proto.reports.ReportHeader(
        hostname = __hostname,
        agentVersion = __agentVersion,
        serviceVersion = __serviceVersion,
        runtimeVersion = __runtimeVersion,
        uname = __uname,
        schemaTag = __schemaTag,
        executableSchemaId = __executableSchemaId,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[mdg.engine.proto.reports.ReportHeader] = _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.")
      mdg.engine.proto.reports.ReportHeader(
        hostname = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        agentVersion = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        serviceVersion = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        runtimeVersion = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        uname = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        schemaTag = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        executableSchemaId = __fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ReportsProto.javaDescriptor.getMessageTypes().get(1)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ReportsProto.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 = mdg.engine.proto.reports.ReportHeader(
    hostname = "",
    agentVersion = "",
    serviceVersion = "",
    runtimeVersion = "",
    uname = "",
    schemaTag = "",
    executableSchemaId = ""
  )
  implicit class ReportHeaderLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, mdg.engine.proto.reports.ReportHeader]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, mdg.engine.proto.reports.ReportHeader](_l) {
    def hostname: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.hostname)((c_, f_) => c_.copy(hostname = f_))
    def agentVersion: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.agentVersion)((c_, f_) => c_.copy(agentVersion = f_))
    def serviceVersion: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.serviceVersion)((c_, f_) => c_.copy(serviceVersion = f_))
    def runtimeVersion: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.runtimeVersion)((c_, f_) => c_.copy(runtimeVersion = f_))
    def uname: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.uname)((c_, f_) => c_.copy(uname = f_))
    def schemaTag: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.schemaTag)((c_, f_) => c_.copy(schemaTag = f_))
    def executableSchemaId: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.executableSchemaId)((c_, f_) => c_.copy(executableSchemaId = f_))
  }
  final val HOSTNAME_FIELD_NUMBER = 5
  final val AGENT_VERSION_FIELD_NUMBER = 6
  final val SERVICE_VERSION_FIELD_NUMBER = 7
  final val RUNTIME_VERSION_FIELD_NUMBER = 8
  final val UNAME_FIELD_NUMBER = 9
  final val SCHEMA_TAG_FIELD_NUMBER = 10
  final val EXECUTABLE_SCHEMA_ID_FIELD_NUMBER = 11
  def of(
    hostname: _root_.scala.Predef.String,
    agentVersion: _root_.scala.Predef.String,
    serviceVersion: _root_.scala.Predef.String,
    runtimeVersion: _root_.scala.Predef.String,
    uname: _root_.scala.Predef.String,
    schemaTag: _root_.scala.Predef.String,
    executableSchemaId: _root_.scala.Predef.String
  ): _root_.mdg.engine.proto.reports.ReportHeader = _root_.mdg.engine.proto.reports.ReportHeader(
    hostname,
    agentVersion,
    serviceVersion,
    runtimeVersion,
    uname,
    schemaTag,
    executableSchemaId
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[mdg.engine.proto.ReportHeader])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy