{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateContainerRecipe
-- 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)
--
-- Creates a new container recipe. Container recipes define how images are
-- configured, tested, and assessed.
module Amazonka.ImageBuilder.CreateContainerRecipe
  ( -- * Creating a Request
    CreateContainerRecipe (..),
    newCreateContainerRecipe,

    -- * Request Lenses
    createContainerRecipe_dockerfileTemplateData,
    createContainerRecipe_imageOsVersionOverride,
    createContainerRecipe_workingDirectory,
    createContainerRecipe_dockerfileTemplateUri,
    createContainerRecipe_kmsKeyId,
    createContainerRecipe_platformOverride,
    createContainerRecipe_description,
    createContainerRecipe_tags,
    createContainerRecipe_instanceConfiguration,
    createContainerRecipe_containerType,
    createContainerRecipe_name,
    createContainerRecipe_semanticVersion,
    createContainerRecipe_components,
    createContainerRecipe_parentImage,
    createContainerRecipe_targetRepository,
    createContainerRecipe_clientToken,

    -- * Destructuring the Response
    CreateContainerRecipeResponse (..),
    newCreateContainerRecipeResponse,

    -- * Response Lenses
    createContainerRecipeResponse_requestId,
    createContainerRecipeResponse_clientToken,
    createContainerRecipeResponse_containerRecipeArn,
    createContainerRecipeResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateContainerRecipe' smart constructor.
data CreateContainerRecipe = CreateContainerRecipe'
  { -- | The Dockerfile template used to build your image as an inline data blob.
    CreateContainerRecipe -> Maybe Text
dockerfileTemplateData :: Prelude.Maybe Prelude.Text,
    -- | Specifies the operating system version for the base image.
    CreateContainerRecipe -> Maybe Text
imageOsVersionOverride :: Prelude.Maybe Prelude.Text,
    -- | The working directory for use during build and test workflows.
    CreateContainerRecipe -> Maybe Text
workingDirectory :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 URI for the Dockerfile that will be used to build your
    -- container image.
    CreateContainerRecipe -> Maybe Text
dockerfileTemplateUri :: Prelude.Maybe Prelude.Text,
    -- | Identifies which KMS key is used to encrypt the container image.
    CreateContainerRecipe -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Specifies the operating system platform when you use a custom base
    -- image.
    CreateContainerRecipe -> Maybe Platform
platformOverride :: Prelude.Maybe Platform,
    -- | The description of the container recipe.
    CreateContainerRecipe -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Tags that are attached to the container recipe.
    CreateContainerRecipe -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A group of options that can be used to configure an instance for
    -- building and testing container images.
    CreateContainerRecipe -> Maybe InstanceConfiguration
instanceConfiguration :: Prelude.Maybe InstanceConfiguration,
    -- | The type of container to create.
    CreateContainerRecipe -> ContainerType
containerType :: ContainerType,
    -- | The name of the container recipe.
    CreateContainerRecipe -> Text
name :: Prelude.Text,
    -- | The semantic version of the container recipe. This version follows the
    -- semantic version syntax.
    --
    -- 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.
    CreateContainerRecipe -> Text
semanticVersion :: Prelude.Text,
    -- | Components for build and test that are included in the container recipe.
    CreateContainerRecipe -> NonEmpty ComponentConfiguration
components :: Prelude.NonEmpty ComponentConfiguration,
    -- | The base image for the container recipe.
    CreateContainerRecipe -> Text
parentImage :: Prelude.Text,
    -- | The destination repository for the container image.
    CreateContainerRecipe -> TargetContainerRepository
targetRepository :: TargetContainerRepository,
    -- | The client token used to make this request idempotent.
    CreateContainerRecipe -> Text
clientToken :: Prelude.Text
  }
  deriving (CreateContainerRecipe -> CreateContainerRecipe -> Bool
(CreateContainerRecipe -> CreateContainerRecipe -> Bool)
-> (CreateContainerRecipe -> CreateContainerRecipe -> Bool)
-> Eq CreateContainerRecipe
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateContainerRecipe -> CreateContainerRecipe -> Bool
$c/= :: CreateContainerRecipe -> CreateContainerRecipe -> Bool
== :: CreateContainerRecipe -> CreateContainerRecipe -> Bool
$c== :: CreateContainerRecipe -> CreateContainerRecipe -> Bool
Prelude.Eq, ReadPrec [CreateContainerRecipe]
ReadPrec CreateContainerRecipe
Int -> ReadS CreateContainerRecipe
ReadS [CreateContainerRecipe]
(Int -> ReadS CreateContainerRecipe)
-> ReadS [CreateContainerRecipe]
-> ReadPrec CreateContainerRecipe
-> ReadPrec [CreateContainerRecipe]
-> Read CreateContainerRecipe
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateContainerRecipe]
$creadListPrec :: ReadPrec [CreateContainerRecipe]
readPrec :: ReadPrec CreateContainerRecipe
$creadPrec :: ReadPrec CreateContainerRecipe
readList :: ReadS [CreateContainerRecipe]
$creadList :: ReadS [CreateContainerRecipe]
readsPrec :: Int -> ReadS CreateContainerRecipe
$creadsPrec :: Int -> ReadS CreateContainerRecipe
Prelude.Read, Int -> CreateContainerRecipe -> ShowS
[CreateContainerRecipe] -> ShowS
CreateContainerRecipe -> String
(Int -> CreateContainerRecipe -> ShowS)
-> (CreateContainerRecipe -> String)
-> ([CreateContainerRecipe] -> ShowS)
-> Show CreateContainerRecipe
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateContainerRecipe] -> ShowS
$cshowList :: [CreateContainerRecipe] -> ShowS
show :: CreateContainerRecipe -> String
$cshow :: CreateContainerRecipe -> String
showsPrec :: Int -> CreateContainerRecipe -> ShowS
$cshowsPrec :: Int -> CreateContainerRecipe -> ShowS
Prelude.Show, (forall x. CreateContainerRecipe -> Rep CreateContainerRecipe x)
-> (forall x. Rep CreateContainerRecipe x -> CreateContainerRecipe)
-> Generic CreateContainerRecipe
forall x. Rep CreateContainerRecipe x -> CreateContainerRecipe
forall x. CreateContainerRecipe -> Rep CreateContainerRecipe x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateContainerRecipe x -> CreateContainerRecipe
$cfrom :: forall x. CreateContainerRecipe -> Rep CreateContainerRecipe x
Prelude.Generic)

