-- Generated by protobuf-simple. DO NOT EDIT!
module Types.UInt32OptMsg where

import Control.Applicative ((<$>))
import Prelude ()
import qualified Data.ProtoBufInt as PB

newtype UInt32OptMsg = UInt32OptMsg
  { value :: PB.Maybe PB.Word32
  } deriving (PB.Show, PB.Eq, PB.Ord)

instance PB.Default UInt32OptMsg where
  defaultVal = UInt32OptMsg
    { value = PB.defaultVal
    }

instance PB.Mergeable UInt32OptMsg where
  merge a b = UInt32OptMsg
    { value = PB.merge (value a) (value b)
    }

instance PB.Required UInt32OptMsg where
  reqTags _ = PB.fromList []

instance PB.WireMessage UInt32OptMsg where
  fieldToValue (PB.WireTag 1 PB.VarInt) self = (\v -> self{value = PB.merge (value self) v}) <$> PB.getUInt32Opt
  fieldToValue tag self = PB.getUnknown tag self

  messageToFields self = do
    PB.putUInt32Opt (PB.WireTag 1 PB.VarInt) (value self)