com.google.api.consumer.Property.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pekko-connectors-google-cloud-bigquery-storage_3 Show documentation
Show all versions of pekko-connectors-google-cloud-bigquery-storage_3 Show documentation
Apache Pekko Connectors is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Pekko.
The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package com.google.api.consumer
/** Defines project properties.
*
* API services can define properties that can be assigned to consumer projects
* so that backends can perform response customization without having to make
* additional calls or maintain additional storage. For example, Maps API
* defines properties that controls map tile cache period, or whether to embed a
* watermark in a result.
*
* These values can be set via API producer console. Only API providers can
* define and set these properties.
*
* @param name
* The name of the property (a.k.a key).
* @param type
* The type of this property.
* @param description
* The description of the property
*/
@SerialVersionUID(0L)
final case class Property(
name: _root_.scala.Predef.String = "",
`type`: com.google.api.consumer.Property.PropertyType = com.google.api.consumer.Property.PropertyType.UNSPECIFIED,
description: _root_.scala.Predef.String = "",
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Property] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = name
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
}
};
{
val __value = `type`.value
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(2, __value)
}
};
{
val __value = description
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(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 = name
if (!__v.isEmpty) {
_output__.writeString(1, __v)
}
};
{
val __v = `type`.value
if (__v != 0) {
_output__.writeEnum(2, __v)
}
};
{
val __v = description
if (!__v.isEmpty) {
_output__.writeString(3, __v)
}
};
unknownFields.writeTo(_output__)
}
def withName(__v: _root_.scala.Predef.String): Property = copy(name = __v)
def withType(__v: com.google.api.consumer.Property.PropertyType): Property = copy(`type` = __v)
def withDescription(__v: _root_.scala.Predef.String): Property = copy(description = __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 = name
if (__t != "") __t else null
}
case 2 => {
val __t = `type`.javaValueDescriptor
if (__t.getNumber() != 0) __t else null
}
case 3 => {
val __t = description
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(name)
case 2 => _root_.scalapb.descriptors.PEnum(`type`.scalaValueDescriptor)
case 3 => _root_.scalapb.descriptors.PString(description)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: com.google.api.consumer.Property.type = com.google.api.consumer.Property
// @@protoc_insertion_point(GeneratedMessage[google.api.Property])
}
object Property extends scalapb.GeneratedMessageCompanion[com.google.api.consumer.Property] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.google.api.consumer.Property] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.google.api.consumer.Property = {
var __name: _root_.scala.Predef.String = ""
var __type: com.google.api.consumer.Property.PropertyType = com.google.api.consumer.Property.PropertyType.UNSPECIFIED
var __description: _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 =>
__name = _input__.readStringRequireUtf8()
case 16 =>
__type = com.google.api.consumer.Property.PropertyType.fromValue(_input__.readEnum())
case 26 =>
__description = _input__.readStringRequireUtf8()
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
com.google.api.consumer.Property(
name = __name,
`type` = __type,
description = __description,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[com.google.api.consumer.Property] = _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.")
com.google.api.consumer.Property(
name = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
`type` = com.google.api.consumer.Property.PropertyType.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(com.google.api.consumer.Property.PropertyType.UNSPECIFIED.scalaValueDescriptor).number),
description = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ConsumerProto.javaDescriptor.getMessageTypes().get(1)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ConsumerProto.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[_] = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 2 => com.google.api.consumer.Property.PropertyType
}
}
lazy val defaultInstance = com.google.api.consumer.Property(
name = "",
`type` = com.google.api.consumer.Property.PropertyType.UNSPECIFIED,
description = ""
)
/** Supported data type of the property values
*/
sealed abstract class PropertyType(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
type EnumType = com.google.api.consumer.Property.PropertyType
type RecognizedType = com.google.api.consumer.Property.PropertyType.Recognized
def isUnspecified: _root_.scala.Boolean = false
def isInt64: _root_.scala.Boolean = false
def isBool: _root_.scala.Boolean = false
def isString: _root_.scala.Boolean = false
def isDouble: _root_.scala.Boolean = false
def companion: _root_.scalapb.GeneratedEnumCompanion[PropertyType] = com.google.api.consumer.Property.PropertyType
final def asRecognized: _root_.scala.Option[com.google.api.consumer.Property.PropertyType.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[com.google.api.consumer.Property.PropertyType.Recognized])
}
object PropertyType extends _root_.scalapb.GeneratedEnumCompanion[PropertyType] {
sealed trait Recognized extends PropertyType
implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[PropertyType] = this
/** The type is unspecified, and will result in an error.
*/
@SerialVersionUID(0L)
case object UNSPECIFIED extends PropertyType(0) with PropertyType.Recognized {
val index = 0
val name = "UNSPECIFIED"
override def isUnspecified: _root_.scala.Boolean = true
}
/** The type is `int64`.
*/
@SerialVersionUID(0L)
case object INT64 extends PropertyType(1) with PropertyType.Recognized {
val index = 1
val name = "INT64"
override def isInt64: _root_.scala.Boolean = true
}
/** The type is `bool`.
*/
@SerialVersionUID(0L)
case object BOOL extends PropertyType(2) with PropertyType.Recognized {
val index = 2
val name = "BOOL"
override def isBool: _root_.scala.Boolean = true
}
/** The type is `string`.
*/
@SerialVersionUID(0L)
case object STRING extends PropertyType(3) with PropertyType.Recognized {
val index = 3
val name = "STRING"
override def isString: _root_.scala.Boolean = true
}
/** The type is 'double'.
*/
@SerialVersionUID(0L)
case object DOUBLE extends PropertyType(4) with PropertyType.Recognized {
val index = 4
val name = "DOUBLE"
override def isDouble: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends PropertyType(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
lazy val values: scala.collection.immutable.Seq[ValueType] = scala.collection.immutable.Seq(UNSPECIFIED, INT64, BOOL, STRING, DOUBLE)
def fromValue(__value: _root_.scala.Int): PropertyType = __value match {
case 0 => UNSPECIFIED
case 1 => INT64
case 2 => BOOL
case 3 => STRING
case 4 => DOUBLE
case __other => Unrecognized(__other)
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = com.google.api.consumer.Property.javaDescriptor.getEnumTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = com.google.api.consumer.Property.scalaDescriptor.enums(0)
}
implicit class PropertyLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.google.api.consumer.Property]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.google.api.consumer.Property](_l) {
def name: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.name)((c_, f_) => c_.copy(name = f_))
def `type`: _root_.scalapb.lenses.Lens[UpperPB, com.google.api.consumer.Property.PropertyType] = field(_.`type`)((c_, f_) => c_.copy(`type` = f_))
def description: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.description)((c_, f_) => c_.copy(description = f_))
}
final val NAME_FIELD_NUMBER = 1
final val TYPE_FIELD_NUMBER = 2
final val DESCRIPTION_FIELD_NUMBER = 3
def of(
name: _root_.scala.Predef.String,
`type`: com.google.api.consumer.Property.PropertyType,
description: _root_.scala.Predef.String
): _root_.com.google.api.consumer.Property = _root_.com.google.api.consumer.Property(
name,
`type`,
description
)
// @@protoc_insertion_point(GeneratedMessageCompanion[google.api.Property])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy