{-# LANGUAGE DeriveAnyClass        #-}
{-# LANGUAGE DeriveGeneric         #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Bank.TrueLayer.DataAPI.Schema where

import           Data.Aeson              (FromJSON (..), ToJSON (..))
import           Data.Time.Calendar      (Day)
import           Data.Time.LocalTime     (ZonedTime)
import           GHC.Generics            (Generic)

import           Bank.TrueLayer.Internal (Options, fromString, param, (&), (.~))

newtype Ip = Ip String
  deriving (Int -> Ip -> ShowS
[Ip] -> ShowS
Ip -> String
(Int -> Ip -> ShowS)
-> (Ip -> String) -> ([Ip] -> ShowS) -> Show Ip
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Ip -> ShowS
showsPrec :: Int -> Ip -> ShowS
$cshow :: Ip -> String
show :: Ip -> String
$cshowList :: [Ip] -> ShowS
showList :: [Ip] -> ShowS
Show)



newtype Accounts = Accounts { Accounts -> [Account]
results :: [Account] }
  deriving (Value -> Parser [Accounts]
Value -> Parser Accounts
(Value -> Parser Accounts)
-> (Value -> Parser [Accounts]) -> FromJSON Accounts
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Accounts
parseJSON :: Value -> Parser Accounts
$cparseJSONList :: Value -> Parser [Accounts]
parseJSONList :: Value -> Parser [Accounts]
FromJSON, (forall x. Accounts -> Rep Accounts x)
-> (forall x. Rep Accounts x -> Accounts) -> Generic Accounts
forall x. Rep Accounts x -> Accounts
forall x. Accounts -> Rep Accounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Accounts -> Rep Accounts x
from :: forall x. Accounts -> Rep Accounts x
$cto :: forall x. Rep Accounts x -> Accounts
to :: forall x. Rep Accounts x -> Accounts
Generic, Int -> Accounts -> ShowS
[Accounts] -> ShowS
Accounts -> String
(Int -> Accounts -> ShowS)
-> (Accounts -> String) -> ([Accounts] -> ShowS) -> Show Accounts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Accounts -> ShowS
showsPrec :: Int -> Accounts -> ShowS
$cshow :: Accounts -> String
show :: Accounts -> String
$cshowList :: [Accounts] -> ShowS
showList :: [Accounts] -> ShowS
Show, [Accounts] -> Value
[Accounts] -> Encoding
Accounts -> Value
Accounts -> Encoding
(Accounts -> Value)
-> (Accounts -> Encoding)
-> ([Accounts] -> Value)
-> ([Accounts] -> Encoding)
-> ToJSON Accounts
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Accounts -> Value
toJSON :: Accounts -> Value
$ctoEncoding :: Accounts -> Encoding
toEncoding :: Accounts -> Encoding
$ctoJSONList :: [Accounts] -> Value
toJSONList :: [Accounts] -> Value
$ctoEncodingList :: [Accounts] -> Encoding
toEncodingList :: [Accounts] -> Encoding
ToJSON)

data Account = Account
                 { Account -> ZonedTime
update_timestamp :: !ZonedTime
                 , Account -> Maybe AccountId
account_id       :: !(Maybe AccountId)
                 , Account -> Maybe String
account_type     :: !(Maybe String)
                 , Account -> Maybe String
display_name     :: !(Maybe String)
                 , Account -> Maybe String
currency         :: !(Maybe String)
                 , Account -> AccountNumber
accountNumber    :: !AccountNumber
                 , Account -> Provider
provider         :: !Provider
                 }
  deriving (Value -> Parser [Account]
Value -> Parser Account
(Value -> Parser Account)
-> (Value -> Parser [Account]) -> FromJSON Account
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Account
parseJSON :: Value -> Parser Account
$cparseJSONList :: Value -> Parser [Account]
parseJSONList :: Value -> Parser [Account]
FromJSON, (forall x. Account -> Rep Account x)
-> (forall x. Rep Account x -> Account) -> Generic Account
forall x. Rep Account x -> Account
forall x. Account -> Rep Account x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Account -> Rep Account x
from :: forall x. Account -> Rep Account x
$cto :: forall x. Rep Account x -> Account
to :: forall x. Rep Account x -> Account
Generic, Int -> Account -> ShowS
[Account] -> ShowS
Account -> String
(Int -> Account -> ShowS)
-> (Account -> String) -> ([Account] -> ShowS) -> Show Account
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Account -> ShowS
showsPrec :: Int -> Account -> ShowS
$cshow :: Account -> String
show :: Account -> String
$cshowList :: [Account] -> ShowS
showList :: [Account] -> ShowS
Show, [Account] -> Value
[Account] -> Encoding
Account -> Value
Account -> Encoding
(Account -> Value)
-> (Account -> Encoding)
-> ([Account] -> Value)
-> ([Account] -> Encoding)
-> ToJSON Account
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Account -> Value
toJSON :: Account -> Value
$ctoEncoding :: Account -> Encoding
toEncoding :: Account -> Encoding
$ctoJSONList :: [Account] -> Value
toJSONList :: [Account] -> Value
$ctoEncodingList :: [Account] -> Encoding
toEncodingList :: [Account] -> Encoding
ToJSON)

data AccountBalance = AccountBalance
                        { AccountBalance -> String
currency         :: !String
                        , AccountBalance -> Double
available        :: !Double
                        , AccountBalance -> Double
current          :: !Double
                        , AccountBalance -> Maybe Double
overdraft        :: !(Maybe Double)
                        , AccountBalance -> Maybe String
update_timestamp :: !(Maybe String)
                        }
  deriving (Value -> Parser [AccountBalance]
Value -> Parser AccountBalance
(Value -> Parser AccountBalance)
-> (Value -> Parser [AccountBalance]) -> FromJSON AccountBalance
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser AccountBalance
parseJSON :: Value -> Parser AccountBalance
$cparseJSONList :: Value -> Parser [AccountBalance]
parseJSONList :: Value -> Parser [AccountBalance]
FromJSON, (forall x. AccountBalance -> Rep AccountBalance x)
-> (forall x. Rep AccountBalance x -> AccountBalance)
-> Generic AccountBalance
forall x. Rep AccountBalance x -> AccountBalance
forall x. AccountBalance -> Rep AccountBalance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AccountBalance -> Rep AccountBalance x
from :: forall x. AccountBalance -> Rep AccountBalance x
$cto :: forall x. Rep AccountBalance x -> AccountBalance
to :: forall x. Rep AccountBalance x -> AccountBalance
Generic, Int -> AccountBalance -> ShowS
[AccountBalance] -> ShowS
AccountBalance -> String
(Int -> AccountBalance -> ShowS)
-> (AccountBalance -> String)
-> ([AccountBalance] -> ShowS)
-> Show AccountBalance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountBalance -> ShowS
showsPrec :: Int -> AccountBalance -> ShowS
$cshow :: AccountBalance -> String
show :: AccountBalance -> String
$cshowList :: [AccountBalance] -> ShowS
showList :: [AccountBalance] -> ShowS
Show, [AccountBalance] -> Value
[AccountBalance] -> Encoding
AccountBalance -> Value
AccountBalance -> Encoding
(AccountBalance -> Value)
-> (AccountBalance -> Encoding)
-> ([AccountBalance] -> Value)
-> ([AccountBalance] -> Encoding)
-> ToJSON AccountBalance
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: AccountBalance -> Value
toJSON :: AccountBalance -> Value
$ctoEncoding :: AccountBalance -> Encoding
toEncoding :: AccountBalance -> Encoding
$ctoJSONList :: [AccountBalance] -> Value
toJSONList :: [AccountBalance] -> Value
$ctoEncodingList :: [AccountBalance] -> Encoding
toEncodingList :: [AccountBalance] -> Encoding
ToJSON)

data AccountBalances = AccountBalances
                         { AccountBalances -> [AccountBalance]
results :: ![AccountBalance]
                         , AccountBalances -> Maybe String
status  :: !(Maybe String)
                         }
  deriving (Value -> Parser [AccountBalances]
Value -> Parser AccountBalances
(Value -> Parser AccountBalances)
-> (Value -> Parser [AccountBalances]) -> FromJSON AccountBalances
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser AccountBalances
parseJSON :: Value -> Parser AccountBalances
$cparseJSONList :: Value -> Parser [AccountBalances]
parseJSONList :: Value -> Parser [AccountBalances]
FromJSON, (forall x. AccountBalances -> Rep AccountBalances x)
-> (forall x. Rep AccountBalances x -> AccountBalances)
-> Generic AccountBalances
forall x. Rep AccountBalances x -> AccountBalances
forall x. AccountBalances -> Rep AccountBalances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AccountBalances -> Rep AccountBalances x
from :: forall x. AccountBalances -> Rep AccountBalances x
$cto :: forall x. Rep AccountBalances x -> AccountBalances
to :: forall x. Rep AccountBalances x -> AccountBalances
Generic, Int -> AccountBalances -> ShowS
[AccountBalances] -> ShowS
AccountBalances -> String
(Int -> AccountBalances -> ShowS)
-> (AccountBalances -> String)
-> ([AccountBalances] -> ShowS)
-> Show AccountBalances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountBalances -> ShowS
showsPrec :: Int -> AccountBalances -> ShowS
$cshow :: AccountBalances -> String
show :: AccountBalances -> String
$cshowList :: [AccountBalances] -> ShowS
showList :: [AccountBalances] -> ShowS
Show, [AccountBalances] -> Value
[AccountBalances] -> Encoding
AccountBalances -> Value
AccountBalances -> Encoding
(AccountBalances -> Value)
-> (AccountBalances -> Encoding)
-> ([AccountBalances] -> Value)
-> ([AccountBalances] -> Encoding)
-> ToJSON AccountBalances
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: AccountBalances -> Value
toJSON :: AccountBalances -> Value
$ctoEncoding :: AccountBalances -> Encoding
toEncoding :: AccountBalances -> Encoding
$ctoJSONList :: [AccountBalances] -> Value
toJSONList :: [AccountBalances] -> Value
$ctoEncodingList :: [AccountBalances] -> Encoding
toEncodingList :: [AccountBalances] -> Encoding
ToJSON)


newtype AccountId = AccountId String
  deriving (Value -> Parser [AccountId]
Value -> Parser AccountId
(Value -> Parser AccountId)
-> (Value -> Parser [AccountId]) -> FromJSON AccountId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser AccountId
parseJSON :: Value -> Parser AccountId
$cparseJSONList :: Value -> Parser [AccountId]
parseJSONList :: Value -> Parser [AccountId]
FromJSON, (forall x. AccountId -> Rep AccountId x)
-> (forall x. Rep AccountId x -> AccountId) -> Generic AccountId
forall x. Rep AccountId x -> AccountId
forall x. AccountId -> Rep AccountId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AccountId -> Rep AccountId x
from :: forall x. AccountId -> Rep AccountId x
$cto :: forall x. Rep AccountId x -> AccountId
to :: forall x. Rep AccountId x -> AccountId
Generic, Int -> AccountId -> ShowS
[AccountId] -> ShowS
AccountId -> String
(Int -> AccountId -> ShowS)
-> (AccountId -> String)
-> ([AccountId] -> ShowS)
-> Show AccountId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountId -> ShowS
showsPrec :: Int -> AccountId -> ShowS
$cshow :: AccountId -> String
show :: AccountId -> String
$cshowList :: [AccountId] -> ShowS
showList :: [AccountId] -> ShowS
Show, [AccountId] -> Value
[AccountId] -> Encoding
AccountId -> Value
AccountId -> Encoding
(AccountId -> Value)
-> (AccountId -> Encoding)
-> ([AccountId] -> Value)
-> ([AccountId] -> Encoding)
-> ToJSON AccountId
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: AccountId -> Value
toJSON :: AccountId -> Value
$ctoEncoding :: AccountId -> Encoding
toEncoding :: AccountId -> Encoding
$ctoJSONList :: [AccountId] -> Value
toJSONList :: [AccountId] -> Value
$ctoEncodingList :: [AccountId] -> Encoding
toEncodingList :: [AccountId] -> Encoding
ToJSON)

data AccountNumber = AccountNumber
                       { AccountNumber -> Maybe String
number         :: !(Maybe String)
                       , AccountNumber -> Maybe String
sort_code      :: !(Maybe String)
                       , AccountNumber -> Maybe String
swift_bic      :: !(Maybe String)
                       , AccountNumber -> Maybe String
iban           :: !(Maybe String)
                       , AccountNumber -> Maybe String
routing_number :: !(Maybe String)
                       }
  deriving (Value -> Parser [AccountNumber]
Value -> Parser AccountNumber
(Value -> Parser AccountNumber)
-> (Value -> Parser [AccountNumber]) -> FromJSON AccountNumber
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser AccountNumber
parseJSON :: Value -> Parser AccountNumber
$cparseJSONList :: Value -> Parser [AccountNumber]
parseJSONList :: Value -> Parser [AccountNumber]
FromJSON, (forall x. AccountNumber -> Rep AccountNumber x)
-> (forall x. Rep AccountNumber x -> AccountNumber)
-> Generic AccountNumber
forall x. Rep AccountNumber x -> AccountNumber
forall x. AccountNumber -> Rep AccountNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AccountNumber -> Rep AccountNumber x
from :: forall x. AccountNumber -> Rep AccountNumber x
$cto :: forall x. Rep AccountNumber x -> AccountNumber
to :: forall x. Rep AccountNumber x -> AccountNumber
Generic, Int -> AccountNumber -> ShowS
[AccountNumber] -> ShowS
AccountNumber -> String
(Int -> AccountNumber -> ShowS)
-> (AccountNumber -> String)
-> ([AccountNumber] -> ShowS)
-> Show AccountNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountNumber -> ShowS
showsPrec :: Int -> AccountNumber -> ShowS
$cshow :: AccountNumber -> String
show :: AccountNumber -> String
$cshowList :: [AccountNumber] -> ShowS
showList :: [AccountNumber] -> ShowS
Show, [AccountNumber] -> Value
[AccountNumber] -> Encoding
AccountNumber -> Value
AccountNumber -> Encoding
(AccountNumber -> Value)
-> (AccountNumber -> Encoding)
-> ([AccountNumber] -> Value)
-> ([AccountNumber] -> Encoding)
-> ToJSON AccountNumber
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: AccountNumber -> Value
toJSON :: AccountNumber -> Value
$ctoEncoding :: AccountNumber -> Encoding
toEncoding :: AccountNumber -> Encoding
$ctoJSONList :: [AccountNumber] -> Value
toJSONList :: [AccountNumber] -> Value
$ctoEncodingList :: [AccountNumber] -> Encoding
toEncodingList :: [AccountNumber] -> Encoding
ToJSON)

data Card = Card
              { Card -> AccountId
account_id          :: !AccountId
              , Card -> String
card_network        :: !String
              , Card -> String
card_type           :: !String
              , Card -> String
currency            :: !String
              , Card -> String
display_name        :: !String
              , Card -> String
partial_card_number :: !String
              , Card -> String
name_on_card        :: !String
              , Card -> Maybe String
valid_from          :: !(Maybe String)
              , Card -> Maybe String
valid_to            :: !(Maybe String)
              , Card -> ZonedTime
update_timestamp    :: !ZonedTime
              , Card -> Provider
provider            :: !Provider
              }
  deriving (Value -> Parser [Card]
Value -> Parser Card
(Value -> Parser Card) -> (Value -> Parser [Card]) -> FromJSON Card
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Card
parseJSON :: Value -> Parser Card
$cparseJSONList :: Value -> Parser [Card]
parseJSONList :: Value -> Parser [Card]
FromJSON, (forall x. Card -> Rep Card x)
-> (forall x. Rep Card x -> Card) -> Generic Card
forall x. Rep Card x -> Card
forall x. Card -> Rep Card x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Card -> Rep Card x
from :: forall x. Card -> Rep Card x
$cto :: forall x. Rep Card x -> Card
to :: forall x. Rep Card x -> Card
Generic, Int -> Card -> ShowS
[Card] -> ShowS
Card -> String
(Int -> Card -> ShowS)
-> (Card -> String) -> ([Card] -> ShowS) -> Show Card
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Card -> ShowS
showsPrec :: Int -> Card -> ShowS
$cshow :: Card -> String
show :: Card -> String
$cshowList :: [Card] -> ShowS
showList :: [Card] -> ShowS
Show, [Card] -> Value
[Card] -> Encoding
Card -> Value
Card -> Encoding
(Card -> Value)
-> (Card -> Encoding)
-> ([Card] -> Value)
-> ([Card] -> Encoding)
-> ToJSON Card
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Card -> Value
toJSON :: Card -> Value
$ctoEncoding :: Card -> Encoding
toEncoding :: Card -> Encoding
$ctoJSONList :: [Card] -> Value
toJSONList :: [Card] -> Value
$ctoEncodingList :: [Card] -> Encoding
toEncodingList :: [Card] -> Encoding
ToJSON)

newtype Cards = Cards { Cards -> [Card]
results :: [Card] }
  deriving (Value -> Parser [Cards]
Value -> Parser Cards
(Value -> Parser Cards)
-> (Value -> Parser [Cards]) -> FromJSON Cards
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Cards
parseJSON :: Value -> Parser Cards
$cparseJSONList :: Value -> Parser [Cards]
parseJSONList :: Value -> Parser [Cards]
FromJSON, (forall x. Cards -> Rep Cards x)
-> (forall x. Rep Cards x -> Cards) -> Generic Cards
forall x. Rep Cards x -> Cards
forall x. Cards -> Rep Cards x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Cards -> Rep Cards x
from :: forall x. Cards -> Rep Cards x
$cto :: forall x. Rep Cards x -> Cards
to :: forall x. Rep Cards x -> Cards
Generic, Int -> Cards -> ShowS
[Cards] -> ShowS
Cards -> String
(Int -> Cards -> ShowS)
-> (Cards -> String) -> ([Cards] -> ShowS) -> Show Cards
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Cards -> ShowS
showsPrec :: Int -> Cards -> ShowS
$cshow :: Cards -> String
show :: Cards -> String
$cshowList :: [Cards] -> ShowS
showList :: [Cards] -> ShowS
Show, [Cards] -> Value
[Cards] -> Encoding
Cards -> Value
Cards -> Encoding
(Cards -> Value)
-> (Cards -> Encoding)
-> ([Cards] -> Value)
-> ([Cards] -> Encoding)
-> ToJSON Cards
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Cards -> Value
toJSON :: Cards -> Value
$ctoEncoding :: Cards -> Encoding
toEncoding :: Cards -> Encoding
$ctoJSONList :: [Cards] -> Value
toJSONList :: [Cards] -> Value
$ctoEncodingList :: [Cards] -> Encoding
toEncodingList :: [Cards] -> Encoding
ToJSON)


newtype CardBalances = CardBalances { CardBalances -> [CardBalance]
results :: [CardBalance] }
  deriving (Value -> Parser [CardBalances]
Value -> Parser CardBalances
(Value -> Parser CardBalances)
-> (Value -> Parser [CardBalances]) -> FromJSON CardBalances
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser CardBalances
parseJSON :: Value -> Parser CardBalances
$cparseJSONList :: Value -> Parser [CardBalances]
parseJSONList :: Value -> Parser [CardBalances]
FromJSON, (forall x. CardBalances -> Rep CardBalances x)
-> (forall x. Rep CardBalances x -> CardBalances)
-> Generic CardBalances
forall x. Rep CardBalances x -> CardBalances
forall x. CardBalances -> Rep CardBalances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CardBalances -> Rep CardBalances x
from :: forall x. CardBalances -> Rep CardBalances x
$cto :: forall x. Rep CardBalances x -> CardBalances
to :: forall x. Rep CardBalances x -> CardBalances
Generic, Int -> CardBalances -> ShowS
[CardBalances] -> ShowS
CardBalances -> String
(Int -> CardBalances -> ShowS)
-> (CardBalances -> String)
-> ([CardBalances] -> ShowS)
-> Show CardBalances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CardBalances -> ShowS
showsPrec :: Int -> CardBalances -> ShowS
$cshow :: CardBalances -> String
show :: CardBalances -> String
$cshowList :: [CardBalances] -> ShowS
showList :: [CardBalances] -> ShowS
Show, [CardBalances] -> Value
[CardBalances] -> Encoding
CardBalances -> Value
CardBalances -> Encoding
(CardBalances -> Value)
-> (CardBalances -> Encoding)
-> ([CardBalances] -> Value)
-> ([CardBalances] -> Encoding)
-> ToJSON CardBalances
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: CardBalances -> Value
toJSON :: CardBalances -> Value
$ctoEncoding :: CardBalances -> Encoding
toEncoding :: CardBalances -> Encoding
$ctoJSONList :: [CardBalances] -> Value
toJSONList :: [CardBalances] -> Value
$ctoEncodingList :: [CardBalances] -> Encoding
toEncodingList :: [CardBalances] -> Encoding
ToJSON)

data CardBalance = CardBalance
                     { CardBalance -> Double
available              :: !Double
                     , CardBalance -> String
currency               :: !String
                     , CardBalance -> Double
current                :: !Double
                     , CardBalance -> Double
credit_limit           :: !Double
                     , CardBalance -> Maybe Double
last_statement_balance :: !(Maybe Double)
                     , CardBalance -> Maybe Day
last_statement_date    :: !(Maybe Day)
                     , CardBalance -> Maybe Double
payment_due            :: !(Maybe Double)
                     , CardBalance -> Maybe Day
payment_due_date       :: !(Maybe Day)
                     , CardBalance -> ZonedTime
update_timestamp       :: !ZonedTime
                     }
  deriving (Value -> Parser [CardBalance]
Value -> Parser CardBalance
(Value -> Parser CardBalance)
-> (Value -> Parser [CardBalance]) -> FromJSON CardBalance
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser CardBalance
parseJSON :: Value -> Parser CardBalance
$cparseJSONList :: Value -> Parser [CardBalance]
parseJSONList :: Value -> Parser [CardBalance]
FromJSON, (forall x. CardBalance -> Rep CardBalance x)
-> (forall x. Rep CardBalance x -> CardBalance)
-> Generic CardBalance
forall x. Rep CardBalance x -> CardBalance
forall x. CardBalance -> Rep CardBalance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CardBalance -> Rep CardBalance x
from :: forall x. CardBalance -> Rep CardBalance x
$cto :: forall x. Rep CardBalance x -> CardBalance
to :: forall x. Rep CardBalance x -> CardBalance
Generic, Int -> CardBalance -> ShowS
[CardBalance] -> ShowS
CardBalance -> String
(Int -> CardBalance -> ShowS)
-> (CardBalance -> String)
-> ([CardBalance] -> ShowS)
-> Show CardBalance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CardBalance -> ShowS
showsPrec :: Int -> CardBalance -> ShowS
$cshow :: CardBalance -> String
show :: CardBalance -> String
$cshowList :: [CardBalance] -> ShowS
showList :: [CardBalance] -> ShowS
Show, [CardBalance] -> Value
[CardBalance] -> Encoding
CardBalance -> Value
CardBalance -> Encoding
(CardBalance -> Value)
-> (CardBalance -> Encoding)
-> ([CardBalance] -> Value)
-> ([CardBalance] -> Encoding)
-> ToJSON CardBalance
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: CardBalance -> Value
toJSON :: CardBalance -> Value
$ctoEncoding :: CardBalance -> Encoding
toEncoding :: CardBalance -> Encoding
$ctoJSONList :: [CardBalance] -> Value
toJSONList :: [CardBalance] -> Value
$ctoEncodingList :: [CardBalance] -> Encoding
toEncodingList :: [CardBalance] -> Encoding
ToJSON)

data DirectDebit = DirectDebit
                     { DirectDebit -> String
direct_debit_id            :: !String
                     , DirectDebit -> String
timestamp                  :: !String
                     , DirectDebit -> String
name                       :: !String
                     , DirectDebit -> String
status                     :: !String
                     , DirectDebit -> Maybe String
previous_payment_timestamp :: !(Maybe String)
                     , DirectDebit -> Maybe Double
previous_payment_amount    :: !(Maybe Double)
                     , DirectDebit -> Maybe String
currency                   :: !(Maybe String)
                     , DirectDebit -> Maybe DirectDebitMeta
meta                       :: !(Maybe DirectDebitMeta)
                     }
  deriving (Value -> Parser [DirectDebit]
Value -> Parser DirectDebit
(Value -> Parser DirectDebit)
-> (Value -> Parser [DirectDebit]) -> FromJSON DirectDebit
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser DirectDebit
parseJSON :: Value -> Parser DirectDebit
$cparseJSONList :: Value -> Parser [DirectDebit]
parseJSONList :: Value -> Parser [DirectDebit]
FromJSON, (forall x. DirectDebit -> Rep DirectDebit x)
-> (forall x. Rep DirectDebit x -> DirectDebit)
-> Generic DirectDebit
forall x. Rep DirectDebit x -> DirectDebit
forall x. DirectDebit -> Rep DirectDebit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DirectDebit -> Rep DirectDebit x
from :: forall x. DirectDebit -> Rep DirectDebit x
$cto :: forall x. Rep DirectDebit x -> DirectDebit
to :: forall x. Rep DirectDebit x -> DirectDebit
Generic, Int -> DirectDebit -> ShowS
[DirectDebit] -> ShowS
DirectDebit -> String
(Int -> DirectDebit -> ShowS)
-> (DirectDebit -> String)
-> ([DirectDebit] -> ShowS)
-> Show DirectDebit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DirectDebit -> ShowS
showsPrec :: Int -> DirectDebit -> ShowS
$cshow :: DirectDebit -> String
show :: DirectDebit -> String
$cshowList :: [DirectDebit] -> ShowS
showList :: [DirectDebit] -> ShowS
Show, [DirectDebit] -> Value
[DirectDebit] -> Encoding
DirectDebit -> Value
DirectDebit -> Encoding
(DirectDebit -> Value)
-> (DirectDebit -> Encoding)
-> ([DirectDebit] -> Value)
-> ([DirectDebit] -> Encoding)
-> ToJSON DirectDebit
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: DirectDebit -> Value
toJSON :: DirectDebit -> Value
$ctoEncoding :: DirectDebit -> Encoding
toEncoding :: DirectDebit -> Encoding
$ctoJSONList :: [DirectDebit] -> Value
toJSONList :: [DirectDebit] -> Value
$ctoEncodingList :: [DirectDebit] -> Encoding
toEncodingList :: [DirectDebit] -> Encoding
ToJSON)

data DirectDebitMeta = DirectDebitMeta
                         { DirectDebitMeta -> Maybe String
provider_mandate_identification :: !(Maybe String)
                         , DirectDebitMeta -> Maybe String
provider_account_id             :: !(Maybe String)
                         }
  deriving (Value -> Parser [DirectDebitMeta]
Value -> Parser DirectDebitMeta
(Value -> Parser DirectDebitMeta)
-> (Value -> Parser [DirectDebitMeta]) -> FromJSON DirectDebitMeta
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser DirectDebitMeta
parseJSON :: Value -> Parser DirectDebitMeta
$cparseJSONList :: Value -> Parser [DirectDebitMeta]
parseJSONList :: Value -> Parser [DirectDebitMeta]
FromJSON, (forall x. DirectDebitMeta -> Rep DirectDebitMeta x)
-> (forall x. Rep DirectDebitMeta x -> DirectDebitMeta)
-> Generic DirectDebitMeta
forall x. Rep DirectDebitMeta x -> DirectDebitMeta
forall x. DirectDebitMeta -> Rep DirectDebitMeta x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DirectDebitMeta -> Rep DirectDebitMeta x
from :: forall x. DirectDebitMeta -> Rep DirectDebitMeta x
$cto :: forall x. Rep DirectDebitMeta x -> DirectDebitMeta
to :: forall x. Rep DirectDebitMeta x -> DirectDebitMeta
Generic, Int -> DirectDebitMeta -> ShowS
[DirectDebitMeta] -> ShowS
DirectDebitMeta -> String
(Int -> DirectDebitMeta -> ShowS)
-> (DirectDebitMeta -> String)
-> ([DirectDebitMeta] -> ShowS)
-> Show DirectDebitMeta
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DirectDebitMeta -> ShowS
showsPrec :: Int -> DirectDebitMeta -> ShowS
$cshow :: DirectDebitMeta -> String
show :: DirectDebitMeta -> String
$cshowList :: [DirectDebitMeta] -> ShowS
showList :: [DirectDebitMeta] -> ShowS
Show, [DirectDebitMeta] -> Value
[DirectDebitMeta] -> Encoding
DirectDebitMeta -> Value
DirectDebitMeta -> Encoding
(DirectDebitMeta -> Value)
-> (DirectDebitMeta -> Encoding)
-> ([DirectDebitMeta] -> Value)
-> ([DirectDebitMeta] -> Encoding)
-> ToJSON DirectDebitMeta
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: DirectDebitMeta -> Value
toJSON :: DirectDebitMeta -> Value
$ctoEncoding :: DirectDebitMeta -> Encoding
toEncoding :: DirectDebitMeta -> Encoding
$ctoJSONList :: [DirectDebitMeta] -> Value
toJSONList :: [DirectDebitMeta] -> Value
$ctoEncodingList :: [DirectDebitMeta] -> Encoding
toEncodingList :: [DirectDebitMeta] -> Encoding
ToJSON)

data DirectDebits = DirectDebits
                      { DirectDebits -> [DirectDebit]
results :: ![DirectDebit]
                      , DirectDebits -> String
status  :: !String
                      }
  deriving (Value -> Parser [DirectDebits]
Value -> Parser DirectDebits
(Value -> Parser DirectDebits)
-> (Value -> Parser [DirectDebits]) -> FromJSON DirectDebits
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser DirectDebits
parseJSON :: Value -> Parser DirectDebits
$cparseJSONList :: Value -> Parser [DirectDebits]
parseJSONList :: Value -> Parser [DirectDebits]
FromJSON, (forall x. DirectDebits -> Rep DirectDebits x)
-> (forall x. Rep DirectDebits x -> DirectDebits)
-> Generic DirectDebits
forall x. Rep DirectDebits x -> DirectDebits
forall x. DirectDebits -> Rep DirectDebits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DirectDebits -> Rep DirectDebits x
from :: forall x. DirectDebits -> Rep DirectDebits x
$cto :: forall x. Rep DirectDebits x -> DirectDebits
to :: forall x. Rep DirectDebits x -> DirectDebits
Generic, Int -> DirectDebits -> ShowS
[DirectDebits] -> ShowS
DirectDebits -> String
(Int -> DirectDebits -> ShowS)
-> (DirectDebits -> String)
-> ([DirectDebits] -> ShowS)
-> Show DirectDebits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DirectDebits -> ShowS
showsPrec :: Int -> DirectDebits -> ShowS
$cshow :: DirectDebits -> String
show :: DirectDebits -> String
$cshowList :: [DirectDebits] -> ShowS
showList :: [DirectDebits] -> ShowS
Show, [DirectDebits] -> Value
[DirectDebits] -> Encoding
DirectDebits -> Value
DirectDebits -> Encoding
(DirectDebits -> Value)
-> (DirectDebits -> Encoding)
-> ([DirectDebits] -> Value)
-> ([DirectDebits] -> Encoding)
-> ToJSON DirectDebits
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: DirectDebits -> Value
toJSON :: DirectDebits -> Value
$ctoEncoding :: DirectDebits -> Encoding
toEncoding :: DirectDebits -> Encoding
$ctoJSONList :: [DirectDebits] -> Value
toJSONList :: [DirectDebits] -> Value
$ctoEncodingList :: [DirectDebits] -> Encoding
toEncodingList :: [DirectDebits] -> Encoding
ToJSON)


newtype Provider = Provider { Provider -> ProviderId
provider_id :: ProviderId }
  deriving (Value -> Parser [Provider]
Value -> Parser Provider
(Value -> Parser Provider)
-> (Value -> Parser [Provider]) -> FromJSON Provider
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Provider
parseJSON :: Value -> Parser Provider
$cparseJSONList :: Value -> Parser [Provider]
parseJSONList :: Value -> Parser [Provider]
FromJSON, (forall x. Provider -> Rep Provider x)
-> (forall x. Rep Provider x -> Provider) -> Generic Provider
forall x. Rep Provider x -> Provider
forall x. Provider -> Rep Provider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Provider -> Rep Provider x
from :: forall x. Provider -> Rep Provider x
$cto :: forall x. Rep Provider x -> Provider
to :: forall x. Rep Provider x -> Provider
Generic, Int -> Provider -> ShowS
[Provider] -> ShowS
Provider -> String
(Int -> Provider -> ShowS)
-> (Provider -> String) -> ([Provider] -> ShowS) -> Show Provider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Provider -> ShowS
showsPrec :: Int -> Provider -> ShowS
$cshow :: Provider -> String
show :: Provider -> String
$cshowList :: [Provider] -> ShowS
showList :: [Provider] -> ShowS
Show, [Provider] -> Value
[Provider] -> Encoding
Provider -> Value
Provider -> Encoding
(Provider -> Value)
-> (Provider -> Encoding)
-> ([Provider] -> Value)
-> ([Provider] -> Encoding)
-> ToJSON Provider
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Provider -> Value
toJSON :: Provider -> Value
$ctoEncoding :: Provider -> Encoding
toEncoding :: Provider -> Encoding
$ctoJSONList :: [Provider] -> Value
toJSONList :: [Provider] -> Value
$ctoEncodingList :: [Provider] -> Encoding
toEncodingList :: [Provider] -> Encoding
ToJSON)

newtype ProviderId = ProviderId String
  deriving (Value -> Parser [ProviderId]
Value -> Parser ProviderId
(Value -> Parser ProviderId)
-> (Value -> Parser [ProviderId]) -> FromJSON ProviderId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser ProviderId
parseJSON :: Value -> Parser ProviderId
$cparseJSONList :: Value -> Parser [ProviderId]
parseJSONList :: Value -> Parser [ProviderId]
FromJSON, (forall x. ProviderId -> Rep ProviderId x)
-> (forall x. Rep ProviderId x -> ProviderId) -> Generic ProviderId
forall x. Rep ProviderId x -> ProviderId
forall x. ProviderId -> Rep ProviderId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ProviderId -> Rep ProviderId x
from :: forall x. ProviderId -> Rep ProviderId x
$cto :: forall x. Rep ProviderId x -> ProviderId
to :: forall x. Rep ProviderId x -> ProviderId
Generic, Int -> ProviderId -> ShowS
[ProviderId] -> ShowS
ProviderId -> String
(Int -> ProviderId -> ShowS)
-> (ProviderId -> String)
-> ([ProviderId] -> ShowS)
-> Show ProviderId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ProviderId -> ShowS
showsPrec :: Int -> ProviderId -> ShowS
$cshow :: ProviderId -> String
show :: ProviderId -> String
$cshowList :: [ProviderId] -> ShowS
showList :: [ProviderId] -> ShowS
Show, [ProviderId] -> Value
[ProviderId] -> Encoding
ProviderId -> Value
ProviderId -> Encoding
(ProviderId -> Value)
-> (ProviderId -> Encoding)
-> ([ProviderId] -> Value)
-> ([ProviderId] -> Encoding)
-> ToJSON ProviderId
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: ProviderId -> Value
toJSON :: ProviderId -> Value
$ctoEncoding :: ProviderId -> Encoding
toEncoding :: ProviderId -> Encoding
$ctoJSONList :: [ProviderId] -> Value
toJSONList :: [ProviderId] -> Value
$ctoEncodingList :: [ProviderId] -> Encoding
toEncodingList :: [ProviderId] -> Encoding
ToJSON)

data RunningBalance = RunningBalance
                        { RunningBalance -> Double
amoung   :: !Double
                        , RunningBalance -> String
currency :: !String
                        }
  deriving (Value -> Parser [RunningBalance]
Value -> Parser RunningBalance
(Value -> Parser RunningBalance)
-> (Value -> Parser [RunningBalance]) -> FromJSON RunningBalance
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser RunningBalance
parseJSON :: Value -> Parser RunningBalance
$cparseJSONList :: Value -> Parser [RunningBalance]
parseJSONList :: Value -> Parser [RunningBalance]
FromJSON, (forall x. RunningBalance -> Rep RunningBalance x)
-> (forall x. Rep RunningBalance x -> RunningBalance)
-> Generic RunningBalance
forall x. Rep RunningBalance x -> RunningBalance
forall x. RunningBalance -> Rep RunningBalance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RunningBalance -> Rep RunningBalance x
from :: forall x. RunningBalance -> Rep RunningBalance x
$cto :: forall x. Rep RunningBalance x -> RunningBalance
to :: forall x. Rep RunningBalance x -> RunningBalance
Generic, Int -> RunningBalance -> ShowS
[RunningBalance] -> ShowS
RunningBalance -> String
(Int -> RunningBalance -> ShowS)
-> (RunningBalance -> String)
-> ([RunningBalance] -> ShowS)
-> Show RunningBalance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RunningBalance -> ShowS
showsPrec :: Int -> RunningBalance -> ShowS
$cshow :: RunningBalance -> String
show :: RunningBalance -> String
$cshowList :: [RunningBalance] -> ShowS
showList :: [RunningBalance] -> ShowS
Show, [RunningBalance] -> Value
[RunningBalance] -> Encoding
RunningBalance -> Value
RunningBalance -> Encoding
(RunningBalance -> Value)
-> (RunningBalance -> Encoding)
-> ([RunningBalance] -> Value)
-> ([RunningBalance] -> Encoding)
-> ToJSON RunningBalance
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: RunningBalance -> Value
toJSON :: RunningBalance -> Value
$ctoEncoding :: RunningBalance -> Encoding
toEncoding :: RunningBalance -> Encoding
$ctoJSONList :: [RunningBalance] -> Value
toJSONList :: [RunningBalance] -> Value
$ctoEncodingList :: [RunningBalance] -> Encoding
toEncodingList :: [RunningBalance] -> Encoding
ToJSON)

data StandingOrder = StandingOrder
                       { StandingOrder -> String
frequency            :: !String
                       , StandingOrder -> Maybe String
status               :: !(Maybe String)
                       , StandingOrder -> String
timestamp            :: !String
                       , StandingOrder -> Maybe String
currency             :: !(Maybe String)
                       , StandingOrder -> Maybe StandingOrderMeta
meta                 :: !(Maybe StandingOrderMeta)
                       , StandingOrder -> Maybe String
next_payment_date    :: !(Maybe String)
                       , StandingOrder -> Maybe Double
next_payment_amount  :: !(Maybe Double)
                       , StandingOrder -> Maybe String
first_payment_date   :: !(Maybe String)
                       , StandingOrder -> Maybe Double
first_payment_amount :: !(Maybe Double)
                       , StandingOrder -> Maybe String
final_payment_date   :: !(Maybe String)
                       , StandingOrder -> Maybe Double
final_payment_amount :: !(Maybe Double)
                       , StandingOrder -> Maybe String
payee                :: !(Maybe String)
                       , StandingOrder -> Maybe String
reference            :: !(Maybe String)
                       }
  deriving (Value -> Parser [StandingOrder]
Value -> Parser StandingOrder
(Value -> Parser StandingOrder)
-> (Value -> Parser [StandingOrder]) -> FromJSON StandingOrder
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser StandingOrder
parseJSON :: Value -> Parser StandingOrder
$cparseJSONList :: Value -> Parser [StandingOrder]
parseJSONList :: Value -> Parser [StandingOrder]
FromJSON, (forall x. StandingOrder -> Rep StandingOrder x)
-> (forall x. Rep StandingOrder x -> StandingOrder)
-> Generic StandingOrder
forall x. Rep StandingOrder x -> StandingOrder
forall x. StandingOrder -> Rep StandingOrder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StandingOrder -> Rep StandingOrder x
from :: forall x. StandingOrder -> Rep StandingOrder x
$cto :: forall x. Rep StandingOrder x -> StandingOrder
to :: forall x. Rep StandingOrder x -> StandingOrder
Generic, Int -> StandingOrder -> ShowS
[StandingOrder] -> ShowS
StandingOrder -> String
(Int -> StandingOrder -> ShowS)
-> (StandingOrder -> String)
-> ([StandingOrder] -> ShowS)
-> Show StandingOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StandingOrder -> ShowS
showsPrec :: Int -> StandingOrder -> ShowS
$cshow :: StandingOrder -> String
show :: StandingOrder -> String
$cshowList :: [StandingOrder] -> ShowS
showList :: [StandingOrder] -> ShowS
Show, [StandingOrder] -> Value
[StandingOrder] -> Encoding
StandingOrder -> Value
StandingOrder -> Encoding
(StandingOrder -> Value)
-> (StandingOrder -> Encoding)
-> ([StandingOrder] -> Value)
-> ([StandingOrder] -> Encoding)
-> ToJSON StandingOrder
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: StandingOrder -> Value
toJSON :: StandingOrder -> Value
$ctoEncoding :: StandingOrder -> Encoding
toEncoding :: StandingOrder -> Encoding
$ctoJSONList :: [StandingOrder] -> Value
toJSONList :: [StandingOrder] -> Value
$ctoEncodingList :: [StandingOrder] -> Encoding
toEncodingList :: [StandingOrder] -> Encoding
ToJSON)

newtype StandingOrderMeta = StandingOrderMeta { StandingOrderMeta -> Maybe String
provider_account_id :: Maybe String }
  deriving (Value -> Parser [StandingOrderMeta]
Value -> Parser StandingOrderMeta
(Value -> Parser StandingOrderMeta)
-> (Value -> Parser [StandingOrderMeta])
-> FromJSON StandingOrderMeta
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser StandingOrderMeta
parseJSON :: Value -> Parser StandingOrderMeta
$cparseJSONList :: Value -> Parser [StandingOrderMeta]
parseJSONList :: Value -> Parser [StandingOrderMeta]
FromJSON, (forall x. StandingOrderMeta -> Rep StandingOrderMeta x)
-> (forall x. Rep StandingOrderMeta x -> StandingOrderMeta)
-> Generic StandingOrderMeta
forall x. Rep StandingOrderMeta x -> StandingOrderMeta
forall x. StandingOrderMeta -> Rep StandingOrderMeta x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StandingOrderMeta -> Rep StandingOrderMeta x
from :: forall x. StandingOrderMeta -> Rep StandingOrderMeta x
$cto :: forall x. Rep StandingOrderMeta x -> StandingOrderMeta
to :: forall x. Rep StandingOrderMeta x -> StandingOrderMeta
Generic, Int -> StandingOrderMeta -> ShowS
[StandingOrderMeta] -> ShowS
StandingOrderMeta -> String
(Int -> StandingOrderMeta -> ShowS)
-> (StandingOrderMeta -> String)
-> ([StandingOrderMeta] -> ShowS)
-> Show StandingOrderMeta
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StandingOrderMeta -> ShowS
showsPrec :: Int -> StandingOrderMeta -> ShowS
$cshow :: StandingOrderMeta -> String
show :: StandingOrderMeta -> String
$cshowList :: [StandingOrderMeta] -> ShowS
showList :: [StandingOrderMeta] -> ShowS
Show, [StandingOrderMeta] -> Value
[StandingOrderMeta] -> Encoding
StandingOrderMeta -> Value
StandingOrderMeta -> Encoding
(StandingOrderMeta -> Value)
-> (StandingOrderMeta -> Encoding)
-> ([StandingOrderMeta] -> Value)
-> ([StandingOrderMeta] -> Encoding)
-> ToJSON StandingOrderMeta
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: StandingOrderMeta -> Value
toJSON :: StandingOrderMeta -> Value
$ctoEncoding :: StandingOrderMeta -> Encoding
toEncoding :: StandingOrderMeta -> Encoding
$ctoJSONList :: [StandingOrderMeta] -> Value
toJSONList :: [StandingOrderMeta] -> Value
$ctoEncodingList :: [StandingOrderMeta] -> Encoding
toEncodingList :: [StandingOrderMeta] -> Encoding
ToJSON)

data StandingOrders = StandingOrders
                        { StandingOrders -> [StandingOrder]
results :: ![StandingOrder]
                        , StandingOrders -> String
status  :: !String
                        }
  deriving (Value -> Parser [StandingOrders]
Value -> Parser StandingOrders
(Value -> Parser StandingOrders)
-> (Value -> Parser [StandingOrders]) -> FromJSON StandingOrders
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser StandingOrders
parseJSON :: Value -> Parser StandingOrders
$cparseJSONList :: Value -> Parser [StandingOrders]
parseJSONList :: Value -> Parser [StandingOrders]
FromJSON, (forall x. StandingOrders -> Rep StandingOrders x)
-> (forall x. Rep StandingOrders x -> StandingOrders)
-> Generic StandingOrders
forall x. Rep StandingOrders x -> StandingOrders
forall x. StandingOrders -> Rep StandingOrders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StandingOrders -> Rep StandingOrders x
from :: forall x. StandingOrders -> Rep StandingOrders x
$cto :: forall x. Rep StandingOrders x -> StandingOrders
to :: forall x. Rep StandingOrders x -> StandingOrders
Generic, Int -> StandingOrders -> ShowS
[StandingOrders] -> ShowS
StandingOrders -> String
(Int -> StandingOrders -> ShowS)
-> (StandingOrders -> String)
-> ([StandingOrders] -> ShowS)
-> Show StandingOrders
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StandingOrders -> ShowS
showsPrec :: Int -> StandingOrders -> ShowS
$cshow :: StandingOrders -> String
show :: StandingOrders -> String
$cshowList :: [StandingOrders] -> ShowS
showList :: [StandingOrders] -> ShowS
Show, [StandingOrders] -> Value
[StandingOrders] -> Encoding
StandingOrders -> Value
StandingOrders -> Encoding
(StandingOrders -> Value)
-> (StandingOrders -> Encoding)
-> ([StandingOrders] -> Value)
-> ([StandingOrders] -> Encoding)
-> ToJSON StandingOrders
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: StandingOrders -> Value
toJSON :: StandingOrders -> Value
$ctoEncoding :: StandingOrders -> Encoding
toEncoding :: StandingOrders -> Encoding
$ctoJSONList :: [StandingOrders] -> Value
toJSONList :: [StandingOrders] -> Value
$ctoEncodingList :: [StandingOrders] -> Encoding
toEncodingList :: [StandingOrders] -> Encoding
ToJSON)

data Transaction = Transaction
                     { Transaction -> TransactionId
transaction_id                     :: !TransactionId
                     , Transaction -> Maybe TransactionId
normalised_provider_transaction_id :: !(Maybe TransactionId)
                     , Transaction -> Maybe TransactionId
provider_transaction_id            :: !(Maybe TransactionId)
                     , Transaction -> ZonedTime
timestamp                          :: !ZonedTime
                     , Transaction -> String
description                        :: !String
                     , Transaction -> Double
amount                             :: !Double
                       -- pounds
                     , Transaction -> String
currency                           :: !String
                     , Transaction -> String
transaction_type                   :: !String
                     , Transaction -> String
transaction_category               :: !String
                     , Transaction -> [String]
transaction_classification         :: ![String]
                     , Transaction -> Maybe String
merchant_name                      :: !(Maybe String)
                     , Transaction -> Maybe RunningBalance
running_balance                    :: !(Maybe RunningBalance)
                     , Transaction -> Maybe TransactionMeta
meta                               :: !(Maybe TransactionMeta)
                     }
  deriving (Value -> Parser [Transaction]
Value -> Parser Transaction
(Value -> Parser Transaction)
-> (Value -> Parser [Transaction]) -> FromJSON Transaction
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Transaction
parseJSON :: Value -> Parser Transaction
$cparseJSONList :: Value -> Parser [Transaction]
parseJSONList :: Value -> Parser [Transaction]
FromJSON, (forall x. Transaction -> Rep Transaction x)
-> (forall x. Rep Transaction x -> Transaction)
-> Generic Transaction
forall x. Rep Transaction x -> Transaction
forall x. Transaction -> Rep Transaction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Transaction -> Rep Transaction x
from :: forall x. Transaction -> Rep Transaction x
$cto :: forall x. Rep Transaction x -> Transaction
to :: forall x. Rep Transaction x -> Transaction
Generic, Int -> Transaction -> ShowS
[Transaction] -> ShowS
Transaction -> String
(Int -> Transaction -> ShowS)
-> (Transaction -> String)
-> ([Transaction] -> ShowS)
-> Show Transaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Transaction -> ShowS
showsPrec :: Int -> Transaction -> ShowS
$cshow :: Transaction -> String
show :: Transaction -> String
$cshowList :: [Transaction] -> ShowS
showList :: [Transaction] -> ShowS
Show, [Transaction] -> Value
[Transaction] -> Encoding
Transaction -> Value
Transaction -> Encoding
(Transaction -> Value)
-> (Transaction -> Encoding)
-> ([Transaction] -> Value)
-> ([Transaction] -> Encoding)
-> ToJSON Transaction
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Transaction -> Value
toJSON :: Transaction -> Value
$ctoEncoding :: Transaction -> Encoding
toEncoding :: Transaction -> Encoding
$ctoJSONList :: [Transaction] -> Value
toJSONList :: [Transaction] -> Value
$ctoEncodingList :: [Transaction] -> Encoding
toEncodingList :: [Transaction] -> Encoding
ToJSON)

data TransactionMeta = TransactionMeta
                         { TransactionMeta -> Maybe String
provider_transaction_category :: !(Maybe String)
                         , TransactionMeta -> Maybe String
provider_reference            :: !(Maybe String)
                         , TransactionMeta -> Maybe String
provider_merchant_name        :: !(Maybe String)
                         , TransactionMeta -> Maybe String
provider_category             :: !(Maybe String)
                         , TransactionMeta -> Maybe String
address                       :: !(Maybe String)
                         , TransactionMeta -> Maybe ProviderId
provider_id                   :: !(Maybe ProviderId)
                         , TransactionMeta -> Maybe String
counter_party_preferred_name  :: !(Maybe String)
                         , TransactionMeta -> Maybe String
counter_party_iban            :: !(Maybe String)
                         , TransactionMeta -> Maybe String
user_comments                 :: !(Maybe String)
                         , TransactionMeta -> Maybe String
debtor_account_name           :: !(Maybe String)
                         , TransactionMeta -> Maybe String
transaction_type              :: !(Maybe String)
                         , TransactionMeta -> Maybe String
provider_source               :: !(Maybe String)
                         , TransactionMeta -> Maybe String
cardNumber                    :: !(Maybe String)
                         , TransactionMeta -> Maybe String
location                      :: !(Maybe String)
                         }
  deriving (Value -> Parser [TransactionMeta]
Value -> Parser TransactionMeta
(Value -> Parser TransactionMeta)
-> (Value -> Parser [TransactionMeta]) -> FromJSON TransactionMeta
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser TransactionMeta
parseJSON :: Value -> Parser TransactionMeta
$cparseJSONList :: Value -> Parser [TransactionMeta]
parseJSONList :: Value -> Parser [TransactionMeta]
FromJSON, (forall x. TransactionMeta -> Rep TransactionMeta x)
-> (forall x. Rep TransactionMeta x -> TransactionMeta)
-> Generic TransactionMeta
forall x. Rep TransactionMeta x -> TransactionMeta
forall x. TransactionMeta -> Rep TransactionMeta x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TransactionMeta -> Rep TransactionMeta x
from :: forall x. TransactionMeta -> Rep TransactionMeta x
$cto :: forall x. Rep TransactionMeta x -> TransactionMeta
to :: forall x. Rep TransactionMeta x -> TransactionMeta
Generic, Int -> TransactionMeta -> ShowS
[TransactionMeta] -> ShowS
TransactionMeta -> String
(Int -> TransactionMeta -> ShowS)
-> (TransactionMeta -> String)
-> ([TransactionMeta] -> ShowS)
-> Show TransactionMeta
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransactionMeta -> ShowS
showsPrec :: Int -> TransactionMeta -> ShowS
$cshow :: TransactionMeta -> String
show :: TransactionMeta -> String
$cshowList :: [TransactionMeta] -> ShowS
showList :: [TransactionMeta] -> ShowS
Show, [TransactionMeta] -> Value
[TransactionMeta] -> Encoding
TransactionMeta -> Value
TransactionMeta -> Encoding
(TransactionMeta -> Value)
-> (TransactionMeta -> Encoding)
-> ([TransactionMeta] -> Value)
-> ([TransactionMeta] -> Encoding)
-> ToJSON TransactionMeta
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: TransactionMeta -> Value
toJSON :: TransactionMeta -> Value
$ctoEncoding :: TransactionMeta -> Encoding
toEncoding :: TransactionMeta -> Encoding
$ctoJSONList :: [TransactionMeta] -> Value
toJSONList :: [TransactionMeta] -> Value
$ctoEncodingList :: [TransactionMeta] -> Encoding
toEncodingList :: [TransactionMeta] -> Encoding
ToJSON)

newtype TransactionId = TransactionId String
  deriving (Value -> Parser [TransactionId]
Value -> Parser TransactionId
(Value -> Parser TransactionId)
-> (Value -> Parser [TransactionId]) -> FromJSON TransactionId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser TransactionId
parseJSON :: Value -> Parser TransactionId
$cparseJSONList :: Value -> Parser [TransactionId]
parseJSONList :: Value -> Parser [TransactionId]
FromJSON, (forall x. TransactionId -> Rep TransactionId x)
-> (forall x. Rep TransactionId x -> TransactionId)
-> Generic TransactionId
forall x. Rep TransactionId x -> TransactionId
forall x. TransactionId -> Rep TransactionId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TransactionId -> Rep TransactionId x
from :: forall x. TransactionId -> Rep TransactionId x
$cto :: forall x. Rep TransactionId x -> TransactionId
to :: forall x. Rep TransactionId x -> TransactionId
Generic, Int -> TransactionId -> ShowS
[TransactionId] -> ShowS
TransactionId -> String
(Int -> TransactionId -> ShowS)
-> (TransactionId -> String)
-> ([TransactionId] -> ShowS)
-> Show TransactionId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransactionId -> ShowS
showsPrec :: Int -> TransactionId -> ShowS
$cshow :: TransactionId -> String
show :: TransactionId -> String
$cshowList :: [TransactionId] -> ShowS
showList :: [TransactionId] -> ShowS
Show, [TransactionId] -> Value
[TransactionId] -> Encoding
TransactionId -> Value
TransactionId -> Encoding
(TransactionId -> Value)
-> (TransactionId -> Encoding)
-> ([TransactionId] -> Value)
-> ([TransactionId] -> Encoding)
-> ToJSON TransactionId
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: TransactionId -> Value
toJSON :: TransactionId -> Value
$ctoEncoding :: TransactionId -> Encoding
toEncoding :: TransactionId -> Encoding
$ctoJSONList :: [TransactionId] -> Value
toJSONList :: [TransactionId] -> Value
$ctoEncodingList :: [TransactionId] -> Encoding
toEncodingList :: [TransactionId] -> Encoding
ToJSON)

newtype Transactions = Transactions { Transactions -> [Transaction]
results :: [Transaction] }
  deriving (Value -> Parser [Transactions]
Value -> Parser Transactions
(Value -> Parser Transactions)
-> (Value -> Parser [Transactions]) -> FromJSON Transactions
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Transactions
parseJSON :: Value -> Parser Transactions
$cparseJSONList :: Value -> Parser [Transactions]
parseJSONList :: Value -> Parser [Transactions]
FromJSON, (forall x. Transactions -> Rep Transactions x)
-> (forall x. Rep Transactions x -> Transactions)
-> Generic Transactions
forall x. Rep Transactions x -> Transactions
forall x. Transactions -> Rep Transactions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Transactions -> Rep Transactions x
from :: forall x. Transactions -> Rep Transactions x
$cto :: forall x. Rep Transactions x -> Transactions
to :: forall x. Rep Transactions x -> Transactions
Generic, Int -> Transactions -> ShowS
[Transactions] -> ShowS
Transactions -> String
(Int -> Transactions -> ShowS)
-> (Transactions -> String)
-> ([Transactions] -> ShowS)
-> Show Transactions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Transactions -> ShowS
showsPrec :: Int -> Transactions -> ShowS
$cshow :: Transactions -> String
show :: Transactions -> String
$cshowList :: [Transactions] -> ShowS
showList :: [Transactions] -> ShowS
Show, [Transactions] -> Value
[Transactions] -> Encoding
Transactions -> Value
Transactions -> Encoding
(Transactions -> Value)
-> (Transactions -> Encoding)
-> ([Transactions] -> Value)
-> ([Transactions] -> Encoding)
-> ToJSON Transactions
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Transactions -> Value
toJSON :: Transactions -> Value
$ctoEncoding :: Transactions -> Encoding
toEncoding :: Transactions -> Encoding
$ctoJSONList :: [Transactions] -> Value
toJSONList :: [Transactions] -> Value
$ctoEncodingList :: [Transactions] -> Encoding
toEncodingList :: [Transactions] -> Encoding
ToJSON)

data TransactionParams = TransactionParams
                           { TransactionParams -> Maybe String
to   :: !(Maybe String)
                           , TransactionParams -> Maybe String
from :: !(Maybe String)
                           }
  deriving (Int -> TransactionParams -> ShowS
[TransactionParams] -> ShowS
TransactionParams -> String
(Int -> TransactionParams -> ShowS)
-> (TransactionParams -> String)
-> ([TransactionParams] -> ShowS)
-> Show TransactionParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransactionParams -> ShowS
showsPrec :: Int -> TransactionParams -> ShowS
$cshow :: TransactionParams -> String
show :: TransactionParams -> String
$cshowList :: [TransactionParams] -> ShowS
showList :: [TransactionParams] -> ShowS
Show)

addTransactionParams :: Maybe TransactionParams -> Options -> IO Options
addTransactionParams :: Maybe TransactionParams -> Options -> IO Options
addTransactionParams (Just TransactionParams { $sel:from:TransactionParams :: TransactionParams -> Maybe String
from = Maybe String
mFrom, $sel:to:TransactionParams :: TransactionParams -> Maybe String
to = Maybe String
mTo }) Options
opts =
    do
        Options
opts' <- case Maybe String
mTo of
            Just String
to' -> Options -> IO Options
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Options -> IO Options) -> Options -> IO Options
forall a b. (a -> b) -> a -> b
$ Options
opts Options -> (Options -> Options) -> Options
forall a b. a -> (a -> b) -> b
& Text -> Lens' Options [Text]
param Text
"to" (([Text] -> Identity [Text]) -> Options -> Identity Options)
-> [Text] -> Options -> Options
forall s t a b. ASetter s t a b -> b -> s -> t
.~ [String -> Text
forall a. IsString a => String -> a
fromString String
to']
            Maybe String
Nothing  -> Options -> IO Options
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Options
opts
        case Maybe String
mFrom of
            Just String
from' -> Options -> IO Options
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Options -> IO Options) -> Options -> IO Options
forall a b. (a -> b) -> a -> b
$ Options
opts' Options -> (Options -> Options) -> Options
forall a b. a -> (a -> b) -> b
& Text -> Lens' Options [Text]
param Text
"from" (([Text] -> Identity [Text]) -> Options -> Identity Options)
-> [Text] -> Options -> Options
forall s t a b. ASetter s t a b -> b -> s -> t
.~ [String -> Text
forall a. IsString a => String -> a
fromString String
from']
            Maybe String
Nothing    -> Options -> IO Options
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Options
opts'
addTransactionParams Maybe TransactionParams
Nothing Options
opts = Options -> IO Options
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Options
opts