{-# 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.ContainerRecipe
-- 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.ContainerRecipe 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.ComponentConfiguration
import Amazonka.ImageBuilder.Types.ContainerType
import Amazonka.ImageBuilder.Types.InstanceConfiguration
import Amazonka.ImageBuilder.Types.Platform
import Amazonka.ImageBuilder.Types.TargetContainerRepository
import qualified Amazonka.Prelude as Prelude

-- | A container recipe.
--
-- /See:/ 'newContainerRecipe' smart constructor.
data ContainerRecipe = ContainerRecipe'
  { -- | The Amazon Resource Name (ARN) of the container recipe.
    --
    -- Semantic versioning is included in each object\'s Amazon Resource Name
    -- (ARN), at the level that applies to that object as follows:
    --
    -- 1.  Versionless ARNs and Name ARNs do not include specific values in any
    --     of the nodes. The nodes are either left off entirely, or they are
    --     specified as wildcards, for example: x.x.x.
    --
    -- 2.  Version ARNs have only the first three nodes:
    --     \<major>.\<minor>.\<patch>
    --
    -- 3.  Build version ARNs have all four nodes, and point to a specific
    --     build for a specific version of an object.
    ContainerRecipe -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Components for build and test that are included in the container recipe.
    ContainerRecipe -> Maybe (NonEmpty ComponentConfiguration)
components :: Prelude.Maybe (Prelude.NonEmpty ComponentConfiguration),
    -- | Specifies the type of container, such as Docker.
    ContainerRecipe -> Maybe ContainerType
containerType :: Prelude.Maybe ContainerType,
    -- | The date when this container recipe was created.
    ContainerRecipe -> Maybe Text
dateCreated :: Prelude.Maybe Prelude.Text,
    -- | The description of the container recipe.
    ContainerRecipe -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Dockerfiles are text documents that are used to build Docker containers,
    -- and ensure that they contain all of the elements required by the
    -- application running inside. The template data consists of contextual
    -- variables where Image Builder places build information or scripts, based
    -- on your container image recipe.
    ContainerRecipe -> Maybe Text
dockerfileTemplateData :: Prelude.Maybe Prelude.Text,
    -- | A flag that indicates if the target container is encrypted.
    ContainerRecipe -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | A group of options that can be used to configure an instance for
    -- building and testing container images.
    ContainerRecipe -> Maybe InstanceConfiguration
instanceConfiguration :: Prelude.Maybe InstanceConfiguration,
    -- | Identifies which KMS key is used to encrypt the container image for
    -- distribution to the target Region.
    ContainerRecipe -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The name of the container recipe.
    ContainerRecipe -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The owner of the container recipe.
    ContainerRecipe -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
    -- | The base image for the container recipe.
    ContainerRecipe -> Maybe Text
parentImage :: Prelude.Maybe Prelude.Text,
    -- | The system platform for the container, such as Windows or Linux.
    ContainerRecipe -> Maybe Platform
platform :: Prelude.Maybe Platform,
    -- | Tags that are attached to the container recipe.
    ContainerRecipe -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The destination repository for the container image.
    ContainerRecipe -> Maybe TargetContainerRepository
targetRepository :: Prelude.Maybe TargetContainerRepository,
    -- | The semantic version of the container recipe.
    --
    -- The semantic version has four nodes:
    -- \<major>.\<minor>.\<patch>\/\<build>. You can assign values for the
    -- first three, and can filter on all of them.
    --
    -- __Assignment:__ For the first three nodes you can assign any positive
    -- integer value, including zero, with an upper limit of 2^30-1, or
    -- 1073741823 for each node. Image Builder automatically assigns the build
    -- number to the fourth node.
    --
    -- __Patterns:__ You can use any numeric pattern that adheres to the
    -- assignment requirements for the nodes that you can assign. For example,
    -- you might choose a software version pattern, such as 1.0.0, or a date,
    -- such as 2021.01.01.
    --
    -- __Filtering:__ With semantic versioning, you have the flexibility to use
    -- wildcards (x) to specify the most recent versions or nodes when
    -- selecting the base image or components for your recipe. When you use a
    -- wildcard in any node, all nodes to the right of the first wildcard must
    -- also be wildcards.
    ContainerRecipe -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The working directory for use during build and test workflows.
    ContainerRecipe -> Maybe Text
workingDirectory :: Prelude.Maybe Prelude.Text
  }
  deriving (ContainerRecipe -> ContainerRecipe -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerRecipe -> ContainerRecipe -> Bool
$c/= :: ContainerRecipe -> ContainerRecipe -> Bool
== :: ContainerRecipe -> ContainerRecipe -> Bool
$c== :: ContainerRecipe -> ContainerRecipe -> Bool
Prelude.Eq, ReadPrec [ContainerRecipe]
ReadPrec ContainerRecipe
Int -> ReadS ContainerRecipe
ReadS [ContainerRecipe]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerRecipe]
$creadListPrec :: ReadPrec [ContainerRecipe]
readPrec :: ReadPrec ContainerRecipe
$creadPrec :: ReadPrec ContainerRecipe
readList :: ReadS [ContainerRecipe]
$creadList :: ReadS [ContainerRecipe]
readsPrec :: Int -> ReadS ContainerRecipe
$creadsPrec :: Int -> ReadS ContainerRecipe
Prelude.Read, Int -> ContainerRecipe -> ShowS
[ContainerRecipe] -> ShowS
ContainerRecipe -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerRecipe] -> ShowS
$cshowList :: [ContainerRecipe] -> ShowS
show :: ContainerRecipe -> String
$cshow :: ContainerRecipe -> String
showsPrec :: Int -> ContainerRecipe -> ShowS
$cshowsPrec :: Int -> ContainerRecipe -> ShowS
Prelude.Show, forall x. Rep ContainerRecipe x -> ContainerRecipe
forall x. ContainerRecipe -> Rep ContainerRecipe x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerRecipe x -> ContainerRecipe
$cfrom :: forall x. ContainerRecipe -> Rep ContainerRecipe x
Prelude.Generic)

-- |
-- Create a value of 'ContainerRecipe' 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', 'containerRecipe_arn' - The Amazon Resource Name (ARN) of the container recipe.
--
-- Semantic versioning is included in each object\'s Amazon Resource Name
-- (ARN), at the level that applies to that object as follows:
--
-- 1.  Versionless ARNs and Name ARNs do not include specific values in any
--     of the nodes. The nodes are either left off entirely, or they are
--     specified as wildcards, for example: x.x.x.
--
-- 2.  Version ARNs have only the first three nodes:
--     \<major>.\<minor>.\<patch>
--
-- 3.  Build version ARNs have all four nodes, and point to a specific
--     build for a specific version of an object.
--
-- 'components', 'containerRecipe_components' - Components for build and test that are included in the container recipe.
--
-- 'containerType', 'containerRecipe_containerType' - Specifies the type of container, such as Docker.
--
-- 'dateCreated', 'containerRecipe_dateCreated' - The date when this container recipe was created.
--
-- 'description', 'containerRecipe_description' - The description of the container recipe.
--
-- 'dockerfileTemplateData', 'containerRecipe_dockerfileTemplateData' - Dockerfiles are text documents that are used to build Docker containers,
-- and ensure that they contain all of the elements required by the
-- application running inside. The template data consists of contextual
-- variables where Image Builder places build information or scripts, based
-- on your container image recipe.
--
-- 'encrypted', 'containerRecipe_encrypted' - A flag that indicates if the target container is encrypted.
--
-- 'instanceConfiguration', 'containerRecipe_instanceConfiguration' - A group of options that can be used to configure an instance for
-- building and testing container images.
--
-- 'kmsKeyId', 'containerRecipe_kmsKeyId' - Identifies which KMS key is used to encrypt the container image for
-- distribution to the target Region.
--
-- 'name', 'containerRecipe_name' - The name of the container recipe.
--
-- 'owner', 'containerRecipe_owner' - The owner of the container recipe.
--
-- 'parentImage', 'containerRecipe_parentImage' - The base image for the container recipe.
--
-- 'platform', 'containerRecipe_platform' - The system platform for the container, such as Windows or Linux.
--
-- 'tags', 'containerRecipe_tags' - Tags that are attached to the container recipe.
--
-- 'targetRepository', 'containerRecipe_targetRepository' - The destination repository for the container image.
--
-- 'version', 'containerRecipe_version' - The semantic version of the container recipe.
--
-- The semantic version has four nodes:
-- \<major>.\<minor>.\<patch>\/\<build>. You can assign values for the
-- first three, and can filter on all of them.
--
-- __Assignment:__ For the first three nodes you can assign any positive
-- integer value, including zero, with an upper limit of 2^30-1, or
-- 1073741823 for each node. Image Builder automatically assigns the build
-- number to the fourth node.
--
-- __Patterns:__ You can use any numeric pattern that adheres to the
-- assignment requirements for the nodes that you can assign. For example,
-- you might choose a software version pattern, such as 1.0.0, or a date,
-- such as 2021.01.01.
--
-- __Filtering:__ With semantic versioning, you have the flexibility to use
-- wildcards (x) to specify the most recent versions or nodes when
-- selecting the base image or components for your recipe. When you use a
-- wildcard in any node, all nodes to the right of the first wildcard must
-- also be wildcards.
--
-- 'workingDirectory', 'containerRecipe_workingDirectory' - The working directory for use during build and test workflows.
newContainerRecipe ::
  ContainerRecipe
