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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ImageBuilder.Types.ContainerType
import Amazonka.ImageBuilder.Types.Platform
import qualified Amazonka.Prelude as Prelude

-- | A summary of a container recipe
--
-- /See:/ 'newContainerRecipeSummary' smart constructor.
data ContainerRecipeSummary = ContainerRecipeSummary'
  { -- | The Amazon Resource Name (ARN) of the container recipe.
    ContainerRecipeSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Specifies the type of container, such as \"Docker\".
    ContainerRecipeSummary -> Maybe ContainerType
containerType :: Prelude.Maybe ContainerType,
    -- | The date when this container recipe was created.
    ContainerRecipeSummary -> Maybe Text
dateCreated :: Prelude.Maybe Prelude.Text,
    -- | The name of the container recipe.
    ContainerRecipeSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The owner of the container recipe.
    ContainerRecipeSummary -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
    -- | The base image for the container recipe.
    ContainerRecipeSummary -> Maybe Text
parentImage :: Prelude.Maybe Prelude.Text,
    -- | The system platform for the container, such as Windows or Linux.
    ContainerRecipeSummary -> Maybe Platform
platform :: Prelude.Maybe Platform,
    -- | Tags that are attached to the container recipe.
    ContainerRecipeSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (ContainerRecipeSummary -> ContainerRecipeSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerRecipeSummary -> ContainerRecipeSummary -> Bool
$c/= :: ContainerRecipeSummary -> ContainerRecipeSummary -> Bool
== :: ContainerRecipeSummary -> ContainerRecipeSummary -> Bool
$c== :: ContainerRecipeSummary -> ContainerRecipeSummary -> Bool
Prelude.Eq, ReadPrec [ContainerRecipeSummary]
ReadPrec ContainerRecipeSummary
Int -> ReadS ContainerRecipeSummary
ReadS [ContainerRecipeSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerRecipeSummary]
$creadListPrec :: ReadPrec [ContainerRecipeSummary]
readPrec :: ReadPrec ContainerRecipeSummary
$creadPrec :: ReadPrec ContainerRecipeSummary
readList :: ReadS [ContainerRecipeSummary]
$creadList :: ReadS [ContainerRecipeSummary]
readsPrec :: Int -> ReadS ContainerRecipeSummary
$creadsPrec :: Int -> ReadS ContainerRecipeSummary
Prelude.Read, Int -> ContainerRecipeSummary -> ShowS
[ContainerRecipeSummary] -> ShowS
ContainerRecipeSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerRecipeSummary] -> ShowS
$cshowList :: [ContainerRecipeSummary] -> ShowS
show :: ContainerRecipeSummary -> String
$cshow :: ContainerRecipeSummary -> String
showsPrec :: Int -> ContainerRecipeSummary -> ShowS
$cshowsPrec :: Int -> ContainerRecipeSummary -> ShowS
Prelude.Show, forall x. Rep ContainerRecipeSummary x -> ContainerRecipeSummary
forall x. ContainerRecipeSummary -> Rep ContainerRecipeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerRecipeSummary x -> ContainerRecipeSummary
$cfrom :: forall x. ContainerRecipeSummary -> Rep ContainerRecipeSummary x
Prelude.Generic)

-- |
-- Create a value of 'ContainerRecipeSummary' 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:
--
-- 'arn', 'containerRecipeSummary_arn' - The Amazon Resource Name (ARN) of the container recipe.
--
-- 'containerType', 'containerRecipeSummary_containerType' - Specifies the type of container, such as \"Docker\".
--
-- 'dateCreated', 'containerRecipeSummary_dateCreated' - The date when this container recipe was created.
--
-- 'name', 'containerRecipeSummary_name' - The name of the container recipe.
--
-- 'owner', 'containerRecipeSummary_owner' - The owner of the container recipe.
--
-- 'parentImage', 'containerRecipeSummary_parentImage' - The base image for the container recipe.
--
-- 'platform', 'containerRecipeSummary_platform' - The system platform for the container, such as Windows or Linux.
--
-- 'tags', 'containerRecipeSummary_tags' - Tags that are attached to the container recipe.
newContainerRecipeSummary ::
  ContainerRecipeSummary
newContainerRecipeSummary :: ContainerRecipeSummary
newContainerRecipeSummary =
  ContainerRecipeSummary'
    { $sel:arn:ContainerRecipeSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:containerType:ContainerRecipeSummary' :: Maybe ContainerType
containerType = forall a. Maybe a
Prelude.Nothing,
      $sel:dateCreated:ContainerRecipeSummary' :: Maybe Text
dateCreated = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ContainerRecipeSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:owner:ContainerRecipeSummary' :: Maybe Text
owner = forall a. Maybe a
Prelude.Nothing,
      $sel:parentImage:ContainerRecipeSummary' :: Maybe Text
parentImage = forall a. Maybe a
Prelude.Nothing,
      $sel:platform:ContainerRecipeSummary' :: Maybe Platform
platform = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ContainerRecipeSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

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

-- | Specifies the type of container, such as \"Docker\".
containerRecipeSummary_containerType :: Lens.Lens' ContainerRecipeSummary (Prelude.Maybe ContainerType)
containerRecipeSummary_containerType :: Lens' ContainerRecipeSummary (Maybe ContainerType)
containerRecipeSummary_containerType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipeSummary' {Maybe ContainerType
containerType :: Maybe ContainerType
$sel:containerType:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe ContainerType
containerType} -> Maybe ContainerType
containerType) (\s :: ContainerRecipeSummary
s@ContainerRecipeSummary' {} Maybe ContainerType
a -> ContainerRecipeSummary
s {$sel:containerType:ContainerRecipeSummary' :: Maybe ContainerType
containerType = Maybe ContainerType
a} :: ContainerRecipeSummary)

