{-# 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.Forecast.Types.EvaluationResult where
import qualified Amazonka.Core as Core
import Amazonka.Forecast.Types.WindowSummary
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EvaluationResult = EvaluationResult'
{
EvaluationResult -> Maybe Text
algorithmArn :: Prelude.Maybe Prelude.Text,
EvaluationResult -> Maybe [WindowSummary]
testWindows :: Prelude.Maybe [WindowSummary]
}
deriving (EvaluationResult -> EvaluationResult -> Bool
(EvaluationResult -> EvaluationResult -> Bool)
-> (EvaluationResult -> EvaluationResult -> Bool)
-> Eq EvaluationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EvaluationResult -> EvaluationResult -> Bool
$c/= :: EvaluationResult -> EvaluationResult -> Bool
== :: EvaluationResult -> EvaluationResult -> Bool
$c== :: EvaluationResult -> EvaluationResult -> Bool
Prelude.Eq, ReadPrec [EvaluationResult]
ReadPrec EvaluationResult
Int -> ReadS EvaluationResult
ReadS [EvaluationResult]
(Int -> ReadS EvaluationResult)
-> ReadS [EvaluationResult]
-> ReadPrec EvaluationResult
-> ReadPrec [EvaluationResult]
-> Read EvaluationResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EvaluationResult]
$creadListPrec :: ReadPrec [EvaluationResult]
readPrec :: ReadPrec EvaluationResult
$creadPrec :: ReadPrec EvaluationResult
readList :: ReadS [EvaluationResult]
$creadList :: ReadS [EvaluationResult]
readsPrec :: Int -> ReadS EvaluationResult
$creadsPrec :: Int -> ReadS EvaluationResult
Prelude.Read, Int -> EvaluationResult -> ShowS
[EvaluationResult] -> ShowS
EvaluationResult -> String
(Int -> EvaluationResult -> ShowS)
-> (EvaluationResult -> String)
-> ([EvaluationResult] -> ShowS)
-> Show EvaluationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EvaluationResult] -> ShowS
$cshowList :: [EvaluationResult] -> ShowS
show :: EvaluationResult -> String
$cshow :: EvaluationResult -> String
showsPrec :: Int -> EvaluationResult -> ShowS
$cshowsPrec :: Int -> EvaluationResult -> ShowS
Prelude.Show, (forall x. EvaluationResult -> Rep EvaluationResult x)
-> (forall x. Rep EvaluationResult x -> EvaluationResult)
-> Generic EvaluationResult
forall x. Rep EvaluationResult x -> EvaluationResult
forall x. EvaluationResult -> Rep EvaluationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EvaluationResult x -> EvaluationResult
$cfrom :: forall x. EvaluationResult -> Rep EvaluationResult x
Prelude.Generic)
newEvaluationResult ::
EvaluationResult
newEvaluationResult :: EvaluationResult
newEvaluationResult =
EvaluationResult' :: Maybe Text -> Maybe [WindowSummary] -> EvaluationResult
EvaluationResult'
{ $sel:algorithmArn:EvaluationResult' :: Maybe Text
algorithmArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:testWindows:EvaluationResult' :: Maybe [WindowSummary]
testWindows = Maybe [WindowSummary]
forall a. Maybe a
Prelude.Nothing
}
evaluationResult_algorithmArn :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.Text)
evaluationResult_algorithmArn :: (Maybe Text -> f (Maybe Text))
-> EvaluationResult -> f EvaluationResult
evaluationResult_algorithmArn = (EvaluationResult -> Maybe Text)
-> (EvaluationResult -> Maybe Text -> EvaluationResult)
-> Lens EvaluationResult EvaluationResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe Text
algorithmArn :: Maybe Text
$sel:algorithmArn:EvaluationResult' :: EvaluationResult -> Maybe Text
algorithmArn} -> Maybe Text
algorithmArn) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe Text
a -> EvaluationResult
s {$sel:algorithmArn:EvaluationResult' :: Maybe Text
algorithmArn = Maybe Text
a} :: EvaluationResult)
evaluationResult_testWindows :: Lens.Lens' EvaluationResult (Prelude.Maybe [WindowSummary])
evaluationResult_testWindows :: (Maybe [WindowSummary] -> f (Maybe [WindowSummary]))
-> EvaluationResult -> f EvaluationResult
evaluationResult_testWindows = (EvaluationResult -> Maybe [WindowSummary])
-> (EvaluationResult -> Maybe [WindowSummary] -> EvaluationResult)
-> Lens
EvaluationResult
EvaluationResult
(Maybe [WindowSummary])
(Maybe [WindowSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe [WindowSummary]
testWindows :: Maybe [WindowSummary]
$sel:testWindows:EvaluationResult' :: EvaluationResult -> Maybe [WindowSummary]
testWindows} -> Maybe [WindowSummary]
testWindows) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe [WindowSummary]
a -> EvaluationResult
s {$sel:testWindows:EvaluationResult' :: Maybe [WindowSummary]
testWindows = Maybe [WindowSummary]
a} :: EvaluationResult) ((Maybe [WindowSummary] -> f (Maybe [WindowSummary]))
-> EvaluationResult -> f EvaluationResult)
-> ((Maybe [WindowSummary] -> f (Maybe [WindowSummary]))
-> Maybe [WindowSummary] -> f (Maybe [WindowSummary]))
-> (Maybe [WindowSummary] -> f (Maybe [WindowSummary]))
-> EvaluationResult
-> f EvaluationResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[WindowSummary] [WindowSummary] [WindowSummary] [WindowSummary]
-> Iso
(Maybe [WindowSummary])
(Maybe [WindowSummary])
(Maybe [WindowSummary])
(Maybe [WindowSummary])
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
[WindowSummary] [WindowSummary] [WindowSummary] [WindowSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON EvaluationResult where
parseJSON :: Value -> Parser EvaluationResult
parseJSON =
String
-> (Object -> Parser EvaluationResult)
-> Value
-> Parser EvaluationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EvaluationResult"
( \Object
x ->
Maybe Text -> Maybe [WindowSummary] -> EvaluationResult
EvaluationResult'
(Maybe Text -> Maybe [WindowSummary] -> EvaluationResult)
-> Parser (Maybe Text)
-> Parser (Maybe [WindowSummary] -> EvaluationResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AlgorithmArn")
Parser (Maybe [WindowSummary] -> EvaluationResult)
-> Parser (Maybe [WindowSummary]) -> Parser EvaluationResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [WindowSummary]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TestWindows" Parser (Maybe (Maybe [WindowSummary]))
-> Maybe [WindowSummary] -> Parser (Maybe [WindowSummary])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [WindowSummary]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable EvaluationResult
instance Prelude.NFData EvaluationResult