newContainerRecipe :: ContainerRecipe
newContainerRecipe =
  ContainerRecipe'
    { $sel:arn:ContainerRecipe' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:components:ContainerRecipe' :: Maybe (NonEmpty ComponentConfiguration)
components = forall a. Maybe a
Prelude.Nothing,
      $sel:containerType:ContainerRecipe' :: Maybe ContainerType
containerType = forall a. Maybe a
Prelude.Nothing,
      $sel:dateCreated:ContainerRecipe' :: Maybe Text
dateCreated = forall a. Maybe a
Prelude.Nothing,
      $sel:description:ContainerRecipe' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:dockerfileTemplateData:ContainerRecipe' :: Maybe Text
dockerfileTemplateData = forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:ContainerRecipe' :: Maybe Bool
encrypted = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceConfiguration:ContainerRecipe' :: Maybe InstanceConfiguration
instanceConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:ContainerRecipe' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ContainerRecipe' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:owner:ContainerRecipe' :: Maybe Text
owner = forall a. Maybe a
Prelude.Nothing,
      $sel:parentImage:ContainerRecipe' :: Maybe Text
parentImage = forall a. Maybe a
Prelude.Nothing,
      $sel:platform:ContainerRecipe' :: Maybe Platform
platform = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ContainerRecipe' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:targetRepository:ContainerRecipe' :: Maybe TargetContainerRepository
targetRepository = forall a. Maybe a
Prelude.Nothing,
      $sel:version:ContainerRecipe' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
      $sel:workingDirectory:ContainerRecipe' :: Maybe Text
workingDirectory = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the container recipe.
--
-- Semantic versioning is included in each object\'s Amazon Resource Name
-- (ARN), at the level that applies to that object as follows:
--
-- 1.  Versionless ARNs and Name ARNs do not include specific values in any
--     of the nodes. The nodes are either left off entirely, or they are
--     specified as wildcards, for example: x.x.x.
--
-- 2.  Version ARNs have only the first three nodes:
--     \<major>.\<minor>.\<patch>
--
-- 3.  Build version ARNs have all four nodes, and point to a specific
--     build for a specific version of an object.
containerRecipe_arn :: Lens.Lens' ContainerRecipe (Prelude.Maybe Prelude.Text)
containerRecipe_arn :: Lens' ContainerRecipe (Maybe Text)
containerRecipe_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe Text
arn :: Maybe Text
$sel:arn:ContainerRecipe' :: ContainerRecipe -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe Text
a -> ContainerRecipe
s {$sel:arn:ContainerRecipe' :: Maybe Text
arn = Maybe Text
a} :: ContainerRecipe)