-- | The date when this container recipe was created.
containerRecipeSummary_dateCreated :: Lens.Lens' ContainerRecipeSummary (Prelude.Maybe Prelude.Text)
containerRecipeSummary_dateCreated :: Lens' ContainerRecipeSummary (Maybe Text)
containerRecipeSummary_dateCreated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipeSummary' {Maybe Text
dateCreated :: Maybe Text
$sel:dateCreated:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
dateCreated} -> Maybe Text
dateCreated) (\s :: ContainerRecipeSummary
s@ContainerRecipeSummary' {} Maybe Text
a -> ContainerRecipeSummary
s {$sel:dateCreated:ContainerRecipeSummary' :: Maybe Text
dateCreated = Maybe Text
a} :: ContainerRecipeSummary)

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

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

-- | The base image for the container recipe.
containerRecipeSummary_parentImage :: Lens.Lens' ContainerRecipeSummary (Prelude.Maybe Prelude.Text)
containerRecipeSummary_parentImage :: Lens' ContainerRecipeSummary (Maybe Text)
containerRecipeSummary_parentImage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipeSummary' {Maybe Text
parentImage :: Maybe Text
$sel:parentImage:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
parentImage} -> Maybe Text
parentImage) (\s :: ContainerRecipeSummary
s@ContainerRecipeSummary' {} Maybe Text
a -> ContainerRecipeSummary
s {$sel:parentImage:ContainerRecipeSummary' :: Maybe Text
parentImage = Maybe Text
a} :: ContainerRecipeSummary)

-- | The system platform for the container, such as Windows or Linux.
containerRecipeSummary_platform :: Lens.Lens' ContainerRecipeSummary (Prelude.Maybe Platform)
containerRecipeSummary_platform :: Lens' ContainerRecipeSummary (Maybe Platform)
containerRecipeSummary_platform = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipeSummary' {Maybe Platform
platform :: Maybe Platform
$sel:platform:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Platform
platform} -> Maybe Platform
platform) (\s :: ContainerRecipeSummary
s@ContainerRecipeSummary' {} Maybe Platform
a -> ContainerRecipeSummary
s {$sel:platform:ContainerRecipeSummary' :: Maybe Platform
platform = Maybe Platform
a} :: ContainerRecipeSummary)

-- | Tags that are attached to the container recipe.
containerRecipeSummary_tags :: Lens.Lens' ContainerRecipeSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
containerRecipeSummary_tags :: Lens' ContainerRecipeSummary (Maybe (HashMap Text Text))
containerRecipeSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipeSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ContainerRecipeSummary
s@ContainerRecipeSummary' {} Maybe (HashMap Text Text)
a -> ContainerRecipeSummary
s {$sel:tags:ContainerRecipeSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ContainerRecipeSummary) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON ContainerRecipeSummary where
  parseJSON :: Value -> Parser ContainerRecipeSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContainerRecipeSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ContainerType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Platform
-> Maybe (HashMap Text Text)
-> ContainerRecipeSummary
ContainerRecipeSummary'
            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
"arn")
            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
"containerType")
            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
"dateCreated")
            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
"owner")
            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
"parentImage")
            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
"platform")
            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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ContainerRecipeSummary where
  hashWithSalt :: Int -> ContainerRecipeSummary -> Int
hashWithSalt Int
_salt ContainerRecipeSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContainerType
Maybe Platform
tags :: Maybe (HashMap Text Text)
platform :: Maybe Platform
parentImage :: Maybe Text
owner :: Maybe Text
name :: Maybe Text
dateCreated :: Maybe Text
containerType :: Maybe ContainerType
arn :: Maybe Text
$sel:tags:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe (HashMap Text Text)
$sel:platform:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Platform
$sel:parentImage:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:owner:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:name:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:dateCreated:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:containerType:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe ContainerType
$sel:arn:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContainerType
containerType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dateCreated
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
owner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parentImage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Platform
platform
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData ContainerRecipeSummary where
  rnf :: ContainerRecipeSummary -> ()
rnf ContainerRecipeSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContainerType
Maybe Platform
tags :: Maybe (HashMap Text Text)
platform :: Maybe Platform
parentImage :: Maybe Text
owner :: Maybe Text
name :: Maybe Text
dateCreated :: Maybe Text
containerType :: Maybe ContainerType
arn :: Maybe Text
$sel:tags:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe (HashMap Text Text)
$sel:platform:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Platform
$sel:parentImage:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:owner:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:name:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:dateCreated:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
$sel:containerType:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe ContainerType
$sel:arn:ContainerRecipeSummary' :: ContainerRecipeSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContainerType
containerType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dateCreated
      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
owner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parentImage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Platform
platform
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags