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

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

newtype StringMsg = StringMsg
  { value :: PB.Text
  } deriving (PB.Show, PB.Eq, PB.Ord)

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

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

instance PB.Required StringMsg where
  reqTags _ = PB.fromList [PB.WireTag 1 PB.LenDelim]

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

  messageToFields self = do
    PB.putString (PB.WireTag 1 PB.LenDelim) (value self)


