{-# 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.ImageBuilder.Types.ImageRecipeSummary
-- 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.ImageBuilder.Types.ImageRecipeSummary where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types.Platform
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A summary of an image recipe.
--
-- /See:/ 'newImageRecipeSummary' smart constructor.
data ImageRecipeSummary = ImageRecipeSummary'
  { -- | The platform of the image recipe.
    ImageRecipeSummary -> Maybe Platform
platform :: Prelude.Maybe Platform,
    -- | The Amazon Resource Name (ARN) of the image recipe.
    ImageRecipeSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The base image of the image recipe.
    ImageRecipeSummary -> Maybe Text
parentImage :: Prelude.Maybe Prelude.Text,
    -- | The owner of the image recipe.
    ImageRecipeSummary -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
    -- | The date on which this image recipe was created.
    ImageRecipeSummary -> Maybe Text
dateCreated :: Prelude.Maybe Prelude.Text,
    -- | The name of the image recipe.
    ImageRecipeSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The tags of the image recipe.
    ImageRecipeSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (ImageRecipeSummary -> ImageRecipeSummary -> Bool
(ImageRecipeSummary -> ImageRecipeSummary -> Bool)
-> (ImageRecipeSummary -> ImageRecipeSummary -> Bool)
-> Eq ImageRecipeSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageRecipeSummary -> ImageRecipeSummary -> Bool
$c/= :: ImageRecipeSummary -> ImageRecipeSummary -> Bool
== :: ImageRecipeSummary -> ImageRecipeSummary -> Bool
$c== :: ImageRecipeSummary -> ImageRecipeSummary -> Bool
Prelude.Eq, ReadPrec [ImageRecipeSummary]
ReadPrec ImageRecipeSummary
Int -> ReadS ImageRecipeSummary
ReadS [ImageRecipeSummary]
(Int -> ReadS ImageRecipeSummary)
-> ReadS [ImageRecipeSummary]
-> ReadPrec ImageRecipeSummary
-> ReadPrec [ImageRecipeSummary]
-> Read ImageRecipeSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImageRecipeSummary]
$creadListPrec :: ReadPrec [ImageRecipeSummary]
readPrec :: ReadPrec ImageRecipeSummary
$creadPrec :: ReadPrec ImageRecipeSummary
readList :: ReadS [ImageRecipeSummary]
$creadList :: ReadS [ImageRecipeSummary]
readsPrec :: Int -> ReadS ImageRecipeSummary
$creadsPrec :: Int -> ReadS ImageRecipeSummary
Prelude.Read, Int -> ImageRecipeSummary -> ShowS
[ImageRecipeSummary] -> ShowS
ImageRecipeSummary -> String
(Int -> ImageRecipeSummary -> ShowS)
-> (ImageRecipeSummary -> String)
-> ([ImageRecipeSummary] -> ShowS)
-> Show ImageRecipeSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageRecipeSummary] -> ShowS
$cshowList :: [ImageRecipeSummary] -> ShowS
show :: ImageRecipeSummary -> String
$cshow :: ImageRecipeSummary -> String
showsPrec :: Int -> ImageRecipeSummary -> ShowS
$cshowsPrec :: Int -> ImageRecipeSummary -> ShowS
Prelude.Show, (forall x. ImageRecipeSummary -> Rep ImageRecipeSummary x)
-> (forall x. Rep ImageRecipeSummary x -> ImageRecipeSummary)
-> Generic ImageRecipeSummary
forall x. Rep ImageRecipeSummary x -> ImageRecipeSummary
forall x. ImageRecipeSummary -> Rep ImageRecipeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageRecipeSummary x -> ImageRecipeSummary
$cfrom :: forall x. ImageRecipeSummary -> Rep ImageRecipeSummary x
Prelude.Generic)

