{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}

{-|
Module      : $Header$
Copyright   : (c) 2015 Deakin Software and Technology Innovation Lab
License     : BSD3

Maintainer  : Rhys Adams <rhys.adams@deakin.edu.au>
Stability   : unstable
Portability : portable

Unused protocol buffer types.
-}

module Network.Protocol.Riemann.Unused (State, Query, Attribute, key, value) where

import Data.Int (Int64)
import Data.ProtocolBuffers (Encode, Decode, Optional, Value, Required, Repeated, Message, field)
import Data.Text (Text)
import GHC.Generics (Generic)
import Lens.Micro.Platform (Lens', makeLenses)

data State = State { _time          :: Optional 1  (Value Int64)
                   , _state         :: Optional 2  (Value Text)
                   , _service       :: Optional 3  (Value Text)
                   , _host          :: Optional 4  (Value Text)
                   , _description   :: Optional 5  (Value Text)
                   , _once          :: Optional 6  (Value Bool)
                   , _tags          :: Repeated 7  (Value Text)
                   , _ttl           :: Optional 8  (Value Float)
                   , _attributes    :: Repeated 9  (Message Attribute) }
             deriving (Show, Generic)

data Query = Query { _string        :: Optional 1  (Value Text) }
             deriving (Show, Generic)

data Attribute = Attribute { __key    :: Required 1  (Value Text)
                           , __value  :: Required 2  (Value Text) }
                 deriving (Eq, Show, Generic)

$(makeLenses ''Attribute)

key :: Lens' Attribute Text
key = _key . field

value :: Lens' Attribute Text
value = _value . field

instance Encode Attribute
instance Decode Attribute
instance Encode Query
instance Decode Query
instance Encode State
instance Decode State
