{-# 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 Amazonka.Forecast.Types.FeaturizationMethodName
import qualified Amazonka.Lens as Lens
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
(FeaturizationMethod -> FeaturizationMethod -> Bool)
-> (FeaturizationMethod -> FeaturizationMethod -> Bool)
-> Eq FeaturizationMethod
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]
(Int -> ReadS FeaturizationMethod)
-> ReadS [FeaturizationMethod]
-> ReadPrec FeaturizationMethod
-> ReadPrec [FeaturizationMethod]
-> Read 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
(Int -> FeaturizationMethod -> ShowS)
-> (FeaturizationMethod -> String)
-> ([FeaturizationMethod] -> ShowS)
-> Show FeaturizationMethod
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. FeaturizationMethod -> Rep FeaturizationMethod x)
-> (forall x. Rep FeaturizationMethod x -> FeaturizationMethod)
-> Generic FeaturizationMethod
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' :: Maybe (HashMap Text Text)
-> FeaturizationMethodName -> FeaturizationMethod
FeaturizationMethod'
{ $sel:featurizationMethodParameters:FeaturizationMethod' :: Maybe (HashMap Text Text)
featurizationMethodParameters =
Maybe (HashMap Text Text)
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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> FeaturizationMethod -> f FeaturizationMethod
featurizationMethod_featurizationMethodParameters = (FeaturizationMethod -> Maybe (HashMap Text Text))
-> (FeaturizationMethod
-> Maybe (HashMap Text Text) -> FeaturizationMethod)
-> Lens
FeaturizationMethod
FeaturizationMethod
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> FeaturizationMethod -> f FeaturizationMethod)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> FeaturizationMethod
-> f FeaturizationMethod
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
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 :: (FeaturizationMethodName -> f FeaturizationMethodName)
-> FeaturizationMethod -> f FeaturizationMethod
featurizationMethod_featurizationMethodName = (FeaturizationMethod -> FeaturizationMethodName)
-> (FeaturizationMethod
-> FeaturizationMethodName -> FeaturizationMethod)
-> Lens
FeaturizationMethod
FeaturizationMethod
FeaturizationMethodName
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 Core.FromJSON FeaturizationMethod where
parseJSON :: Value -> Parser FeaturizationMethod
parseJSON =
String
-> (Object -> Parser FeaturizationMethod)
-> Value
-> Parser FeaturizationMethod
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FeaturizationMethod"
( \Object
x ->
Maybe (HashMap Text Text)
-> FeaturizationMethodName -> FeaturizationMethod
FeaturizationMethod'
(Maybe (HashMap Text Text)
-> FeaturizationMethodName -> FeaturizationMethod)
-> Parser (Maybe (HashMap Text Text))
-> Parser (FeaturizationMethodName -> FeaturizationMethod)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FeaturizationMethodParameters"
Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
)
Parser (FeaturizationMethodName -> FeaturizationMethod)
-> Parser FeaturizationMethodName -> Parser FeaturizationMethod
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FeaturizationMethodName
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FeaturizationMethodName")
)
instance Prelude.Hashable FeaturizationMethod
instance Prelude.NFData FeaturizationMethod
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FeaturizationMethodParameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
featurizationMethodParameters,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"FeaturizationMethodName"
Text -> FeaturizationMethodName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FeaturizationMethodName
featurizationMethodName
)
]
)