{- This file was auto-generated from tendermint/tendermint/libs/common/types.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
module Proto.Tendermint.Tendermint.Libs.Common.Types (
        KI64Pair(), KVPair()
    ) 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
import qualified Proto.Gogo.Protobuf.Gogoproto.Gogo
{- | Fields :
     
         * 'Proto.Tendermint.Tendermint.Libs.Common.Types_Fields.key' @:: Lens' KI64Pair Data.ByteString.ByteString@
         * 'Proto.Tendermint.Tendermint.Libs.Common.Types_Fields.value' @:: Lens' KI64Pair Data.Int.Int64@ -}
data KI64Pair
  = KI64Pair'_constructor {KI64Pair -> ByteString
_KI64Pair'key :: !Data.ByteString.ByteString,
                           KI64Pair -> Int64
_KI64Pair'value :: !Data.Int.Int64,
                           KI64Pair -> FieldSet
_KI64Pair'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving (KI64Pair -> KI64Pair -> Bool
(KI64Pair -> KI64Pair -> Bool)
-> (KI64Pair -> KI64Pair -> Bool) -> Eq KI64Pair
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KI64Pair -> KI64Pair -> Bool
$c/= :: KI64Pair -> KI64Pair -> Bool
== :: KI64Pair -> KI64Pair -> Bool
$c== :: KI64Pair -> KI64Pair -> Bool
Prelude.Eq, Eq KI64Pair
Eq KI64Pair =>
(KI64Pair -> KI64Pair -> Ordering)
-> (KI64Pair -> KI64Pair -> Bool)
-> (KI64Pair -> KI64Pair -> Bool)
-> (KI64Pair -> KI64Pair -> Bool)
-> (KI64Pair -> KI64Pair -> Bool)
-> (KI64Pair -> KI64Pair -> KI64Pair)
-> (KI64Pair -> KI64Pair -> KI64Pair)
-> Ord KI64Pair
KI64Pair -> KI64Pair -> Bool
KI64Pair -> KI64Pair -> Ordering
KI64Pair -> KI64Pair -> KI64Pair
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: KI64Pair -> KI64Pair -> KI64Pair
$cmin :: KI64Pair -> KI64Pair -> KI64Pair
max :: KI64Pair -> KI64Pair -> KI64Pair
$cmax :: KI64Pair -> KI64Pair -> KI64Pair
>= :: KI64Pair -> KI64Pair -> Bool
$c>= :: KI64Pair -> KI64Pair -> Bool
> :: KI64Pair -> KI64Pair -> Bool
$c> :: KI64Pair -> KI64Pair -> Bool
<= :: KI64Pair -> KI64Pair -> Bool
$c<= :: KI64Pair -> KI64Pair -> Bool
< :: KI64Pair -> KI64Pair -> Bool
$c< :: KI64Pair -> KI64Pair -> Bool
compare :: KI64Pair -> KI64Pair -> Ordering
$ccompare :: KI64Pair -> KI64Pair -> Ordering
$cp1Ord :: Eq KI64Pair
Prelude.Ord)
instance Prelude.Show KI64Pair where
  showsPrec :: Int -> KI64Pair -> ShowS
showsPrec _ __x :: KI64Pair
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (KI64Pair -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort KI64Pair
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField KI64Pair "key" Data.ByteString.ByteString where
  fieldOf :: Proxy# "key"
-> (ByteString -> f ByteString) -> KI64Pair -> f KI64Pair
fieldOf _
    = ((ByteString -> f ByteString) -> KI64Pair -> f KI64Pair)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> KI64Pair
-> f KI64Pair
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((KI64Pair -> ByteString)
-> (KI64Pair -> ByteString -> KI64Pair)
-> Lens KI64Pair KI64Pair ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           KI64Pair -> ByteString
_KI64Pair'key (\ x__ :: KI64Pair
x__ y__ :: ByteString
y__ -> KI64Pair
x__ {_KI64Pair'key :: ByteString
_KI64Pair'key = ByteString
y__}))
        (ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField KI64Pair "value" Data.Int.Int64 where
  fieldOf :: Proxy# "value" -> (Int64 -> f Int64) -> KI64Pair -> f KI64Pair
fieldOf _
    = ((Int64 -> f Int64) -> KI64Pair -> f KI64Pair)
-> ((Int64 -> f Int64) -> Int64 -> f Int64)
-> (Int64 -> f Int64)
-> KI64Pair
-> f KI64Pair
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((KI64Pair -> Int64)
-> (KI64Pair -> Int64 -> KI64Pair)
-> Lens KI64Pair KI64Pair Int64 Int64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           KI64Pair -> Int64
_KI64Pair'value (\ x__ :: KI64Pair
x__ y__ :: Int64
y__ -> KI64Pair
x__ {_KI64Pair'value :: Int64
_KI64Pair'value = Int64
y__}))
        (Int64 -> f Int64) -> Int64 -> f Int64
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message KI64Pair where
  messageName :: Proxy KI64Pair -> Text
messageName _ = String -> Text
Data.Text.pack "common.KI64Pair"
  fieldsByTag :: Map Tag (FieldDescriptor KI64Pair)
fieldsByTag
    = let
        key__field_descriptor :: FieldDescriptor KI64Pair
key__field_descriptor
          = String
-> FieldTypeDescriptor ByteString
-> FieldAccessor KI64Pair ByteString
-> FieldDescriptor KI64Pair
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "key"
              (ScalarField ByteString -> FieldTypeDescriptor ByteString
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField ByteString
Data.ProtoLens.BytesField ::
                 Data.ProtoLens.FieldTypeDescriptor Data.ByteString.ByteString)
              (WireDefault ByteString
-> Lens KI64Pair KI64Pair ByteString ByteString
-> FieldAccessor KI64Pair ByteString
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault ByteString
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key")) ::
              Data.ProtoLens.FieldDescriptor KI64Pair
        value__field_descriptor :: FieldDescriptor KI64Pair
value__field_descriptor
          = String
-> FieldTypeDescriptor Int64
-> FieldAccessor KI64Pair Int64
-> FieldDescriptor KI64Pair
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "value"
              (ScalarField Int64 -> FieldTypeDescriptor Int64
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Int64
Data.ProtoLens.Int64Field ::
                 Data.ProtoLens.FieldTypeDescriptor Data.Int.Int64)
              (WireDefault Int64
-> Lens KI64Pair KI64Pair Int64 Int64
-> FieldAccessor KI64Pair Int64
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault Int64
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "value" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"value")) ::
              Data.ProtoLens.FieldDescriptor KI64Pair
      in
        [(Tag, FieldDescriptor KI64Pair)]
-> Map Tag (FieldDescriptor KI64Pair)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor KI64Pair
key__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor KI64Pair
value__field_descriptor)]
  unknownFields :: LensLike' f KI64Pair FieldSet
