{-# 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.MGN.DeleteLaunchConfigurationTemplate
-- 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 single Launch Configuration Template by ID.
module Amazonka.MGN.DeleteLaunchConfigurationTemplate
  ( -- * Creating a Request
    DeleteLaunchConfigurationTemplate (..),
    newDeleteLaunchConfigurationTemplate,

    -- * Request Lenses
    deleteLaunchConfigurationTemplate_launchConfigurationTemplateID,

    -- * Destructuring the Response
    DeleteLaunchConfigurationTemplateResponse (..),
    newDeleteLaunchConfigurationTemplateResponse,

    -- * Response Lenses
    deleteLaunchConfigurationTemplateResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDeleteLaunchConfigurationTemplate' smart constructor.
data DeleteLaunchConfigurationTemplate = DeleteLaunchConfigurationTemplate'
  { -- | ID of resource to be deleted.
    DeleteLaunchConfigurationTemplate -> Text
launchConfigurationTemplateID :: Prelude.Text
  }
  deriving (DeleteLaunchConfigurationTemplate
-> DeleteLaunchConfigurationTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLaunchConfigurationTemplate
-> DeleteLaunchConfigurationTemplate -> Bool
$c/= :: DeleteLaunchConfigurationTemplate
-> DeleteLaunchConfigurationTemplate -> Bool
== :: DeleteLaunchConfigurationTemplate
-> DeleteLaunchConfigurationTemplate -> Bool
$c== :: DeleteLaunchConfigurationTemplate
-> DeleteLaunchConfigurationTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteLaunchConfigurationTemplate]
ReadPrec DeleteLaunchConfigurationTemplate
Int -> ReadS DeleteLaunchConfigurationTemplate
ReadS [DeleteLaunchConfigurationTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLaunchConfigurationTemplate]
$creadListPrec :: ReadPrec [DeleteLaunchConfigurationTemplate]
readPrec :: ReadPrec DeleteLaunchConfigurationTemplate
$creadPrec :: ReadPrec DeleteLaunchConfigurationTemplate
readList :: ReadS [DeleteLaunchConfigurationTemplate]
$creadList :: ReadS [DeleteLaunchConfigurationTemplate]
readsPrec :: Int -> ReadS DeleteLaunchConfigurationTemplate
$creadsPrec :: Int -> ReadS DeleteLaunchConfigurationTemplate
Prelude.Read, Int -> DeleteLaunchConfigurationTemplate -> ShowS
[DeleteLaunchConfigurationTemplate] -> ShowS
DeleteLaunchConfigurationTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLaunchConfigurationTemplate] -> ShowS
$cshowList :: [DeleteLaunchConfigurationTemplate] -> ShowS
show :: DeleteLaunchConfigurationTemplate -> String
$cshow :: DeleteLaunchConfigurationTemplate -> String
showsPrec :: Int -> DeleteLaunchConfigurationTemplate -> ShowS
$cshowsPrec :: Int -> DeleteLaunchConfigurationTemplate -> ShowS
Prelude.Show, forall x.
Rep DeleteLaunchConfigurationTemplate x
-> DeleteLaunchConfigurationTemplate
forall x.
DeleteLaunchConfigurationTemplate
-> Rep DeleteLaunchConfigurationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteLaunchConfigurationTemplate x
-> DeleteLaunchConfigurationTemplate
$cfrom :: forall x.
DeleteLaunchConfigurationTemplate
-> Rep DeleteLaunchConfigurationTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLaunchConfigurationTemplate' 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:
--
-- 'launchConfigurationTemplateID', 'deleteLaunchConfigurationTemplate_launchConfigurationTemplateID' - ID of resource to be deleted.
newDeleteLaunchConfigurationTemplate ::
  -- | 'launchConfigurationTemplateID'
  Prelude.Text ->
  DeleteLaunchConfigurationTemplate
newDeleteLaunchConfigurationTemplate :: Text -> DeleteLaunchConfigurationTemplate
newDeleteLaunchConfigurationTemplate
  Text
pLaunchConfigurationTemplateID_ =
    DeleteLaunchConfigurationTemplate'
      { $sel:launchConfigurationTemplateID:DeleteLaunchConfigurationTemplate' :: Text
launchConfigurationTemplateID =
          Text
pLaunchConfigurationTemplateID_
      }

-- | ID of resource to be deleted.
deleteLaunchConfigurationTemplate_launchConfigurationTemplateID :: Lens.Lens' DeleteLaunchConfigurationTemplate Prelude.Text
deleteLaunchConfigurationTemplate_launchConfigurationTemplateID :: Lens' DeleteLaunchConfigurationTemplate Text
deleteLaunchConfigurationTemplate_launchConfigurationTemplateID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLaunchConfigurationTemplate' {Text
launchConfigurationTemplateID :: Text
$sel:launchConfigurationTemplateID:DeleteLaunchConfigurationTemplate' :: DeleteLaunchConfigurationTemplate -> Text
launchConfigurationTemplateID} -> Text
launchConfigurationTemplateID) (\s :: DeleteLaunchConfigurationTemplate
s@DeleteLaunchConfigurationTemplate' {} Text
a -> DeleteLaunchConfigurationTemplate
s {$sel:launchConfigurationTemplateID:DeleteLaunchConfigurationTemplate' :: Text
launchConfigurationTemplateID = Text
a} :: DeleteLaunchConfigurationTemplate)