-- |
-- Create a value of 'CreateContainerRecipe' 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:
--
-- 'dockerfileTemplateData', 'createContainerRecipe_dockerfileTemplateData' - The Dockerfile template used to build your image as an inline data blob.
--
-- 'imageOsVersionOverride', 'createContainerRecipe_imageOsVersionOverride' - Specifies the operating system version for the base image.
--
-- 'workingDirectory', 'createContainerRecipe_workingDirectory' - The working directory for use during build and test workflows.
--
-- 'dockerfileTemplateUri', 'createContainerRecipe_dockerfileTemplateUri' - The Amazon S3 URI for the Dockerfile that will be used to build your
-- container image.
--
-- 'kmsKeyId', 'createContainerRecipe_kmsKeyId' - Identifies which KMS key is used to encrypt the container image.
--
-- 'platformOverride', 'createContainerRecipe_platformOverride' - Specifies the operating system platform when you use a custom base
-- image.
--
-- 'description', 'createContainerRecipe_description' - The description of the container recipe.
--
-- 'tags', 'createContainerRecipe_tags' - Tags that are attached to the container recipe.
--
-- 'instanceConfiguration', 'createContainerRecipe_instanceConfiguration' - A group of options that can be used to configure an instance for
-- building and testing container images.
--
-- 'containerType', 'createContainerRecipe_containerType' - The type of container to create.
--
-- 'name', 'createContainerRecipe_name' - The name of the container recipe.
--
-- 'semanticVersion', 'createContainerRecipe_semanticVersion' - The semantic version of the container recipe. This version follows the
-- semantic version syntax.
--
-- 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.
--
-- 'components', 'createContainerRecipe_components' - Components for build and test that are included in the container recipe.
--
-- 'parentImage', 'createContainerRecipe_parentImage' - The base image for the container recipe.
--
-- 'targetRepository', 'createContainerRecipe_targetRepository' - The destination repository for the container image.
--
-- 'clientToken', 'createContainerRecipe_clientToken' - The client token used to make this request idempotent.
newCreateContainerRecipe ::
  -- | 'containerType'
  ContainerType ->
  -- | 'name'
  Prelude.Text ->
  -- | 'semanticVersion'
  Prelude.Text ->
  -- | 'components'
  Prelude.NonEmpty ComponentConfiguration ->
  -- | 'parentImage'
  Prelude.Text ->
  -- | 'targetRepository'
  TargetContainerRepository ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateContainerRecipe
newCreateContainerRecipe :: ContainerType
-> Text
-> Text
-> NonEmpty ComponentConfiguration
-> Text
-> TargetContainerRepository
-> Text
-> CreateContainerRecipe
newCreateContainerRecipe
  ContainerType
pContainerType_
  Text
pName_
  Text
pSemanticVersion_
  NonEmpty ComponentConfiguration
pComponents_
  Text
pParentImage_
  TargetContainerRepository
pTargetRepository_
  Text
pClientToken_ =
    CreateContainerRecipe' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Platform
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe InstanceConfiguration
-> ContainerType
-> Text
-> Text
-> NonEmpty ComponentConfiguration
-> Text
-> TargetContainerRepository
-> Text
-> CreateContainerRecipe
CreateContainerRecipe'
      { $sel:dockerfileTemplateData:CreateContainerRecipe' :: Maybe Text
dockerfileTemplateData =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:imageOsVersionOverride:CreateContainerRecipe' :: Maybe Text
imageOsVersionOverride = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:workingDirectory:CreateContainerRecipe' :: Maybe Text
workingDirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:dockerfileTemplateUri:CreateContainerRecipe' :: Maybe Text
dockerfileTemplateUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:CreateContainerRecipe' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:platformOverride:CreateContainerRecipe' :: Maybe Platform
platformOverride = Maybe Platform
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateContainerRecipe' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateContainerRecipe' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceConfiguration:CreateContainerRecipe' :: Maybe InstanceConfiguration
instanceConfiguration = Maybe InstanceConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:containerType:CreateContainerRecipe' :: ContainerType
containerType = ContainerType
pContainerType_,
        $sel:name:CreateContainerRecipe' :: Text
name = Text
pName_,
        $sel:semanticVersion:CreateContainerRecipe' :: Text
semanticVersion = Text
pSemanticVersion_,
        $sel:components:CreateContainerRecipe' :: NonEmpty ComponentConfiguration
components = Tagged
  (NonEmpty ComponentConfiguration)
  (Identity (NonEmpty ComponentConfiguration))
-> Tagged
     (NonEmpty ComponentConfiguration)
     (Identity (NonEmpty ComponentConfiguration))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty ComponentConfiguration)
   (Identity (NonEmpty ComponentConfiguration))
 -> Tagged
      (NonEmpty ComponentConfiguration)
      (Identity (NonEmpty ComponentConfiguration)))
-> NonEmpty ComponentConfiguration
-> NonEmpty ComponentConfiguration
forall t b. AReview t b -> b -> t
Lens.# NonEmpty ComponentConfiguration
pComponents_,
        $sel:parentImage:CreateContainerRecipe' :: Text
parentImage = Text
pParentImage_,
        $sel:targetRepository:CreateContainerRecipe' :: TargetContainerRepository
targetRepository = TargetContainerRepository
pTargetRepository_,
        $sel:clientToken:CreateContainerRecipe' :: Text
clientToken = Text
pClientToken_
      }

-- | The Dockerfile template used to build your image as an inline data blob.
createContainerRecipe_dockerfileTemplateData :: Lens.Lens' CreateContainerRecipe (Prelude.Maybe Prelude.Text)
createContainerRecipe_dockerfileTemplateData :: (Maybe Text -> f (Maybe Text))
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_dockerfileTemplateData = (CreateContainerRecipe -> Maybe Text)
-> (CreateContainerRecipe -> Maybe Text -> CreateContainerRecipe)
-> Lens
     CreateContainerRecipe
     CreateContainerRecipe
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {Maybe Text
dockerfileTemplateData :: Maybe Text
$sel:dockerfileTemplateData:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
dockerfileTemplateData} -> Maybe Text
dockerfileTemplateData) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} Maybe Text
a -> CreateContainerRecipe
s {$sel:dockerfileTemplateData:CreateContainerRecipe' :: Maybe Text
dockerfileTemplateData = Maybe Text
a} :: CreateContainerRecipe)