unknownFields
    = (KI64Pair -> FieldSet)
-> (KI64Pair -> FieldSet -> KI64Pair) -> Lens' KI64Pair FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        KI64Pair -> FieldSet
_KI64Pair'_unknownFields
        (\ x__ :: KI64Pair
x__ y__ :: FieldSet
y__ -> KI64Pair
x__ {_KI64Pair'_unknownFields :: FieldSet
_KI64Pair'_unknownFields = FieldSet
y__})
  defMessage :: KI64Pair
defMessage
    = $WKI64Pair'_constructor :: ByteString -> Int64 -> FieldSet -> KI64Pair
KI64Pair'_constructor
        {_KI64Pair'key :: ByteString
_KI64Pair'key = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _KI64Pair'value :: Int64
_KI64Pair'value = Int64
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _KI64Pair'_unknownFields :: FieldSet
_KI64Pair'_unknownFields = []}
  parseMessage :: Parser KI64Pair
parseMessage
    = let
        loop :: KI64Pair -> Data.ProtoLens.Encoding.Bytes.Parser KI64Pair
        loop :: KI64Pair -> Parser KI64Pair
loop x :: KI64Pair
x
          = do Bool
end <- Parser Bool
Data.ProtoLens.Encoding.Bytes.atEnd
               if Bool
end then
                   do (let missing :: [a]
missing = []
                       in
                         if [Any] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
Prelude.null [Any]
forall a. [a]
missing then
                             () -> Parser ()
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return ()
                         else
                             String -> Parser ()
forall (m :: * -> *) a. MonadFail m => String -> m a
Prelude.fail
                               (String -> ShowS
forall a. [a] -> [a] -> [a]
(Prelude.++)
                                  "Missing required fields: "
                                  ([String] -> String
forall a. Show a => a -> String
Prelude.show ([String]
forall a. [a]
missing :: [Prelude.String]))))
                      KI64Pair -> Parser KI64Pair
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter KI64Pair KI64Pair FieldSet FieldSet
-> (FieldSet -> FieldSet) -> KI64Pair -> KI64Pair
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                           forall msg. Message msg => Lens' msg FieldSet
Setter KI64Pair KI64Pair FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) KI64Pair
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        10
                          -> do ByteString
y <- Parser ByteString -> String -> Parser ByteString
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser ByteString
Data.ProtoLens.Encoding.Bytes.getBytes
                                             (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len))
                                       "key"
                                KI64Pair -> Parser KI64Pair
loop (Setter KI64Pair KI64Pair ByteString ByteString
-> ByteString -> KI64Pair -> KI64Pair
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key") ByteString
y KI64Pair
x)
                        16
                          -> do Int64
y <- Parser Int64 -> String -> Parser Int64
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       ((Word64 -> Int64) -> Parser Word64 -> Parser Int64
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap
                                          Word64 -> Int64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral
                                          Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt)
                                       "value"
                                KI64Pair -> Parser KI64Pair
loop (Setter KI64Pair KI64Pair Int64 Int64
-> Int64 -> KI64Pair -> KI64Pair
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "value" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"value") Int64
y KI64Pair
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                KI64Pair -> Parser KI64Pair
loop
                                  (Setter KI64Pair KI64Pair FieldSet FieldSet
-> (FieldSet -> FieldSet) -> KI64Pair -> KI64Pair
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                                     forall msg. Message msg => Lens' msg FieldSet
Setter KI64Pair KI64Pair FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) KI64Pair
x)
      in
        Parser KI64Pair -> String -> Parser KI64Pair
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do KI64Pair -> Parser KI64Pair
loop KI64Pair
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "KI64Pair"
  buildMessage :: KI64Pair -> Builder
buildMessage
    = \ _x :: KI64Pair
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (let _v :: ByteString
_v = FoldLike ByteString KI64Pair KI64Pair ByteString ByteString
-> KI64Pair -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key") KI64Pair
_x
              in
                if ByteString -> ByteString -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) ByteString
_v ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
                    Builder
