{-# 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.EvaluationParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EvaluationParameters = EvaluationParameters'
{
EvaluationParameters -> Maybe Int
backTestWindowOffset :: Prelude.Maybe Prelude.Int,
EvaluationParameters -> Maybe Int
numberOfBacktestWindows :: Prelude.Maybe Prelude.Int
}
deriving (EvaluationParameters -> EvaluationParameters -> Bool
(EvaluationParameters -> EvaluationParameters -> Bool)
-> (EvaluationParameters -> EvaluationParameters -> Bool)
-> Eq EvaluationParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EvaluationParameters -> EvaluationParameters -> Bool
$c/= :: EvaluationParameters -> EvaluationParameters -> Bool
== :: EvaluationParameters -> EvaluationParameters -> Bool
$c== :: EvaluationParameters -> EvaluationParameters -> Bool
Prelude.Eq, ReadPrec [EvaluationParameters]
ReadPrec EvaluationParameters
Int -> ReadS EvaluationParameters
ReadS [EvaluationParameters]
(Int -> ReadS EvaluationParameters)
-> ReadS [EvaluationParameters]
-> ReadPrec EvaluationParameters
-> ReadPrec [EvaluationParameters]
-> Read EvaluationParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EvaluationParameters]
$creadListPrec :: ReadPrec [EvaluationParameters]
readPrec :: ReadPrec EvaluationParameters
$creadPrec :: ReadPrec EvaluationParameters
readList :: ReadS [EvaluationParameters]
$creadList :: ReadS [EvaluationParameters]
readsPrec :: Int -> ReadS EvaluationParameters
$creadsPrec :: Int -> ReadS EvaluationParameters
Prelude.Read, Int -> EvaluationParameters -> ShowS
[EvaluationParameters] -> ShowS
EvaluationParameters -> String
(Int -> EvaluationParameters -> ShowS)
-> (EvaluationParameters -> String)
-> ([EvaluationParameters] -> ShowS)
-> Show EvaluationParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EvaluationParameters] -> ShowS
$cshowList :: [EvaluationParameters] -> ShowS
show :: EvaluationParameters -> String
$cshow :: EvaluationParameters -> String
showsPrec :: Int -> EvaluationParameters -> ShowS
$cshowsPrec :: Int -> EvaluationParameters -> ShowS
Prelude.Show, (forall x. EvaluationParameters -> Rep EvaluationParameters x)
-> (forall x. Rep EvaluationParameters x -> EvaluationParameters)
-> Generic EvaluationParameters
forall x. Rep EvaluationParameters x -> EvaluationParameters
forall x. EvaluationParameters -> Rep EvaluationParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EvaluationParameters x -> EvaluationParameters
$cfrom :: forall x. EvaluationParameters -> Rep EvaluationParameters x
Prelude.Generic)
newEvaluationParameters ::
EvaluationParameters
newEvaluationParameters :: EvaluationParameters
newEvaluationParameters =
EvaluationParameters' :: Maybe Int -> Maybe Int -> EvaluationParameters
EvaluationParameters'
{ $sel:backTestWindowOffset:EvaluationParameters' :: Maybe Int
backTestWindowOffset =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:numberOfBacktestWindows:EvaluationParameters' :: Maybe Int
numberOfBacktestWindows = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
evaluationParameters_backTestWindowOffset :: Lens.Lens' EvaluationParameters (Prelude.Maybe Prelude.Int)
evaluationParameters_backTestWindowOffset :: (Maybe Int -> f (Maybe Int))
-> EvaluationParameters -> f EvaluationParameters
evaluationParameters_backTestWindowOffset = (EvaluationParameters -> Maybe Int)
-> (EvaluationParameters -> Maybe Int -> EvaluationParameters)
-> Lens
EvaluationParameters EvaluationParameters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationParameters' {Maybe Int
backTestWindowOffset :: Maybe Int
$sel:backTestWindowOffset:EvaluationParameters' :: EvaluationParameters -> Maybe Int
backTestWindowOffset} -> Maybe Int
backTestWindowOffset) (\s :: EvaluationParameters
s@EvaluationParameters' {} Maybe Int
a -> EvaluationParameters
s {$sel:backTestWindowOffset:EvaluationParameters' :: Maybe Int
backTestWindowOffset = Maybe Int
a} :: EvaluationParameters)
evaluationParameters_numberOfBacktestWindows :: Lens.Lens' EvaluationParameters (Prelude.Maybe Prelude.Int)
evaluationParameters_numberOfBacktestWindows :: (Maybe Int -> f (Maybe Int))
-> EvaluationParameters -> f EvaluationParameters
evaluationParameters_numberOfBacktestWindows = (EvaluationParameters -> Maybe Int)
-> (EvaluationParameters -> Maybe Int -> EvaluationParameters)
-> Lens
EvaluationParameters EvaluationParameters (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationParameters' {Maybe Int
numberOfBacktestWindows :: Maybe Int
$sel:numberOfBacktestWindows:EvaluationParameters' :: EvaluationParameters -> Maybe Int
numberOfBacktestWindows} -> Maybe Int
numberOfBacktestWindows) (\s :: EvaluationParameters
s@EvaluationParameters' {} Maybe Int
a -> EvaluationParameters
s {$sel:numberOfBacktestWindows:EvaluationParameters' :: Maybe Int
numberOfBacktestWindows = Maybe Int
a} :: EvaluationParameters)
instance Core.FromJSON EvaluationParameters where
parseJSON :: Value -> Parser EvaluationParameters
parseJSON =
String
-> (Object -> Parser EvaluationParameters)
-> Value
-> Parser EvaluationParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EvaluationParameters"
( \Object
x ->
Maybe Int -> Maybe Int -> EvaluationParameters
EvaluationParameters'
(Maybe Int -> Maybe Int -> EvaluationParameters)
-> Parser (Maybe Int) -> Parser (Maybe Int -> EvaluationParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackTestWindowOffset")
Parser (Maybe Int -> EvaluationParameters)
-> Parser (Maybe Int) -> Parser EvaluationParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfBacktestWindows")
)
instance Prelude.Hashable EvaluationParameters
instance Prelude.NFData EvaluationParameters
instance Core.ToJSON EvaluationParameters where
toJSON :: EvaluationParameters -> Value
toJSON EvaluationParameters' {Maybe Int
numberOfBacktestWindows :: Maybe Int
backTestWindowOffset :: Maybe Int
$sel:numberOfBacktestWindows:EvaluationParameters' :: EvaluationParameters -> Maybe Int
$sel:backTestWindowOffset:EvaluationParameters' :: EvaluationParameters -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"BackTestWindowOffset" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
backTestWindowOffset,
(Text
"NumberOfBacktestWindows" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
numberOfBacktestWindows
]
)