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