{-# LANGUAGE TemplateHaskell #-}

module CoinbasePro.Authenticated.Profile
  ( Profile (..)
  , ProfileTransfer (..)
  ) where

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

import           CoinbasePro.Types (CreatedAt, CurrencyType, ProfileId, UserId)

data Profile = Profile
    { Profile -> ProfileId
pId        :: ProfileId
    , Profile -> ProfileId
pUserId    :: UserId
    , Profile -> ProfileId
pName      :: Text
    , Profile -> Bool
pActive    :: Bool
    , Profile -> Bool
pIsDefault :: Bool
    , Profile -> CreatedAt
pCreatedAt :: CreatedAt
    } deriving Int -> Profile -> ShowS
[Profile] -> ShowS
Profile -> String
(Int -> Profile -> ShowS)
-> (Profile -> String) -> ([Profile] -> ShowS) -> Show Profile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Profile] -> ShowS
$cshowList :: [Profile] -> ShowS
show :: Profile -> String
$cshow :: Profile -> String
showsPrec :: Int -> Profile -> ShowS
$cshowsPrec :: Int -> Profile -> ShowS
Show


deriveJSON defaultOptions { fieldLabelModifier = snakeCase . drop 1 } ''Profile


data ProfileTransfer = ProfileTransfer
    { ProfileTransfer -> ProfileId
from     :: ProfileId
    , ProfileTransfer -> ProfileId
to       :: ProfileId
    , ProfileTransfer -> CurrencyType
currency :: CurrencyType
    , ProfileTransfer -> String
amount   :: String
    } deriving Int -> ProfileTransfer -> ShowS
[ProfileTransfer] -> ShowS
ProfileTransfer -> String
(Int -> ProfileTransfer -> ShowS)
-> (ProfileTransfer -> String)
-> ([ProfileTransfer] -> ShowS)
-> Show ProfileTransfer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProfileTransfer] -> ShowS
$cshowList :: [ProfileTransfer] -> ShowS
show :: ProfileTransfer -> String
$cshow :: ProfileTransfer -> String
showsPrec :: Int -> ProfileTransfer -> ShowS
$cshowsPrec :: Int -> ProfileTransfer -> ShowS
Show


deriveJSON defaultOptions { fieldLabelModifier = snakeCase } ''ProfileTransfer