{-# 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.DeleteImageRecipe
(
DeleteImageRecipe (..),
newDeleteImageRecipe,
deleteImageRecipe_imageRecipeArn,
DeleteImageRecipeResponse (..),
newDeleteImageRecipeResponse,
deleteImageRecipeResponse_requestId,
deleteImageRecipeResponse_imageRecipeArn,
deleteImageRecipeResponse_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 DeleteImageRecipe = DeleteImageRecipe'
{
DeleteImageRecipe -> Text
imageRecipeArn :: Prelude.Text
}
deriving (DeleteImageRecipe -> DeleteImageRecipe -> Bool
(DeleteImageRecipe -> DeleteImageRecipe -> Bool)
-> (DeleteImageRecipe -> DeleteImageRecipe -> Bool)
-> Eq DeleteImageRecipe
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteImageRecipe -> DeleteImageRecipe -> Bool
$c/= :: DeleteImageRecipe -> DeleteImageRecipe -> Bool
== :: DeleteImageRecipe -> DeleteImageRecipe -> Bool
$c== :: DeleteImageRecipe -> DeleteImageRecipe -> Bool
Prelude.Eq, ReadPrec [DeleteImageRecipe]
ReadPrec DeleteImageRecipe
Int -> ReadS DeleteImageRecipe
ReadS [DeleteImageRecipe]
(Int -> ReadS DeleteImageRecipe)
-> ReadS [DeleteImageRecipe]
-> ReadPrec DeleteImageRecipe
-> ReadPrec [DeleteImageRecipe]
-> Read DeleteImageRecipe
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteImageRecipe]
$creadListPrec :: ReadPrec [DeleteImageRecipe]
readPrec :: ReadPrec DeleteImageRecipe
$creadPrec :: ReadPrec DeleteImageRecipe
readList :: ReadS [DeleteImageRecipe]
$creadList :: ReadS [DeleteImageRecipe]
readsPrec :: Int -> ReadS DeleteImageRecipe
$creadsPrec :: Int -> ReadS DeleteImageRecipe
Prelude.Read, Int -> DeleteImageRecipe -> ShowS
[DeleteImageRecipe] -> ShowS
DeleteImageRecipe -> String
(Int -> DeleteImageRecipe -> ShowS)
-> (DeleteImageRecipe -> String)
-> ([DeleteImageRecipe] -> ShowS)
-> Show DeleteImageRecipe
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteImageRecipe] -> ShowS
$cshowList :: [DeleteImageRecipe] -> ShowS
show :: DeleteImageRecipe -> String
$cshow :: DeleteImageRecipe -> String
showsPrec :: Int -> DeleteImageRecipe -> ShowS
$cshowsPrec :: Int -> DeleteImageRecipe -> ShowS
Prelude.Show, (forall x. DeleteImageRecipe -> Rep DeleteImageRecipe x)
-> (forall x. Rep DeleteImageRecipe x -> DeleteImageRecipe)
-> Generic DeleteImageRecipe
forall x. Rep DeleteImageRecipe x -> DeleteImageRecipe
forall x. DeleteImageRecipe -> Rep DeleteImageRecipe x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteImageRecipe x -> DeleteImageRecipe
$cfrom :: forall x. DeleteImageRecipe -> Rep DeleteImageRecipe x
Prelude.Generic)
newDeleteImageRecipe ::
Prelude.Text ->
DeleteImageRecipe
newDeleteImageRecipe :: Text -> DeleteImageRecipe
newDeleteImageRecipe Text
pImageRecipeArn_ =
DeleteImageRecipe' :: Text -> DeleteImageRecipe
DeleteImageRecipe'
{ $sel:imageRecipeArn:DeleteImageRecipe' :: Text
imageRecipeArn =
Text
pImageRecipeArn_
}
deleteImageRecipe_imageRecipeArn :: Lens.Lens' DeleteImageRecipe Prelude.Text
deleteImageRecipe_imageRecipeArn :: (Text -> f Text) -> DeleteImageRecipe -> f DeleteImageRecipe
deleteImageRecipe_imageRecipeArn = (DeleteImageRecipe -> Text)
-> (DeleteImageRecipe -> Text -> DeleteImageRecipe)
-> Lens DeleteImageRecipe DeleteImageRecipe Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImageRecipe' {Text
imageRecipeArn :: Text
$sel:imageRecipeArn:DeleteImageRecipe' :: DeleteImageRecipe -> Text
imageRecipeArn} -> Text
imageRecipeArn) (\s :: DeleteImageRecipe
s@DeleteImageRecipe' {} Text
a -> DeleteImageRecipe
s {$sel:imageRecipeArn:DeleteImageRecipe' :: Text
imageRecipeArn = Text
a} :: DeleteImageRecipe)
instance Core.AWSRequest DeleteImageRecipe where
type
AWSResponse DeleteImageRecipe =
DeleteImageRecipeResponse
request :: DeleteImageRecipe -> Request DeleteImageRecipe
request = Service -> DeleteImageRecipe -> Request DeleteImageRecipe
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteImageRecipe
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteImageRecipe)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteImageRecipe))
-> Logger
-> Service
-> Proxy DeleteImageRecipe
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteImageRecipe)))
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 -> Int -> DeleteImageRecipeResponse
DeleteImageRecipeResponse'
(Maybe Text -> Maybe Text -> Int -> DeleteImageRecipeResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DeleteImageRecipeResponse)
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 -> Int -> DeleteImageRecipeResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteImageRecipeResponse)
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 -> DeleteImageRecipeResponse)
-> Either String Int -> Either String DeleteImageRecipeResponse
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 DeleteImageRecipe
instance Prelude.NFData DeleteImageRecipe
instance Core.ToHeaders DeleteImageRecipe where
toHeaders :: DeleteImageRecipe -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteImageRecipe -> 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.ToPath DeleteImageRecipe where
toPath :: DeleteImageRecipe -> ByteString
toPath = ByteString -> DeleteImageRecipe -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/DeleteImageRecipe"
instance Core.ToQuery DeleteImageRecipe where
toQuery :: DeleteImageRecipe -> QueryString
toQuery DeleteImageRecipe' {Text
imageRecipeArn :: Text
$sel:imageRecipeArn:DeleteImageRecipe' :: DeleteImageRecipe -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"imageRecipeArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
imageRecipeArn]
data DeleteImageRecipeResponse = DeleteImageRecipeResponse'
{
DeleteImageRecipeResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
DeleteImageRecipeResponse -> Maybe Text
imageRecipeArn :: Prelude.Maybe Prelude.Text,
DeleteImageRecipeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteImageRecipeResponse -> DeleteImageRecipeResponse -> Bool
(DeleteImageRecipeResponse -> DeleteImageRecipeResponse -> Bool)
-> (DeleteImageRecipeResponse -> DeleteImageRecipeResponse -> Bool)
-> Eq DeleteImageRecipeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteImageRecipeResponse -> DeleteImageRecipeResponse -> Bool
$c/= :: DeleteImageRecipeResponse -> DeleteImageRecipeResponse -> Bool
== :: DeleteImageRecipeResponse -> DeleteImageRecipeResponse -> Bool
$c== :: DeleteImageRecipeResponse -> DeleteImageRecipeResponse -> Bool
Prelude.Eq, ReadPrec [DeleteImageRecipeResponse]
ReadPrec DeleteImageRecipeResponse
Int -> ReadS DeleteImageRecipeResponse
ReadS [DeleteImageRecipeResponse]
(Int -> ReadS DeleteImageRecipeResponse)
-> ReadS [DeleteImageRecipeResponse]
-> ReadPrec DeleteImageRecipeResponse
-> ReadPrec [DeleteImageRecipeResponse]
-> Read DeleteImageRecipeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteImageRecipeResponse]
$creadListPrec :: ReadPrec [DeleteImageRecipeResponse]
readPrec :: ReadPrec DeleteImageRecipeResponse
$creadPrec :: ReadPrec DeleteImageRecipeResponse
readList :: ReadS [DeleteImageRecipeResponse]
$creadList :: ReadS [DeleteImageRecipeResponse]
readsPrec :: Int -> ReadS DeleteImageRecipeResponse
$creadsPrec :: Int -> ReadS DeleteImageRecipeResponse
Prelude.Read, Int -> DeleteImageRecipeResponse -> ShowS
[DeleteImageRecipeResponse] -> ShowS
DeleteImageRecipeResponse -> String
(Int -> DeleteImageRecipeResponse -> ShowS)
-> (DeleteImageRecipeResponse -> String)
-> ([DeleteImageRecipeResponse] -> ShowS)
-> Show DeleteImageRecipeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteImageRecipeResponse] -> ShowS
$cshowList :: [DeleteImageRecipeResponse] -> ShowS
show :: DeleteImageRecipeResponse -> String
$cshow :: DeleteImageRecipeResponse -> String
showsPrec :: Int -> DeleteImageRecipeResponse -> ShowS
$cshowsPrec :: Int -> DeleteImageRecipeResponse -> ShowS
Prelude.Show, (forall x.
DeleteImageRecipeResponse -> Rep DeleteImageRecipeResponse x)
-> (forall x.
Rep DeleteImageRecipeResponse x -> DeleteImageRecipeResponse)
-> Generic DeleteImageRecipeResponse
forall x.
Rep DeleteImageRecipeResponse x -> DeleteImageRecipeResponse
forall x.
DeleteImageRecipeResponse -> Rep DeleteImageRecipeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteImageRecipeResponse x -> DeleteImageRecipeResponse
$cfrom :: forall x.
DeleteImageRecipeResponse -> Rep DeleteImageRecipeResponse x
Prelude.Generic)
newDeleteImageRecipeResponse ::
Prelude.Int ->
DeleteImageRecipeResponse
newDeleteImageRecipeResponse :: Int -> DeleteImageRecipeResponse
newDeleteImageRecipeResponse Int
pHttpStatus_ =
DeleteImageRecipeResponse' :: Maybe Text -> Maybe Text -> Int -> DeleteImageRecipeResponse
DeleteImageRecipeResponse'
{ $sel:requestId:DeleteImageRecipeResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageRecipeArn:DeleteImageRecipeResponse' :: Maybe Text
imageRecipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteImageRecipeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteImageRecipeResponse_requestId :: Lens.Lens' DeleteImageRecipeResponse (Prelude.Maybe Prelude.Text)
deleteImageRecipeResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteImageRecipeResponse -> f DeleteImageRecipeResponse
deleteImageRecipeResponse_requestId = (DeleteImageRecipeResponse -> Maybe Text)
-> (DeleteImageRecipeResponse
-> Maybe Text -> DeleteImageRecipeResponse)
-> Lens
DeleteImageRecipeResponse
DeleteImageRecipeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImageRecipeResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteImageRecipeResponse' :: DeleteImageRecipeResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteImageRecipeResponse
s@DeleteImageRecipeResponse' {} Maybe Text
a -> DeleteImageRecipeResponse
s {$sel:requestId:DeleteImageRecipeResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteImageRecipeResponse)
deleteImageRecipeResponse_imageRecipeArn :: Lens.Lens' DeleteImageRecipeResponse (Prelude.Maybe Prelude.Text)
deleteImageRecipeResponse_imageRecipeArn :: (Maybe Text -> f (Maybe Text))
-> DeleteImageRecipeResponse -> f DeleteImageRecipeResponse
deleteImageRecipeResponse_imageRecipeArn = (DeleteImageRecipeResponse -> Maybe Text)
-> (DeleteImageRecipeResponse
-> Maybe Text -> DeleteImageRecipeResponse)
-> Lens
DeleteImageRecipeResponse
DeleteImageRecipeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImageRecipeResponse' {Maybe Text
imageRecipeArn :: Maybe Text
$sel:imageRecipeArn:DeleteImageRecipeResponse' :: DeleteImageRecipeResponse -> Maybe Text
imageRecipeArn} -> Maybe Text
imageRecipeArn) (\s :: DeleteImageRecipeResponse
s@DeleteImageRecipeResponse' {} Maybe Text
a -> DeleteImageRecipeResponse
s {$sel:imageRecipeArn:DeleteImageRecipeResponse' :: Maybe Text
imageRecipeArn = Maybe Text
a} :: DeleteImageRecipeResponse)
deleteImageRecipeResponse_httpStatus :: Lens.Lens' DeleteImageRecipeResponse Prelude.Int
deleteImageRecipeResponse_httpStatus :: (Int -> f Int)
-> DeleteImageRecipeResponse -> f DeleteImageRecipeResponse
deleteImageRecipeResponse_httpStatus = (DeleteImageRecipeResponse -> Int)
-> (DeleteImageRecipeResponse -> Int -> DeleteImageRecipeResponse)
-> Lens DeleteImageRecipeResponse DeleteImageRecipeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImageRecipeResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteImageRecipeResponse' :: DeleteImageRecipeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteImageRecipeResponse
s@DeleteImageRecipeResponse' {} Int
a -> DeleteImageRecipeResponse
s {$sel:httpStatus:DeleteImageRecipeResponse' :: Int
httpStatus = Int
a} :: DeleteImageRecipeResponse)
instance Prelude.NFData DeleteImageRecipeResponse