{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ForecastQuery.Types.Forecast where
import qualified Amazonka.Core as Core
import Amazonka.ForecastQuery.Types.DataPoint
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Forecast = Forecast'
{
Forecast -> Maybe (HashMap Text [DataPoint])
predictions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [DataPoint])
}
deriving (Forecast -> Forecast -> Bool
(Forecast -> Forecast -> Bool)
-> (Forecast -> Forecast -> Bool) -> Eq Forecast
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Forecast -> Forecast -> Bool
$c/= :: Forecast -> Forecast -> Bool
== :: Forecast -> Forecast -> Bool
$c== :: Forecast -> Forecast -> Bool
Prelude.Eq, ReadPrec [Forecast]
ReadPrec Forecast
Int -> ReadS Forecast
ReadS [Forecast]
(Int -> ReadS Forecast)
-> ReadS [Forecast]
-> ReadPrec Forecast
-> ReadPrec [Forecast]
-> Read Forecast
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Forecast]
$creadListPrec :: ReadPrec [Forecast]
readPrec :: ReadPrec Forecast
$creadPrec :: ReadPrec Forecast
readList :: ReadS [Forecast]
$creadList :: ReadS [Forecast]
readsPrec :: Int -> ReadS Forecast
$creadsPrec :: Int -> ReadS Forecast
Prelude.Read, Int -> Forecast -> ShowS
[Forecast] -> ShowS
Forecast -> String
(Int -> Forecast -> ShowS)
-> (Forecast -> String) -> ([Forecast] -> ShowS) -> Show Forecast
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Forecast] -> ShowS
$cshowList :: [Forecast] -> ShowS
show :: Forecast -> String
$cshow :: Forecast -> String
showsPrec :: Int -> Forecast -> ShowS
$cshowsPrec :: Int -> Forecast -> ShowS
Prelude.Show, (forall x. Forecast -> Rep Forecast x)
-> (forall x. Rep Forecast x -> Forecast) -> Generic Forecast
forall x. Rep Forecast x -> Forecast
forall x. Forecast -> Rep Forecast x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Forecast x -> Forecast
$cfrom :: forall x. Forecast -> Rep Forecast x
Prelude.Generic)
newForecast ::
Forecast
newForecast :: Forecast
newForecast =
Forecast' :: Maybe (HashMap Text [DataPoint]) -> Forecast
Forecast' {$sel:predictions:Forecast' :: Maybe (HashMap Text [DataPoint])
predictions = Maybe (HashMap Text [DataPoint])
forall a. Maybe a
Prelude.Nothing}
forecast_predictions :: Lens.Lens' Forecast (Prelude.Maybe (Prelude.HashMap Prelude.Text [DataPoint]))
forecast_predictions :: (Maybe (HashMap Text [DataPoint])
-> f (Maybe (HashMap Text [DataPoint])))
-> Forecast -> f Forecast
forecast_predictions = (Forecast -> Maybe (HashMap Text [DataPoint]))
-> (Forecast -> Maybe (HashMap Text [DataPoint]) -> Forecast)
-> Lens
Forecast
Forecast
(Maybe (HashMap Text [DataPoint]))
(Maybe (HashMap Text [DataPoint]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Forecast' {Maybe (HashMap Text [DataPoint])
predictions :: Maybe (HashMap Text [DataPoint])
$sel:predictions:Forecast' :: Forecast -> Maybe (HashMap Text [DataPoint])
predictions} -> Maybe (HashMap Text [DataPoint])
predictions) (\s :: Forecast
s@Forecast' {} Maybe (HashMap Text [DataPoint])
a -> Forecast
s {$sel:predictions:Forecast' :: Maybe (HashMap Text [DataPoint])
predictions = Maybe (HashMap Text [DataPoint])
a} :: Forecast) ((Maybe (HashMap Text [DataPoint])
-> f (Maybe (HashMap Text [DataPoint])))
-> Forecast -> f Forecast)
-> ((Maybe (HashMap Text [DataPoint])
-> f (Maybe (HashMap Text [DataPoint])))
-> Maybe (HashMap Text [DataPoint])
-> f (Maybe (HashMap Text [DataPoint])))
-> (Maybe (HashMap Text [DataPoint])
-> f (Maybe (HashMap Text [DataPoint])))
-> Forecast
-> f Forecast
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text [DataPoint])
(HashMap Text [DataPoint])
(HashMap Text [DataPoint])
(HashMap Text [DataPoint])
-> Iso
(Maybe (HashMap Text [DataPoint]))
(Maybe (HashMap Text [DataPoint]))
(Maybe (HashMap Text [DataPoint]))
(Maybe (HashMap Text [DataPoint]))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text [DataPoint])
(HashMap Text [DataPoint])
(HashMap Text [DataPoint])
(HashMap Text [DataPoint])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Forecast where
parseJSON :: Value -> Parser Forecast
parseJSON =
String -> (Object -> Parser Forecast) -> Value -> Parser Forecast
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Forecast"
( \Object
x ->
Maybe (HashMap Text [DataPoint]) -> Forecast
Forecast'
(Maybe (HashMap Text [DataPoint]) -> Forecast)
-> Parser (Maybe (HashMap Text [DataPoint])) -> Parser Forecast
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text [DataPoint])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Predictions" Parser (Maybe (Maybe (HashMap Text [DataPoint])))
-> Maybe (HashMap Text [DataPoint])
-> Parser (Maybe (HashMap Text [DataPoint]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text [DataPoint])
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Forecast
instance Prelude.NFData Forecast