summaryrefslogtreecommitdiff
path: root/src/Network/Riak/Protocol/SetBucketRequest.hs
diff options
context:
space:
mode:
authorlambda_foo <>2019-03-04 01:34:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-03-04 01:34:00 (GMT)
commit2c2d656ee1071cdfce809e618b31fbf85781a5f7 (patch)
tree5eeca137ac5d32c27873545673ded452e48aa6dd /src/Network/Riak/Protocol/SetBucketRequest.hs
parenta19c2cf609349d6e19a899906d554d1b78020c31 (diff)
version 0.24.0.0HEAD0.24.0.0master
Diffstat (limited to 'src/Network/Riak/Protocol/SetBucketRequest.hs')
-rw-r--r--src/Network/Riak/Protocol/SetBucketRequest.hs31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/Network/Riak/Protocol/SetBucketRequest.hs b/src/Network/Riak/Protocol/SetBucketRequest.hs
index f2c3e8f..25bfb71 100644
--- a/src/Network/Riak/Protocol/SetBucketRequest.hs
+++ b/src/Network/Riak/Protocol/SetBucketRequest.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.SetBucketRequest (SetBucketRequest(..)) where
-import Prelude ((+), (/))
+import Prelude ((+), (/), (++), (.))
import qualified Prelude as Prelude'
import qualified Data.Typeable as Prelude'
import qualified GHC.Generics as Prelude'
@@ -11,7 +11,7 @@ import qualified Network.Riak.Protocol.BucketProps as Protocol (BucketProps)
data SetBucketRequest = SetBucketRequest{bucket :: !(P'.ByteString), props :: !(Protocol.BucketProps),
type' :: !(P'.Maybe P'.ByteString)}
- 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 SetBucketRequest where
mergeAppend (SetBucketRequest x'1 x'2 x'3) (SetBucketRequest y'1 y'2 y'3)
@@ -28,23 +28,26 @@ instance P'.Wire SetBucketRequest where
_ -> P'.wireSizeErr ft' self'
where
calc'Size = (P'.wireSizeReq 1 12 x'1 + P'.wireSizeReq 1 11 x'2 + P'.wireSizeOpt 1 12 x'3)
- wirePut ft' self'@(SetBucketRequest x'1 x'2 x'3)
+ wirePutWithSize ft' self'@(SetBucketRequest x'1 x'2 x'3)
= 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'.wirePutReq 10 12 x'1
- P'.wirePutReq 18 11 x'2
- P'.wirePutOpt 26 12 x'3
+ = P'.sequencePutWithSize
+ [P'.wirePutReqWithSize 10 12 x'1, P'.wirePutReqWithSize 18 11 x'2, P'.wirePutOptWithSize 26 12 x'3]
+ 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
@@ -63,7 +66,7 @@ instance P'.ReflectDescriptor SetBucketRequest where
getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [10, 18]) (P'.fromDistinctAscList [10, 18, 26])
reflectDescriptorInfo _
= Prelude'.read
- "DescriptorInfo {descName = ProtoName {protobufName = FIName \".Protocol.SetBucketRequest\", haskellPrefix = [MName \"Network\",MName \"Riak\"], parentModule = [MName \"Protocol\"], baseName = MName \"SetBucketRequest\"}, descFilePath = [\"Network\",\"Riak\",\"Protocol\",\"SetBucketRequest.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.SetBucketRequest.bucket\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"SetBucketRequest\"], baseName' = FName \"bucket\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.SetBucketRequest.props\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"SetBucketRequest\"], baseName' = FName \"props\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".Protocol.BucketProps\", haskellPrefix = [MName \"Network\",MName \"Riak\"], parentModule = [MName \"Protocol\"], baseName = MName \"BucketProps\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.SetBucketRequest.type\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"SetBucketRequest\"], baseName' = FName \"type'\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, 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.SetBucketRequest\", haskellPrefix = [MName \"Network\",MName \"Riak\"], parentModule = [MName \"Protocol\"], baseName = MName \"SetBucketRequest\"}, descFilePath = [\"Network\",\"Riak\",\"Protocol\",\"SetBucketRequest.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.SetBucketRequest.bucket\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"SetBucketRequest\"], baseName' = FName \"bucket\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.SetBucketRequest.props\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"SetBucketRequest\"], baseName' = FName \"props\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = True, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {protobufName = FIName \".Protocol.BucketProps\", haskellPrefix = [MName \"Network\",MName \"Riak\"], parentModule = [MName \"Protocol\"], baseName = MName \"BucketProps\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".Protocol.SetBucketRequest.type\", haskellPrefix' = [MName \"Network\",MName \"Riak\"], parentModule' = [MName \"Protocol\",MName \"SetBucketRequest\"], baseName' = FName \"type'\", baseNamePrefix' = \"\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], descOneofs = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False, jsonInstances = False}"
instance P'.TextType SetBucketRequest where
tellT = P'.tellSubMessage