-- | Components for build and test that are included in the container recipe.
containerRecipe_components :: Lens.Lens' ContainerRecipe (Prelude.Maybe (Prelude.NonEmpty ComponentConfiguration))
containerRecipe_components :: Lens' ContainerRecipe (Maybe (NonEmpty ComponentConfiguration))
containerRecipe_components = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe (NonEmpty ComponentConfiguration)
components :: Maybe (NonEmpty ComponentConfiguration)
$sel:components:ContainerRecipe' :: ContainerRecipe -> Maybe (NonEmpty ComponentConfiguration)
components} -> Maybe (NonEmpty ComponentConfiguration)
components) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe (NonEmpty ComponentConfiguration)
a -> ContainerRecipe
s {$sel:components:ContainerRecipe' :: Maybe (NonEmpty ComponentConfiguration)
components = Maybe (NonEmpty ComponentConfiguration)
a} :: ContainerRecipe) 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

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

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

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

-- | Dockerfiles are text documents that are used to build Docker containers,
-- and ensure that they contain all of the elements required by the
-- application running inside. The template data consists of contextual
-- variables where Image Builder places build information or scripts, based
-- on your container image recipe.
containerRecipe_dockerfileTemplateData :: Lens.Lens' ContainerRecipe (Prelude.Maybe Prelude.Text)
containerRecipe_dockerfileTemplateData :: Lens' ContainerRecipe (Maybe Text)
containerRecipe_dockerfileTemplateData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe Text
dockerfileTemplateData :: Maybe Text
$sel:dockerfileTemplateData:ContainerRecipe' :: ContainerRecipe -> Maybe Text
dockerfileTemplateData} -> Maybe Text
dockerfileTemplateData) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe Text
a -> ContainerRecipe
s {$sel:dockerfileTemplateData:ContainerRecipe' :: Maybe Text
dockerfileTemplateData = Maybe Text
a} :: ContainerRecipe)

-- | A flag that indicates if the target container is encrypted.
containerRecipe_encrypted :: Lens.Lens' ContainerRecipe (Prelude.Maybe Prelude.Bool)
containerRecipe_encrypted :: Lens' ContainerRecipe (Maybe Bool)
containerRecipe_encrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:ContainerRecipe' :: ContainerRecipe -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe Bool
a -> ContainerRecipe
s {$sel:encrypted:ContainerRecipe' :: Maybe Bool
encrypted = Maybe Bool
a} :: ContainerRecipe)

-- | A group of options that can be used to configure an instance for
-- building and testing container images.
containerRecipe_instanceConfiguration :: Lens.Lens' ContainerRecipe (Prelude.Maybe InstanceConfiguration)
containerRecipe_instanceConfiguration :: Lens' ContainerRecipe (Maybe InstanceConfiguration)
containerRecipe_instanceConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe InstanceConfiguration
instanceConfiguration :: Maybe InstanceConfiguration
$sel:instanceConfiguration:ContainerRecipe' :: ContainerRecipe -> Maybe InstanceConfiguration
instanceConfiguration} -> Maybe InstanceConfiguration
instanceConfiguration) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe InstanceConfiguration
a -> ContainerRecipe
s {$sel:instanceConfiguration:ContainerRecipe' :: Maybe InstanceConfiguration
instanceConfiguration = Maybe InstanceConfiguration
a} :: ContainerRecipe)

-- | Identifies which KMS key is used to encrypt the container image for
-- distribution to the target Region.
containerRecipe_kmsKeyId :: Lens.Lens' ContainerRecipe (Prelude.Maybe Prelude.Text)
containerRecipe_kmsKeyId :: Lens' ContainerRecipe (Maybe Text)
containerRecipe_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:ContainerRecipe' :: ContainerRecipe -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe Text
a -> ContainerRecipe
s {$sel:kmsKeyId:ContainerRecipe' :: Maybe Text
kmsKeyId = Maybe Text
a} :: ContainerRecipe)

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

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

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

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

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

