{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell   #-}

module CoinbasePro.WebSocketFeed.Channel.Full.Activate
    ( Activate (..)
    ) where

import           Data.Aeson.Casing (snakeCase)
import           Data.Aeson.TH     (defaultOptions, deriveJSON,
                                    fieldLabelModifier)
import           Data.Text         (Text)
import           Data.Time.Clock   (UTCTime)

import           CoinbasePro.Types (Funds, OrderId, Price, ProductId, ProfileId,
                                    Side, Size, UserId)


type StopType     = Text


data Activate = Activate
    { Activate -> ProductId
productId :: ProductId
    , Activate -> UTCTime
timestamp :: UTCTime
    , Activate -> OrderId
orderId   :: OrderId
    , Activate -> StopType
stopType  :: StopType
    , Activate -> Side
side      :: Side
    , Activate -> Price
stopPrice :: Price
    , Activate -> Size
size      :: Size
    , Activate -> Funds
funds     :: Funds
    , Activate -> Bool
private   :: Bool
    , Activate -> StopType
userId    :: UserId
    , Activate -> StopType
profileId :: ProfileId
    } deriving (Activate -> Activate -> Bool
(Activate -> Activate -> Bool)
-> (Activate -> Activate -> Bool) -> Eq Activate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Activate -> Activate -> Bool
$c/= :: Activate -> Activate -> Bool
== :: Activate -> Activate -> Bool
$c== :: Activate -> Activate -> Bool
Eq, Eq Activate
Eq Activate
-> (Activate -> Activate -> Ordering)
-> (Activate -> Activate -> Bool)
-> (Activate -> Activate -> Bool)
-> (Activate -> Activate -> Bool)
-> (Activate -> Activate -> Bool)
-> (Activate -> Activate -> Activate)
-> (Activate -> Activate -> Activate)
-> Ord Activate
Activate -> Activate -> Bool
Activate -> Activate -> Ordering
Activate -> Activate -> Activate
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Activate -> Activate -> Activate
$cmin :: Activate -> Activate -> Activate
max :: Activate -> Activate -> Activate
$cmax :: Activate -> Activate -> Activate
>= :: Activate -> Activate -> Bool
$c>= :: Activate -> Activate -> Bool
> :: Activate -> Activate -> Bool
$c> :: Activate -> Activate -> Bool
<= :: Activate -> Activate -> Bool
$c<= :: Activate -> Activate -> Bool
< :: Activate -> Activate -> Bool
$c< :: Activate -> Activate -> Bool
compare :: Activate -> Activate -> Ordering
$ccompare :: Activate -> Activate -> Ordering
$cp1Ord :: Eq Activate
Ord, Int -> Activate -> ShowS
[Activate] -> ShowS
Activate -> String
(Int -> Activate -> ShowS)
-> (Activate -> String) -> ([Activate] -> ShowS) -> Show Activate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Activate] -> ShowS
$cshowList :: [Activate] -> ShowS
show :: Activate -> String
$cshow :: Activate -> String
showsPrec :: Int -> Activate -> ShowS
$cshowsPrec :: Int -> Activate -> ShowS
Show)


deriveJSON defaultOptions {fieldLabelModifier = snakeCase} ''Activate