summaryrefslogtreecommitdiff
path: root/src/Network/Riak/Protocol/SetBucketRequest.hs
diff options
context:
space:
mode:
authorlambda_foo <>2016-03-10 00:13:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2016-03-10 00:13:00 (GMT)
commitf0c96a5d5d1e2cb8e65ed06e071bde4f72c08219 (patch)
tree0013e9b3f852b653dc67f4e8ed9cc1d19156e166 /src/Network/Riak/Protocol/SetBucketRequest.hs
parent6695b915bc0995fc46047ab2655a08618a0af440 (diff)
version 0.21.0.00.21.0.0
Diffstat (limited to 'src/Network/Riak/Protocol/SetBucketRequest.hs')
-rw-r--r--src/Network/Riak/Protocol/SetBucketRequest.hs33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/Network/Riak/Protocol/SetBucketRequest.hs b/src/Network/Riak/Protocol/SetBucketRequest.hs
index e976010..ab0b9df 100644
--- a/src/Network/Riak/Protocol/SetBucketRequest.hs
+++ b/src/Network/Riak/Protocol/SetBucketRequest.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
+{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Riak.Protocol.SetBucketRequest (SetBucketRequest(..)) where
import Prelude ((+), (/))
@@ -8,25 +8,26 @@ 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),
+ type' :: !(P'.Maybe P'.ByteString)}
deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data)
instance P'.Mergeable SetBucketRequest where
- mergeAppend (SetBucketRequest x'1 x'2) (SetBucketRequest y'1 y'2)
- = SetBucketRequest (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)
+ mergeAppend (SetBucketRequest x'1 x'2 x'3) (SetBucketRequest y'1 y'2 y'3)
+ = SetBucketRequest (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3)
instance P'.Default SetBucketRequest where
- defaultValue = SetBucketRequest P'.defaultValue P'.defaultValue
+ defaultValue = SetBucketRequest P'.defaultValue P'.defaultValue P'.defaultValue
instance P'.Wire SetBucketRequest where
- wireSize ft' self'@(SetBucketRequest x'1 x'2)
+ wireSize ft' self'@(SetBucketRequest x'1 x'2 x'3)
= case ft' of
10 -> calc'Size
11 -> P'.prependMessageSize calc'Size
_ -> P'.wireSizeErr ft' self'
where
- calc'Size = (P'.wireSizeReq 1 12 x'1 + P'.wireSizeReq 1 11 x'2)
- wirePut ft' self'@(SetBucketRequest x'1 x'2)
+ 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)
= case ft' of
10 -> put'Fields
11 -> do
@@ -38,6 +39,7 @@ instance P'.Wire SetBucketRequest where
= do
P'.wirePutReq 10 12 x'1
P'.wirePutReq 18 11 x'2
+ P'.wirePutOpt 26 12 x'3
wireGet ft'
= case ft' of
10 -> P'.getBareMessageWith update'Self
@@ -48,6 +50,7 @@ instance P'.Wire SetBucketRequest where
= case wire'Tag of
10 -> Prelude'.fmap (\ !new'Field -> old'Self{bucket = new'Field}) (P'.wireGet 12)
18 -> Prelude'.fmap (\ !new'Field -> old'Self{props = P'.mergeAppend (props old'Self) (new'Field)}) (P'.wireGet 11)
+ 26 -> Prelude'.fmap (\ !new'Field -> old'Self{type' = Prelude'.Just new'Field}) (P'.wireGet 12)
_ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self
instance P'.MessageAPI msg' (msg' -> SetBucketRequest) SetBucketRequest where
@@ -56,10 +59,10 @@ instance P'.MessageAPI msg' (msg' -> SetBucketRequest) SetBucketRequest where
instance P'.GPB SetBucketRequest
instance P'.ReflectDescriptor SetBucketRequest where
- getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList [10, 18]) (P'.fromDistinctAscList [10, 18])
+ 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\"}, 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}"
+ "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}], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False, makeLenses = False}"
instance P'.TextType SetBucketRequest where
tellT = P'.tellSubMessage
@@ -70,9 +73,10 @@ instance P'.TextMsg SetBucketRequest where
= do
P'.tellT "bucket" (bucket msg)
P'.tellT "props" (props msg)
+ P'.tellT "type" (type' msg)
textGet
= do
- mods <- P'.sepEndBy (P'.choice [parse'bucket, parse'props]) P'.spaces
+ mods <- P'.sepEndBy (P'.choice [parse'bucket, parse'props, parse'type']) P'.spaces
Prelude'.return (Prelude'.foldl (\ v f -> f v) P'.defaultValue mods)
where
parse'bucket
@@ -84,4 +88,9 @@ instance P'.TextMsg SetBucketRequest where
= P'.try
(do
v <- P'.getT "props"
- Prelude'.return (\ o -> o{props = v})) \ No newline at end of file
+ Prelude'.return (\ o -> o{props = v}))
+ parse'type'
+ = P'.try
+ (do
+ v <- P'.getT "type"
+ Prelude'.return (\ o -> o{type' = v})) \ No newline at end of file