-- | The destination repository for the container image.
containerRecipe_targetRepository :: Lens.Lens' ContainerRecipe (Prelude.Maybe TargetContainerRepository)
containerRecipe_targetRepository :: Lens' ContainerRecipe (Maybe TargetContainerRepository)
containerRecipe_targetRepository = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe TargetContainerRepository
targetRepository :: Maybe TargetContainerRepository
$sel:targetRepository:ContainerRecipe' :: ContainerRecipe -> Maybe TargetContainerRepository
targetRepository} -> Maybe TargetContainerRepository
targetRepository) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe TargetContainerRepository
a -> ContainerRecipe
s {$sel:targetRepository:ContainerRecipe' :: Maybe TargetContainerRepository
targetRepository = Maybe TargetContainerRepository
a} :: ContainerRecipe)

-- | The semantic version of the container recipe.
--
-- The semantic version has four nodes:
-- \<major>.\<minor>.\<patch>\/\<build>. You can assign values for the
-- first three, and can filter on all of them.
--
-- __Assignment:__ For the first three nodes you can assign any positive
-- integer value, including zero, with an upper limit of 2^30-1, or
-- 1073741823 for each node. Image Builder automatically assigns the build
-- number to the fourth node.
--
-- __Patterns:__ You can use any numeric pattern that adheres to the
-- assignment requirements for the nodes that you can assign. For example,
-- you might choose a software version pattern, such as 1.0.0, or a date,
-- such as 2021.01.01.
--
-- __Filtering:__ With semantic versioning, you have the flexibility to use
-- wildcards (x) to specify the most recent versions or nodes when
-- selecting the base image or components for your recipe. When you use a
-- wildcard in any node, all nodes to the right of the first wildcard must
-- also be wildcards.
containerRecipe_version :: Lens.Lens' ContainerRecipe (Prelude.Maybe Prelude.Text)
containerRecipe_version :: Lens' ContainerRecipe (Maybe Text)
containerRecipe_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe Text
version :: Maybe Text
$sel:version:ContainerRecipe' :: ContainerRecipe -> Maybe Text
version} -> Maybe Text
version) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe Text
a -> ContainerRecipe
s {$sel:version:ContainerRecipe' :: Maybe Text
version = Maybe Text
a} :: ContainerRecipe)

-- | The working directory for use during build and test workflows.
containerRecipe_workingDirectory :: Lens.Lens' ContainerRecipe (Prelude.Maybe Prelude.Text)
containerRecipe_workingDirectory :: Lens' ContainerRecipe (Maybe Text)
containerRecipe_workingDirectory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerRecipe' {Maybe Text
workingDirectory :: Maybe Text
$sel:workingDirectory:ContainerRecipe' :: ContainerRecipe -> Maybe Text
workingDirectory} -> Maybe Text
workingDirectory) (\s :: ContainerRecipe
s@ContainerRecipe' {} Maybe Text
a -> ContainerRecipe
s {$sel:workingDirectory:ContainerRecipe' :: Maybe Text
workingDirectory = Maybe Text
a} :: ContainerRecipe)

instance Data.FromJSON ContainerRecipe where
  parseJSON :: Value -> Parser ContainerRecipe
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContainerRecipe"
      ( \Object
x ->
          Maybe Text
-> Maybe (NonEmpty ComponentConfiguration)
-> Maybe ContainerType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe InstanceConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Platform
-> Maybe (HashMap Text Text)
-> Maybe TargetContainerRepository
-> Maybe Text
-> Maybe Text
-> ContainerRecipe
ContainerRecipe'
            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
"components")
            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
"description")
            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
"dockerfileTemplateData")
            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
"encrypted")
            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
"instanceConfiguration")
            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
"kmsKeyId")
            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)
            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
"targetRepository")
            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
"version")
            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
"workingDirectory")
      )

instance Prelude.Hashable ContainerRecipe where
  hashWithSalt :: Int -> ContainerRecipe -> Int