-- | Specifies the operating system version for the base image.
createContainerRecipe_imageOsVersionOverride :: Lens.Lens' CreateContainerRecipe (Prelude.Maybe Prelude.Text)
createContainerRecipe_imageOsVersionOverride :: (Maybe Text -> f (Maybe Text))
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_imageOsVersionOverride = (CreateContainerRecipe -> Maybe Text)
-> (CreateContainerRecipe -> Maybe Text -> CreateContainerRecipe)
-> Lens
     CreateContainerRecipe
     CreateContainerRecipe
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {Maybe Text
imageOsVersionOverride :: Maybe Text
$sel:imageOsVersionOverride:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
imageOsVersionOverride} -> Maybe Text
imageOsVersionOverride) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} Maybe Text
a -> CreateContainerRecipe
s {$sel:imageOsVersionOverride:CreateContainerRecipe' :: Maybe Text
imageOsVersionOverride = Maybe Text
a} :: CreateContainerRecipe)

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

-- | The Amazon S3 URI for the Dockerfile that will be used to build your
-- container image.
createContainerRecipe_dockerfileTemplateUri :: Lens.Lens' CreateContainerRecipe (Prelude.Maybe Prelude.Text)
createContainerRecipe_dockerfileTemplateUri :: (Maybe Text -> f (Maybe Text))
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_dockerfileTemplateUri = (CreateContainerRecipe -> Maybe Text)
-> (CreateContainerRecipe -> Maybe Text -> CreateContainerRecipe)
-> Lens
     CreateContainerRecipe
     CreateContainerRecipe
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {Maybe Text
dockerfileTemplateUri :: Maybe Text
$sel:dockerfileTemplateUri:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
dockerfileTemplateUri} -> Maybe Text
dockerfileTemplateUri) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} Maybe Text
a -> CreateContainerRecipe
s {$sel:dockerfileTemplateUri:CreateContainerRecipe' :: Maybe Text
dockerfileTemplateUri = Maybe Text
a} :: CreateContainerRecipe)

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

-- | Specifies the operating system platform when you use a custom base
-- image.
createContainerRecipe_platformOverride :: Lens.Lens' CreateContainerRecipe (Prelude.Maybe Platform)
createContainerRecipe_platformOverride :: (Maybe Platform -> f (Maybe Platform))
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_platformOverride = (CreateContainerRecipe -> Maybe Platform)
-> (CreateContainerRecipe
    -> Maybe Platform -> CreateContainerRecipe)
-> Lens
     CreateContainerRecipe
     CreateContainerRecipe
     (Maybe Platform)
     (Maybe Platform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {Maybe Platform
platformOverride :: Maybe Platform
$sel:platformOverride:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Platform
platformOverride} -> Maybe Platform
platformOverride) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} Maybe Platform
a -> CreateContainerRecipe
s {$sel:platformOverride:CreateContainerRecipe' :: Maybe Platform
platformOverride = Maybe Platform
a} :: CreateContainerRecipe)

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

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

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

-- | The type of container to create.
createContainerRecipe_containerType :: Lens.Lens' CreateContainerRecipe ContainerType
createContainerRecipe_containerType :: (ContainerType -> f ContainerType)
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_containerType = (CreateContainerRecipe -> ContainerType)
-> (CreateContainerRecipe
    -> ContainerType -> CreateContainerRecipe)
-> Lens
     CreateContainerRecipe
     CreateContainerRecipe
     ContainerType
     ContainerType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {ContainerType
containerType :: ContainerType
$sel:containerType:CreateContainerRecipe' :: CreateContainerRecipe -> ContainerType
containerType} -> ContainerType
containerType) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} ContainerType
a -> CreateContainerRecipe
s {$sel:containerType:CreateContainerRecipe' :: ContainerType
containerType = ContainerType
a} :: CreateContainerRecipe)

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

-- | The semantic version of the container recipe. This version follows the
-- semantic version syntax.
--
-- 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.
createContainerRecipe_semanticVersion :: Lens.Lens' CreateContainerRecipe Prelude.Text
createContainerRecipe_semanticVersion :: (Text -> f Text)
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_semanticVersion = (CreateContainerRecipe -> Text)
-> (CreateContainerRecipe -> Text -> CreateContainerRecipe)
-> Lens CreateContainerRecipe CreateContainerRecipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {Text
semanticVersion :: Text
$sel:semanticVersion:CreateContainerRecipe' :: CreateContainerRecipe -> Text
semanticVersion} -> Text
semanticVersion) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} Text
a -> CreateContainerRecipe
s {$sel:semanticVersion:CreateContainerRecipe' :: Text
semanticVersion = Text
a} :: CreateContainerRecipe)

-- | Components for build and test that are included in the container recipe.
createContainerRecipe_components :: Lens.Lens' CreateContainerRecipe (Prelude.NonEmpty ComponentConfiguration)
createContainerRecipe_components :: (NonEmpty ComponentConfiguration
 -> f (NonEmpty ComponentConfiguration))
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_components = (CreateContainerRecipe -> NonEmpty ComponentConfiguration)
-> (CreateContainerRecipe
    -> NonEmpty ComponentConfiguration -> CreateContainerRecipe)
-> Lens
     CreateContainerRecipe
     CreateContainerRecipe
     (NonEmpty ComponentConfiguration)
     (NonEmpty ComponentConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {NonEmpty ComponentConfiguration
components :: NonEmpty ComponentConfiguration
$sel:components:CreateContainerRecipe' :: CreateContainerRecipe -> NonEmpty ComponentConfiguration
components} -> NonEmpty ComponentConfiguration
components) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} NonEmpty ComponentConfiguration
a -> CreateContainerRecipe
s {$sel:components:CreateContainerRecipe' :: NonEmpty ComponentConfiguration
components = NonEmpty ComponentConfiguration
a} :: CreateContainerRecipe) ((NonEmpty ComponentConfiguration
  -> f (NonEmpty ComponentConfiguration))
 -> CreateContainerRecipe -> f CreateContainerRecipe)
-> ((NonEmpty ComponentConfiguration
     -> f (NonEmpty ComponentConfiguration))
    -> NonEmpty ComponentConfiguration
    -> f (NonEmpty ComponentConfiguration))
-> (NonEmpty ComponentConfiguration
    -> f (NonEmpty ComponentConfiguration))
-> CreateContainerRecipe
-> f CreateContainerRecipe
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty ComponentConfiguration
 -> f (NonEmpty ComponentConfiguration))
-> NonEmpty ComponentConfiguration
-> f (NonEmpty ComponentConfiguration)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

-- | The client token used to make this request idempotent.
createContainerRecipe_clientToken :: Lens.Lens' CreateContainerRecipe Prelude.Text
createContainerRecipe_clientToken :: (Text -> f Text)
-> CreateContainerRecipe -> f CreateContainerRecipe
createContainerRecipe_clientToken = (CreateContainerRecipe -> Text)
-> (CreateContainerRecipe -> Text -> CreateContainerRecipe)
-> Lens CreateContainerRecipe CreateContainerRecipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipe' {Text
clientToken :: Text
$sel:clientToken:CreateContainerRecipe' :: CreateContainerRecipe -> Text
clientToken} -> Text
clientToken) (\s :: CreateContainerRecipe
s@CreateContainerRecipe' {} Text
a -> CreateContainerRecipe
s {$sel:clientToken:CreateContainerRecipe' :: Text
clientToken = Text
a} :: CreateContainerRecipe)

instance Core.AWSRequest CreateContainerRecipe where
  type
    AWSResponse CreateContainerRecipe =
      CreateContainerRecipeResponse
  request :: CreateContainerRecipe -> Request CreateContainerRecipe
request = Service -> CreateContainerRecipe -> Request CreateContainerRecipe
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateContainerRecipe
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateContainerRecipe)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateContainerRecipe))
-> Logger
-> Service
-> Proxy CreateContainerRecipe
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateContainerRecipe)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateContainerRecipeResponse
CreateContainerRecipeResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateContainerRecipeResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> CreateContainerRecipeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"requestId")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> CreateContainerRecipeResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateContainerRecipeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clientToken")
            Either String (Maybe Text -> Int -> CreateContainerRecipeResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateContainerRecipeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"containerRecipeArn")
            Either String (Int -> CreateContainerRecipeResponse)
-> Either String Int -> Either String CreateContainerRecipeResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateContainerRecipe

instance Prelude.NFData CreateContainerRecipe

instance Core.ToHeaders CreateContainerRecipe where
  toHeaders :: CreateContainerRecipe -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateContainerRecipe -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateContainerRecipe where
  toJSON :: CreateContainerRecipe -> Value
toJSON CreateContainerRecipe' {Maybe Text
Maybe (HashMap Text Text)
Maybe InstanceConfiguration
Maybe Platform
NonEmpty ComponentConfiguration
Text
ContainerType
TargetContainerRepository
clientToken :: Text
targetRepository :: TargetContainerRepository
parentImage :: Text
components :: NonEmpty ComponentConfiguration
semanticVersion :: Text
name :: Text
containerType :: ContainerType
instanceConfiguration :: Maybe InstanceConfiguration
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
platformOverride :: Maybe Platform
kmsKeyId :: Maybe Text
dockerfileTemplateUri :: Maybe Text
workingDirectory :: Maybe Text
imageOsVersionOverride :: Maybe Text
dockerfileTemplateData :: Maybe Text
$sel:clientToken:CreateContainerRecipe' :: CreateContainerRecipe -> Text
$sel:targetRepository:CreateContainerRecipe' :: CreateContainerRecipe -> TargetContainerRepository
$sel:parentImage:CreateContainerRecipe' :: CreateContainerRecipe -> Text
$sel:components:CreateContainerRecipe' :: CreateContainerRecipe -> NonEmpty ComponentConfiguration
$sel:semanticVersion:CreateContainerRecipe' :: CreateContainerRecipe -> Text
$sel:name:CreateContainerRecipe' :: CreateContainerRecipe -> Text
$sel:containerType:CreateContainerRecipe' :: CreateContainerRecipe -> ContainerType
$sel:instanceConfiguration:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe InstanceConfiguration
$sel:tags:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe (HashMap Text Text)
$sel:description:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
$sel:platformOverride:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Platform
$sel:kmsKeyId:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
$sel:dockerfileTemplateUri:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
$sel:workingDirectory:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
$sel:imageOsVersionOverride:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
$sel:dockerfileTemplateData:CreateContainerRecipe' :: CreateContainerRecipe -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"dockerfileTemplateData" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dockerfileTemplateData,
            (Text
"imageOsVersionOverride" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imageOsVersionOverride,
            (Text
"workingDirectory" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
workingDirectory,
            (Text
"dockerfileTemplateUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dockerfileTemplateUri,
            (Text
"kmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Text
"platformOverride" Text -> Platform -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Platform -> Pair) -> Maybe Platform -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Platform
platformOverride,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            (Text
"instanceConfiguration" Text -> InstanceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (InstanceConfiguration -> Pair)
-> Maybe InstanceConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstanceConfiguration
instanceConfiguration,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"containerType" Text -> ContainerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ContainerType
containerType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"semanticVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
semanticVersion),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"components" Text -> NonEmpty ComponentConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty ComponentConfiguration
components),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"parentImage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
parentImage),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"targetRepository" Text -> TargetContainerRepository -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TargetContainerRepository
targetRepository),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

instance Core.ToPath CreateContainerRecipe where
  toPath :: CreateContainerRecipe -> ByteString
toPath = ByteString -> CreateContainerRecipe -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/CreateContainerRecipe"

instance Core.ToQuery CreateContainerRecipe where
  toQuery :: CreateContainerRecipe -> QueryString
