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

com.google.api.logging.Logging.scala Maven / Gradle / Ivy

Go to download

Apache Pekko Connectors is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Pekko.

There is a newer version: 1.1.0
Show newest version
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package com.google.api.logging

/** Logging configuration of the service.
  *
  * The following example shows how to configure logs to be sent to the
  * producer and consumer projects. In the example, the `activity_history`
  * log is sent to both the producer and consumer projects, whereas the
  * `purchase_history` log is only sent to the producer project.
  *
  *     monitored_resources:
  *     - type: library.googleapis.com/branch
  *       labels:
  *       - key: /city
  *         description: The city where the library branch is located in.
  *       - key: /name
  *         description: The name of the branch.
  *     logs:
  *     - name: activity_history
  *       labels:
  *       - key: /customer_id
  *     - name: purchase_history
  *     logging:
  *       producer_destinations:
  *       - monitored_resource: library.googleapis.com/branch
  *         logs:
  *         - activity_history
  *         - purchase_history
  *       consumer_destinations:
  *       - monitored_resource: library.googleapis.com/branch
  *         logs:
  *         - activity_history
  *
  * @param producerDestinations
  *   Logging configurations for sending logs to the producer project.
  *   There can be multiple producer destinations, each one must have a
  *   different monitored resource type. A log can be used in at most
  *   one producer destination.
  * @param consumerDestinations
  *   Logging configurations for sending logs to the consumer project.
  *   There can be multiple consumer destinations, each one must have a
  *   different monitored resource type. A log can be used in at most
  *   one consumer destination.
  */
@SerialVersionUID(0L)
final case class Logging(
    producerDestinations: _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination] = _root_.scala.Seq.empty,
    consumerDestinations: _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination] = _root_.scala.Seq.empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Logging] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      producerDestinations.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      consumerDestinations.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      __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 = {
      producerDestinations.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      consumerDestinations.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def clearProducerDestinations = copy(producerDestinations = _root_.scala.Seq.empty)
    def addProducerDestinations(__vs: com.google.api.logging.Logging.LoggingDestination *): Logging = addAllProducerDestinations(__vs)
    def addAllProducerDestinations(__vs: Iterable[com.google.api.logging.Logging.LoggingDestination]): Logging = copy(producerDestinations = producerDestinations ++ __vs)
    def withProducerDestinations(__v: _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination]): Logging = copy(producerDestinations = __v)
    def clearConsumerDestinations = copy(consumerDestinations = _root_.scala.Seq.empty)
    def addConsumerDestinations(__vs: com.google.api.logging.Logging.LoggingDestination *): Logging = addAllConsumerDestinations(__vs)
    def addAllConsumerDestinations(__vs: Iterable[com.google.api.logging.Logging.LoggingDestination]): Logging = copy(consumerDestinations = consumerDestinations ++ __vs)
    def withConsumerDestinations(__v: _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination]): Logging = copy(consumerDestinations = __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 => producerDestinations
        case 2 => consumerDestinations
      }
    }
    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.PRepeated(producerDestinations.iterator.map(_.toPMessage).toVector)
        case 2 => _root_.scalapb.descriptors.PRepeated(consumerDestinations.iterator.map(_.toPMessage).toVector)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: com.google.api.logging.Logging.type = com.google.api.logging.Logging
    // @@protoc_insertion_point(GeneratedMessage[google.api.Logging])
}

