{-# 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.Personalize.Types.Recipe where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Recipe = Recipe'
{
Recipe -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Recipe -> Maybe Text
algorithmArn :: Prelude.Maybe Prelude.Text,
Recipe -> Maybe Text
recipeArn :: Prelude.Maybe Prelude.Text,
Recipe -> Maybe Text
featureTransformationArn :: Prelude.Maybe Prelude.Text,
Recipe -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
Recipe -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Recipe -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
Recipe -> Maybe Text
recipeType :: Prelude.Maybe Prelude.Text,
Recipe -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (Recipe -> Recipe -> Bool
(Recipe -> Recipe -> Bool)
-> (Recipe -> Recipe -> Bool) -> Eq Recipe
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Recipe -> Recipe -> Bool
$c/= :: Recipe -> Recipe -> Bool
== :: Recipe -> Recipe -> Bool
$c== :: Recipe -> Recipe -> Bool
Prelude.Eq, ReadPrec [Recipe]
ReadPrec Recipe
Int -> ReadS Recipe
ReadS [Recipe]
(Int -> ReadS Recipe)
-> ReadS [Recipe]
-> ReadPrec Recipe
-> ReadPrec [Recipe]
-> Read Recipe
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Recipe]
$creadListPrec :: ReadPrec [Recipe]
readPrec :: ReadPrec Recipe
$creadPrec :: ReadPrec Recipe
readList :: ReadS [Recipe]
$creadList :: ReadS [Recipe]
readsPrec :: Int -> ReadS Recipe
$creadsPrec :: Int -> ReadS Recipe
Prelude.Read, Int -> Recipe -> ShowS
[Recipe] -> ShowS
Recipe -> String
(Int -> Recipe -> ShowS)
-> (Recipe -> String) -> ([Recipe] -> ShowS) -> Show Recipe
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Recipe] -> ShowS
$cshowList :: [Recipe] -> ShowS
show :: Recipe -> String
$cshow :: Recipe -> String
showsPrec :: Int -> Recipe -> ShowS
$cshowsPrec :: Int -> Recipe -> ShowS
Prelude.Show, (forall x. Recipe -> Rep Recipe x)
-> (forall x. Rep Recipe x -> Recipe) -> Generic Recipe
forall x. Rep Recipe x -> Recipe
forall x. Recipe -> Rep Recipe x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Recipe x -> Recipe
$cfrom :: forall x. Recipe -> Rep Recipe x
Prelude.Generic)
newRecipe ::
Recipe
newRecipe :: Recipe
newRecipe =
Recipe' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe
Recipe'
{ $sel:status:Recipe' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:algorithmArn:Recipe' :: Maybe Text
algorithmArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recipeArn:Recipe' :: Maybe Text
recipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:featureTransformationArn:Recipe' :: Maybe Text
featureTransformationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedDateTime:Recipe' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:Recipe' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDateTime:Recipe' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:recipeType:Recipe' :: Maybe Text
recipeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Recipe' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
recipe_status :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_status :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_status = (Recipe -> Maybe Text)
-> (Recipe -> Maybe Text -> Recipe)
-> Lens Recipe Recipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe Text
status :: Maybe Text
$sel:status:Recipe' :: Recipe -> Maybe Text
status} -> Maybe Text
status) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:status:Recipe' :: Maybe Text
status = Maybe Text
a} :: Recipe)
recipe_algorithmArn :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_algorithmArn :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_algorithmArn = (Recipe -> Maybe Text)
-> (Recipe -> Maybe Text -> Recipe)
-> Lens Recipe Recipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe Text
algorithmArn :: Maybe Text
$sel:algorithmArn:Recipe' :: Recipe -> Maybe Text
algorithmArn} -> Maybe Text
algorithmArn) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:algorithmArn:Recipe' :: Maybe Text
algorithmArn = Maybe Text
a} :: Recipe)
recipe_recipeArn :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_recipeArn :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_recipeArn = (Recipe -> Maybe Text)
-> (Recipe -> Maybe Text -> Recipe)
-> Lens Recipe Recipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe Text
recipeArn :: Maybe Text
$sel:recipeArn:Recipe' :: Recipe -> Maybe Text
recipeArn} -> Maybe Text
recipeArn) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:recipeArn:Recipe' :: Maybe Text
recipeArn = Maybe Text
a} :: Recipe)
recipe_featureTransformationArn :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_featureTransformationArn :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_featureTransformationArn = (Recipe -> Maybe Text)
-> (Recipe -> Maybe Text -> Recipe)
-> Lens Recipe Recipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe Text
featureTransformationArn :: Maybe Text
$sel:featureTransformationArn:Recipe' :: Recipe -> Maybe Text
featureTransformationArn} -> Maybe Text
featureTransformationArn) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:featureTransformationArn:Recipe' :: Maybe Text
featureTransformationArn = Maybe Text
a} :: Recipe)
recipe_lastUpdatedDateTime :: Lens.Lens' Recipe (Prelude.Maybe Prelude.UTCTime)
recipe_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Recipe -> f Recipe
recipe_lastUpdatedDateTime = (Recipe -> Maybe POSIX)
-> (Recipe -> Maybe POSIX -> Recipe)
-> Lens Recipe Recipe (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:Recipe' :: Recipe -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: Recipe
s@Recipe' {} Maybe POSIX
a -> Recipe
s {$sel:lastUpdatedDateTime:Recipe' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: Recipe) ((Maybe POSIX -> f (Maybe POSIX)) -> Recipe -> f Recipe)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Recipe
-> f Recipe
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
recipe_name :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_name :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_name = (Recipe -> Maybe Text)
-> (Recipe -> Maybe Text -> Recipe)
-> Lens Recipe Recipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe Text
name :: Maybe Text
$sel:name:Recipe' :: Recipe -> Maybe Text
name} -> Maybe Text
name) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:name:Recipe' :: Maybe Text
name = Maybe Text
a} :: Recipe)
recipe_creationDateTime :: Lens.Lens' Recipe (Prelude.Maybe Prelude.UTCTime)
recipe_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Recipe -> f Recipe
recipe_creationDateTime = (Recipe -> Maybe POSIX)
-> (Recipe -> Maybe POSIX -> Recipe)
-> Lens Recipe Recipe (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:Recipe' :: Recipe -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: Recipe
s@Recipe' {} Maybe POSIX
a -> Recipe
s {$sel:creationDateTime:Recipe' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: Recipe) ((Maybe POSIX -> f (Maybe POSIX)) -> Recipe -> f Recipe)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Recipe
-> f Recipe
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
recipe_recipeType :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_recipeType :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_recipeType = (Recipe -> Maybe Text)
-> (Recipe -> Maybe Text -> Recipe)
-> Lens Recipe Recipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe Text
recipeType :: Maybe Text
$sel:recipeType:Recipe' :: Recipe -> Maybe Text
recipeType} -> Maybe Text
recipeType) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:recipeType:Recipe' :: Maybe Text
recipeType = Maybe Text
a} :: Recipe)
recipe_description :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_description :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_description = (Recipe -> Maybe Text)
-> (Recipe -> Maybe Text -> Recipe)
-> Lens Recipe Recipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe Text
description :: Maybe Text
$sel:description:Recipe' :: Recipe -> Maybe Text
description} -> Maybe Text
description) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:description:Recipe' :: Maybe Text
description = Maybe Text
a} :: Recipe)
instance Core.FromJSON Recipe where
parseJSON :: Value -> Parser Recipe
parseJSON =
String -> (Object -> Parser Recipe) -> Value -> Parser Recipe
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Recipe"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe
Recipe'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe)
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
"status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe)
forall (f :: * -> *) a b. Applicative f => 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 Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe)
forall (f :: * -> *) a b. Applicative f => 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
"recipeArn")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Recipe)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe POSIX -> Maybe Text -> Maybe Text -> Recipe)
forall (f :: * -> *) a b. Applicative f => 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
"featureTransformationArn")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe POSIX -> Maybe Text -> Maybe Text -> Recipe)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe POSIX -> Maybe Text -> Maybe Text -> Recipe)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedDateTime")
Parser
(Maybe Text -> Maybe POSIX -> Maybe Text -> Maybe Text -> Recipe)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Recipe)
forall (f :: * -> *) a b. Applicative f => 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
"name")
Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Recipe)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Recipe)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationDateTime")
Parser (Maybe Text -> Maybe Text -> Recipe)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Recipe)
forall (f :: * -> *) a b. Applicative f => 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
"recipeType")
Parser (Maybe Text -> Recipe)
-> Parser (Maybe Text) -> Parser Recipe
forall (f :: * -> *) a b. Applicative f => 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
"description")
)
instance Prelude.Hashable Recipe
instance Prelude.NFData Recipe