{- This file was auto-generated from text.proto by the proto-lens-protoc program. -} {-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-} {-# OPTIONS_GHC -Wno-unused-imports#-} {-# OPTIONS_GHC -Wno-duplicate-exports#-} {-# OPTIONS_GHC -Wno-dodgy-exports#-} module Proto.Text ( Payload() ) where import qualified Data.ProtoLens.Runtime.Control.DeepSeq as Control.DeepSeq import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Prism as Data.ProtoLens.Prism import qualified Data.ProtoLens.Runtime.Prelude as Prelude import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int import qualified Data.ProtoLens.Runtime.Data.Monoid as Data.Monoid import qualified Data.ProtoLens.Runtime.Data.Word as Data.Word import qualified Data.ProtoLens.Runtime.Data.ProtoLens as Data.ProtoLens import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Bytes as Data.ProtoLens.Encoding.Bytes import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Growing as Data.ProtoLens.Encoding.Growing import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Parser.Unsafe as Data.ProtoLens.Encoding.Parser.Unsafe import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Wire as Data.ProtoLens.Encoding.Wire import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Field as Data.ProtoLens.Field import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Message.Enum as Data.ProtoLens.Message.Enum import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Service.Types as Data.ProtoLens.Service.Types import qualified Data.ProtoLens.Runtime.Lens.Family2 as Lens.Family2 import qualified Data.ProtoLens.Runtime.Lens.Family2.Unchecked as Lens.Family2.Unchecked import qualified Data.ProtoLens.Runtime.Data.Text as Data.Text import qualified Data.ProtoLens.Runtime.Data.Map as Data.Map import qualified Data.ProtoLens.Runtime.Data.ByteString as Data.ByteString import qualified Data.ProtoLens.Runtime.Data.ByteString.Char8 as Data.ByteString.Char8 import qualified Data.ProtoLens.Runtime.Data.Text.Encoding as Data.Text.Encoding import qualified Data.ProtoLens.Runtime.Data.Vector as Data.Vector import qualified Data.ProtoLens.Runtime.Data.Vector.Generic as Data.Vector.Generic import qualified Data.ProtoLens.Runtime.Data.Vector.Unboxed as Data.Vector.Unboxed import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read {- | Fields : * 'Proto.Text_Fields.text' @:: Lens' Payload Data.Text.Text@ -} data Payload = Payload'_constructor {_Payload'text :: !Data.Text.Text, _Payload'_unknownFields :: !Data.ProtoLens.FieldSet} deriving stock (Prelude.Eq, Prelude.Ord) instance Prelude.Show Payload where showsPrec _ __x __s = Prelude.showChar '{' (Prelude.showString (Data.ProtoLens.showMessageShort __x) (Prelude.showChar '}' __s)) instance Data.ProtoLens.Field.HasField Payload "text" Data.Text.Text where fieldOf _ = (Prelude..) (Lens.Family2.Unchecked.lens _Payload'text (\ x__ y__ -> x__ {_Payload'text = y__})) Prelude.id instance Data.ProtoLens.Message Payload where messageName _ = Data.Text.pack "Text.Payload" packedMessageDescriptor _ = "\n\ \\aPayload\DC2\DC2\n\ \\EOTtext\CAN\SOH \SOH(\tR\EOTtext" packedFileDescriptor _ = packedFileDescriptor fieldsByTag = let text__field_descriptor = Data.ProtoLens.FieldDescriptor "text" (Data.ProtoLens.ScalarField Data.ProtoLens.StringField :: Data.ProtoLens.FieldTypeDescriptor Data.Text.Text) (Data.ProtoLens.PlainField Data.ProtoLens.Optional (Data.ProtoLens.Field.field @"text")) :: Data.ProtoLens.FieldDescriptor Payload in Data.Map.fromList [(Data.ProtoLens.Tag 1, text__field_descriptor)] unknownFields = Lens.Family2.Unchecked.lens _Payload'_unknownFields (\ x__ y__ -> x__ {_Payload'_unknownFields = y__}) defMessage = Payload'_constructor {_Payload'text = Data.ProtoLens.fieldDefault, _Payload'_unknownFields = []} parseMessage = let loop :: Payload -> Data.ProtoLens.Encoding.Bytes.Parser Payload loop x = do end <- Data.ProtoLens.Encoding.Bytes.atEnd if end then do (let missing = [] in if Prelude.null missing then Prelude.return () else Prelude.fail ((Prelude.++) "Missing required fields: " (Prelude.show (missing :: [Prelude.String])))) Prelude.return (Lens.Family2.over Data.ProtoLens.unknownFields (\ !t -> Prelude.reverse t) x) else do tag <- Data.ProtoLens.Encoding.Bytes.getVarInt case tag of 10 -> do y <- (Data.ProtoLens.Encoding.Bytes.) (do value <- do len <- Data.ProtoLens.Encoding.Bytes.getVarInt Data.ProtoLens.Encoding.Bytes.getBytes (Prelude.fromIntegral len) Data.ProtoLens.Encoding.Bytes.runEither (case Data.Text.Encoding.decodeUtf8' value of (Prelude.Left err) -> Prelude.Left (Prelude.show err) (Prelude.Right r) -> Prelude.Right r)) "text" loop (Lens.Family2.set (Data.ProtoLens.Field.field @"text") y x) wire -> do !y <- Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire wire loop (Lens.Family2.over Data.ProtoLens.unknownFields (\ !t -> (:) y t) x) in (Data.ProtoLens.Encoding.Bytes.) (do loop Data.ProtoLens.defMessage) "Payload" buildMessage = \ _x -> (Data.Monoid.<>) (let _v = Lens.Family2.view (Data.ProtoLens.Field.field @"text") _x in if (Prelude.==) _v Data.ProtoLens.fieldDefault then Data.Monoid.mempty else (Data.Monoid.<>) (Data.ProtoLens.Encoding.Bytes.putVarInt 10) ((Prelude..) (\ bs -> (Data.Monoid.<>) (Data.ProtoLens.Encoding.Bytes.putVarInt (Prelude.fromIntegral (Data.ByteString.length bs))) (Data.ProtoLens.Encoding.Bytes.putBytes bs)) Data.Text.Encoding.encodeUtf8 _v)) (Data.ProtoLens.Encoding.Wire.buildFieldSet (Lens.Family2.view Data.ProtoLens.unknownFields _x)) instance Control.DeepSeq.NFData Payload where rnf = \ x__ -> Control.DeepSeq.deepseq (_Payload'_unknownFields x__) (Control.DeepSeq.deepseq (_Payload'text x__) ()) packedFileDescriptor :: Data.ByteString.ByteString packedFileDescriptor = "\n\ \\n\ \text.proto\DC2\EOTText\"\GS\n\ \\aPayload\DC2\DC2\n\ \\EOTtext\CAN\SOH \SOH(\tR\EOTtextJz\n\ \\ACK\DC2\EOT\NUL\NUL\ENQ\SOH\n\ \\b\n\ \\SOH\f\DC2\ETX\NUL\NUL\DC2\n\ \\b\n\ \\SOH\STX\DC2\ETX\SOH\NUL\r\n\ \\n\ \\n\ \\STX\EOT\NUL\DC2\EOT\ETX\NUL\ENQ\SOH\n\ \\n\ \\n\ \\ETX\EOT\NUL\SOH\DC2\ETX\ETX\b\SI\n\ \\v\n\ \\EOT\EOT\NUL\STX\NUL\DC2\ETX\EOT\STX\DC2\n\ \\r\n\ \\ENQ\EOT\NUL\STX\NUL\EOT\DC2\EOT\EOT\STX\ETX\DC1\n\ \\f\n\ \\ENQ\EOT\NUL\STX\NUL\ENQ\DC2\ETX\EOT\STX\b\n\ \\f\n\ \\ENQ\EOT\NUL\STX\NUL\SOH\DC2\ETX\EOT\t\r\n\ \\f\n\ \\ENQ\EOT\NUL\STX\NUL\ETX\DC2\ETX\EOT\DLE\DC1b\ACKproto3"