object Logging extends scalapb.GeneratedMessageCompanion[com.google.api.logging.Logging] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.google.api.logging.Logging] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.google.api.logging.Logging = {
    val __producerDestinations: _root_.scala.collection.immutable.VectorBuilder[com.google.api.logging.Logging.LoggingDestination] = new _root_.scala.collection.immutable.VectorBuilder[com.google.api.logging.Logging.LoggingDestination]
    val __consumerDestinations: _root_.scala.collection.immutable.VectorBuilder[com.google.api.logging.Logging.LoggingDestination] = new _root_.scala.collection.immutable.VectorBuilder[com.google.api.logging.Logging.LoggingDestination]
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __producerDestinations += _root_.scalapb.LiteParser.readMessage[com.google.api.logging.Logging.LoggingDestination](_input__)
        case 18 =>
          __consumerDestinations += _root_.scalapb.LiteParser.readMessage[com.google.api.logging.Logging.LoggingDestination](_input__)
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    com.google.api.logging.Logging(
        producerDestinations = __producerDestinations.result(),
        consumerDestinations = __consumerDestinations.result(),
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[com.google.api.logging.Logging] = _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.logging.Logging(
        producerDestinations = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination]]).getOrElse(_root_.scala.Seq.empty),
        consumerDestinations = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination]]).getOrElse(_root_.scala.Seq.empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LoggingProto.javaDescriptor.getMessageTypes().get(0)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LoggingProto.scalaDescriptor.messages(0)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 1 => __out = com.google.api.logging.Logging.LoggingDestination
      case 2 => __out = com.google.api.logging.Logging.LoggingDestination
    }
    __out
  }
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] =
    Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]](
      _root_.com.google.api.logging.Logging.LoggingDestination
    )
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = com.google.api.logging.Logging(
    producerDestinations = _root_.scala.Seq.empty,
    consumerDestinations = _root_.scala.Seq.empty
  )
  /** Configuration of a specific logging destination (the producer project
    * or the consumer project).
    *
    * @param monitoredResource
    *   The monitored resource type. The type must be defined in the
    *   [Service.monitored_resources][google.api.Service.monitored_resources]
    *   section.
    * @param logs
    *   Names of the logs to be sent to this destination. Each name must
    *   be defined in the [Service.logs][google.api.Service.logs] section. If the
    *   log name is not a domain scoped name, it will be automatically prefixed
    *   with the service name followed by "/".
    */
  @SerialVersionUID(0L)
  final case class LoggingDestination(
      monitoredResource: _root_.scala.Predef.String = "",
      logs: _root_.scala.Seq[_root_.scala.Predef.String] = _root_.scala.Seq.empty,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[LoggingDestination] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        
        {
          val __value = monitoredResource
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value)
          }
        };
        logs.foreach { __item =>
          val __value = __item
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __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 = {
        logs.foreach { __v =>
          val __m = __v
          _output__.writeString(1, __m)
        };
        {
          val __v = monitoredResource
          if (!__v.isEmpty) {
            _output__.writeString(3, __v)
          }
        };
        unknownFields.writeTo(_output__)
      }
      def withMonitoredResource(__v: _root_.scala.Predef.String): LoggingDestination = copy(monitoredResource = __v)
      def clearLogs = copy(logs = _root_.scala.Seq.empty)
      def addLogs(__vs: _root_.scala.Predef.String *): LoggingDestination = addAllLogs(__vs)
      def addAllLogs(__vs: Iterable[_root_.scala.Predef.String]): LoggingDestination = copy(logs = logs ++ __vs)
      def withLogs(__v: _root_.scala.Seq[_root_.scala.Predef.String]): LoggingDestination = copy(logs = __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 = monitoredResource
            if (__t != "") __t else null
          }
          case 1 => logs
        }
      }
      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(monitoredResource)
          case 1 => _root_.scalapb.descriptors.PRepeated(logs.iterator.map(_root_.scalapb.descriptors.PString(_)).toVector)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: com.google.api.logging.Logging.LoggingDestination.type = com.google.api.logging.Logging.LoggingDestination
      // @@protoc_insertion_point(GeneratedMessage[google.api.Logging.LoggingDestination])
  }
  
  object LoggingDestination extends scalapb.GeneratedMessageCompanion[com.google.api.logging.Logging.LoggingDestination] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.google.api.logging.Logging.LoggingDestination] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.google.api.logging.Logging.LoggingDestination = {
      var __monitoredResource: _root_.scala.Predef.String = ""
      val __logs: _root_.scala.collection.immutable.VectorBuilder[_root_.scala.Predef.String] = new _root_.scala.collection.immutable.VectorBuilder[_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 26 =>
            __monitoredResource = _input__.readStringRequireUtf8()
          case 10 =>
            __logs += _input__.readStringRequireUtf8()
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      com.google.api.logging.Logging.LoggingDestination(
          monitoredResource = __monitoredResource,
          logs = __logs.result(),
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[com.google.api.logging.Logging.LoggingDestination] = _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.logging.Logging.LoggingDestination(
          monitoredResource = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          logs = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[_root_.scala.Predef.String]]).getOrElse(_root_.scala.Seq.empty)
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = com.google.api.logging.Logging.javaDescriptor.getNestedTypes().get(0)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = com.google.api.logging.Logging.scalaDescriptor.nestedMessages(0)
    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 = com.google.api.logging.Logging.LoggingDestination(
      monitoredResource = "",
      logs = _root_.scala.Seq.empty
    )
    implicit class LoggingDestinationLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.google.api.logging.Logging.LoggingDestination]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.google.api.logging.Logging.LoggingDestination](_l) {
      def monitoredResource: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.monitoredResource)((c_, f_) => c_.copy(monitoredResource = f_))
      def logs: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.scala.Predef.String]] = field(_.logs)((c_, f_) => c_.copy(logs = f_))
    }
    final val MONITORED_RESOURCE_FIELD_NUMBER = 3
    final val LOGS_FIELD_NUMBER = 1
    def of(
      monitoredResource: _root_.scala.Predef.String,
      logs: _root_.scala.Seq[_root_.scala.Predef.String]
    ): _root_.com.google.api.logging.Logging.LoggingDestination = _root_.com.google.api.logging.Logging.LoggingDestination(
      monitoredResource,
      logs
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[google.api.Logging.LoggingDestination])
  }
  
  implicit class LoggingLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, com.google.api.logging.Logging]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, com.google.api.logging.Logging](_l) {
    def producerDestinations: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination]] = field(_.producerDestinations)((c_, f_) => c_.copy(producerDestinations = f_))
    def consumerDestinations: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination]] = field(_.consumerDestinations)((c_, f_) => c_.copy(consumerDestinations = f_))
  }
  final val PRODUCER_DESTINATIONS_FIELD_NUMBER = 1
  final val CONSUMER_DESTINATIONS_FIELD_NUMBER = 2
  def of(
    producerDestinations: _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination],
    consumerDestinations: _root_.scala.Seq[com.google.api.logging.Logging.LoggingDestination]
  ): _root_.com.google.api.logging.Logging = _root_.com.google.api.logging.Logging(
    producerDestinations,
    consumerDestinations
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[google.api.Logging])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy