Mercurial > public > lazybear
diff LazyBear/Views/Home/Networking/HomeResponse.swift @ 346:80bfa88c6b0f
Implementing Prop API
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sun, 11 Apr 2021 19:55:47 +0200 |
parents | |
children | 5ccceb527178 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Views/Home/Networking/HomeResponse.swift Sun Apr 11 19:55:47 2021 +0200 @@ -0,0 +1,31 @@ +// +// HomeResponse.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 11/4/21. +// + +import SwiftUI + +struct HomeResponse: Codable { + var lists: [String: [QuoteModel]]? // String is the list type; gainers, losers ... + var sectorPerformance: [SectorPerformanceModel]? + var tradingDates: [TradingDatesModel]? + var intradayPrices: [String: NestedIntradayPricesModel]? // String is each company symbol + + private enum CodingKeys : String, CodingKey { + case lists + case sectorPerformance = "sector_performance" + case tradingDates = "trading_dates" + case intradayPrices = "intraday_prices" + } +} + + +struct NestedIntradayPricesModel: Codable { + var nestedIntradayPrices: [IntradayPricesModel] + + private enum CodingKeys : String, CodingKey { + case nestedIntradayPrices = "intradayprices" + } +}