{-# 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.DataBrew.Types.Recipe
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DataBrew.Types.Recipe where

import qualified Amazonka.Core as Core
import Amazonka.DataBrew.Types.RecipeStep
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents one or more actions to be performed on a DataBrew dataset.
--
-- /See:/ 'newRecipe' smart constructor.
data Recipe = Recipe'
  { -- | The last modification date and time of the recipe.
    Recipe -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The date and time that the recipe was created.
    Recipe -> Maybe POSIX
createDate :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the user who published the recipe.
    Recipe -> Maybe Text
publishedBy :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the user who created the recipe.
    Recipe -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | A list of steps that are defined by the recipe.
    Recipe -> Maybe [RecipeStep]
steps :: Prelude.Maybe [RecipeStep],
    -- | The date and time when the recipe was published.
    Recipe -> Maybe POSIX
publishedDate :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) for the recipe.
    Recipe -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the version for the recipe. Must be one of the
    -- following:
    --
    -- -   Numeric version (@X.Y@) - @X@ and @Y@ stand for major and minor
    --     version numbers. The maximum length of each is 6 digits, and neither
    --     can be negative values. Both @X@ and @Y@ are required, and \"0.0\"
    --     isn\'t a valid version.
    --
    -- -   @LATEST_WORKING@ - the most recent valid version being developed in
    --     a DataBrew project.
    --
    -- -   @LATEST_PUBLISHED@ - the most recent published version.
    Recipe -> Maybe Text
recipeVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the project that the recipe is associated with.
    Recipe -> Maybe Text
projectName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the user who last modified the recipe.
    Recipe -> Maybe Text
lastModifiedBy :: Prelude.Maybe Prelude.Text,
    -- | The description of the recipe.
    Recipe -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Metadata tags that have been applied to the recipe.
    Recipe -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique name for the recipe.
    Recipe -> Text
name :: 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)

-- |
-- Create a value of 'Recipe' 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:
--
-- 'lastModifiedDate', 'recipe_lastModifiedDate' - The last modification date and time of the recipe.
--
-- 'createDate', 'recipe_createDate' - The date and time that the recipe was created.
--
-- 'publishedBy', 'recipe_publishedBy' - The Amazon Resource Name (ARN) of the user who published the recipe.
--
-- 'createdBy', 'recipe_createdBy' - The Amazon Resource Name (ARN) of the user who created the recipe.
--
-- 'steps', 'recipe_steps' - A list of steps that are defined by the recipe.
--
-- 'publishedDate', 'recipe_publishedDate' - The date and time when the recipe was published.
--
-- 'resourceArn', 'recipe_resourceArn' - The Amazon Resource Name (ARN) for the recipe.
--
-- 'recipeVersion', 'recipe_recipeVersion' - The identifier for the version for the recipe. Must be one of the
-- following:
--
-- -   Numeric version (@X.Y@) - @X@ and @Y@ stand for major and minor
--     version numbers. The maximum length of each is 6 digits, and neither
--     can be negative values. Both @X@ and @Y@ are required, and \"0.0\"
--     isn\'t a valid version.
--
-- -   @LATEST_WORKING@ - the most recent valid version being developed in
--     a DataBrew project.
--
-- -   @LATEST_PUBLISHED@ - the most recent published version.
--
-- 'projectName', 'recipe_projectName' - The name of the project that the recipe is associated with.
--
-- 'lastModifiedBy', 'recipe_lastModifiedBy' - The Amazon Resource Name (ARN) of the user who last modified the recipe.
--
-- 'description', 'recipe_description' - The description of the recipe.
--
-- 'tags', 'recipe_tags' - Metadata tags that have been applied to the recipe.
--
-- 'name', 'recipe_name' - The unique name for the recipe.
newRecipe ::
  -- | 'name'
  Prelude.Text ->
  Recipe
newRecipe :: Text -> Recipe
newRecipe Text
pName_ =
  Recipe' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [RecipeStep]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Recipe
Recipe'
    { $sel:lastModifiedDate:Recipe' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:Recipe' :: Maybe POSIX
createDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:publishedBy:Recipe' :: Maybe Text
publishedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:Recipe' :: Maybe Text
createdBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:steps:Recipe' :: Maybe [RecipeStep]
steps = Maybe [RecipeStep]
forall a. Maybe a
Prelude.Nothing,
      $sel:publishedDate:Recipe' :: Maybe POSIX
publishedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:Recipe' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recipeVersion:Recipe' :: Maybe Text
recipeVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:Recipe' :: Maybe Text
projectName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedBy:Recipe' :: Maybe Text
lastModifiedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Recipe' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Recipe' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Recipe' :: Text
name = Text
pName_
    }

