{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Personalize.Types.RecipeSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Personalize.Types.RecipeSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Personalize.Types.Domain
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of the properties of a recipe. For a complete
-- listing, call the
-- <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeRecipe.html DescribeRecipe>
-- API.
--
-- /See:/ 'newRecipeSummary' smart constructor.
data RecipeSummary = RecipeSummary'
  { -- | The date and time (in Unix time) that the recipe was created.
    RecipeSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The domain of the recipe (if the recipe is a Domain dataset group use
    -- case).
    RecipeSummary -> Maybe Domain
domain :: Prelude.Maybe Domain,
    -- | The date and time (in Unix time) that the recipe was last updated.
    RecipeSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the recipe.
    RecipeSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the recipe.
    RecipeSummary -> Maybe Text
recipeArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the recipe.
    RecipeSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (RecipeSummary -> RecipeSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipeSummary -> RecipeSummary -> Bool
$c/= :: RecipeSummary -> RecipeSummary -> Bool
== :: RecipeSummary -> RecipeSummary -> Bool
$c== :: RecipeSummary -> RecipeSummary -> Bool
Prelude.Eq, ReadPrec [RecipeSummary]
ReadPrec RecipeSummary
Int -> ReadS RecipeSummary
ReadS [RecipeSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecipeSummary]
$creadListPrec :: ReadPrec [RecipeSummary]
readPrec :: ReadPrec RecipeSummary
$creadPrec :: ReadPrec RecipeSummary
readList :: ReadS [RecipeSummary]
$creadList :: ReadS [RecipeSummary]
readsPrec :: Int -> ReadS RecipeSummary
$creadsPrec :: Int -> ReadS RecipeSummary
Prelude.Read, Int -> RecipeSummary -> ShowS
[RecipeSummary] -> ShowS
RecipeSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipeSummary] -> ShowS
$cshowList :: [RecipeSummary] -> ShowS
show :: RecipeSummary -> String
$cshow :: RecipeSummary -> String
showsPrec :: Int -> RecipeSummary -> ShowS
$cshowsPrec :: Int -> RecipeSummary -> ShowS
Prelude.Show, forall x. Rep RecipeSummary x -> RecipeSummary
forall x. RecipeSummary -> Rep RecipeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecipeSummary x -> RecipeSummary
$cfrom :: forall x. RecipeSummary -> Rep RecipeSummary x
Prelude.Generic)

-- |
-- Create a value of 'RecipeSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'creationDateTime', 'recipeSummary_creationDateTime' - The date and time (in Unix time) that the recipe was created.
--
-- 'domain', 'recipeSummary_domain' - The domain of the recipe (if the recipe is a Domain dataset group use
-- case).
--
-- 'lastUpdatedDateTime', 'recipeSummary_lastUpdatedDateTime' - The date and time (in Unix time) that the recipe was last updated.
--
-- 'name', 'recipeSummary_name' - The name of the recipe.
--
-- 'recipeArn', 'recipeSummary_recipeArn' - The Amazon Resource Name (ARN) of the recipe.
--
-- 'status', 'recipeSummary_status' - The status of the recipe.
newRecipeSummary ::
  RecipeSummary
newRecipeSummary :: RecipeSummary
newRecipeSummary =
  RecipeSummary'
    { $sel:creationDateTime:RecipeSummary' :: Maybe POSIX
creationDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:domain:RecipeSummary' :: Maybe Domain
domain = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:RecipeSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:RecipeSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:recipeArn:RecipeSummary' :: Maybe Text
recipeArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:RecipeSummary' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time (in Unix time) that the recipe was created.
recipeSummary_creationDateTime :: Lens.Lens' RecipeSummary (Prelude.Maybe Prelude.UTCTime)
recipeSummary_creationDateTime :: Lens' RecipeSummary (Maybe UTCTime)
recipeSummary_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:RecipeSummary' :: RecipeSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: RecipeSummary
s@RecipeSummary' {} Maybe POSIX
a -> RecipeSummary
s {$sel:creationDateTime:RecipeSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: RecipeSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The domain of the recipe (if the recipe is a Domain dataset group use
-- case).
recipeSummary_domain :: Lens.Lens' RecipeSummary (Prelude.Maybe Domain)
recipeSummary_domain :: Lens' RecipeSummary (Maybe Domain)
recipeSummary_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeSummary' {Maybe Domain
domain :: Maybe Domain
$sel:domain:RecipeSummary' :: RecipeSummary -> Maybe Domain
domain} -> Maybe Domain
domain) (\s :: RecipeSummary
s@RecipeSummary' {} Maybe Domain
a -> RecipeSummary
s {$sel:domain:RecipeSummary' :: Maybe Domain
domain = Maybe Domain
a} :: RecipeSummary)

-- | The date and time (in Unix time) that the recipe was last updated.
recipeSummary_lastUpdatedDateTime :: Lens.Lens' RecipeSummary (Prelude.Maybe Prelude.UTCTime)
recipeSummary_lastUpdatedDateTime :: Lens' RecipeSummary (Maybe UTCTime)
recipeSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:RecipeSummary' :: RecipeSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: RecipeSummary
s@RecipeSummary' {} Maybe POSIX
a -> RecipeSummary
s {$sel:lastUpdatedDateTime:RecipeSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: RecipeSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the recipe.
recipeSummary_name :: Lens.Lens' RecipeSummary (Prelude.Maybe Prelude.Text)
recipeSummary_name :: Lens' RecipeSummary (Maybe Text)
recipeSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeSummary' {Maybe Text
name :: Maybe Text
$sel:name:RecipeSummary' :: RecipeSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: RecipeSummary
s@RecipeSummary' {} Maybe Text
a -> RecipeSummary
s {$sel:name:RecipeSummary' :: Maybe Text
name = Maybe Text
a} :: RecipeSummary)

-- | The Amazon Resource Name (ARN) of the recipe.
recipeSummary_recipeArn :: Lens.Lens' RecipeSummary (Prelude.Maybe Prelude.Text)
recipeSummary_recipeArn :: Lens' RecipeSummary (Maybe Text)
recipeSummary_recipeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeSummary' {Maybe Text
recipeArn :: Maybe Text
$sel:recipeArn:RecipeSummary' :: RecipeSummary -> Maybe Text
recipeArn} -> Maybe Text
recipeArn) (\s :: RecipeSummary
s@RecipeSummary' {} Maybe Text
a -> RecipeSummary
s {$sel:recipeArn:RecipeSummary' :: Maybe Text
recipeArn = Maybe Text
a} :: RecipeSummary)

