{-# 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 #-}
module Amazonka.ImageBuilder.CreateImageRecipe
(
CreateImageRecipe (..),
newCreateImageRecipe,
createImageRecipe_additionalInstanceConfiguration,
createImageRecipe_workingDirectory,
createImageRecipe_blockDeviceMappings,
createImageRecipe_description,
createImageRecipe_tags,
createImageRecipe_name,
createImageRecipe_semanticVersion,
createImageRecipe_components,
createImageRecipe_parentImage,
createImageRecipe_clientToken,
CreateImageRecipeResponse (..),
newCreateImageRecipeResponse,
createImageRecipeResponse_requestId,
createImageRecipeResponse_clientToken,
createImageRecipeResponse_imageRecipeArn,
createImageRecipeResponse_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
data CreateImageRecipe = CreateImageRecipe'
{
CreateImageRecipe -> Maybe AdditionalInstanceConfiguration
additionalInstanceConfiguration :: Prelude.Maybe AdditionalInstanceConfiguration,
CreateImageRecipe -> Maybe Text
workingDirectory :: Prelude.Maybe Prelude.Text,
CreateImageRecipe -> Maybe [InstanceBlockDeviceMapping]
blockDeviceMappings :: Prelude.Maybe [InstanceBlockDeviceMapping],
CreateImageRecipe -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateImageRecipe -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateImageRecipe -> Text
name :: Prelude.Text,
CreateImageRecipe -> Text
semanticVersion :: Prelude.Text,
CreateImageRecipe -> NonEmpty ComponentConfiguration
components :: Prelude.NonEmpty ComponentConfiguration,
CreateImageRecipe -> Text
parentImage :: Prelude.Text,
CreateImageRecipe -> Text
clientToken :: Prelude.Text
}
deriving (CreateImageRecipe -> CreateImageRecipe -> Bool
(CreateImageRecipe -> CreateImageRecipe -> Bool)
-> (CreateImageRecipe -> CreateImageRecipe -> Bool)
-> Eq CreateImageRecipe
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateImageRecipe -> CreateImageRecipe -> Bool
$c/= :: CreateImageRecipe -> CreateImageRecipe -> Bool
== :: CreateImageRecipe -> CreateImageRecipe -> Bool
$c== :: CreateImageRecipe -> CreateImageRecipe -> Bool
Prelude.Eq, ReadPrec [CreateImageRecipe]
ReadPrec CreateImageRecipe
Int -> ReadS CreateImageRecipe
ReadS [CreateImageRecipe]
(Int -> ReadS CreateImageRecipe)
-> ReadS [CreateImageRecipe]
-> ReadPrec CreateImageRecipe
-> ReadPrec [CreateImageRecipe]
-> Read CreateImageRecipe
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateImageRecipe]
$creadListPrec :: ReadPrec [CreateImageRecipe]
readPrec :: ReadPrec CreateImageRecipe
$creadPrec :: ReadPrec CreateImageRecipe
readList :: ReadS [CreateImageRecipe]
$creadList :: ReadS [CreateImageRecipe]
readsPrec :: Int -> ReadS CreateImageRecipe
$creadsPrec :: Int -> ReadS CreateImageRecipe
Prelude.Read, Int -> CreateImageRecipe -> ShowS
[CreateImageRecipe] -> ShowS
CreateImageRecipe -> String
(Int -> CreateImageRecipe -> ShowS)
-> (CreateImageRecipe -> String)
-> ([CreateImageRecipe] -> ShowS)
-> Show CreateImageRecipe
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateImageRecipe] -> ShowS
$cshowList :: [CreateImageRecipe] -> ShowS
show :: CreateImageRecipe -> String
$cshow :: CreateImageRecipe -> String
showsPrec :: Int -> CreateImageRecipe -> ShowS
$cshowsPrec :: Int -> CreateImageRecipe -> ShowS
Prelude.Show, (forall x. CreateImageRecipe -> Rep CreateImageRecipe x)
-> (forall x. Rep CreateImageRecipe x -> CreateImageRecipe)
-> Generic CreateImageRecipe
forall x. Rep CreateImageRecipe x -> CreateImageRecipe
forall x. CreateImageRecipe -> Rep CreateImageRecipe x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateImageRecipe x -> CreateImageRecipe
$cfrom :: forall x. CreateImageRecipe -> Rep CreateImageRecipe x
Prelude.Generic)
newCreateImageRecipe ::
Prelude.Text ->
Prelude.Text ->
Prelude.NonEmpty ComponentConfiguration ->
Prelude.Text ->
Prelude.Text ->
CreateImageRecipe
newCreateImageRecipe :: Text
-> Text
-> NonEmpty ComponentConfiguration
-> Text
-> Text
-> CreateImageRecipe
newCreateImageRecipe
Text
pName_
Text
pSemanticVersion_
NonEmpty ComponentConfiguration
pComponents_
Text
pParentImage_
Text
pClientToken_ =
CreateImageRecipe' :: Maybe AdditionalInstanceConfiguration
-> Maybe Text
-> Maybe [InstanceBlockDeviceMapping]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> NonEmpty ComponentConfiguration
-> Text
-> Text
-> CreateImageRecipe
CreateImageRecipe'
{ $sel:additionalInstanceConfiguration:CreateImageRecipe' :: Maybe AdditionalInstanceConfiguration
additionalInstanceConfiguration =
Maybe AdditionalInstanceConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:workingDirectory:CreateImageRecipe' :: Maybe Text
workingDirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:blockDeviceMappings:CreateImageRecipe' :: Maybe [InstanceBlockDeviceMapping]
blockDeviceMappings = Maybe [InstanceBlockDeviceMapping]
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateImageRecipe' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateImageRecipe' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateImageRecipe' :: Text
name = Text
pName_,
$sel:semanticVersion:CreateImageRecipe' :: Text
semanticVersion = Text
pSemanticVersion_,
$sel:components:CreateImageRecipe' :: 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:CreateImageRecipe' :: Text
parentImage = Text
pParentImage_,
$sel:clientToken:CreateImageRecipe' :: Text
clientToken = Text
pClientToken_
}
createImageRecipe_additionalInstanceConfiguration :: Lens.Lens' CreateImageRecipe (Prelude.Maybe AdditionalInstanceConfiguration)
createImageRecipe_additionalInstanceConfiguration :: (Maybe AdditionalInstanceConfiguration
-> f (Maybe AdditionalInstanceConfiguration))
-> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_additionalInstanceConfiguration = (CreateImageRecipe -> Maybe AdditionalInstanceConfiguration)
-> (CreateImageRecipe
-> Maybe AdditionalInstanceConfiguration -> CreateImageRecipe)
-> Lens
CreateImageRecipe
CreateImageRecipe
(Maybe AdditionalInstanceConfiguration)
(Maybe AdditionalInstanceConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Maybe AdditionalInstanceConfiguration
additionalInstanceConfiguration :: Maybe AdditionalInstanceConfiguration
$sel:additionalInstanceConfiguration:CreateImageRecipe' :: CreateImageRecipe -> Maybe AdditionalInstanceConfiguration
additionalInstanceConfiguration} -> Maybe AdditionalInstanceConfiguration
additionalInstanceConfiguration) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Maybe AdditionalInstanceConfiguration
a -> CreateImageRecipe
s {$sel:additionalInstanceConfiguration:CreateImageRecipe' :: Maybe AdditionalInstanceConfiguration
additionalInstanceConfiguration = Maybe AdditionalInstanceConfiguration
a} :: CreateImageRecipe)
createImageRecipe_workingDirectory :: Lens.Lens' CreateImageRecipe (Prelude.Maybe Prelude.Text)
createImageRecipe_workingDirectory :: (Maybe Text -> f (Maybe Text))
-> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_workingDirectory = (CreateImageRecipe -> Maybe Text)
-> (CreateImageRecipe -> Maybe Text -> CreateImageRecipe)
-> Lens
CreateImageRecipe CreateImageRecipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Maybe Text
workingDirectory :: Maybe Text
$sel:workingDirectory:CreateImageRecipe' :: CreateImageRecipe -> Maybe Text
workingDirectory} -> Maybe Text
workingDirectory) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Maybe Text
a -> CreateImageRecipe
s {$sel:workingDirectory:CreateImageRecipe' :: Maybe Text
workingDirectory = Maybe Text
a} :: CreateImageRecipe)
createImageRecipe_blockDeviceMappings :: Lens.Lens' CreateImageRecipe (Prelude.Maybe [InstanceBlockDeviceMapping])
createImageRecipe_blockDeviceMappings :: (Maybe [InstanceBlockDeviceMapping]
-> f (Maybe [InstanceBlockDeviceMapping]))
-> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_blockDeviceMappings = (CreateImageRecipe -> Maybe [InstanceBlockDeviceMapping])
-> (CreateImageRecipe
-> Maybe [InstanceBlockDeviceMapping] -> CreateImageRecipe)
-> Lens
CreateImageRecipe
CreateImageRecipe
(Maybe [InstanceBlockDeviceMapping])
(Maybe [InstanceBlockDeviceMapping])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Maybe [InstanceBlockDeviceMapping]
blockDeviceMappings :: Maybe [InstanceBlockDeviceMapping]
$sel:blockDeviceMappings:CreateImageRecipe' :: CreateImageRecipe -> Maybe [InstanceBlockDeviceMapping]
blockDeviceMappings} -> Maybe [InstanceBlockDeviceMapping]
blockDeviceMappings) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Maybe [InstanceBlockDeviceMapping]
a -> CreateImageRecipe
s {$sel:blockDeviceMappings:CreateImageRecipe' :: Maybe [InstanceBlockDeviceMapping]
blockDeviceMappings = Maybe [InstanceBlockDeviceMapping]
a} :: CreateImageRecipe) ((Maybe [InstanceBlockDeviceMapping]
-> f (Maybe [InstanceBlockDeviceMapping]))
-> CreateImageRecipe -> f CreateImageRecipe)
-> ((Maybe [InstanceBlockDeviceMapping]
-> f (Maybe [InstanceBlockDeviceMapping]))
-> Maybe [InstanceBlockDeviceMapping]
-> f (Maybe [InstanceBlockDeviceMapping]))
-> (Maybe [InstanceBlockDeviceMapping]
-> f (Maybe [InstanceBlockDeviceMapping]))
-> CreateImageRecipe
-> f CreateImageRecipe
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InstanceBlockDeviceMapping]
[InstanceBlockDeviceMapping]
[InstanceBlockDeviceMapping]
[InstanceBlockDeviceMapping]
-> Iso
(Maybe [InstanceBlockDeviceMapping])
(Maybe [InstanceBlockDeviceMapping])
(Maybe [InstanceBlockDeviceMapping])
(Maybe [InstanceBlockDeviceMapping])
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
[InstanceBlockDeviceMapping]
[InstanceBlockDeviceMapping]
[InstanceBlockDeviceMapping]
[InstanceBlockDeviceMapping]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createImageRecipe_description :: Lens.Lens' CreateImageRecipe (Prelude.Maybe Prelude.Text)
createImageRecipe_description :: (Maybe Text -> f (Maybe Text))
-> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_description = (CreateImageRecipe -> Maybe Text)
-> (CreateImageRecipe -> Maybe Text -> CreateImageRecipe)
-> Lens
CreateImageRecipe CreateImageRecipe (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Maybe Text
description :: Maybe Text
$sel:description:CreateImageRecipe' :: CreateImageRecipe -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Maybe Text
a -> CreateImageRecipe
s {$sel:description:CreateImageRecipe' :: Maybe Text
description = Maybe Text
a} :: CreateImageRecipe)
createImageRecipe_tags :: Lens.Lens' CreateImageRecipe (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createImageRecipe_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_tags = (CreateImageRecipe -> Maybe (HashMap Text Text))
-> (CreateImageRecipe
-> Maybe (HashMap Text Text) -> CreateImageRecipe)
-> Lens
CreateImageRecipe
CreateImageRecipe
(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 (\CreateImageRecipe' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateImageRecipe' :: CreateImageRecipe -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Maybe (HashMap Text Text)
a -> CreateImageRecipe
s {$sel:tags:CreateImageRecipe' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateImageRecipe) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateImageRecipe -> f CreateImageRecipe)
-> ((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)))
-> CreateImageRecipe
-> f CreateImageRecipe
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
createImageRecipe_name :: Lens.Lens' CreateImageRecipe Prelude.Text
createImageRecipe_name :: (Text -> f Text) -> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_name = (CreateImageRecipe -> Text)
-> (CreateImageRecipe -> Text -> CreateImageRecipe)
-> Lens CreateImageRecipe CreateImageRecipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Text
name :: Text
$sel:name:CreateImageRecipe' :: CreateImageRecipe -> Text
name} -> Text
name) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Text
a -> CreateImageRecipe
s {$sel:name:CreateImageRecipe' :: Text
name = Text
a} :: CreateImageRecipe)
createImageRecipe_semanticVersion :: Lens.Lens' CreateImageRecipe Prelude.Text
createImageRecipe_semanticVersion :: (Text -> f Text) -> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_semanticVersion = (CreateImageRecipe -> Text)
-> (CreateImageRecipe -> Text -> CreateImageRecipe)
-> Lens CreateImageRecipe CreateImageRecipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Text
semanticVersion :: Text
$sel:semanticVersion:CreateImageRecipe' :: CreateImageRecipe -> Text
semanticVersion} -> Text
semanticVersion) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Text
a -> CreateImageRecipe
s {$sel:semanticVersion:CreateImageRecipe' :: Text
semanticVersion = Text
a} :: CreateImageRecipe)
createImageRecipe_components :: Lens.Lens' CreateImageRecipe (Prelude.NonEmpty ComponentConfiguration)
createImageRecipe_components :: (NonEmpty ComponentConfiguration
-> f (NonEmpty ComponentConfiguration))
-> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_components = (CreateImageRecipe -> NonEmpty ComponentConfiguration)
-> (CreateImageRecipe
-> NonEmpty ComponentConfiguration -> CreateImageRecipe)
-> Lens
CreateImageRecipe
CreateImageRecipe
(NonEmpty ComponentConfiguration)
(NonEmpty ComponentConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {NonEmpty ComponentConfiguration
components :: NonEmpty ComponentConfiguration
$sel:components:CreateImageRecipe' :: CreateImageRecipe -> NonEmpty ComponentConfiguration
components} -> NonEmpty ComponentConfiguration
components) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} NonEmpty ComponentConfiguration
a -> CreateImageRecipe
s {$sel:components:CreateImageRecipe' :: NonEmpty ComponentConfiguration
components = NonEmpty ComponentConfiguration
a} :: CreateImageRecipe) ((NonEmpty ComponentConfiguration
-> f (NonEmpty ComponentConfiguration))
-> CreateImageRecipe -> f CreateImageRecipe)
-> ((NonEmpty ComponentConfiguration
-> f (NonEmpty ComponentConfiguration))
-> NonEmpty ComponentConfiguration
-> f (NonEmpty ComponentConfiguration))
-> (NonEmpty ComponentConfiguration
-> f (NonEmpty ComponentConfiguration))
-> CreateImageRecipe
-> f CreateImageRecipe
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
createImageRecipe_parentImage :: Lens.Lens' CreateImageRecipe Prelude.Text
createImageRecipe_parentImage :: (Text -> f Text) -> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_parentImage = (CreateImageRecipe -> Text)
-> (CreateImageRecipe -> Text -> CreateImageRecipe)
-> Lens CreateImageRecipe CreateImageRecipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Text
parentImage :: Text
$sel:parentImage:CreateImageRecipe' :: CreateImageRecipe -> Text
parentImage} -> Text
parentImage) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Text
a -> CreateImageRecipe
s {$sel:parentImage:CreateImageRecipe' :: Text
parentImage = Text
a} :: CreateImageRecipe)
createImageRecipe_clientToken :: Lens.Lens' CreateImageRecipe Prelude.Text
createImageRecipe_clientToken :: (Text -> f Text) -> CreateImageRecipe -> f CreateImageRecipe
createImageRecipe_clientToken = (CreateImageRecipe -> Text)
-> (CreateImageRecipe -> Text -> CreateImageRecipe)
-> Lens CreateImageRecipe CreateImageRecipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipe' {Text
clientToken :: Text
$sel:clientToken:CreateImageRecipe' :: CreateImageRecipe -> Text
clientToken} -> Text
clientToken) (\s :: CreateImageRecipe
s@CreateImageRecipe' {} Text
a -> CreateImageRecipe
s {$sel:clientToken:CreateImageRecipe' :: Text
clientToken = Text
a} :: CreateImageRecipe)
instance Core.AWSRequest CreateImageRecipe where
type
AWSResponse CreateImageRecipe =
CreateImageRecipeResponse
request :: CreateImageRecipe -> Request CreateImageRecipe
request = Service -> CreateImageRecipe -> Request CreateImageRecipe
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateImageRecipe
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateImageRecipe)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateImageRecipe))
-> Logger
-> Service
-> Proxy CreateImageRecipe
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateImageRecipe)))
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 -> CreateImageRecipeResponse
CreateImageRecipeResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateImageRecipeResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> CreateImageRecipeResponse)
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 -> CreateImageRecipeResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateImageRecipeResponse)
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 -> CreateImageRecipeResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateImageRecipeResponse)
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
"imageRecipeArn")
Either String (Int -> CreateImageRecipeResponse)
-> Either String Int -> Either String CreateImageRecipeResponse
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 CreateImageRecipe
instance Prelude.NFData CreateImageRecipe
instance Core.ToHeaders CreateImageRecipe where
toHeaders :: CreateImageRecipe -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateImageRecipe -> 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 CreateImageRecipe where
toJSON :: CreateImageRecipe -> Value
toJSON CreateImageRecipe' {Maybe [InstanceBlockDeviceMapping]
Maybe Text
Maybe (HashMap Text Text)
Maybe AdditionalInstanceConfiguration
NonEmpty ComponentConfiguration
Text
clientToken :: Text
parentImage :: Text
components :: NonEmpty ComponentConfiguration
semanticVersion :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
blockDeviceMappings :: Maybe [InstanceBlockDeviceMapping]
workingDirectory :: Maybe Text
additionalInstanceConfiguration :: Maybe AdditionalInstanceConfiguration
$sel:clientToken:CreateImageRecipe' :: CreateImageRecipe -> Text
$sel:parentImage:CreateImageRecipe' :: CreateImageRecipe -> Text
$sel:components:CreateImageRecipe' :: CreateImageRecipe -> NonEmpty ComponentConfiguration
$sel:semanticVersion:CreateImageRecipe' :: CreateImageRecipe -> Text
$sel:name:CreateImageRecipe' :: CreateImageRecipe -> Text
$sel:tags:CreateImageRecipe' :: CreateImageRecipe -> Maybe (HashMap Text Text)
$sel:description:CreateImageRecipe' :: CreateImageRecipe -> Maybe Text
$sel:blockDeviceMappings:CreateImageRecipe' :: CreateImageRecipe -> Maybe [InstanceBlockDeviceMapping]
$sel:workingDirectory:CreateImageRecipe' :: CreateImageRecipe -> Maybe Text
$sel:additionalInstanceConfiguration:CreateImageRecipe' :: CreateImageRecipe -> Maybe AdditionalInstanceConfiguration
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"additionalInstanceConfiguration" Text -> AdditionalInstanceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AdditionalInstanceConfiguration -> Pair)
-> Maybe AdditionalInstanceConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AdditionalInstanceConfiguration
additionalInstanceConfiguration,
(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
"blockDeviceMappings" Text -> [InstanceBlockDeviceMapping] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([InstanceBlockDeviceMapping] -> Pair)
-> Maybe [InstanceBlockDeviceMapping] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceBlockDeviceMapping]
blockDeviceMappings,
(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,
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
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
]
)
instance Core.ToPath CreateImageRecipe where
toPath :: CreateImageRecipe -> ByteString
toPath = ByteString -> CreateImageRecipe -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/CreateImageRecipe"
instance Core.ToQuery CreateImageRecipe where
toQuery :: CreateImageRecipe -> QueryString
toQuery = QueryString -> CreateImageRecipe -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateImageRecipeResponse = CreateImageRecipeResponse'
{
CreateImageRecipeResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateImageRecipeResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
CreateImageRecipeResponse -> Maybe Text
imageRecipeArn :: Prelude.Maybe Prelude.Text,
CreateImageRecipeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateImageRecipeResponse -> CreateImageRecipeResponse -> Bool
(CreateImageRecipeResponse -> CreateImageRecipeResponse -> Bool)
-> (CreateImageRecipeResponse -> CreateImageRecipeResponse -> Bool)
-> Eq CreateImageRecipeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateImageRecipeResponse -> CreateImageRecipeResponse -> Bool
$c/= :: CreateImageRecipeResponse -> CreateImageRecipeResponse -> Bool
== :: CreateImageRecipeResponse -> CreateImageRecipeResponse -> Bool
$c== :: CreateImageRecipeResponse -> CreateImageRecipeResponse -> Bool
Prelude.Eq, ReadPrec [CreateImageRecipeResponse]
ReadPrec CreateImageRecipeResponse
Int -> ReadS CreateImageRecipeResponse
ReadS [CreateImageRecipeResponse]
(Int -> ReadS CreateImageRecipeResponse)
-> ReadS [CreateImageRecipeResponse]
-> ReadPrec CreateImageRecipeResponse
-> ReadPrec [CreateImageRecipeResponse]
-> Read CreateImageRecipeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateImageRecipeResponse]
$creadListPrec :: ReadPrec [CreateImageRecipeResponse]
readPrec :: ReadPrec CreateImageRecipeResponse
$creadPrec :: ReadPrec CreateImageRecipeResponse
readList :: ReadS [CreateImageRecipeResponse]
$creadList :: ReadS [CreateImageRecipeResponse]
readsPrec :: Int -> ReadS CreateImageRecipeResponse
$creadsPrec :: Int -> ReadS CreateImageRecipeResponse
Prelude.Read, Int -> CreateImageRecipeResponse -> ShowS
[CreateImageRecipeResponse] -> ShowS
CreateImageRecipeResponse -> String
(Int -> CreateImageRecipeResponse -> ShowS)
-> (CreateImageRecipeResponse -> String)
-> ([CreateImageRecipeResponse] -> ShowS)
-> Show CreateImageRecipeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateImageRecipeResponse] -> ShowS
$cshowList :: [CreateImageRecipeResponse] -> ShowS
show :: CreateImageRecipeResponse -> String
$cshow :: CreateImageRecipeResponse -> String
showsPrec :: Int -> CreateImageRecipeResponse -> ShowS
$cshowsPrec :: Int -> CreateImageRecipeResponse -> ShowS
Prelude.Show, (forall x.
CreateImageRecipeResponse -> Rep CreateImageRecipeResponse x)
-> (forall x.
Rep CreateImageRecipeResponse x -> CreateImageRecipeResponse)
-> Generic CreateImageRecipeResponse
forall x.
Rep CreateImageRecipeResponse x -> CreateImageRecipeResponse
forall x.
CreateImageRecipeResponse -> Rep CreateImageRecipeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateImageRecipeResponse x -> CreateImageRecipeResponse
$cfrom :: forall x.
CreateImageRecipeResponse -> Rep CreateImageRecipeResponse x
Prelude.Generic)
newCreateImageRecipeResponse ::
Prelude.Int ->
CreateImageRecipeResponse
newCreateImageRecipeResponse :: Int -> CreateImageRecipeResponse
newCreateImageRecipeResponse Int
pHttpStatus_ =
CreateImageRecipeResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateImageRecipeResponse
CreateImageRecipeResponse'
{ $sel:requestId:CreateImageRecipeResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clientToken:CreateImageRecipeResponse' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageRecipeArn:CreateImageRecipeResponse' :: Maybe Text
imageRecipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateImageRecipeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createImageRecipeResponse_requestId :: Lens.Lens' CreateImageRecipeResponse (Prelude.Maybe Prelude.Text)
createImageRecipeResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateImageRecipeResponse -> f CreateImageRecipeResponse
createImageRecipeResponse_requestId = (CreateImageRecipeResponse -> Maybe Text)
-> (CreateImageRecipeResponse
-> Maybe Text -> CreateImageRecipeResponse)
-> Lens
CreateImageRecipeResponse
CreateImageRecipeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipeResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateImageRecipeResponse' :: CreateImageRecipeResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateImageRecipeResponse
s@CreateImageRecipeResponse' {} Maybe Text
a -> CreateImageRecipeResponse
s {$sel:requestId:CreateImageRecipeResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateImageRecipeResponse)
createImageRecipeResponse_clientToken :: Lens.Lens' CreateImageRecipeResponse (Prelude.Maybe Prelude.Text)
createImageRecipeResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateImageRecipeResponse -> f CreateImageRecipeResponse
createImageRecipeResponse_clientToken = (CreateImageRecipeResponse -> Maybe Text)
-> (CreateImageRecipeResponse
-> Maybe Text -> CreateImageRecipeResponse)
-> Lens
CreateImageRecipeResponse
CreateImageRecipeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipeResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateImageRecipeResponse' :: CreateImageRecipeResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateImageRecipeResponse
s@CreateImageRecipeResponse' {} Maybe Text
a -> CreateImageRecipeResponse
s {$sel:clientToken:CreateImageRecipeResponse' :: Maybe Text
clientToken = Maybe Text
a} :: CreateImageRecipeResponse)
createImageRecipeResponse_imageRecipeArn :: Lens.Lens' CreateImageRecipeResponse (Prelude.Maybe Prelude.Text)
createImageRecipeResponse_imageRecipeArn :: (Maybe Text -> f (Maybe Text))
-> CreateImageRecipeResponse -> f CreateImageRecipeResponse
createImageRecipeResponse_imageRecipeArn = (CreateImageRecipeResponse -> Maybe Text)
-> (CreateImageRecipeResponse
-> Maybe Text -> CreateImageRecipeResponse)
-> Lens
CreateImageRecipeResponse
CreateImageRecipeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipeResponse' {Maybe Text
imageRecipeArn :: Maybe Text
$sel:imageRecipeArn:CreateImageRecipeResponse' :: CreateImageRecipeResponse -> Maybe Text
imageRecipeArn} -> Maybe Text
imageRecipeArn) (\s :: CreateImageRecipeResponse
s@CreateImageRecipeResponse' {} Maybe Text
a -> CreateImageRecipeResponse
s {$sel:imageRecipeArn:CreateImageRecipeResponse' :: Maybe Text
imageRecipeArn = Maybe Text
a} :: CreateImageRecipeResponse)
createImageRecipeResponse_httpStatus :: Lens.Lens' CreateImageRecipeResponse Prelude.Int
createImageRecipeResponse_httpStatus :: (Int -> f Int)
-> CreateImageRecipeResponse -> f CreateImageRecipeResponse
createImageRecipeResponse_httpStatus = (CreateImageRecipeResponse -> Int)
-> (CreateImageRecipeResponse -> Int -> CreateImageRecipeResponse)
-> Lens CreateImageRecipeResponse CreateImageRecipeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateImageRecipeResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateImageRecipeResponse' :: CreateImageRecipeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateImageRecipeResponse
s@CreateImageRecipeResponse' {} Int
a -> CreateImageRecipeResponse
s {$sel:httpStatus:CreateImageRecipeResponse' :: Int
httpStatus = Int
a} :: CreateImageRecipeResponse)
instance Prelude.NFData CreateImageRecipeResponse