summaryrefslogtreecommitdiff
path: root/src/Network/Riak/Protocol/CounterGetResponse.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Riak/Protocol/CounterGetResponse.hs')
-rw-r--r--src/Network/Riak/Protocol/CounterGetResponse.hs29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/Network/Riak/Protocol/CounterGetResponse.hs b/src/Network/Riak/Protocol/CounterGetResponse.hs
index 8aea689..5864eff 100644
--- a/src/Network/Riak/Protocol/CounterGetResponse.hs
+++ b/src/Network/Riak/Protocol/CounterGetResponse.hs
@@ -1,7 +1,7 @@
-{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses #-}
+{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Riak.Protocol.CounterGetResponse (CounterGetResponse(..)) where
-import Prelude ((+), (/))
+import Prelude ((+), (/), (++), (.))
import qualified Prelude as Prelude'
import qualified Data.Typeable as Prelude'
import qualified GHC.Generics as Prelude'
@@ -9,7 +9,7 @@ import qualified Data.Data as Prelude'
import qualified Text.ProtocolBuffers.Header as P'
data CounterGetResponse = CounterGetResponse{value :: !(P'.Maybe P'.Int64)}
- deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)
+ deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data, Prelude'.Generic)
instance P'.Mergeable CounterGetResponse where
mergeAppend (CounterGetResponse x'1) (CounterGetResponse y'1) = CounterGetResponse (P'.mergeAppend x'1 y'1)
@@ -25,21 +25,24 @@ instance P'.Wire CounterGetResponse where
_ -> P'.wireSizeErr ft' self'
where
calc'Size = (P'.wireSizeOpt 1 18 x'1)
- wirePut ft' self'@(CounterGetResponse x'1)
+ wirePutWithSize ft' self'@(CounterGetResponse x'1)
= case ft' of
10 -> put'Fields
- 11 -> do
- P'.putSize (P'.wireSize 10 self')
- put'Fields
+ 11 -> put'FieldsSized
_ -> P'.wirePutErr ft' self'
where
- put'Fields
- = do
- P'.wirePutOpt 8 18 x'1
+ put'Fields = P'.sequencePutWithSize [P'.wirePutOptWithSize 8 18 x'1]
+ put'FieldsSized
+ = let size' = Prelude'.fst (P'.runPutM put'Fields)
+ put'Size
+ = do
+ P'.putSize size'
+ Prelude'.return (P'.size'WireSize size')
+ in P'.sequencePutWithSize [put'Size, put'Fields]
wireGet ft'
= case ft' of
- 10 -> P'.getBareMessageWith update'Self
- 11 -> P'.getMessageWith update'Self
+ 10 -> P'.getBareMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)
+ 11 -> P'.getMessageWith (P'.catch'Unknown' P'.discardUnknown update'Self)
_ -> P'.wireGetErr ft'
where
update'Self wire'Tag old'Self
@@ -56,7 +59,7 @@ instance P'.ReflectDescriptor CounterGetResponse where
getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [8])
reflectDescriptorInfo _
= Prelude'.read
- "DescriptorInfo {descName = ProtoName {protobufName = FIName \".Protocol.CounterGetResponse\", haskellPrefix = [MName \"Network\",MName \"Riak\"], parentModule = [MName \"Protocol\"], baseName = MName \"CounterGetResponse\"}, descFilePath = [\"Network\",\"Riak\",\"Protocol\",\"CounterGetResponse.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.CounterGetResponse.value\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"CounterGetResponse\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False}"
+ "DescriptorInfo {descName = ProtoName {protobufName = FIName \".Protocol.CounterGetResponse\", haskellPrefix = [MName \"Network\",MName \"Riak\"], parentModule = [MName \"Protocol\"], baseName = MName \"CounterGetResponse\"}, descFilePath = [\"Network\",\"Riak\",\"Protocol\",\"CounterGetResponse.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.CounterGetResponse.value\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"CounterGetResponse\"], baseName' = FName \"value\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"
instance P'.TextType CounterGetResponse where
tellT = P'.tellSubMessage