forall a. Monoid a => a
Data.Monoid.mempty
                else
                    Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                      (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 10)
                      ((\ bs :: ByteString
bs
                          -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                               (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
                                  (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
                               (ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
                         ByteString
_v))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (let
                   _v :: Int64
_v = FoldLike Int64 KI64Pair KI64Pair Int64 Int64 -> KI64Pair -> Int64
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "value" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"value") KI64Pair
_x
                 in
                   if Int64 -> Int64 -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Int64
_v Int64
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
                       Builder
forall a. Monoid a => a
Data.Monoid.mempty
                   else
                       Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                         (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 16)
                         ((Word64 -> Builder) -> (Int64 -> Word64) -> Int64 -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                            Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt Int64 -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Int64
_v))
                (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                   (FoldLike FieldSet KI64Pair KI64Pair FieldSet FieldSet
-> KI64Pair -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet KI64Pair KI64Pair FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields KI64Pair
_x)))
instance Control.DeepSeq.NFData KI64Pair where
  rnf :: KI64Pair -> ()
rnf
    = \ x__ :: KI64Pair
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (KI64Pair -> FieldSet
_KI64Pair'_unknownFields KI64Pair
x__)
             (ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (KI64Pair -> ByteString
_KI64Pair'key KI64Pair
x__)
                (Int64 -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (KI64Pair -> Int64
_KI64Pair'value KI64Pair
x__) ()))
{- | Fields :
     
         * 'Proto.Tendermint.Tendermint.Libs.Common.Types_Fields.key' @:: Lens' KVPair Data.ByteString.ByteString@
         * 'Proto.Tendermint.Tendermint.Libs.Common.Types_Fields.value' @:: Lens' KVPair Data.ByteString.ByteString@ -}
data KVPair
  = KVPair'_constructor {KVPair -> ByteString
_KVPair'key :: !Data.ByteString.ByteString,
                         KVPair -> ByteString
_KVPair'value :: !Data.ByteString.ByteString,
                         KVPair -> FieldSet
_KVPair'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving (KVPair -> KVPair -> Bool
(KVPair -> KVPair -> Bool)
-> (KVPair -> KVPair -> Bool) -> Eq KVPair
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KVPair -> KVPair -> Bool
$c/= :: KVPair -> KVPair -> Bool
== :: KVPair -> KVPair -> Bool
$c== :: KVPair -> KVPair -> Bool
Prelude.Eq, Eq KVPair
Eq KVPair =>
(KVPair -> KVPair -> Ordering)
-> (KVPair -> KVPair -> Bool)
-> (KVPair -> KVPair -> Bool)
-> (KVPair -> KVPair -> Bool)
-> (KVPair -> KVPair -> Bool)
-> (KVPair -> KVPair -> KVPair)
-> (KVPair -> KVPair -> KVPair)
-> Ord KVPair
KVPair -> KVPair -> Bool
KVPair -> KVPair -> Ordering
KVPair -> KVPair -> KVPair
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: KVPair -> KVPair -> KVPair
$cmin :: KVPair -> KVPair -> KVPair
max :: KVPair -> KVPair -> KVPair
$cmax :: KVPair -> KVPair -> KVPair
>= :: KVPair -> KVPair -> Bool
$c>= :: KVPair -> KVPair -> Bool
> :: KVPair -> KVPair -> Bool
$c> :: KVPair -> KVPair -> Bool
<= :: KVPair -> KVPair -> Bool
$c<= :: KVPair -> KVPair -> Bool
< :: KVPair -> KVPair -> Bool
$c< :: KVPair -> KVPair -> Bool
compare :: KVPair -> KVPair -> Ordering
$ccompare :: KVPair -> KVPair -> Ordering
$cp1Ord :: Eq KVPair
Prelude.Ord)
instance Prelude.Show KVPair where
  showsPrec :: Int -> KVPair -> ShowS
showsPrec _ __x :: KVPair
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (KVPair -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort KVPair
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField KVPair "key" Data.ByteString.ByteString where
  fieldOf :: Proxy# "key" -> (ByteString -> f ByteString) -> KVPair -> f KVPair
fieldOf _
    = ((ByteString -> f ByteString) -> KVPair -> f KVPair)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> KVPair
-> f KVPair
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((KVPair -> ByteString)
-> (KVPair -> ByteString -> KVPair)
-> Lens KVPair KVPair ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           KVPair -> ByteString
_KVPair'key (\ x__ :: KVPair
x__ y__ :: ByteString
y__ -> KVPair
x__ {_KVPair'key :: ByteString
_KVPair'key = ByteString
y__}))
        (ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField KVPair "value" Data.ByteString.ByteString where
  fieldOf :: Proxy# "value"
-> (ByteString -> f ByteString) -> KVPair -> f KVPair
fieldOf _
    = ((ByteString -> f ByteString) -> KVPair -> f KVPair)
-> ((ByteString -> f ByteString) -> ByteString -> f ByteString)
-> (ByteString -> f ByteString)
-> KVPair
-> f KVPair
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((KVPair -> ByteString)
-> (KVPair -> ByteString -> KVPair)
-> Lens KVPair KVPair ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           KVPair -> ByteString
_KVPair'value (\ x__ :: KVPair
x__ y__ :: ByteString
y__ -> KVPair
x__ {_KVPair'value :: ByteString
_KVPair'value = ByteString
y__}))
        (ByteString -> f ByteString) -> ByteString -> f ByteString
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message KVPair where
  messageName :: Proxy KVPair -> Text
messageName _ = String -> Text
Data.Text.pack "common.KVPair"
  fieldsByTag :: Map Tag (FieldDescriptor KVPair)
fieldsByTag
    = let
        key__field_descriptor :: FieldDescriptor KVPair
key__field_descriptor
          = String
-> FieldTypeDescriptor ByteString
-> FieldAccessor KVPair ByteString
-> FieldDescriptor KVPair
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "key"
              (ScalarField ByteString -> FieldTypeDescriptor ByteString
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField ByteString
Data.ProtoLens.BytesField ::
                 Data.ProtoLens.FieldTypeDescriptor Data.ByteString.ByteString)
              (WireDefault ByteString
-> Lens KVPair KVPair ByteString ByteString
-> FieldAccessor KVPair ByteString
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault ByteString
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key")) ::
              Data.ProtoLens.FieldDescriptor KVPair
        value__field_descriptor :: FieldDescriptor KVPair
value__field_descriptor
          = String
-> FieldTypeDescriptor ByteString
-> FieldAccessor KVPair ByteString
-> FieldDescriptor KVPair
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "value"
              (ScalarField ByteString -> FieldTypeDescriptor ByteString
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField ByteString
Data.ProtoLens.BytesField ::
                 Data.ProtoLens.FieldTypeDescriptor Data.ByteString.ByteString)
              (WireDefault ByteString
-> Lens KVPair KVPair ByteString ByteString
-> FieldAccessor KVPair ByteString
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault ByteString
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "value" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"value")) ::
              Data.ProtoLens.FieldDescriptor KVPair
      in
        [(Tag, FieldDescriptor KVPair)] -> Map Tag (FieldDescriptor KVPair)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor KVPair
key__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor KVPair
value__field_descriptor)]
  unknownFields :: LensLike' f KVPair FieldSet
unknownFields
    = (KVPair -> FieldSet)
-> (KVPair -> FieldSet -> KVPair) -> Lens' KVPair FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        KVPair -> FieldSet
_KVPair'_unknownFields
        (\ x__ :: KVPair
x__ y__ :: FieldSet
y__ -> KVPair
x__ {_KVPair'_unknownFields :: FieldSet
_KVPair'_unknownFields = FieldSet
y__})
  defMessage :: KVPair
defMessage
    = $WKVPair'_constructor :: ByteString -> ByteString -> FieldSet -> KVPair
KVPair'_constructor
        {_KVPair'key :: ByteString
_KVPair'key = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _KVPair'value :: ByteString
_KVPair'value = ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _KVPair'_unknownFields :: FieldSet
_KVPair'_unknownFields = []}
  parseMessage :: Parser KVPair
parseMessage
    = let
        loop :: KVPair -> Data.ProtoLens.Encoding.Bytes.Parser KVPair
        loop :: KVPair -> Parser KVPair
loop x :: KVPair
x
          = do Bool
end <- Parser Bool
Data.ProtoLens.Encoding.Bytes.atEnd
               if Bool
end then
                   do (let missing :: [a]
missing = []
                       in
                         if [Any] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
Prelude.null [Any]
forall a. [a]
missing then
                             () -> Parser ()
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return ()
                         else
                             String -> Parser ()
forall (m :: * -> *) a. MonadFail m => String -> m a
Prelude.fail
                               (String -> ShowS
forall a. [a] -> [a] -> [a]
(Prelude.++)
                                  "Missing required fields: "
                                  ([String] -> String
forall a. Show a => a -> String
Prelude.show ([String]
forall a. [a]
missing :: [Prelude.String]))))
                      KVPair -> Parser KVPair
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter KVPair KVPair FieldSet FieldSet
-> (FieldSet -> FieldSet) -> KVPair -> KVPair
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                           forall msg. Message msg => Lens' msg FieldSet
Setter KVPair KVPair FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) KVPair
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        10
                          -> do ByteString
y <- Parser ByteString -> String -> Parser ByteString
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser ByteString
Data.ProtoLens.Encoding.Bytes.getBytes
                                             (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len))
                                       "key"
                                KVPair -> Parser KVPair
loop (Setter KVPair KVPair ByteString ByteString
-> ByteString -> KVPair -> KVPair
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key") ByteString
y KVPair
x)
                        18
                          -> do ByteString
y <- Parser ByteString -> String -> Parser ByteString
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser ByteString
Data.ProtoLens.Encoding.Bytes.getBytes
                                             (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len))
                                       "value"
                                KVPair -> Parser KVPair
loop (Setter KVPair KVPair ByteString ByteString
-> ByteString -> KVPair -> KVPair
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "value" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"value") ByteString
y KVPair
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                KVPair -> Parser KVPair
loop
                                  (Setter KVPair KVPair FieldSet FieldSet
-> (FieldSet -> FieldSet) -> KVPair -> KVPair
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                                     forall msg. Message msg => Lens' msg FieldSet
Setter KVPair KVPair FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) KVPair
x)
      in
        Parser KVPair -> String -> Parser KVPair
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do KVPair -> Parser KVPair
loop KVPair
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "KVPair"
  buildMessage :: KVPair -> Builder
buildMessage
    = \ _x :: KVPair
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (let _v :: ByteString
_v = FoldLike ByteString KVPair KVPair ByteString ByteString
-> KVPair -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "key" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"key") KVPair
_x
              in
                if ByteString -> ByteString -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) ByteString
_v ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
                    Builder
forall a. Monoid a => a
Data.Monoid.mempty
                else
                    Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                      (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 10)
                      ((\ bs :: ByteString
bs
                          -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                               (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
                                  (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
                               (ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
                         ByteString
_v))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (let
                   _v :: ByteString
_v = FoldLike ByteString KVPair KVPair ByteString ByteString
-> KVPair -> ByteString
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "value" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"value") KVPair
_x
                 in
                   if ByteString -> ByteString -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) ByteString
_v ByteString
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
                       Builder
forall a. Monoid a => a
Data.Monoid.mempty
                   else
                       Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                         (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 18)
                         ((\ bs :: ByteString
bs
                             -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                                  (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
                                     (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
                                  (ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
                            ByteString
_v))
                (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                   (FoldLike FieldSet KVPair KVPair FieldSet FieldSet
-> KVPair -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet KVPair KVPair FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields KVPair
_x)))
instance Control.DeepSeq.NFData KVPair where
  rnf :: KVPair -> ()
rnf
    = \ x__ :: KVPair
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (KVPair -> FieldSet
_KVPair'_unknownFields KVPair
x__)
             (ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (KVPair -> ByteString
_KVPair'key KVPair
x__) (ByteString -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (KVPair -> ByteString
_KVPair'value KVPair
x__) ()))