mintAccounts :: Wreq.Options -> IO ()
mintAccounts tokenSession = do
    let accountUrl = Settings.mintHostname ++ "/bundledServiceController.xevent?legacy=false"
    let accountJson = "[{"
                    ++ "\"id\": \"1\","
                    ++ "\"service\": \"MintAccountService\","
                    ++ "\"task\": \"getAccountsSortedByBalanceDescending\","
                    ++ "\"args\": {"
                        ++ "\"types\": ["
                            ++ "\"BANK\","
                            ++ "\"CREDIT\","
                            ++ "\"INVESTMENT\","
                            ++ "\"LOAN\","
                            ++ "\"MORTGAGE\","
                            ++ "\"OTHER_PROPERTY\","
                            ++ "\"REAL_ESTATE\","
                            ++ "\"VEHICLE\","
                            ++ "\"UNCLASSIFIED\""
                        ++ "]"
                    ++ "}"
                ++ "}]"
    response <- Wreq.postWith tokenSession accountUrl ["input" Wreq.:= Text.pack accountJson]

    let resultMaybe = response ^? Wreq.responseBody . key "response" . key "1" . key "response"
    case fmap fromJSON resultMaybe :: Maybe (Result [JsonAccount]) of
         Just (Success jsonAccounts) -> updateAccounts $ filter isActive jsonAccounts
         Just (Error message)        -> putStrLn ("Error: could not decode account JSON response. " ++ message)
         Nothing                     -> putStrLn "Error: could not decode account JSON response."
mintAccounts :: Wreq.Options -> IO ()
mintAccounts tokenSession = do
    let accountUrl = Settings.mintHostname ++ "/bundledServiceController.xevent?legacy=false"
    let accountJson = "[{"
                    ++ "\"id\": \"1\","
                    ++ "\"service\": \"MintAccountService\","
                    ++ "\"task\": \"getAccountsSortedByBalanceDescending\","
                    ++ "\"args\": {"
                        ++ "\"types\": ["
                            ++ "\"BANK\","
                            ++ "\"CREDIT\","
                            ++ "\"INVESTMENT\","
                            ++ "\"LOAN\","
                            ++ "\"MORTGAGE\","
                            ++ "\"OTHER_PROPERTY\","
                            ++ "\"REAL_ESTATE\","
                            ++ "\"VEHICLE\","
                            ++ "\"UNCLASSIFIED\""
                        ++ "]"
                    ++ "}"
                ++ "}]"
    response <- Wreq.postWith tokenSession accountUrl ["input" Wreq.:= Text.pack accountJson]

    let resultMaybe = response ^? Wreq.responseBody . key "response" . key "1" . key "response"
    case fmap fromJSON resultMaybe :: Maybe (Result [JsonAccount]) of
         Just (Success jsonAccounts) -> updateAccounts $ filter isActive jsonAccounts
         Just (Error message)        -> putStrLn ("Error: could not decode account JSON response. " ++ message)
         Nothing                     -> putStrLn "Error: could not decode account JSON response."
mintAccounts tokenSession = do
    let accountUrl = Settings.mintHostname ++ "/bundledServiceController.xevent?legacy=false"
    let accountJson = "[{"
                    ++ "\"id\": \"1\","
                    ++ "\"service\": \"MintAccountService\","
                    ++ "\"task\": \"getAccountsSortedByBalanceDescending\","
                    ++ "\"args\": {"
                        ++ "\"types\": ["
                            ++ "\"BANK\","
                            ++ "\"CREDIT\","
                            ++ "\"INVESTMENT\","
                            ++ "\"LOAN\","
                            ++ "\"MORTGAGE\","
                            ++ "\"OTHER_PROPERTY\","
                            ++ "\"REAL_ESTATE\","
                            ++ "\"VEHICLE\","
                            ++ "\"UNCLASSIFIED\""
                        ++ "]"
                    ++ "}"
                ++ "}]"
    response <- Wreq.postWith tokenSession accountUrl ["input" Wreq.:= Text.pack accountJson]

    let resultMaybe = response ^? Wreq.responseBody . key "response" . key "1" . key "response"
    case fmap fromJSON resultMaybe :: Maybe (Result [JsonAccount]) of
         Just (Success jsonAccounts) -> updateAccounts $ filter isActive jsonAccounts
         Just (Error message)        -> putStrLn ("Error: could not decode account JSON response. " ++ message)
         Nothing                     -> putStrLn "Error: could not decode account JSON response."