-- |
-- Create a value of 'ImageRecipeSummary' 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:
--
-- 'platform', 'imageRecipeSummary_platform' - The platform of the image recipe.
--
-- 'arn', 'imageRecipeSummary_arn' - The Amazon Resource Name (ARN) of the image recipe.
--
-- 'parentImage', 'imageRecipeSummary_parentImage' - The base image of the image recipe.
--
-- 'owner', 'imageRecipeSummary_owner' - The owner of the image recipe.
--
-- 'dateCreated', 'imageRecipeSummary_dateCreated' - The date on which this image recipe was created.
--
-- 'name', 'imageRecipeSummary_name' - The name of the image recipe.
--
-- 'tags', 'imageRecipeSummary_tags' - The tags of the image recipe.
newImageRecipeSummary ::
  ImageRecipeSummary
newImageRecipeSummary :: ImageRecipeSummary
newImageRecipeSummary =
  ImageRecipeSummary' :: Maybe Platform
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ImageRecipeSummary
ImageRecipeSummary'
    { $sel:platform:ImageRecipeSummary' :: Maybe Platform
platform = Maybe Platform
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ImageRecipeSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parentImage:ImageRecipeSummary' :: Maybe Text
parentImage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:owner:ImageRecipeSummary' :: Maybe Text
owner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dateCreated:ImageRecipeSummary' :: Maybe Text
dateCreated = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ImageRecipeSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ImageRecipeSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The platform of the image recipe.
imageRecipeSummary_platform :: Lens.Lens' ImageRecipeSummary (Prelude.Maybe Platform)
imageRecipeSummary_platform :: (Maybe Platform -> f (Maybe Platform))
-> ImageRecipeSummary -> f ImageRecipeSummary
imageRecipeSummary_platform = (ImageRecipeSummary -> Maybe Platform)
-> (ImageRecipeSummary -> Maybe Platform -> ImageRecipeSummary)
-> Lens
     ImageRecipeSummary
     ImageRecipeSummary
     (Maybe Platform)
     (Maybe Platform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageRecipeSummary' {Maybe Platform
platform :: Maybe Platform
$sel:platform:ImageRecipeSummary' :: ImageRecipeSummary -> Maybe Platform
platform} -> Maybe Platform
platform) (\s :: ImageRecipeSummary
s@ImageRecipeSummary' {} Maybe Platform
a -> ImageRecipeSummary
s {$sel:platform:ImageRecipeSummary' :: Maybe Platform
platform = Maybe Platform
a} :: ImageRecipeSummary)

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

-- | The base image of the image recipe.
imageRecipeSummary_parentImage :: Lens.Lens' ImageRecipeSummary (Prelude.Maybe Prelude.Text)
imageRecipeSummary_parentImage :: (Maybe Text -> f (Maybe Text))
-> ImageRecipeSummary -> f ImageRecipeSummary
imageRecipeSummary_parentImage = (ImageRecipeSummary -> Maybe Text)
-> (ImageRecipeSummary -> Maybe Text -> ImageRecipeSummary)
-> Lens
     ImageRecipeSummary ImageRecipeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageRecipeSummary' {Maybe Text
parentImage :: Maybe Text
$sel:parentImage:ImageRecipeSummary' :: ImageRecipeSummary -> Maybe Text
parentImage} -> Maybe Text
parentImage) (\s :: ImageRecipeSummary
s@ImageRecipeSummary' {} Maybe Text
a -> ImageRecipeSummary
s {$sel:parentImage:ImageRecipeSummary' :: Maybe Text
parentImage = Maybe Text
a} :: ImageRecipeSummary)

-- | The owner of the image recipe.
imageRecipeSummary_owner :: Lens.Lens' ImageRecipeSummary (Prelude.Maybe Prelude.Text)
imageRecipeSummary_owner :: (Maybe Text -> f (Maybe Text))
-> ImageRecipeSummary -> f ImageRecipeSummary
imageRecipeSummary_owner = (ImageRecipeSummary -> Maybe Text)
-> (ImageRecipeSummary -> Maybe Text -> ImageRecipeSummary)
-> Lens
     ImageRecipeSummary ImageRecipeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageRecipeSummary' {Maybe Text
owner :: Maybe Text
$sel:owner:ImageRecipeSummary' :: ImageRecipeSummary -> Maybe Text
owner} -> Maybe Text
owner) (\s :: ImageRecipeSummary
s@ImageRecipeSummary' {} Maybe Text
a -> ImageRecipeSummary
s {$sel:owner:ImageRecipeSummary' :: Maybe Text
owner = Maybe Text
a} :: ImageRecipeSummary)

-- | The date on which this image recipe was created.
imageRecipeSummary_dateCreated :: Lens.Lens' ImageRecipeSummary (Prelude.Maybe Prelude.Text)
imageRecipeSummary_dateCreated :: (Maybe Text -> f (Maybe Text))
-> ImageRecipeSummary -> f ImageRecipeSummary
imageRecipeSummary_dateCreated = (ImageRecipeSummary -> Maybe Text)
-> (ImageRecipeSummary -> Maybe Text -> ImageRecipeSummary)
-> Lens
     ImageRecipeSummary ImageRecipeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageRecipeSummary' {Maybe Text
dateCreated :: Maybe Text
$sel:dateCreated:ImageRecipeSummary' :: ImageRecipeSummary -> Maybe Text
dateCreated} -> Maybe Text
dateCreated) (\s :: ImageRecipeSummary
s@ImageRecipeSummary' {} Maybe Text
a -> ImageRecipeSummary
s {$sel:dateCreated:ImageRecipeSummary' :: Maybe Text
dateCreated = Maybe Text
a} :: ImageRecipeSummary)

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

-- | The tags of the image recipe.
imageRecipeSummary_tags :: Lens.Lens' ImageRecipeSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
imageRecipeSummary_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ImageRecipeSummary -> f ImageRecipeSummary
imageRecipeSummary_tags = (ImageRecipeSummary -> Maybe (HashMap Text Text))
-> (ImageRecipeSummary
    -> Maybe (HashMap Text Text) -> ImageRecipeSummary)
-> Lens
     ImageRecipeSummary
     ImageRecipeSummary
     (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 (\ImageRecipeSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ImageRecipeSummary' :: ImageRecipeSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ImageRecipeSummary
s@ImageRecipeSummary' {} Maybe (HashMap Text Text)
a -> ImageRecipeSummary
s {$sel:tags:ImageRecipeSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ImageRecipeSummary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ImageRecipeSummary -> f ImageRecipeSummary)
-> ((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)))
-> ImageRecipeSummary
-> f ImageRecipeSummary
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

instance Core.FromJSON ImageRecipeSummary where
  parseJSON :: Value -> Parser ImageRecipeSummary
parseJSON =
    String
-> (Object -> Parser ImageRecipeSummary)
-> Value
-> Parser ImageRecipeSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ImageRecipeSummary"
      ( \Object
x ->
          Maybe Platform
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ImageRecipeSummary
ImageRecipeSummary'
            (Maybe Platform
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> ImageRecipeSummary)
-> Parser (Maybe Platform)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> ImageRecipeSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Platform)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"platform")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ImageRecipeSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> ImageRecipeSummary)
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
"arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ImageRecipeSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> ImageRecipeSummary)
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
"parentImage")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ImageRecipeSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (HashMap Text Text) -> ImageRecipeSummary)
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
"owner")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (HashMap Text Text) -> ImageRecipeSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe (HashMap Text Text) -> ImageRecipeSummary)
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
"dateCreated")
            Parser
  (Maybe Text -> Maybe (HashMap Text Text) -> ImageRecipeSummary)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> ImageRecipeSummary)
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 (HashMap Text Text) -> ImageRecipeSummary)
-> Parser (Maybe (HashMap Text Text)) -> Parser ImageRecipeSummary
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)
      )

instance Prelude.Hashable ImageRecipeSummary

instance Prelude.NFData ImageRecipeSummary