-- | The status of the recipe.
recipeSummary_status :: Lens.Lens' RecipeSummary (Prelude.Maybe Prelude.Text)
recipeSummary_status :: Lens' RecipeSummary (Maybe Text)
recipeSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeSummary' {Maybe Text
status :: Maybe Text
$sel:status:RecipeSummary' :: RecipeSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: RecipeSummary
s@RecipeSummary' {} Maybe Text
a -> RecipeSummary
s {$sel:status:RecipeSummary' :: Maybe Text
status = Maybe Text
a} :: RecipeSummary)

instance Data.FromJSON RecipeSummary where
  parseJSON :: Value -> Parser RecipeSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecipeSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Domain
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RecipeSummary
RecipeSummary'
            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
"creationDateTime")
            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
"domain")
            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
"lastUpdatedDateTime")
            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
"name")
            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
"recipeArn")
            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
"status")
      )

instance Prelude.Hashable RecipeSummary where
  hashWithSalt :: Int -> RecipeSummary -> Int
hashWithSalt Int
_salt RecipeSummary' {Maybe Text
Maybe POSIX
Maybe Domain
status :: Maybe Text
recipeArn :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
domain :: Maybe Domain
creationDateTime :: Maybe POSIX
$sel:status:RecipeSummary' :: RecipeSummary -> Maybe Text
$sel:recipeArn:RecipeSummary' :: RecipeSummary -> Maybe Text
$sel:name:RecipeSummary' :: RecipeSummary -> Maybe Text
$sel:lastUpdatedDateTime:RecipeSummary' :: RecipeSummary -> Maybe POSIX
$sel:domain:RecipeSummary' :: RecipeSummary -> Maybe Domain
$sel:creationDateTime:RecipeSummary' :: RecipeSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Domain
domain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recipeArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

instance Prelude.NFData RecipeSummary where
  rnf :: RecipeSummary -> ()
rnf RecipeSummary' {Maybe Text
Maybe POSIX
Maybe Domain
status :: Maybe Text
recipeArn :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
domain :: Maybe Domain
creationDateTime :: Maybe POSIX
$sel:status:RecipeSummary' :: RecipeSummary -> Maybe Text
$sel:recipeArn:RecipeSummary' :: RecipeSummary -> Maybe Text
$sel:name:RecipeSummary' :: RecipeSummary -> Maybe Text
$sel:lastUpdatedDateTime:RecipeSummary' :: RecipeSummary -> Maybe POSIX
$sel:domain:RecipeSummary' :: RecipeSummary -> Maybe Domain
$sel:creationDateTime:RecipeSummary' :: RecipeSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Domain
domain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recipeArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status