-- | The last modification date and time of the recipe.
recipe_lastModifiedDate :: Lens.Lens' Recipe (Prelude.Maybe Prelude.UTCTime)
recipe_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Recipe -> f Recipe
recipe_lastModifiedDate = (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
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:Recipe' :: Recipe -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: Recipe
s@Recipe' {} Maybe POSIX
a -> Recipe
s {$sel:lastModifiedDate:Recipe' :: Maybe POSIX
lastModifiedDate = 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

-- | The date and time that the recipe was created.
recipe_createDate :: Lens.Lens' Recipe (Prelude.Maybe Prelude.UTCTime)
recipe_createDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Recipe -> f Recipe
recipe_createDate = (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
createDate :: Maybe POSIX
$sel:createDate:Recipe' :: Recipe -> Maybe POSIX
createDate} -> Maybe POSIX
createDate) (\s :: Recipe
s@Recipe' {} Maybe POSIX
a -> Recipe
s {$sel:createDate:Recipe' :: Maybe POSIX
createDate = 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

-- | The Amazon Resource Name (ARN) of the user who published the recipe.
recipe_publishedBy :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_publishedBy :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_publishedBy = (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
publishedBy :: Maybe Text
$sel:publishedBy:Recipe' :: Recipe -> Maybe Text
publishedBy} -> Maybe Text
publishedBy) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:publishedBy:Recipe' :: Maybe Text
publishedBy = Maybe Text
a} :: Recipe)

-- | The Amazon Resource Name (ARN) of the user who created the recipe.
recipe_createdBy :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_createdBy :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_createdBy = (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
createdBy :: Maybe Text
$sel:createdBy:Recipe' :: Recipe -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:createdBy:Recipe' :: Maybe Text
createdBy = Maybe Text
a} :: Recipe)

-- | A list of steps that are defined by the recipe.
recipe_steps :: Lens.Lens' Recipe (Prelude.Maybe [RecipeStep])
recipe_steps :: (Maybe [RecipeStep] -> f (Maybe [RecipeStep]))
-> Recipe -> f Recipe
recipe_steps = (Recipe -> Maybe [RecipeStep])
-> (Recipe -> Maybe [RecipeStep] -> Recipe)
-> Lens Recipe Recipe (Maybe [RecipeStep]) (Maybe [RecipeStep])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Maybe [RecipeStep]
steps :: Maybe [RecipeStep]
$sel:steps:Recipe' :: Recipe -> Maybe [RecipeStep]
steps} -> Maybe [RecipeStep]
steps) (\s :: Recipe
s@Recipe' {} Maybe [RecipeStep]
a -> Recipe
s {$sel:steps:Recipe' :: Maybe [RecipeStep]
steps = Maybe [RecipeStep]
a} :: Recipe) ((Maybe [RecipeStep] -> f (Maybe [RecipeStep]))
 -> Recipe -> f Recipe)
-> ((Maybe [RecipeStep] -> f (Maybe [RecipeStep]))
    -> Maybe [RecipeStep] -> f (Maybe [RecipeStep]))
-> (Maybe [RecipeStep] -> f (Maybe [RecipeStep]))
-> Recipe
-> f Recipe
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [RecipeStep] [RecipeStep] [RecipeStep] [RecipeStep]
-> Iso
     (Maybe [RecipeStep])
     (Maybe [RecipeStep])
     (Maybe [RecipeStep])
     (Maybe [RecipeStep])
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 [RecipeStep] [RecipeStep] [RecipeStep] [RecipeStep]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date and time when the recipe was published.
recipe_publishedDate :: Lens.Lens' Recipe (Prelude.Maybe Prelude.UTCTime)
recipe_publishedDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Recipe -> f Recipe
recipe_publishedDate = (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
publishedDate :: Maybe POSIX
$sel:publishedDate:Recipe' :: Recipe -> Maybe POSIX
publishedDate} -> Maybe POSIX
publishedDate) (\s :: Recipe
s@Recipe' {} Maybe POSIX
a -> Recipe
s {$sel:publishedDate:Recipe' :: Maybe POSIX
publishedDate = 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

-- | The Amazon Resource Name (ARN) for the recipe.
recipe_resourceArn :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_resourceArn :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_resourceArn = (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
resourceArn :: Maybe Text
$sel:resourceArn:Recipe' :: Recipe -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:resourceArn:Recipe' :: Maybe Text
resourceArn = Maybe Text
a} :: Recipe)

-- | The identifier for the version for the recipe. Must be one of the
-- following:
--
-- -   Numeric version (@X.Y@) - @X@ and @Y@ stand for major and minor
--     version numbers. The maximum length of each is 6 digits, and neither
--     can be negative values. Both @X@ and @Y@ are required, and \"0.0\"
--     isn\'t a valid version.
--
-- -   @LATEST_WORKING@ - the most recent valid version being developed in
--     a DataBrew project.
--
-- -   @LATEST_PUBLISHED@ - the most recent published version.
recipe_recipeVersion :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_recipeVersion :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_recipeVersion = (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
recipeVersion :: Maybe Text
$sel:recipeVersion:Recipe' :: Recipe -> Maybe Text
recipeVersion} -> Maybe Text
recipeVersion) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:recipeVersion:Recipe' :: Maybe Text
recipeVersion = Maybe Text
a} :: Recipe)

