{-# 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.FeaturizationMethod 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.FeaturizationMethodName
import qualified Amazonka.Prelude as Prelude
data FeaturizationMethod = FeaturizationMethod'
{
FeaturizationMethod -> Maybe (HashMap Text Text)
featurizationMethodParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
FeaturizationMethod -> FeaturizationMethodName
featurizationMethodName :: FeaturizationMethodName
}
deriving (FeaturizationMethod -> FeaturizationMethod -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FeaturizationMethod -> FeaturizationMethod -> Bool
$c/= :: FeaturizationMethod -> FeaturizationMethod -> Bool
== :: FeaturizationMethod -> FeaturizationMethod -> Bool
$c== :: FeaturizationMethod -> FeaturizationMethod -> Bool
Prelude.Eq, ReadPrec [FeaturizationMethod]
ReadPrec FeaturizationMethod
Int -> ReadS FeaturizationMethod
ReadS [FeaturizationMethod]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FeaturizationMethod]
$creadListPrec :: ReadPrec [FeaturizationMethod]
readPrec :: ReadPrec FeaturizationMethod
$creadPrec :: ReadPrec FeaturizationMethod
readList :: ReadS [FeaturizationMethod]
$creadList :: ReadS [FeaturizationMethod]
readsPrec :: Int -> ReadS FeaturizationMethod
$creadsPrec :: Int -> ReadS FeaturizationMethod
Prelude.Read, Int -> FeaturizationMethod -> ShowS
[FeaturizationMethod] -> ShowS
FeaturizationMethod -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FeaturizationMethod] -> ShowS
$cshowList :: [FeaturizationMethod] -> ShowS
show :: FeaturizationMethod -> String
$cshow :: FeaturizationMethod -> String
showsPrec :: Int -> FeaturizationMethod -> ShowS
$cshowsPrec :: Int -> FeaturizationMethod -> ShowS
Prelude.Show, forall x. Rep FeaturizationMethod x -> FeaturizationMethod
forall x. FeaturizationMethod -> Rep FeaturizationMethod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FeaturizationMethod x -> FeaturizationMethod
$cfrom :: forall x. FeaturizationMethod -> Rep FeaturizationMethod x
Prelude.Generic)
newFeaturizationMethod ::
FeaturizationMethodName ->
FeaturizationMethod
newFeaturizationMethod :: FeaturizationMethodName -> FeaturizationMethod
newFeaturizationMethod FeaturizationMethodName
pFeaturizationMethodName_ =
FeaturizationMethod'
{ $sel:featurizationMethodParameters:FeaturizationMethod' :: Maybe (HashMap Text Text)
featurizationMethodParameters =
forall a. Maybe a
Prelude.Nothing,
$sel:featurizationMethodName:FeaturizationMethod' :: FeaturizationMethodName
featurizationMethodName = FeaturizationMethodName
pFeaturizationMethodName_
}
featurizationMethod_featurizationMethodParameters :: Lens.Lens' FeaturizationMethod (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
featurizationMethod_featurizationMethodParameters :: Lens' FeaturizationMethod (Maybe (HashMap Text Text))
featurizationMethod_featurizationMethodParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeaturizationMethod' {Maybe (HashMap Text Text)
featurizationMethodParameters :: Maybe (HashMap Text Text)
$sel:featurizationMethodParameters:FeaturizationMethod' :: FeaturizationMethod -> Maybe (HashMap Text Text)
featurizationMethodParameters} -> Maybe (HashMap Text Text)
featurizationMethodParameters) (\s :: FeaturizationMethod
s@FeaturizationMethod' {} Maybe (HashMap Text Text)
a -> FeaturizationMethod
s {$sel:featurizationMethodParameters:FeaturizationMethod' :: Maybe (HashMap Text Text)
featurizationMethodParameters = Maybe (HashMap Text Text)
a} :: FeaturizationMethod) 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
featurizationMethod_featurizationMethodName :: Lens.Lens' FeaturizationMethod FeaturizationMethodName
featurizationMethod_featurizationMethodName :: Lens' FeaturizationMethod FeaturizationMethodName
featurizationMethod_featurizationMethodName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeaturizationMethod' {FeaturizationMethodName
featurizationMethodName :: FeaturizationMethodName
$sel:featurizationMethodName:FeaturizationMethod' :: FeaturizationMethod -> FeaturizationMethodName
featurizationMethodName} -> FeaturizationMethodName
featurizationMethodName) (\s :: FeaturizationMethod
s@FeaturizationMethod' {} FeaturizationMethodName
a -> FeaturizationMethod
s {$sel:featurizationMethodName:FeaturizationMethod' :: FeaturizationMethodName
featurizationMethodName = FeaturizationMethodName
a} :: FeaturizationMethod)
instance Data.FromJSON FeaturizationMethod where
parseJSON :: Value -> Parser FeaturizationMethod
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FeaturizationMethod"
( \Object
x ->
Maybe (HashMap Text Text)
-> FeaturizationMethodName -> FeaturizationMethod
FeaturizationMethod'
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
"FeaturizationMethodParameters"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FeaturizationMethodName")
)
instance Prelude.Hashable FeaturizationMethod where
hashWithSalt :: Int -> FeaturizationMethod -> Int
hashWithSalt Int
_salt FeaturizationMethod' {Maybe (HashMap Text Text)
FeaturizationMethodName
featurizationMethodName :: FeaturizationMethodName
featurizationMethodParameters :: Maybe (HashMap Text Text)
$sel:featurizationMethodName:FeaturizationMethod' :: FeaturizationMethod -> FeaturizationMethodName
$sel:featurizationMethodParameters:FeaturizationMethod' :: FeaturizationMethod -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
featurizationMethodParameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FeaturizationMethodName
featurizationMethodName
instance Prelude.NFData FeaturizationMethod where
rnf :: FeaturizationMethod -> ()
rnf FeaturizationMethod' {Maybe (HashMap Text Text)
FeaturizationMethodName
featurizationMethodName :: FeaturizationMethodName
featurizationMethodParameters :: Maybe (HashMap Text Text)
$sel:featurizationMethodName:FeaturizationMethod' :: FeaturizationMethod -> FeaturizationMethodName
$sel:featurizationMethodParameters:FeaturizationMethod' :: FeaturizationMethod -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
featurizationMethodParameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FeaturizationMethodName
featurizationMethodName
instance Data.ToJSON FeaturizationMethod where
toJSON :: FeaturizationMethod -> Value
toJSON FeaturizationMethod' {Maybe (HashMap Text Text)
FeaturizationMethodName
featurizationMethodName :: FeaturizationMethodName
featurizationMethodParameters :: Maybe (HashMap Text Text)
$sel:featurizationMethodName:FeaturizationMethod' :: FeaturizationMethod -> FeaturizationMethodName
$sel:featurizationMethodParameters:FeaturizationMethod' :: FeaturizationMethod -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"FeaturizationMethodParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
featurizationMethodParameters,
forall a. a -> Maybe a
Prelude.Just
( Key
"FeaturizationMethodName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FeaturizationMethodName
featurizationMethodName
)
]
)