hashWithSalt Int
_salt ContainerRecipe' {Maybe Bool
Maybe (NonEmpty ComponentConfiguration)
Maybe Text
Maybe (HashMap Text Text)
Maybe ContainerType
Maybe InstanceConfiguration
Maybe Platform
Maybe TargetContainerRepository
workingDirectory :: Maybe Text
version :: Maybe Text
targetRepository :: Maybe TargetContainerRepository
tags :: Maybe (HashMap Text Text)
platform :: Maybe Platform
parentImage :: Maybe Text
owner :: Maybe Text
name :: Maybe Text
kmsKeyId :: Maybe Text
instanceConfiguration :: Maybe InstanceConfiguration
encrypted :: Maybe Bool
dockerfileTemplateData :: Maybe Text
description :: Maybe Text
dateCreated :: Maybe Text
containerType :: Maybe ContainerType
components :: Maybe (NonEmpty ComponentConfiguration)
arn :: Maybe Text
$sel:workingDirectory:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:version:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:targetRepository:ContainerRecipe' :: ContainerRecipe -> Maybe TargetContainerRepository
$sel:tags:ContainerRecipe' :: ContainerRecipe -> Maybe (HashMap Text Text)
$sel:platform:ContainerRecipe' :: ContainerRecipe -> Maybe Platform
$sel:parentImage:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:owner:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:name:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:kmsKeyId:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:instanceConfiguration:ContainerRecipe' :: ContainerRecipe -> Maybe InstanceConfiguration
$sel:encrypted:ContainerRecipe' :: ContainerRecipe -> Maybe Bool
$sel:dockerfileTemplateData:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:description:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:dateCreated:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:containerType:ContainerRecipe' :: ContainerRecipe -> Maybe ContainerType
$sel:components:ContainerRecipe' :: ContainerRecipe -> Maybe (NonEmpty ComponentConfiguration)
$sel:arn:ContainerRecipe' :: ContainerRecipe -> 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 (NonEmpty ComponentConfiguration)
components
      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
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dockerfileTemplateData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encrypted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceConfiguration
instanceConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TargetContainerRepository
targetRepository
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
workingDirectory

instance Prelude.NFData ContainerRecipe where
  rnf :: ContainerRecipe -> ()
rnf ContainerRecipe' {Maybe Bool
Maybe (NonEmpty ComponentConfiguration)
Maybe Text
Maybe (HashMap Text Text)
Maybe ContainerType
Maybe InstanceConfiguration
Maybe Platform
Maybe TargetContainerRepository
workingDirectory :: Maybe Text
version :: Maybe Text
targetRepository :: Maybe TargetContainerRepository
tags :: Maybe (HashMap Text Text)
platform :: Maybe Platform
parentImage :: Maybe Text
owner :: Maybe Text
name :: Maybe Text
kmsKeyId :: Maybe Text
instanceConfiguration :: Maybe InstanceConfiguration
encrypted :: Maybe Bool
dockerfileTemplateData :: Maybe Text
description :: Maybe Text
dateCreated :: Maybe Text
containerType :: Maybe ContainerType
components :: Maybe (NonEmpty ComponentConfiguration)
arn :: Maybe Text
$sel:workingDirectory:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:version:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:targetRepository:ContainerRecipe' :: ContainerRecipe -> Maybe TargetContainerRepository
$sel:tags:ContainerRecipe' :: ContainerRecipe -> Maybe (HashMap Text Text)
$sel:platform:ContainerRecipe' :: ContainerRecipe -> Maybe Platform
$sel:parentImage:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:owner:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:name:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:kmsKeyId:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:instanceConfiguration:ContainerRecipe' :: ContainerRecipe -> Maybe InstanceConfiguration
$sel:encrypted:ContainerRecipe' :: ContainerRecipe -> Maybe Bool
$sel:dockerfileTemplateData:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:description:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:dateCreated:ContainerRecipe' :: ContainerRecipe -> Maybe Text
$sel:containerType:ContainerRecipe' :: ContainerRecipe -> Maybe ContainerType
$sel:components:ContainerRecipe' :: ContainerRecipe -> Maybe (NonEmpty ComponentConfiguration)
$sel:arn:ContainerRecipe' :: ContainerRecipe -> 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 (NonEmpty ComponentConfiguration)
components
      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
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dockerfileTemplateData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encrypted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceConfiguration
instanceConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TargetContainerRepository
targetRepository
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
workingDirectory