instance
  Core.AWSRequest
    DeleteLaunchConfigurationTemplate
  where
  type
    AWSResponse DeleteLaunchConfigurationTemplate =
      DeleteLaunchConfigurationTemplateResponse
  request :: (Service -> Service)
-> DeleteLaunchConfigurationTemplate
-> Request DeleteLaunchConfigurationTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteLaunchConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteLaunchConfigurationTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteLaunchConfigurationTemplateResponse
DeleteLaunchConfigurationTemplateResponse'
            forall (f :: * -> *) a b. Functor 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
    DeleteLaunchConfigurationTemplate
  where
  hashWithSalt :: Int -> DeleteLaunchConfigurationTemplate -> Int
hashWithSalt
    Int
_salt
    DeleteLaunchConfigurationTemplate' {Text
launchConfigurationTemplateID :: Text
$sel:launchConfigurationTemplateID:DeleteLaunchConfigurationTemplate' :: DeleteLaunchConfigurationTemplate -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
launchConfigurationTemplateID

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

instance
  Data.ToHeaders
    DeleteLaunchConfigurationTemplate
  where
  toHeaders :: DeleteLaunchConfigurationTemplate -> 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.ToJSON
    DeleteLaunchConfigurationTemplate
  where
  toJSON :: DeleteLaunchConfigurationTemplate -> Value
toJSON DeleteLaunchConfigurationTemplate' {Text
launchConfigurationTemplateID :: Text
$sel:launchConfigurationTemplateID:DeleteLaunchConfigurationTemplate' :: DeleteLaunchConfigurationTemplate -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"launchConfigurationTemplateID"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
launchConfigurationTemplateID
              )
          ]
      )

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

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

-- | /See:/ 'newDeleteLaunchConfigurationTemplateResponse' smart constructor.
data DeleteLaunchConfigurationTemplateResponse = DeleteLaunchConfigurationTemplateResponse'
  { -- | The response's http status code.
    DeleteLaunchConfigurationTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteLaunchConfigurationTemplateResponse
-> DeleteLaunchConfigurationTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLaunchConfigurationTemplateResponse
-> DeleteLaunchConfigurationTemplateResponse -> Bool
$c/= :: DeleteLaunchConfigurationTemplateResponse
-> DeleteLaunchConfigurationTemplateResponse -> Bool
== :: DeleteLaunchConfigurationTemplateResponse
-> DeleteLaunchConfigurationTemplateResponse -> Bool
$c== :: DeleteLaunchConfigurationTemplateResponse
-> DeleteLaunchConfigurationTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteLaunchConfigurationTemplateResponse]
ReadPrec DeleteLaunchConfigurationTemplateResponse
Int -> ReadS DeleteLaunchConfigurationTemplateResponse
ReadS [DeleteLaunchConfigurationTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLaunchConfigurationTemplateResponse]
$creadListPrec :: ReadPrec [DeleteLaunchConfigurationTemplateResponse]
readPrec :: ReadPrec DeleteLaunchConfigurationTemplateResponse
$creadPrec :: ReadPrec DeleteLaunchConfigurationTemplateResponse
readList :: ReadS [DeleteLaunchConfigurationTemplateResponse]
$creadList :: ReadS [DeleteLaunchConfigurationTemplateResponse]
readsPrec :: Int -> ReadS DeleteLaunchConfigurationTemplateResponse
$creadsPrec :: Int -> ReadS DeleteLaunchConfigurationTemplateResponse
Prelude.Read, Int -> DeleteLaunchConfigurationTemplateResponse -> ShowS
[DeleteLaunchConfigurationTemplateResponse] -> ShowS
DeleteLaunchConfigurationTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLaunchConfigurationTemplateResponse] -> ShowS
$cshowList :: [DeleteLaunchConfigurationTemplateResponse] -> ShowS
show :: DeleteLaunchConfigurationTemplateResponse -> String
$cshow :: DeleteLaunchConfigurationTemplateResponse -> String
showsPrec :: Int -> DeleteLaunchConfigurationTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteLaunchConfigurationTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteLaunchConfigurationTemplateResponse x
-> DeleteLaunchConfigurationTemplateResponse
forall x.
DeleteLaunchConfigurationTemplateResponse
-> Rep DeleteLaunchConfigurationTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteLaunchConfigurationTemplateResponse x
-> DeleteLaunchConfigurationTemplateResponse
$cfrom :: forall x.
DeleteLaunchConfigurationTemplateResponse
-> Rep DeleteLaunchConfigurationTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLaunchConfigurationTemplateResponse' 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:
--
-- 'httpStatus', 'deleteLaunchConfigurationTemplateResponse_httpStatus' - The response's http status code.
newDeleteLaunchConfigurationTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteLaunchConfigurationTemplateResponse
newDeleteLaunchConfigurationTemplateResponse :: Int -> DeleteLaunchConfigurationTemplateResponse
newDeleteLaunchConfigurationTemplateResponse
  Int
pHttpStatus_ =
    DeleteLaunchConfigurationTemplateResponse'
      { $sel:httpStatus:DeleteLaunchConfigurationTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

instance
  Prelude.NFData
    DeleteLaunchConfigurationTemplateResponse
  where
  rnf :: DeleteLaunchConfigurationTemplateResponse -> ()
rnf DeleteLaunchConfigurationTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteLaunchConfigurationTemplateResponse' :: DeleteLaunchConfigurationTemplateResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus