{-# 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.DeleteContainerRecipe
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a container recipe.
module Amazonka.ImageBuilder.DeleteContainerRecipe
  ( -- * Creating a Request
    DeleteContainerRecipe (..),
    newDeleteContainerRecipe,

    -- * Request Lenses
    deleteContainerRecipe_containerRecipeArn,

    -- * Destructuring the Response
    DeleteContainerRecipeResponse (..),
    newDeleteContainerRecipeResponse,

    -- * Response Lenses
    deleteContainerRecipeResponse_containerRecipeArn,
    deleteContainerRecipeResponse_requestId,
    deleteContainerRecipeResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDeleteContainerRecipe' smart constructor.
data DeleteContainerRecipe = DeleteContainerRecipe'
  { -- | The Amazon Resource Name (ARN) of the container recipe to delete.
    DeleteContainerRecipe -> Text
containerRecipeArn :: Prelude.Text
  }
  deriving (DeleteContainerRecipe -> DeleteContainerRecipe -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContainerRecipe -> DeleteContainerRecipe -> Bool
$c/= :: DeleteContainerRecipe -> DeleteContainerRecipe -> Bool
== :: DeleteContainerRecipe -> DeleteContainerRecipe -> Bool
$c== :: DeleteContainerRecipe -> DeleteContainerRecipe -> Bool
Prelude.Eq, ReadPrec [DeleteContainerRecipe]
ReadPrec DeleteContainerRecipe
Int -> ReadS DeleteContainerRecipe
ReadS [DeleteContainerRecipe]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContainerRecipe]
$creadListPrec :: ReadPrec [DeleteContainerRecipe]
readPrec :: ReadPrec DeleteContainerRecipe
$creadPrec :: ReadPrec DeleteContainerRecipe
readList :: ReadS [DeleteContainerRecipe]
$creadList :: ReadS [DeleteContainerRecipe]
readsPrec :: Int -> ReadS DeleteContainerRecipe
$creadsPrec :: Int -> ReadS DeleteContainerRecipe
Prelude.Read, Int -> DeleteContainerRecipe -> ShowS
[DeleteContainerRecipe] -> ShowS
DeleteContainerRecipe -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContainerRecipe] -> ShowS
$cshowList :: [DeleteContainerRecipe] -> ShowS
show :: DeleteContainerRecipe -> String
$cshow :: DeleteContainerRecipe -> String
showsPrec :: Int -> DeleteContainerRecipe -> ShowS
$cshowsPrec :: Int -> DeleteContainerRecipe -> ShowS
Prelude.Show, forall x. Rep DeleteContainerRecipe x -> DeleteContainerRecipe
forall x. DeleteContainerRecipe -> Rep DeleteContainerRecipe x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteContainerRecipe x -> DeleteContainerRecipe
$cfrom :: forall x. DeleteContainerRecipe -> Rep DeleteContainerRecipe x
Prelude.Generic)

-- |
-- Create a value of 'DeleteContainerRecipe' 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:
--
-- 'containerRecipeArn', 'deleteContainerRecipe_containerRecipeArn' - The Amazon Resource Name (ARN) of the container recipe to delete.
newDeleteContainerRecipe ::
  -- | 'containerRecipeArn'
  Prelude.Text ->
  DeleteContainerRecipe
newDeleteContainerRecipe :: Text -> DeleteContainerRecipe
newDeleteContainerRecipe Text
pContainerRecipeArn_ =
  DeleteContainerRecipe'
    { $sel:containerRecipeArn:DeleteContainerRecipe' :: Text
containerRecipeArn =
        Text
pContainerRecipeArn_
    }

-- | The Amazon Resource Name (ARN) of the container recipe to delete.
deleteContainerRecipe_containerRecipeArn :: Lens.Lens' DeleteContainerRecipe Prelude.Text
deleteContainerRecipe_containerRecipeArn :: Lens' DeleteContainerRecipe Text
deleteContainerRecipe_containerRecipeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContainerRecipe' {Text
containerRecipeArn :: Text
$sel:containerRecipeArn:DeleteContainerRecipe' :: DeleteContainerRecipe -> Text
containerRecipeArn} -> Text
containerRecipeArn) (\s :: DeleteContainerRecipe
s@DeleteContainerRecipe' {} Text
a -> DeleteContainerRecipe
s {$sel:containerRecipeArn:DeleteContainerRecipe' :: Text
containerRecipeArn = Text
a} :: DeleteContainerRecipe)

instance Core.AWSRequest DeleteContainerRecipe where
  type
    AWSResponse DeleteContainerRecipe =
      DeleteContainerRecipeResponse
  request :: (Service -> Service)
-> DeleteContainerRecipe -> Request DeleteContainerRecipe
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteContainerRecipe
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteContainerRecipe)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Int -> DeleteContainerRecipeResponse
DeleteContainerRecipeResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"containerRecipeArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"requestId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteContainerRecipe where
  hashWithSalt :: Int -> DeleteContainerRecipe -> Int
hashWithSalt Int
_salt DeleteContainerRecipe' {Text
containerRecipeArn :: Text
$sel:containerRecipeArn:DeleteContainerRecipe' :: DeleteContainerRecipe -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
containerRecipeArn

instance Prelude.NFData DeleteContainerRecipe where
  rnf :: DeleteContainerRecipe -> ()
rnf DeleteContainerRecipe' {Text
containerRecipeArn :: Text
$sel:containerRecipeArn:DeleteContainerRecipe' :: DeleteContainerRecipe -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
containerRecipeArn

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

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

instance Data.ToQuery DeleteContainerRecipe where
  toQuery :: DeleteContainerRecipe -> QueryString
toQuery DeleteContainerRecipe' {Text
containerRecipeArn :: Text
$sel:containerRecipeArn:DeleteContainerRecipe' :: DeleteContainerRecipe -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"containerRecipeArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
containerRecipeArn]

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

-- |
-- Create a value of 'DeleteContainerRecipeResponse' 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:
--
-- 'containerRecipeArn', 'deleteContainerRecipeResponse_containerRecipeArn' - The Amazon Resource Name (ARN) of the container recipe that was deleted.
--
-- 'requestId', 'deleteContainerRecipeResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'httpStatus', 'deleteContainerRecipeResponse_httpStatus' - The response's http status code.
newDeleteContainerRecipeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteContainerRecipeResponse
newDeleteContainerRecipeResponse :: Int -> DeleteContainerRecipeResponse
newDeleteContainerRecipeResponse Int
pHttpStatus_ =
  DeleteContainerRecipeResponse'
    { $sel:containerRecipeArn:DeleteContainerRecipeResponse' :: Maybe Text
containerRecipeArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:DeleteContainerRecipeResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DeleteContainerRecipeResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the container recipe that was deleted.
deleteContainerRecipeResponse_containerRecipeArn :: Lens.Lens' DeleteContainerRecipeResponse (Prelude.Maybe Prelude.Text)
deleteContainerRecipeResponse_containerRecipeArn :: Lens' DeleteContainerRecipeResponse (Maybe Text)
deleteContainerRecipeResponse_containerRecipeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContainerRecipeResponse' {Maybe Text
containerRecipeArn :: Maybe Text
$sel:containerRecipeArn:DeleteContainerRecipeResponse' :: DeleteContainerRecipeResponse -> Maybe Text
containerRecipeArn} -> Maybe Text
containerRecipeArn) (\s :: DeleteContainerRecipeResponse
s@DeleteContainerRecipeResponse' {} Maybe Text
a -> DeleteContainerRecipeResponse
s {$sel:containerRecipeArn:DeleteContainerRecipeResponse' :: Maybe Text
containerRecipeArn = Maybe Text
a} :: DeleteContainerRecipeResponse)

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

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

instance Prelude.NFData DeleteContainerRecipeResponse where
  rnf :: DeleteContainerRecipeResponse -> ()
rnf DeleteContainerRecipeResponse' {Int
Maybe Text
httpStatus :: Int
requestId :: Maybe Text
containerRecipeArn :: Maybe Text
$sel:httpStatus:DeleteContainerRecipeResponse' :: DeleteContainerRecipeResponse -> Int
$sel:requestId:DeleteContainerRecipeResponse' :: DeleteContainerRecipeResponse -> Maybe Text
$sel:containerRecipeArn:DeleteContainerRecipeResponse' :: DeleteContainerRecipeResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
containerRecipeArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus