summaryrefslogtreecommitdiff
path: root/src/Network/Riak/Protocol/SetBucketRequest.hs
diff options
context:
space:
mode:
authorlambda_foo <>2015-09-10 22:55:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2015-09-10 22:55:00 (GMT)
commit6695b915bc0995fc46047ab2655a08618a0af440 (patch)
treed818079374505fcb495858176559e6867f49d0f9 /src/Network/Riak/Protocol/SetBucketRequest.hs
parentd6842f04f3f40067b18f9bae1b08717e09da89cc (diff)
version 0.20.0.00.20.0.0
Diffstat (limited to 'src/Network/Riak/Protocol/SetBucketRequest.hs')
-rw-r--r--src/Network/Riak/Protocol/SetBucketRequest.hs31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/Network/Riak/Protocol/SetBucketRequest.hs b/src/Network/Riak/Protocol/SetBucketRequest.hs
index 3b607cd..e976010 100644
--- a/src/Network/Riak/Protocol/SetBucketRequest.hs
+++ b/src/Network/Riak/Protocol/SetBucketRequest.hs
@@ -1,5 +1,5 @@
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Riak.Protocol.SetBucketRequest (SetBucketRequest(..)) where
import Prelude ((+), (/))
import qualified Prelude as Prelude'
@@ -8,7 +8,7 @@ import qualified Data.Data as Prelude'
import qualified Text.ProtocolBuffers.Header as P'
import qualified Network.Riak.Protocol.BucketProps as Protocol (BucketProps)
-data SetBucketRequest = SetBucketRequest{bucket :: !P'.ByteString, props :: !Protocol.BucketProps}
+data SetBucketRequest = SetBucketRequest{bucket :: !(P'.ByteString), props :: !(Protocol.BucketProps)}
deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data)
instance P'.Mergeable SetBucketRequest where
@@ -59,4 +59,29 @@ instance P'.ReflectDescriptor SetBucketRequest where
getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [10, 18]) (P'.fromDistinctAscList [10, 18])
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\"}, 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\"}, 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}], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False}" \ No newline at end of file
+ "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\"}, 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\"}, 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}], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False}"
+
+instance P'.TextType SetBucketRequest where
+ tellT = P'.tellSubMessage
+ getT = P'.getSubMessage
+
+instance P'.TextMsg SetBucketRequest where
+ textPut msg
+ = do
+ P'.tellT "bucket" (bucket msg)
+ P'.tellT "props" (props msg)
+ textGet
+ = do
+ mods <- P'.sepEndBy (P'.choice [parse'bucket, parse'props]) P'.spaces
+ Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)
+ where
+ parse'bucket
+ = P'.try
+ (do
+ v <- P'.getT "bucket"
+ Prelude'.return (\ o -> o{bucket = v}))
+ parse'props
+ = P'.try
+ (do
+ v <- P'.getT "props"
+ Prelude'.return (\ o -> o{props = v})) \ No newline at end of file