-- | The name of the project that the recipe is associated with.
recipe_projectName :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_projectName :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_projectName = (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
projectName :: Maybe Text
$sel:projectName:Recipe' :: Recipe -> Maybe Text
projectName} -> Maybe Text
projectName) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:projectName:Recipe' :: Maybe Text
projectName = Maybe Text
a} :: Recipe)

-- | The Amazon Resource Name (ARN) of the user who last modified the recipe.
recipe_lastModifiedBy :: Lens.Lens' Recipe (Prelude.Maybe Prelude.Text)
recipe_lastModifiedBy :: (Maybe Text -> f (Maybe Text)) -> Recipe -> f Recipe
recipe_lastModifiedBy = (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
lastModifiedBy :: Maybe Text
$sel:lastModifiedBy:Recipe' :: Recipe -> Maybe Text
lastModifiedBy} -> Maybe Text
lastModifiedBy) (\s :: Recipe
s@Recipe' {} Maybe Text
a -> Recipe
s {$sel:lastModifiedBy:Recipe' :: Maybe Text
lastModifiedBy = Maybe Text
a} :: Recipe)

-- | The description of the 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)

-- | Metadata tags that have been applied to the recipe.
recipe_tags :: Lens.Lens' Recipe (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
recipe_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Recipe -> f Recipe
recipe_tags = (Recipe -> Maybe (HashMap Text Text))
-> (Recipe -> Maybe (HashMap Text Text) -> Recipe)
-> Lens
     Recipe
     Recipe
     (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 (\Recipe' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Recipe' :: Recipe -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Recipe
s@Recipe' {} Maybe (HashMap Text Text)
a -> Recipe
s {$sel:tags:Recipe' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Recipe) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Recipe -> f Recipe)
-> ((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)))
-> Recipe
-> f Recipe
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

-- | The unique name for the recipe.
recipe_name :: Lens.Lens' Recipe Prelude.Text
recipe_name :: (Text -> f Text) -> Recipe -> f Recipe
recipe_name = (Recipe -> Text)
-> (Recipe -> Text -> Recipe) -> Lens Recipe Recipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipe' {Text
name :: Text
$sel:name:Recipe' :: Recipe -> Text
name} -> Text
name) (\s :: Recipe
s@Recipe' {} Text
a -> Recipe
s {$sel:name:Recipe' :: Text
name = 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 POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [RecipeStep]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Recipe
Recipe'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe [RecipeStep]
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Text
 -> Recipe)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe [RecipeStep]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Recipe)
forall (f :: * -> *) a b. Functor 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
"LastModifiedDate")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe [RecipeStep]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [RecipeStep]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> 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
"CreateDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [RecipeStep]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [RecipeStep]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> 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
"PublishedBy")
            Parser
  (Maybe Text
   -> Maybe [RecipeStep]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe Text)
-> Parser
     (Maybe [RecipeStep]
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> 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
"CreatedBy")
            Parser
  (Maybe [RecipeStep]
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe [RecipeStep])
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Recipe)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [RecipeStep]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Steps" Parser (Maybe (Maybe [RecipeStep]))
-> Maybe [RecipeStep] -> Parser (Maybe [RecipeStep])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RecipeStep]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> 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
"PublishedDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> 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
"ResourceArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> 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
"RecipeVersion")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Recipe)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (HashMap Text Text) -> 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
"ProjectName")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (HashMap Text Text) -> Text -> Recipe)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe (HashMap Text Text) -> 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
"LastModifiedBy")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> Text -> Recipe)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> 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
"Description")
            Parser (Maybe (HashMap Text Text) -> Text -> Recipe)
-> Parser (Maybe (HashMap Text Text)) -> Parser (Text -> Recipe)
forall (f :: * -> *) a b. Applicative f => 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
"Tags" 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 (Text -> Recipe) -> Parser Text -> Parser Recipe
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
      )

instance Prelude.Hashable Recipe

instance Prelude.NFData Recipe