toQuery = QueryString -> CreateContainerRecipe -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateContainerRecipeResponse' smart constructor.
data CreateContainerRecipeResponse = CreateContainerRecipeResponse'
  { -- | The request ID that uniquely identifies this request.
    CreateContainerRecipeResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The client token used to make this request idempotent.
    CreateContainerRecipeResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Returns the Amazon Resource Name (ARN) of the container recipe that the
    -- request created.
    CreateContainerRecipeResponse -> Maybe Text
containerRecipeArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateContainerRecipeResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateContainerRecipeResponse
-> CreateContainerRecipeResponse -> Bool
(CreateContainerRecipeResponse
 -> CreateContainerRecipeResponse -> Bool)
-> (CreateContainerRecipeResponse
    -> CreateContainerRecipeResponse -> Bool)
-> Eq CreateContainerRecipeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateContainerRecipeResponse
-> CreateContainerRecipeResponse -> Bool
$c/= :: CreateContainerRecipeResponse
-> CreateContainerRecipeResponse -> Bool
== :: CreateContainerRecipeResponse
-> CreateContainerRecipeResponse -> Bool
$c== :: CreateContainerRecipeResponse
-> CreateContainerRecipeResponse -> Bool
Prelude.Eq, ReadPrec [CreateContainerRecipeResponse]
ReadPrec CreateContainerRecipeResponse
Int -> ReadS CreateContainerRecipeResponse
ReadS [CreateContainerRecipeResponse]
(Int -> ReadS CreateContainerRecipeResponse)
-> ReadS [CreateContainerRecipeResponse]
-> ReadPrec CreateContainerRecipeResponse
-> ReadPrec [CreateContainerRecipeResponse]
-> Read CreateContainerRecipeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateContainerRecipeResponse]
$creadListPrec :: ReadPrec [CreateContainerRecipeResponse]
readPrec :: ReadPrec CreateContainerRecipeResponse
$creadPrec :: ReadPrec CreateContainerRecipeResponse
readList :: ReadS [CreateContainerRecipeResponse]
$creadList :: ReadS [CreateContainerRecipeResponse]
readsPrec :: Int -> ReadS CreateContainerRecipeResponse
$creadsPrec :: Int -> ReadS CreateContainerRecipeResponse
Prelude.Read, Int -> CreateContainerRecipeResponse -> ShowS
[CreateContainerRecipeResponse] -> ShowS
CreateContainerRecipeResponse -> String
(Int -> CreateContainerRecipeResponse -> ShowS)
-> (CreateContainerRecipeResponse -> String)
-> ([CreateContainerRecipeResponse] -> ShowS)
-> Show CreateContainerRecipeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateContainerRecipeResponse] -> ShowS
$cshowList :: [CreateContainerRecipeResponse] -> ShowS
show :: CreateContainerRecipeResponse -> String
$cshow :: CreateContainerRecipeResponse -> String
showsPrec :: Int -> CreateContainerRecipeResponse -> ShowS
$cshowsPrec :: Int -> CreateContainerRecipeResponse -> ShowS
Prelude.Show, (forall x.
 CreateContainerRecipeResponse
 -> Rep CreateContainerRecipeResponse x)
-> (forall x.
    Rep CreateContainerRecipeResponse x
    -> CreateContainerRecipeResponse)
-> Generic CreateContainerRecipeResponse
forall x.
Rep CreateContainerRecipeResponse x
-> CreateContainerRecipeResponse
forall x.
CreateContainerRecipeResponse
-> Rep CreateContainerRecipeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateContainerRecipeResponse x
-> CreateContainerRecipeResponse
$cfrom :: forall x.
CreateContainerRecipeResponse
-> Rep CreateContainerRecipeResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateContainerRecipeResponse' 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:
--
-- 'requestId', 'createContainerRecipeResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'clientToken', 'createContainerRecipeResponse_clientToken' - The client token used to make this request idempotent.
--
-- 'containerRecipeArn', 'createContainerRecipeResponse_containerRecipeArn' - Returns the Amazon Resource Name (ARN) of the container recipe that the
-- request created.
--
-- 'httpStatus', 'createContainerRecipeResponse_httpStatus' - The response's http status code.
newCreateContainerRecipeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateContainerRecipeResponse
newCreateContainerRecipeResponse :: Int -> CreateContainerRecipeResponse
newCreateContainerRecipeResponse Int
pHttpStatus_ =
  CreateContainerRecipeResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateContainerRecipeResponse
CreateContainerRecipeResponse'
    { $sel:requestId:CreateContainerRecipeResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:CreateContainerRecipeResponse' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:containerRecipeArn:CreateContainerRecipeResponse' :: Maybe Text
containerRecipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateContainerRecipeResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The request ID that uniquely identifies this request.
createContainerRecipeResponse_requestId :: Lens.Lens' CreateContainerRecipeResponse (Prelude.Maybe Prelude.Text)
createContainerRecipeResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateContainerRecipeResponse -> f CreateContainerRecipeResponse
createContainerRecipeResponse_requestId = (CreateContainerRecipeResponse -> Maybe Text)
-> (CreateContainerRecipeResponse
    -> Maybe Text -> CreateContainerRecipeResponse)
-> Lens
     CreateContainerRecipeResponse
     CreateContainerRecipeResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipeResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateContainerRecipeResponse' :: CreateContainerRecipeResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateContainerRecipeResponse
s@CreateContainerRecipeResponse' {} Maybe Text
a -> CreateContainerRecipeResponse
s {$sel:requestId:CreateContainerRecipeResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateContainerRecipeResponse)

-- | The client token used to make this request idempotent.
createContainerRecipeResponse_clientToken :: Lens.Lens' CreateContainerRecipeResponse (Prelude.Maybe Prelude.Text)
createContainerRecipeResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateContainerRecipeResponse -> f CreateContainerRecipeResponse
createContainerRecipeResponse_clientToken = (CreateContainerRecipeResponse -> Maybe Text)
-> (CreateContainerRecipeResponse
    -> Maybe Text -> CreateContainerRecipeResponse)
-> Lens
     CreateContainerRecipeResponse
     CreateContainerRecipeResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipeResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateContainerRecipeResponse' :: CreateContainerRecipeResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateContainerRecipeResponse
s@CreateContainerRecipeResponse' {} Maybe Text
a -> CreateContainerRecipeResponse
s {$sel:clientToken:CreateContainerRecipeResponse' :: Maybe Text
clientToken = Maybe Text
a} :: CreateContainerRecipeResponse)

-- | Returns the Amazon Resource Name (ARN) of the container recipe that the
-- request created.
createContainerRecipeResponse_containerRecipeArn :: Lens.Lens' CreateContainerRecipeResponse (Prelude.Maybe Prelude.Text)
createContainerRecipeResponse_containerRecipeArn :: (Maybe Text -> f (Maybe Text))
-> CreateContainerRecipeResponse -> f CreateContainerRecipeResponse
createContainerRecipeResponse_containerRecipeArn = (CreateContainerRecipeResponse -> Maybe Text)
-> (CreateContainerRecipeResponse
    -> Maybe Text -> CreateContainerRecipeResponse)
-> Lens
     CreateContainerRecipeResponse
     CreateContainerRecipeResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipeResponse' {Maybe Text
containerRecipeArn :: Maybe Text
$sel:containerRecipeArn:CreateContainerRecipeResponse' :: CreateContainerRecipeResponse -> Maybe Text
containerRecipeArn} -> Maybe Text
containerRecipeArn) (\s :: CreateContainerRecipeResponse
s@CreateContainerRecipeResponse' {} Maybe Text
a -> CreateContainerRecipeResponse
s {$sel:containerRecipeArn:CreateContainerRecipeResponse' :: Maybe Text
containerRecipeArn = Maybe Text
a} :: CreateContainerRecipeResponse)

-- | The response's http status code.
createContainerRecipeResponse_httpStatus :: Lens.Lens' CreateContainerRecipeResponse Prelude.Int
createContainerRecipeResponse_httpStatus :: (Int -> f Int)
-> CreateContainerRecipeResponse -> f CreateContainerRecipeResponse
createContainerRecipeResponse_httpStatus = (CreateContainerRecipeResponse -> Int)
-> (CreateContainerRecipeResponse
    -> Int -> CreateContainerRecipeResponse)
-> Lens
     CreateContainerRecipeResponse CreateContainerRecipeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateContainerRecipeResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateContainerRecipeResponse' :: CreateContainerRecipeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateContainerRecipeResponse
s@CreateContainerRecipeResponse' {} Int
a -> CreateContainerRecipeResponse
s {$sel:httpStatus:CreateContainerRecipeResponse' :: Int
httpStatus = Int
a} :: CreateContainerRecipeResponse)

instance Prelude.NFData CreateContainerRecipeResponse