scalapb.mdg.engine.proto.reports.FieldStat.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
/** @param returnType
* required; eg "String!" for User.email:String!
* @param latencyCount
* Duration histogram; see docs/histograms.md
*/
@SerialVersionUID(0L)
final case class FieldStat(
returnType: _root_.scala.Predef.String = "",
errorsCount: _root_.scala.Long = 0L,
count: _root_.scala.Long = 0L,
requestsWithErrorsCount: _root_.scala.Long = 0L,
latencyCount: _root_.scala.Seq[_root_.scala.Long] = _root_.scala.Seq.empty,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[FieldStat] {
private[this] def latencyCountSerializedSize = {
if (__latencyCountSerializedSizeField == 0) __latencyCountSerializedSizeField = {
var __s: _root_.scala.Int = 0
latencyCount.foreach(__i => __s += _root_.com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(__i))
__s
}
__latencyCountSerializedSizeField
}
@transient private[this] var __latencyCountSerializedSizeField: _root_.scala.Int = 0
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = returnType
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value)
}
};
{
val __value = errorsCount
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(4, __value)
}
};
{
val __value = count
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(5, __value)
}
};
{
val __value = requestsWithErrorsCount
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(6, __value)
}
};
if (latencyCount.nonEmpty) {
val __localsize = latencyCountSerializedSize
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__localsize) + __localsize
}
__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 = returnType
if (!__v.isEmpty) {
_output__.writeString(3, __v)
}
};
{
val __v = errorsCount
if (__v != 0L) {
_output__.writeUInt64(4, __v)
}
};
{
val __v = count
if (__v != 0L) {
_output__.writeUInt64(5, __v)
}
};
{
val __v = requestsWithErrorsCount
if (__v != 0L) {
_output__.writeUInt64(6, __v)
}
};
if (latencyCount.nonEmpty) {
_output__.writeTag(8, 2)
_output__.writeUInt32NoTag(latencyCountSerializedSize)
latencyCount.foreach(_output__.writeInt64NoTag)
};
unknownFields.writeTo(_output__)
}
def withReturnType(__v: _root_.scala.Predef.String): FieldStat = copy(returnType = __v)
def withErrorsCount(__v: _root_.scala.Long): FieldStat = copy(errorsCount = __v)
def withCount(__v: _root_.scala.Long): FieldStat = copy(count = __v)
def withRequestsWithErrorsCount(__v: _root_.scala.Long): FieldStat = copy(requestsWithErrorsCount = __v)
def clearLatencyCount = copy(latencyCount = _root_.scala.Seq.empty)
def addLatencyCount(__vs: _root_.scala.Long *): FieldStat = addAllLatencyCount(__vs)
def addAllLatencyCount(__vs: Iterable[_root_.scala.Long]): FieldStat = copy(latencyCount = latencyCount ++ __vs)
def withLatencyCount(__v: _root_.scala.Seq[_root_.scala.Long]): FieldStat = copy(latencyCount = __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 3 => {
val __t = returnType
if (__t != "") __t else null
}
case 4 => {
val __t = errorsCount
if (__t != 0L) __t else null
}
case 5 => {
val __t = count
if (__t != 0L) __t else null
}
case 6 => {
val __t = requestsWithErrorsCount
if (__t != 0L) __t else null
}
case 8 => latencyCount
}
}
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 3 => _root_.scalapb.descriptors.PString(returnType)
case 4 => _root_.scalapb.descriptors.PLong(errorsCount)
case 5 => _root_.scalapb.descriptors.PLong(count)
case 6 => _root_.scalapb.descriptors.PLong(requestsWithErrorsCount)
case 8 => _root_.scalapb.descriptors.PRepeated(latencyCount.iterator.map(_root_.scalapb.descriptors.PLong(_)).toVector)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: mdg.engine.proto.reports.FieldStat.type = mdg.engine.proto.reports.FieldStat
// @@protoc_insertion_point(GeneratedMessage[mdg.engine.proto.FieldStat])
}
object FieldStat extends scalapb.GeneratedMessageCompanion[mdg.engine.proto.reports.FieldStat] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[mdg.engine.proto.reports.FieldStat] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): mdg.engine.proto.reports.FieldStat = {
var __returnType: _root_.scala.Predef.String = ""
var __errorsCount: _root_.scala.Long = 0L
var __count: _root_.scala.Long = 0L
var __requestsWithErrorsCount: _root_.scala.Long = 0L
val __latencyCount: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Long] = new _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Long]
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 26 =>
__returnType = _input__.readStringRequireUtf8()
case 32 =>
__errorsCount = _input__.readUInt64()
case 40 =>
__count = _input__.readUInt64()
case 48 =>
__requestsWithErrorsCount = _input__.readUInt64()
case 64 =>
__latencyCount += _input__.readInt64()
case 66 => {
val length = _input__.readRawVarint32()
val oldLimit = _input__.pushLimit(length)
while (_input__.getBytesUntilLimit > 0) {
__latencyCount += _input__.readInt64()
}
_input__.popLimit(oldLimit)
}
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
mdg.engine.proto.reports.FieldStat(
returnType = __returnType,
errorsCount = __errorsCount,
count = __count,
requestsWithErrorsCount = __requestsWithErrorsCount,
latencyCount = __latencyCount.result(),
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[mdg.engine.proto.reports.FieldStat] = _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.FieldStat(
returnType = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
errorsCount = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
count = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
requestsWithErrorsCount = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
latencyCount = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Seq[_root_.scala.Long]]).getOrElse(_root_.scala.Seq.empty)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ReportsProto.javaDescriptor.getMessageTypes().get(7)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ReportsProto.scalaDescriptor.messages(7)
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.FieldStat(
returnType = "",
errorsCount = 0L,
count = 0L,
requestsWithErrorsCount = 0L,
latencyCount = _root_.scala.Seq.empty
)
implicit class FieldStatLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, mdg.engine.proto.reports.FieldStat]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, mdg.engine.proto.reports.FieldStat](_l) {
def returnType: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.returnType)((c_, f_) => c_.copy(returnType = f_))
def errorsCount: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.errorsCount)((c_, f_) => c_.copy(errorsCount = f_))
def count: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.count)((c_, f_) => c_.copy(count = f_))
def requestsWithErrorsCount: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.requestsWithErrorsCount)((c_, f_) => c_.copy(requestsWithErrorsCount = f_))
def latencyCount: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Long]] = field(_.latencyCount)((c_, f_) => c_.copy(latencyCount = f_))
}
final val RETURN_TYPE_FIELD_NUMBER = 3
final val ERRORS_COUNT_FIELD_NUMBER = 4
final val COUNT_FIELD_NUMBER = 5
final val REQUESTS_WITH_ERRORS_COUNT_FIELD_NUMBER = 6
final val LATENCY_COUNT_FIELD_NUMBER = 8
def of(
returnType: _root_.scala.Predef.String,
errorsCount: _root_.scala.Long,
count: _root_.scala.Long,
requestsWithErrorsCount: _root_.scala.Long,
latencyCount: _root_.scala.Seq[_root_.scala.Long]
): _root_.mdg.engine.proto.reports.FieldStat = _root_.mdg.engine.proto.reports.FieldStat(
returnType,
errorsCount,
count,
requestsWithErrorsCount,
latencyCount
)
// @@protoc_insertion_point(GeneratedMessageCompanion[mdg.engine.proto.FieldStat])
}