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

scalapb.fs2.pubsub.grpc.internal.BorderStyle.scala Maven / Gradle / Ivy

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

package fs2.pubsub.grpc.internal

/** The style options for the border of a card or widget, including the border
  * type and color.
  *
  * [Google Workspace Add-ons and Chat
  * apps](https://developers.google.com/workspace/extend):
  *
  * @param type
  *   The border type.
  * @param strokeColor
  *   The colors to use when the type is `BORDER_TYPE_STROKE`.
  * @param cornerRadius
  *   The corner radius for the border.
  */
@SerialVersionUID(0L)
@scala.annotation.nowarn private[grpc]
final case class BorderStyle(
    `type`: fs2.pubsub.grpc.internal.BorderStyle.BorderType = fs2.pubsub.grpc.internal.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED,
    strokeColor: _root_.scala.Option[fs2.pubsub.grpc.internal.Color] = _root_.scala.None,
    cornerRadius: _root_.scala.Int = 0,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[BorderStyle] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = `type`.value
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(1, __value)
        }
      };
      if (strokeColor.isDefined) {
        val __value = strokeColor.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      
      {
        val __value = cornerRadius
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(3, __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 = `type`.value
        if (__v != 0) {
          _output__.writeEnum(1, __v)
        }
      };
      strokeColor.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      {
        val __v = cornerRadius
        if (__v != 0) {
          _output__.writeInt32(3, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withType(__v: fs2.pubsub.grpc.internal.BorderStyle.BorderType): BorderStyle = copy(`type` = __v)
    def getStrokeColor: fs2.pubsub.grpc.internal.Color = strokeColor.getOrElse(fs2.pubsub.grpc.internal.Color.defaultInstance)
    def clearStrokeColor: BorderStyle = copy(strokeColor = _root_.scala.None)
    def withStrokeColor(__v: fs2.pubsub.grpc.internal.Color): BorderStyle = copy(strokeColor = Option(__v))
    def withCornerRadius(__v: _root_.scala.Int): BorderStyle = copy(cornerRadius = __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 = `type`.javaValueDescriptor
          if (__t.getNumber() != 0) __t else null
        }
        case 2 => strokeColor.orNull
        case 3 => {
          val __t = cornerRadius
          if (__t != 0) __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.PEnum(`type`.scalaValueDescriptor)
        case 2 => strokeColor.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 3 => _root_.scalapb.descriptors.PInt(cornerRadius)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: fs2.pubsub.grpc.internal.BorderStyle.type = fs2.pubsub.grpc.internal.BorderStyle
    // @@protoc_insertion_point(GeneratedMessage[google.apps.card.v1.BorderStyle])
}

@scala.annotation.nowarn private[grpc]
object BorderStyle extends scalapb.GeneratedMessageCompanion[fs2.pubsub.grpc.internal.BorderStyle] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[fs2.pubsub.grpc.internal.BorderStyle] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): fs2.pubsub.grpc.internal.BorderStyle = {
    var __type: fs2.pubsub.grpc.internal.BorderStyle.BorderType = fs2.pubsub.grpc.internal.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED
    var __strokeColor: _root_.scala.Option[fs2.pubsub.grpc.internal.Color] = _root_.scala.None
    var __cornerRadius: _root_.scala.Int = 0
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 8 =>
          __type = fs2.pubsub.grpc.internal.BorderStyle.BorderType.fromValue(_input__.readEnum())
        case 18 =>
          __strokeColor = Option(__strokeColor.fold(_root_.scalapb.LiteParser.readMessage[fs2.pubsub.grpc.internal.Color](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 24 =>
          __cornerRadius = _input__.readInt32()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    fs2.pubsub.grpc.internal.BorderStyle(
        `type` = __type,
        strokeColor = __strokeColor,
        cornerRadius = __cornerRadius,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[fs2.pubsub.grpc.internal.BorderStyle] = _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.")
      fs2.pubsub.grpc.internal.BorderStyle(
        `type` = fs2.pubsub.grpc.internal.BorderStyle.BorderType.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(fs2.pubsub.grpc.internal.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED.scalaValueDescriptor).number),
        strokeColor = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[fs2.pubsub.grpc.internal.Color]]),
        cornerRadius = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Int]).getOrElse(0)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = CardProto.javaDescriptor.getMessageTypes().get(15)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = CardProto.scalaDescriptor.messages(15)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 2 => __out = fs2.pubsub.grpc.internal.Color
    }
    __out
  }
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = {
    (__fieldNumber: @_root_.scala.unchecked) match {
      case 1 => fs2.pubsub.grpc.internal.BorderStyle.BorderType
    }
  }
  lazy val defaultInstance = fs2.pubsub.grpc.internal.BorderStyle(
    `type` = fs2.pubsub.grpc.internal.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED,
    strokeColor = _root_.scala.None,
    cornerRadius = 0
  )
  /** Represents the border types applied to widgets.
    *
    * [Google Workspace Add-ons
    * and Chat apps](https://developers.google.com/workspace/extend):
    */
  sealed abstract class BorderType(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
    type EnumType = fs2.pubsub.grpc.internal.BorderStyle.BorderType
    type RecognizedType = fs2.pubsub.grpc.internal.BorderStyle.BorderType.Recognized
    def isBorderTypeUnspecified: _root_.scala.Boolean = false
    def isNoBorder: _root_.scala.Boolean = false
    def isStroke: _root_.scala.Boolean = false
    def companion: _root_.scalapb.GeneratedEnumCompanion[BorderType] = fs2.pubsub.grpc.internal.BorderStyle.BorderType
    final def asRecognized: _root_.scala.Option[fs2.pubsub.grpc.internal.BorderStyle.BorderType.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[fs2.pubsub.grpc.internal.BorderStyle.BorderType.Recognized])
  }
  
  object BorderType extends _root_.scalapb.GeneratedEnumCompanion[BorderType] {
    sealed trait Recognized extends BorderType
    implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[BorderType] = this
    
    /** Don't use. Unspecified.
      */
    @SerialVersionUID(0L)
    case object BORDER_TYPE_UNSPECIFIED extends BorderType(0) with BorderType.Recognized {
      val index = 0
      val name = "BORDER_TYPE_UNSPECIFIED"
      override def isBorderTypeUnspecified: _root_.scala.Boolean = true
    }
    
    /** Default value. No border.
      */
    @SerialVersionUID(0L)
    case object NO_BORDER extends BorderType(1) with BorderType.Recognized {
      val index = 1
      val name = "NO_BORDER"
      override def isNoBorder: _root_.scala.Boolean = true
    }
    
    /** Outline.
      */
    @SerialVersionUID(0L)
    case object STROKE extends BorderType(2) with BorderType.Recognized {
      val index = 2
      val name = "STROKE"
      override def isStroke: _root_.scala.Boolean = true
    }
    
    @SerialVersionUID(0L)
    final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends BorderType(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
    lazy val values: scala.collection.immutable.Seq[ValueType] = scala.collection.immutable.Seq(BORDER_TYPE_UNSPECIFIED, NO_BORDER, STROKE)
    def fromValue(__value: _root_.scala.Int): BorderType = __value match {
      case 0 => BORDER_TYPE_UNSPECIFIED
      case 1 => NO_BORDER
      case 2 => STROKE
      case __other => Unrecognized(__other)
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = fs2.pubsub.grpc.internal.BorderStyle.javaDescriptor.getEnumTypes().get(0)
    def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = fs2.pubsub.grpc.internal.BorderStyle.scalaDescriptor.enums(0)
  }
  implicit class BorderStyleLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, fs2.pubsub.grpc.internal.BorderStyle]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, fs2.pubsub.grpc.internal.BorderStyle](_l) {
    def `type`: _root_.scalapb.lenses.Lens[UpperPB, fs2.pubsub.grpc.internal.BorderStyle.BorderType] = field(_.`type`)((c_, f_) => c_.copy(`type` = f_))
    def strokeColor: _root_.scalapb.lenses.Lens[UpperPB, fs2.pubsub.grpc.internal.Color] = field(_.getStrokeColor)((c_, f_) => c_.copy(strokeColor = Option(f_)))
    def optionalStrokeColor: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[fs2.pubsub.grpc.internal.Color]] = field(_.strokeColor)((c_, f_) => c_.copy(strokeColor = f_))
    def cornerRadius: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.cornerRadius)((c_, f_) => c_.copy(cornerRadius = f_))
  }
  final val TYPE_FIELD_NUMBER = 1
  final val STROKE_COLOR_FIELD_NUMBER = 2
  final val CORNER_RADIUS_FIELD_NUMBER = 3
  def of(
    `type`: fs2.pubsub.grpc.internal.BorderStyle.BorderType,
    strokeColor: _root_.scala.Option[fs2.pubsub.grpc.internal.Color],
    cornerRadius: _root_.scala.Int
  ): _root_.fs2.pubsub.grpc.internal.BorderStyle = _root_.fs2.pubsub.grpc.internal.BorderStyle(
    `type`,
    strokeColor,
    cornerRadius
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[google.apps.card.v1.BorderStyle])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy