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

io.envoyproxy.envoy.service.auth.v2.AttributeContext.scala Maven / Gradle / Ivy

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

package io.envoyproxy.envoy.service.auth.v2

/** An attribute is a piece of metadata that describes an activity on a network.
  * For example, the size of an HTTP request, or the status code of an HTTP response.
  *
  * Each attribute has a type and a name, which is logically defined as a proto message field
  * of the `AttributeContext`. The `AttributeContext` is a collection of individual attributes
  * supported by Envoy authorization system.
  * [#comment: The following items are left out of this proto
  * Request.Auth field for jwt tokens
  * Request.Api for api management
  * Origin peer that originated the request
  * Caching Protocol
  * request_context return values to inject back into the filter chain
  * peer.claims -- from X.509 extensions
  * Configuration
  * - field mask to send
  * - which return values from request_context are copied back
  * - which return values are copied into request_headers]
  * [#next-free-field: 12]
  *
  * @param source
  *   The source of a network activity, such as starting a TCP connection.
  *   In a multi hop network activity, the source represents the sender of the
  *   last hop.
  * @param destination
  *   The destination of a network activity, such as accepting a TCP connection.
  *   In a multi hop network activity, the destination represents the receiver of
  *   the last hop.
  * @param request
  *   Represents a network request, such as an HTTP request.
  * @param contextExtensions
  *   This is analogous to http_request.headers, however these contents will not be sent to the
  *   upstream server. Context_extensions provide an extension mechanism for sending additional
  *   information to the auth server without modifying the proto definition. It maps to the
  *   internal opaque context in the filter chain.
  * @param metadataContext
  *   Dynamic metadata associated with the request.
  */
@SerialVersionUID(0L)
final case class AttributeContext(
    source: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = _root_.scala.None,
    destination: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = _root_.scala.None,
    request: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request] = _root_.scala.None,
    contextExtensions: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] = _root_.scala.collection.immutable.Map.empty,
    metadataContext: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Metadata] = _root_.scala.None,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[AttributeContext] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      if (source.isDefined) {
        val __value = source.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (destination.isDefined) {
        val __value = destination.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (request.isDefined) {
        val __value = request.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      contextExtensions.foreach { __item =>
        val __value = io.envoyproxy.envoy.service.auth.v2.AttributeContext._typemapper_contextExtensions.toBase(__item)
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      if (metadataContext.isDefined) {
        val __value = metadataContext.get
        __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 = {
      source.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      destination.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      request.foreach { __v =>
        val __m = __v
        _output__.writeTag(4, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      contextExtensions.foreach { __v =>
        val __m = io.envoyproxy.envoy.service.auth.v2.AttributeContext._typemapper_contextExtensions.toBase(__v)
        _output__.writeTag(10, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      metadataContext.foreach { __v =>
        val __m = __v
        _output__.writeTag(11, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def getSource: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer = source.getOrElse(io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.defaultInstance)
    def clearSource: AttributeContext = copy(source = _root_.scala.None)
    def withSource(__v: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer): AttributeContext = copy(source = Option(__v))
    def getDestination: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer = destination.getOrElse(io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.defaultInstance)
    def clearDestination: AttributeContext = copy(destination = _root_.scala.None)
    def withDestination(__v: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer): AttributeContext = copy(destination = Option(__v))
    def getRequest: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request = request.getOrElse(io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request.defaultInstance)
    def clearRequest: AttributeContext = copy(request = _root_.scala.None)
    def withRequest(__v: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request): AttributeContext = copy(request = Option(__v))
    def clearContextExtensions = copy(contextExtensions = _root_.scala.collection.immutable.Map.empty)
    def addContextExtensions(__vs: (_root_.scala.Predef.String, _root_.scala.Predef.String) *): AttributeContext = addAllContextExtensions(__vs)
    def addAllContextExtensions(__vs: Iterable[(_root_.scala.Predef.String, _root_.scala.Predef.String)]): AttributeContext = copy(contextExtensions = contextExtensions ++ __vs)
    def withContextExtensions(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]): AttributeContext = copy(contextExtensions = __v)
    def getMetadataContext: io.envoyproxy.envoy.api.v2.core.Metadata = metadataContext.getOrElse(io.envoyproxy.envoy.api.v2.core.Metadata.defaultInstance)
    def clearMetadataContext: AttributeContext = copy(metadataContext = _root_.scala.None)
    def withMetadataContext(__v: io.envoyproxy.envoy.api.v2.core.Metadata): AttributeContext = copy(metadataContext = Option(__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 => source.orNull
        case 2 => destination.orNull
        case 4 => request.orNull
        case 10 => contextExtensions.iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext._typemapper_contextExtensions.toBase(_)).toSeq
        case 11 => metadataContext.orNull
      }
    }
    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 => source.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => destination.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => request.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 10 => _root_.scalapb.descriptors.PRepeated(contextExtensions.iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext._typemapper_contextExtensions.toBase(_).toPMessage).toVector)
        case 11 => metadataContext.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: io.envoyproxy.envoy.service.auth.v2.AttributeContext.type = io.envoyproxy.envoy.service.auth.v2.AttributeContext
    // @@protoc_insertion_point(GeneratedMessage[envoy.service.auth.v2.AttributeContext])
}

object AttributeContext extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.auth.v2.AttributeContext = {
    var __source: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = _root_.scala.None
    var __destination: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = _root_.scala.None
    var __request: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request] = _root_.scala.None
    val __contextExtensions: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.scala.Predef.String), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.scala.Predef.String]
    var __metadataContext: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Metadata] = _root_.scala.None
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __source = Option(__source.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 18 =>
          __destination = Option(__destination.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 34 =>
          __request = Option(__request.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 82 =>
          __contextExtensions += io.envoyproxy.envoy.service.auth.v2.AttributeContext._typemapper_contextExtensions.toCustom(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry](_input__))
        case 90 =>
          __metadataContext = Option(__metadataContext.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.api.v2.core.Metadata](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    io.envoyproxy.envoy.service.auth.v2.AttributeContext(
        source = __source,
        destination = __destination,
        request = __request,
        contextExtensions = __contextExtensions.result(),
        metadataContext = __metadataContext,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.auth.v2.AttributeContext] = _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.")
      io.envoyproxy.envoy.service.auth.v2.AttributeContext(
        source = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer]]),
        destination = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer]]),
        request = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request]]),
        contextExtensions = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext._typemapper_contextExtensions.toCustom(_)).toMap,
        metadataContext = __fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Metadata]])
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = AttributeContextProto.javaDescriptor.getMessageTypes().get(0)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = AttributeContextProto.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 = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer
      case 2 => __out = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer
      case 4 => __out = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request
      case 10 => __out = io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry
      case 11 => __out = io.envoyproxy.envoy.api.v2.core.Metadata
    }
    __out
  }
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] =
    Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]](
      _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer,
      _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request,
      _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest,
      _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry
    )
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = io.envoyproxy.envoy.service.auth.v2.AttributeContext(
    source = _root_.scala.None,
    destination = _root_.scala.None,
    request = _root_.scala.None,
    contextExtensions = _root_.scala.collection.immutable.Map.empty,
    metadataContext = _root_.scala.None
  )
  /** This message defines attributes for a node that handles a network request.
    * The node can be either a service or an application that sends, forwards,
    * or receives the request. Service peers should fill in the `service`,
    * `principal`, and `labels` as appropriate.
    * [#next-free-field: 6]
    *
    * @param address
    *   The address of the peer, this is typically the IP address.
    *   It can also be UDS path, or others.
    * @param service
    *   The canonical service name of the peer.
    *   It should be set to :ref:`the HTTP x-envoy-downstream-service-cluster
    *   <config_http_conn_man_headers_downstream-service-cluster>`
    *   If a more trusted source of the service name is available through mTLS/secure naming, it
    *   should be used.
    * @param labels
    *   The labels associated with the peer.
    *   These could be pod labels for Kubernetes or tags for VMs.
    *   The source of the labels could be an X.509 certificate or other configuration.
    * @param principal
    *   The authenticated identity of this peer.
    *   For example, the identity associated with the workload such as a service account.
    *   If an X.509 certificate is used to assert the identity this field should be sourced from
    *   `URI Subject Alternative Names`, `DNS Subject Alternate Names` or `Subject` in that order.
    *   The primary identity should be the principal. The principal format is issuer specific.
    *  
    *   Example:
    *   *    SPIFFE format is `spiffe://trust-domain/path`
    *   *    Google account format is `https://accounts.google.com/{userid}`
    * @param certificate
    *   The X.509 certificate used to authenticate the identify of this peer.
    *   When present, the certificate contents are encoded in URL and PEM format.
    */
  @SerialVersionUID(0L)
  final case class Peer(
      address: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Address] = _root_.scala.None,
      service: _root_.scala.Predef.String = "",
      labels: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] = _root_.scala.collection.immutable.Map.empty,
      principal: _root_.scala.Predef.String = "",
      certificate: _root_.scala.Predef.String = "",
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Peer] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        if (address.isDefined) {
          val __value = address.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        
        {
          val __value = service
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value)
          }
        };
        labels.foreach { __item =>
          val __value = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer._typemapper_labels.toBase(__item)
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        }
        
        {
          val __value = principal
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __value)
          }
        };
        
        {
          val __value = certificate
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __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 = {
        address.foreach { __v =>
          val __m = __v
          _output__.writeTag(1, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        {
          val __v = service
          if (!__v.isEmpty) {
            _output__.writeString(2, __v)
          }
        };
        labels.foreach { __v =>
          val __m = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer._typemapper_labels.toBase(__v)
          _output__.writeTag(3, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        {
          val __v = principal
          if (!__v.isEmpty) {
            _output__.writeString(4, __v)
          }
        };
        {
          val __v = certificate
          if (!__v.isEmpty) {
            _output__.writeString(5, __v)
          }
        };
        unknownFields.writeTo(_output__)
      }
      def getAddress: io.envoyproxy.envoy.api.v2.core.Address = address.getOrElse(io.envoyproxy.envoy.api.v2.core.Address.defaultInstance)
      def clearAddress: Peer = copy(address = _root_.scala.None)
      def withAddress(__v: io.envoyproxy.envoy.api.v2.core.Address): Peer = copy(address = Option(__v))
      def withService(__v: _root_.scala.Predef.String): Peer = copy(service = __v)
      def clearLabels = copy(labels = _root_.scala.collection.immutable.Map.empty)
      def addLabels(__vs: (_root_.scala.Predef.String, _root_.scala.Predef.String) *): Peer = addAllLabels(__vs)
      def addAllLabels(__vs: Iterable[(_root_.scala.Predef.String, _root_.scala.Predef.String)]): Peer = copy(labels = labels ++ __vs)
      def withLabels(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]): Peer = copy(labels = __v)
      def withPrincipal(__v: _root_.scala.Predef.String): Peer = copy(principal = __v)
      def withCertificate(__v: _root_.scala.Predef.String): Peer = copy(certificate = __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 => address.orNull
          case 2 => {
            val __t = service
            if (__t != "") __t else null
          }
          case 3 => labels.iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer._typemapper_labels.toBase(_)).toSeq
          case 4 => {
            val __t = principal
            if (__t != "") __t else null
          }
          case 5 => {
            val __t = certificate
            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 => address.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 2 => _root_.scalapb.descriptors.PString(service)
          case 3 => _root_.scalapb.descriptors.PRepeated(labels.iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer._typemapper_labels.toBase(_).toPMessage).toVector)
          case 4 => _root_.scalapb.descriptors.PString(principal)
          case 5 => _root_.scalapb.descriptors.PString(certificate)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.type = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer
      // @@protoc_insertion_point(GeneratedMessage[envoy.service.auth.v2.AttributeContext.Peer])
  }
  
  object Peer extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer = {
      var __address: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Address] = _root_.scala.None
      var __service: _root_.scala.Predef.String = ""
      val __labels: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.scala.Predef.String), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.scala.Predef.String]
      var __principal: _root_.scala.Predef.String = ""
      var __certificate: _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 =>
            __address = Option(__address.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.api.v2.core.Address](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 18 =>
            __service = _input__.readStringRequireUtf8()
          case 26 =>
            __labels += io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer._typemapper_labels.toCustom(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry](_input__))
          case 34 =>
            __principal = _input__.readStringRequireUtf8()
          case 42 =>
            __certificate = _input__.readStringRequireUtf8()
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer(
          address = __address,
          service = __service,
          labels = __labels.result(),
          principal = __principal,
          certificate = __certificate,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = _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.")
        io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer(
          address = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Address]]),
          service = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          labels = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer._typemapper_labels.toCustom(_)).toMap,
          principal = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          certificate = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.javaDescriptor.getNestedTypes().get(0)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.scalaDescriptor.nestedMessages(0)
    def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
      var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
      (__number: @_root_.scala.unchecked) match {
        case 1 => __out = io.envoyproxy.envoy.api.v2.core.Address
        case 3 => __out = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry
      }
      __out
    }
    lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] =
      Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]](
        _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry
      )
    def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
    lazy val defaultInstance = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer(
      address = _root_.scala.None,
      service = "",
      labels = _root_.scala.collection.immutable.Map.empty,
      principal = "",
      certificate = ""
    )
    @SerialVersionUID(0L)
    final case class LabelsEntry(
        key: _root_.scala.Predef.String = "",
        value: _root_.scala.Predef.String = "",
        unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
        ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[LabelsEntry] {
        @transient
        private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
        private[this] def __computeSerializedSize(): _root_.scala.Int = {
          var __size = 0
          
          {
            val __value = key
            if (!__value.isEmpty) {
              __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
            }
          };
          
          {
            val __value = value
            if (!__value.isEmpty) {
              __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __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 = key
            if (!__v.isEmpty) {
              _output__.writeString(1, __v)
            }
          };
          {
            val __v = value
            if (!__v.isEmpty) {
              _output__.writeString(2, __v)
            }
          };
          unknownFields.writeTo(_output__)
        }
        def withKey(__v: _root_.scala.Predef.String): LabelsEntry = copy(key = __v)
        def withValue(__v: _root_.scala.Predef.String): LabelsEntry = copy(value = __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 = key
              if (__t != "") __t else null
            }
            case 2 => {
              val __t = value
              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(key)
            case 2 => _root_.scalapb.descriptors.PString(value)
          }
        }
        def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
        def companion: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry.type = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry
        // @@protoc_insertion_point(GeneratedMessage[envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry])
    }
    
    object LabelsEntry extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry] {
      implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry] = this
      def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry = {
        var __key: _root_.scala.Predef.String = ""
        var __value: _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 =>
              __key = _input__.readStringRequireUtf8()
            case 18 =>
              __value = _input__.readStringRequireUtf8()
            case tag =>
              if (_unknownFields__ == null) {
                _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
              }
              _unknownFields__.parseField(tag, _input__)
          }
        }
        io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry(
            key = __key,
            value = __value,
            unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
        )
      }
      implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry] = _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.")
          io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry(
            key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
            value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
          )
        case _ => throw new RuntimeException("Expected PMessage")
      }
      def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.javaDescriptor.getNestedTypes().get(0)
      def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.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 = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry(
        key = "",
        value = ""
      )
      implicit class LabelsEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry](_l) {
        def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_))
        def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.value)((c_, f_) => c_.copy(value = f_))
      }
      final val KEY_FIELD_NUMBER = 1
      final val VALUE_FIELD_NUMBER = 2
      @transient
      implicit val keyValueMapper: _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] =
        _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)](__m => (__m.key, __m.value))(__p => io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry(__p._1, __p._2))
      def of(
        key: _root_.scala.Predef.String,
        value: _root_.scala.Predef.String
      ): _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry = _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry(
        key,
        value
      )
      // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry])
    }
    
    implicit class PeerLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer](_l) {
      def address: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.api.v2.core.Address] = field(_.getAddress)((c_, f_) => c_.copy(address = Option(f_)))
      def optionalAddress: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Address]] = field(_.address)((c_, f_) => c_.copy(address = f_))
      def service: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.service)((c_, f_) => c_.copy(service = f_))
      def labels: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = field(_.labels)((c_, f_) => c_.copy(labels = f_))
      def principal: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.principal)((c_, f_) => c_.copy(principal = f_))
      def certificate: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.certificate)((c_, f_) => c_.copy(certificate = f_))
    }
    final val ADDRESS_FIELD_NUMBER = 1
    final val SERVICE_FIELD_NUMBER = 2
    final val LABELS_FIELD_NUMBER = 3
    final val PRINCIPAL_FIELD_NUMBER = 4
    final val CERTIFICATE_FIELD_NUMBER = 5
    @transient
    private[v2] val _typemapper_labels: _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = implicitly[_root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer.LabelsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)]]
    def of(
      address: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Address],
      service: _root_.scala.Predef.String,
      labels: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String],
      principal: _root_.scala.Predef.String,
      certificate: _root_.scala.Predef.String
    ): _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer = _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer(
      address,
      service,
      labels,
      principal,
      certificate
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.auth.v2.AttributeContext.Peer])
  }
  
  /** Represents a network request, such as an HTTP request.
    *
    * @param time
    *   The timestamp when the proxy receives the first byte of the request.
    * @param http
    *   Represents an HTTP request or an HTTP-like request.
    */
  @SerialVersionUID(0L)
  final case class Request(
      time: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None,
      http: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest] = _root_.scala.None,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[Request] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        if (time.isDefined) {
          val __value = time.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (http.isDefined) {
          val __value = http.get
          __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 = {
        time.foreach { __v =>
          val __m = __v
          _output__.writeTag(1, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        http.foreach { __v =>
          val __m = __v
          _output__.writeTag(2, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        unknownFields.writeTo(_output__)
      }
      def getTime: com.google.protobuf.timestamp.Timestamp = time.getOrElse(com.google.protobuf.timestamp.Timestamp.defaultInstance)
      def clearTime: Request = copy(time = _root_.scala.None)
      def withTime(__v: com.google.protobuf.timestamp.Timestamp): Request = copy(time = Option(__v))
      def getHttp: io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest = http.getOrElse(io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.defaultInstance)
      def clearHttp: Request = copy(http = _root_.scala.None)
      def withHttp(__v: io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest): Request = copy(http = Option(__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 => time.orNull
          case 2 => http.orNull
        }
      }
      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 => time.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 2 => http.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request.type = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request
      // @@protoc_insertion_point(GeneratedMessage[envoy.service.auth.v2.AttributeContext.Request])
  }
  
  object Request extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request = {
      var __time: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp] = _root_.scala.None
      var __http: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest] = _root_.scala.None
      var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
      var _done__ = false
      while (!_done__) {
        val _tag__ = _input__.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 10 =>
            __time = Option(__time.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.timestamp.Timestamp](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 18 =>
            __http = Option(__http.fold(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request(
          time = __time,
          http = __http,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request] = _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.")
        io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request(
          time = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.timestamp.Timestamp]]),
          http = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest]])
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.javaDescriptor.getNestedTypes().get(1)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.scalaDescriptor.nestedMessages(1)
    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.protobuf.timestamp.Timestamp
        case 2 => __out = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest
      }
      __out
    }
    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 = io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request(
      time = _root_.scala.None,
      http = _root_.scala.None
    )
    implicit class RequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request](_l) {
      def time: _root_.scalapb.lenses.Lens[UpperPB, com.google.protobuf.timestamp.Timestamp] = field(_.getTime)((c_, f_) => c_.copy(time = Option(f_)))
      def optionalTime: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[com.google.protobuf.timestamp.Timestamp]] = field(_.time)((c_, f_) => c_.copy(time = f_))
      def http: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest] = field(_.getHttp)((c_, f_) => c_.copy(http = Option(f_)))
      def optionalHttp: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest]] = field(_.http)((c_, f_) => c_.copy(http = f_))
    }
    final val TIME_FIELD_NUMBER = 1
    final val HTTP_FIELD_NUMBER = 2
    def of(
      time: _root_.scala.Option[com.google.protobuf.timestamp.Timestamp],
      http: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest]
    ): _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request = _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request(
      time,
      http
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.auth.v2.AttributeContext.Request])
  }
  
  /** This message defines attributes for an HTTP request.
    * HTTP/1.x, HTTP/2, gRPC are all considered as HTTP requests.
    * [#next-free-field: 12]
    *
    * @param id
    *   The unique ID for a request, which can be propagated to downstream
    *   systems. The ID should have low probability of collision
    *   within a single day for a specific service.
    *   For HTTP requests, it should be X-Request-ID or equivalent.
    * @param method
    *   The HTTP request method, such as `GET`, `POST`.
    * @param headers
    *   The HTTP request headers. If multiple headers share the same key, they
    *   must be merged according to the HTTP spec. All header keys must be
    *   lower-cased, because HTTP header keys are case-insensitive.
    * @param path
    *   The request target, as it appears in the first line of the HTTP request. This includes
    *   the URL path and query-string. No decoding is performed.
    * @param host
    *   The HTTP request `Host` or 'Authority` header value.
    * @param scheme
    *   The HTTP URL scheme, such as `http` and `https`. This is set for HTTP/2
    *   requests only. For HTTP/1.1, use "x-forwarded-for" header value to lookup
    *   the scheme of the request.
    * @param query
    *   This field is always empty, and exists for compatibility reasons. The HTTP URL query is
    *   included in `path` field.
    * @param fragment
    *   This field is always empty, and exists for compatibility reasons. The URL fragment is
    *   not submitted as part of HTTP requests; it is unknowable.
    * @param size
    *   The HTTP request size in bytes. If unknown, it must be -1.
    * @param protocol
    *   The network protocol used with the request, such as "HTTP/1.0", "HTTP/1.1", or "HTTP/2".
    *  
    *   See :repo:`headers.h:ProtocolStrings <source/common/http/headers.h>` for a list of all
    *   possible values.
    * @param body
    *   The HTTP request body.
    */
  @SerialVersionUID(0L)
  final case class HttpRequest(
      id: _root_.scala.Predef.String = "",
      method: _root_.scala.Predef.String = "",
      headers: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String] = _root_.scala.collection.immutable.Map.empty,
      path: _root_.scala.Predef.String = "",
      host: _root_.scala.Predef.String = "",
      scheme: _root_.scala.Predef.String = "",
      query: _root_.scala.Predef.String = "",
      fragment: _root_.scala.Predef.String = "",
      size: _root_.scala.Long = 0L,
      protocol: _root_.scala.Predef.String = "",
      body: _root_.scala.Predef.String = "",
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[HttpRequest] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        
        {
          val __value = id
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
          }
        };
        
        {
          val __value = method
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value)
          }
        };
        headers.foreach { __item =>
          val __value = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest._typemapper_headers.toBase(__item)
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        }
        
        {
          val __value = path
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(4, __value)
          }
        };
        
        {
          val __value = host
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __value)
          }
        };
        
        {
          val __value = scheme
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(6, __value)
          }
        };
        
        {
          val __value = query
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(7, __value)
          }
        };
        
        {
          val __value = fragment
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(8, __value)
          }
        };
        
        {
          val __value = size
          if (__value != 0L) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(9, __value)
          }
        };
        
        {
          val __value = protocol
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(10, __value)
          }
        };
        
        {
          val __value = body
          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 = id
          if (!__v.isEmpty) {
            _output__.writeString(1, __v)
          }
        };
        {
          val __v = method
          if (!__v.isEmpty) {
            _output__.writeString(2, __v)
          }
        };
        headers.foreach { __v =>
          val __m = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest._typemapper_headers.toBase(__v)
          _output__.writeTag(3, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        {
          val __v = path
          if (!__v.isEmpty) {
            _output__.writeString(4, __v)
          }
        };
        {
          val __v = host
          if (!__v.isEmpty) {
            _output__.writeString(5, __v)
          }
        };
        {
          val __v = scheme
          if (!__v.isEmpty) {
            _output__.writeString(6, __v)
          }
        };
        {
          val __v = query
          if (!__v.isEmpty) {
            _output__.writeString(7, __v)
          }
        };
        {
          val __v = fragment
          if (!__v.isEmpty) {
            _output__.writeString(8, __v)
          }
        };
        {
          val __v = size
          if (__v != 0L) {
            _output__.writeInt64(9, __v)
          }
        };
        {
          val __v = protocol
          if (!__v.isEmpty) {
            _output__.writeString(10, __v)
          }
        };
        {
          val __v = body
          if (!__v.isEmpty) {
            _output__.writeString(11, __v)
          }
        };
        unknownFields.writeTo(_output__)
      }
      def withId(__v: _root_.scala.Predef.String): HttpRequest = copy(id = __v)
      def withMethod(__v: _root_.scala.Predef.String): HttpRequest = copy(method = __v)
      def clearHeaders = copy(headers = _root_.scala.collection.immutable.Map.empty)
      def addHeaders(__vs: (_root_.scala.Predef.String, _root_.scala.Predef.String) *): HttpRequest = addAllHeaders(__vs)
      def addAllHeaders(__vs: Iterable[(_root_.scala.Predef.String, _root_.scala.Predef.String)]): HttpRequest = copy(headers = headers ++ __vs)
      def withHeaders(__v: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]): HttpRequest = copy(headers = __v)
      def withPath(__v: _root_.scala.Predef.String): HttpRequest = copy(path = __v)
      def withHost(__v: _root_.scala.Predef.String): HttpRequest = copy(host = __v)
      def withScheme(__v: _root_.scala.Predef.String): HttpRequest = copy(scheme = __v)
      def withQuery(__v: _root_.scala.Predef.String): HttpRequest = copy(query = __v)
      def withFragment(__v: _root_.scala.Predef.String): HttpRequest = copy(fragment = __v)
      def withSize(__v: _root_.scala.Long): HttpRequest = copy(size = __v)
      def withProtocol(__v: _root_.scala.Predef.String): HttpRequest = copy(protocol = __v)
      def withBody(__v: _root_.scala.Predef.String): HttpRequest = copy(body = __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 = id
            if (__t != "") __t else null
          }
          case 2 => {
            val __t = method
            if (__t != "") __t else null
          }
          case 3 => headers.iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest._typemapper_headers.toBase(_)).toSeq
          case 4 => {
            val __t = path
            if (__t != "") __t else null
          }
          case 5 => {
            val __t = host
            if (__t != "") __t else null
          }
          case 6 => {
            val __t = scheme
            if (__t != "") __t else null
          }
          case 7 => {
            val __t = query
            if (__t != "") __t else null
          }
          case 8 => {
            val __t = fragment
            if (__t != "") __t else null
          }
          case 9 => {
            val __t = size
            if (__t != 0L) __t else null
          }
          case 10 => {
            val __t = protocol
            if (__t != "") __t else null
          }
          case 11 => {
            val __t = body
            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(id)
          case 2 => _root_.scalapb.descriptors.PString(method)
          case 3 => _root_.scalapb.descriptors.PRepeated(headers.iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest._typemapper_headers.toBase(_).toPMessage).toVector)
          case 4 => _root_.scalapb.descriptors.PString(path)
          case 5 => _root_.scalapb.descriptors.PString(host)
          case 6 => _root_.scalapb.descriptors.PString(scheme)
          case 7 => _root_.scalapb.descriptors.PString(query)
          case 8 => _root_.scalapb.descriptors.PString(fragment)
          case 9 => _root_.scalapb.descriptors.PLong(size)
          case 10 => _root_.scalapb.descriptors.PString(protocol)
          case 11 => _root_.scalapb.descriptors.PString(body)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.type = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest
      // @@protoc_insertion_point(GeneratedMessage[envoy.service.auth.v2.AttributeContext.HttpRequest])
  }
  
  object HttpRequest extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest = {
      var __id: _root_.scala.Predef.String = ""
      var __method: _root_.scala.Predef.String = ""
      val __headers: _root_.scala.collection.mutable.Builder[(_root_.scala.Predef.String, _root_.scala.Predef.String), _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = _root_.scala.collection.immutable.Map.newBuilder[_root_.scala.Predef.String, _root_.scala.Predef.String]
      var __path: _root_.scala.Predef.String = ""
      var __host: _root_.scala.Predef.String = ""
      var __scheme: _root_.scala.Predef.String = ""
      var __query: _root_.scala.Predef.String = ""
      var __fragment: _root_.scala.Predef.String = ""
      var __size: _root_.scala.Long = 0L
      var __protocol: _root_.scala.Predef.String = ""
      var __body: _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 =>
            __id = _input__.readStringRequireUtf8()
          case 18 =>
            __method = _input__.readStringRequireUtf8()
          case 26 =>
            __headers += io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest._typemapper_headers.toCustom(_root_.scalapb.LiteParser.readMessage[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry](_input__))
          case 34 =>
            __path = _input__.readStringRequireUtf8()
          case 42 =>
            __host = _input__.readStringRequireUtf8()
          case 50 =>
            __scheme = _input__.readStringRequireUtf8()
          case 58 =>
            __query = _input__.readStringRequireUtf8()
          case 66 =>
            __fragment = _input__.readStringRequireUtf8()
          case 72 =>
            __size = _input__.readInt64()
          case 82 =>
            __protocol = _input__.readStringRequireUtf8()
          case 90 =>
            __body = _input__.readStringRequireUtf8()
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest(
          id = __id,
          method = __method,
          headers = __headers.result(),
          path = __path,
          host = __host,
          scheme = __scheme,
          query = __query,
          fragment = __fragment,
          size = __size,
          protocol = __protocol,
          body = __body,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest] = _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.")
        io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest(
          id = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          method = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          headers = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Seq[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest._typemapper_headers.toCustom(_)).toMap,
          path = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          host = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          scheme = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          query = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          fragment = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          size = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
          protocol = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          body = __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 = io.envoyproxy.envoy.service.auth.v2.AttributeContext.javaDescriptor.getNestedTypes().get(2)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.scalaDescriptor.nestedMessages(2)
    def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
      var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
      (__number: @_root_.scala.unchecked) match {
        case 3 => __out = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry
      }
      __out
    }
    lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] =
      Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]](
        _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry
      )
    def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
    lazy val defaultInstance = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest(
      id = "",
      method = "",
      headers = _root_.scala.collection.immutable.Map.empty,
      path = "",
      host = "",
      scheme = "",
      query = "",
      fragment = "",
      size = 0L,
      protocol = "",
      body = ""
    )
    @SerialVersionUID(0L)
    final case class HeadersEntry(
        key: _root_.scala.Predef.String = "",
        value: _root_.scala.Predef.String = "",
        unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
        ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[HeadersEntry] {
        @transient
        private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
        private[this] def __computeSerializedSize(): _root_.scala.Int = {
          var __size = 0
          
          {
            val __value = key
            if (!__value.isEmpty) {
              __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
            }
          };
          
          {
            val __value = value
            if (!__value.isEmpty) {
              __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __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 = key
            if (!__v.isEmpty) {
              _output__.writeString(1, __v)
            }
          };
          {
            val __v = value
            if (!__v.isEmpty) {
              _output__.writeString(2, __v)
            }
          };
          unknownFields.writeTo(_output__)
        }
        def withKey(__v: _root_.scala.Predef.String): HeadersEntry = copy(key = __v)
        def withValue(__v: _root_.scala.Predef.String): HeadersEntry = copy(value = __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 = key
              if (__t != "") __t else null
            }
            case 2 => {
              val __t = value
              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(key)
            case 2 => _root_.scalapb.descriptors.PString(value)
          }
        }
        def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
        def companion: io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry.type = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry
        // @@protoc_insertion_point(GeneratedMessage[envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry])
    }
    
    object HeadersEntry extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry] {
      implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry] = this
      def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry = {
        var __key: _root_.scala.Predef.String = ""
        var __value: _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 =>
              __key = _input__.readStringRequireUtf8()
            case 18 =>
              __value = _input__.readStringRequireUtf8()
            case tag =>
              if (_unknownFields__ == null) {
                _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
              }
              _unknownFields__.parseField(tag, _input__)
          }
        }
        io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry(
            key = __key,
            value = __value,
            unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
        )
      }
      implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry] = _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.")
          io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry(
            key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
            value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
          )
        case _ => throw new RuntimeException("Expected PMessage")
      }
      def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.javaDescriptor.getNestedTypes().get(0)
      def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.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 = io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry(
        key = "",
        value = ""
      )
      implicit class HeadersEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry](_l) {
        def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_))
        def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.value)((c_, f_) => c_.copy(value = f_))
      }
      final val KEY_FIELD_NUMBER = 1
      final val VALUE_FIELD_NUMBER = 2
      @transient
      implicit val keyValueMapper: _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] =
        _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)](__m => (__m.key, __m.value))(__p => io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry(__p._1, __p._2))
      def of(
        key: _root_.scala.Predef.String,
        value: _root_.scala.Predef.String
      ): _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry = _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry(
        key,
        value
      )
      // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry])
    }
    
    implicit class HttpRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest](_l) {
      def id: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.id)((c_, f_) => c_.copy(id = f_))
      def method: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.method)((c_, f_) => c_.copy(method = f_))
      def headers: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = field(_.headers)((c_, f_) => c_.copy(headers = f_))
      def path: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.path)((c_, f_) => c_.copy(path = f_))
      def host: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.host)((c_, f_) => c_.copy(host = f_))
      def scheme: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.scheme)((c_, f_) => c_.copy(scheme = f_))
      def query: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.query)((c_, f_) => c_.copy(query = f_))
      def fragment: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.fragment)((c_, f_) => c_.copy(fragment = f_))
      def size: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.size)((c_, f_) => c_.copy(size = f_))
      def protocol: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.protocol)((c_, f_) => c_.copy(protocol = f_))
      def body: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.body)((c_, f_) => c_.copy(body = f_))
    }
    final val ID_FIELD_NUMBER = 1
    final val METHOD_FIELD_NUMBER = 2
    final val HEADERS_FIELD_NUMBER = 3
    final val PATH_FIELD_NUMBER = 4
    final val HOST_FIELD_NUMBER = 5
    final val SCHEME_FIELD_NUMBER = 6
    final val QUERY_FIELD_NUMBER = 7
    final val FRAGMENT_FIELD_NUMBER = 8
    final val SIZE_FIELD_NUMBER = 9
    final val PROTOCOL_FIELD_NUMBER = 10
    final val BODY_FIELD_NUMBER = 11
    @transient
    private[v2] val _typemapper_headers: _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = implicitly[_root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest.HeadersEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)]]
    def of(
      id: _root_.scala.Predef.String,
      method: _root_.scala.Predef.String,
      headers: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String],
      path: _root_.scala.Predef.String,
      host: _root_.scala.Predef.String,
      scheme: _root_.scala.Predef.String,
      query: _root_.scala.Predef.String,
      fragment: _root_.scala.Predef.String,
      size: _root_.scala.Long,
      protocol: _root_.scala.Predef.String,
      body: _root_.scala.Predef.String
    ): _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest = _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.HttpRequest(
      id,
      method,
      headers,
      path,
      host,
      scheme,
      query,
      fragment,
      size,
      protocol,
      body
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.auth.v2.AttributeContext.HttpRequest])
  }
  
  @SerialVersionUID(0L)
  final case class ContextExtensionsEntry(
      key: _root_.scala.Predef.String = "",
      value: _root_.scala.Predef.String = "",
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ContextExtensionsEntry] {
      @transient
      private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
      private[this] def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        
        {
          val __value = key
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
          }
        };
        
        {
          val __value = value
          if (!__value.isEmpty) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __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 = key
          if (!__v.isEmpty) {
            _output__.writeString(1, __v)
          }
        };
        {
          val __v = value
          if (!__v.isEmpty) {
            _output__.writeString(2, __v)
          }
        };
        unknownFields.writeTo(_output__)
      }
      def withKey(__v: _root_.scala.Predef.String): ContextExtensionsEntry = copy(key = __v)
      def withValue(__v: _root_.scala.Predef.String): ContextExtensionsEntry = copy(value = __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 = key
            if (__t != "") __t else null
          }
          case 2 => {
            val __t = value
            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(key)
          case 2 => _root_.scalapb.descriptors.PString(value)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry.type = io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry
      // @@protoc_insertion_point(GeneratedMessage[envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry])
  }
  
  object ContextExtensionsEntry extends scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry = {
      var __key: _root_.scala.Predef.String = ""
      var __value: _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 =>
            __key = _input__.readStringRequireUtf8()
          case 18 =>
            __value = _input__.readStringRequireUtf8()
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry(
          key = __key,
          value = __value,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry] = _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.")
        io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry(
          key = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
          value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse("")
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.javaDescriptor.getNestedTypes().get(3)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = io.envoyproxy.envoy.service.auth.v2.AttributeContext.scalaDescriptor.nestedMessages(3)
    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 = io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry(
      key = "",
      value = ""
    )
    implicit class ContextExtensionsEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry](_l) {
      def key: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.key)((c_, f_) => c_.copy(key = f_))
      def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.value)((c_, f_) => c_.copy(value = f_))
    }
    final val KEY_FIELD_NUMBER = 1
    final val VALUE_FIELD_NUMBER = 2
    @transient
    implicit val keyValueMapper: _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] =
      _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)](__m => (__m.key, __m.value))(__p => io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry(__p._1, __p._2))
    def of(
      key: _root_.scala.Predef.String,
      value: _root_.scala.Predef.String
    ): _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry = _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry(
      key,
      value
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry])
  }
  
  implicit class AttributeContextLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext](_l) {
    def source: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = field(_.getSource)((c_, f_) => c_.copy(source = Option(f_)))
    def optionalSource: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer]] = field(_.source)((c_, f_) => c_.copy(source = f_))
    def destination: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer] = field(_.getDestination)((c_, f_) => c_.copy(destination = Option(f_)))
    def optionalDestination: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer]] = field(_.destination)((c_, f_) => c_.copy(destination = f_))
    def request: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request] = field(_.getRequest)((c_, f_) => c_.copy(request = Option(f_)))
    def optionalRequest: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request]] = field(_.request)((c_, f_) => c_.copy(request = f_))
    def contextExtensions: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String]] = field(_.contextExtensions)((c_, f_) => c_.copy(contextExtensions = f_))
    def metadataContext: _root_.scalapb.lenses.Lens[UpperPB, io.envoyproxy.envoy.api.v2.core.Metadata] = field(_.getMetadataContext)((c_, f_) => c_.copy(metadataContext = Option(f_)))
    def optionalMetadataContext: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Metadata]] = field(_.metadataContext)((c_, f_) => c_.copy(metadataContext = f_))
  }
  final val SOURCE_FIELD_NUMBER = 1
  final val DESTINATION_FIELD_NUMBER = 2
  final val REQUEST_FIELD_NUMBER = 4
  final val CONTEXT_EXTENSIONS_FIELD_NUMBER = 10
  final val METADATA_CONTEXT_FIELD_NUMBER = 11
  @transient
  private[v2] val _typemapper_contextExtensions: _root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)] = implicitly[_root_.scalapb.TypeMapper[io.envoyproxy.envoy.service.auth.v2.AttributeContext.ContextExtensionsEntry, (_root_.scala.Predef.String, _root_.scala.Predef.String)]]
  def of(
    source: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer],
    destination: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Peer],
    request: _root_.scala.Option[io.envoyproxy.envoy.service.auth.v2.AttributeContext.Request],
    contextExtensions: _root_.scala.collection.immutable.Map[_root_.scala.Predef.String, _root_.scala.Predef.String],
    metadataContext: _root_.scala.Option[io.envoyproxy.envoy.api.v2.core.Metadata]
  ): _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext = _root_.io.envoyproxy.envoy.service.auth.v2.AttributeContext(
    source,
    destination,
    request,
    contextExtensions,
    metadataContext
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[envoy.service.auth.v2.AttributeContext])
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy