{-# 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.AutoScaling.DeleteLaunchConfiguration
-- 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)
--
-- Deletes the specified launch configuration.
--
-- The launch configuration must not be attached to an Auto Scaling group.
-- When this call completes, the launch configuration is no longer
-- available for use.
module Amazonka.AutoScaling.DeleteLaunchConfiguration
  ( -- * Creating a Request
    DeleteLaunchConfiguration (..),
    newDeleteLaunchConfiguration,

    -- * Request Lenses
    deleteLaunchConfiguration_launchConfigurationName,

    -- * Destructuring the Response
    DeleteLaunchConfigurationResponse (..),
    newDeleteLaunchConfigurationResponse,
  )
where

import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
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:/ 'newDeleteLaunchConfiguration' smart constructor.
data DeleteLaunchConfiguration = DeleteLaunchConfiguration'
  { -- | The name of the launch configuration.
    DeleteLaunchConfiguration -> Text
launchConfigurationName :: Prelude.Text
  }
  deriving (DeleteLaunchConfiguration -> DeleteLaunchConfiguration -> Bool
(DeleteLaunchConfiguration -> DeleteLaunchConfiguration -> Bool)
-> (DeleteLaunchConfiguration -> DeleteLaunchConfiguration -> Bool)
-> Eq DeleteLaunchConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLaunchConfiguration -> DeleteLaunchConfiguration -> Bool
$c/= :: DeleteLaunchConfiguration -> DeleteLaunchConfiguration -> Bool
== :: DeleteLaunchConfiguration -> DeleteLaunchConfiguration -> Bool
$c== :: DeleteLaunchConfiguration -> DeleteLaunchConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteLaunchConfiguration]
ReadPrec DeleteLaunchConfiguration
Int -> ReadS DeleteLaunchConfiguration
ReadS [DeleteLaunchConfiguration]
(Int -> ReadS DeleteLaunchConfiguration)
-> ReadS [DeleteLaunchConfiguration]
-> ReadPrec DeleteLaunchConfiguration
-> ReadPrec [DeleteLaunchConfiguration]
-> Read DeleteLaunchConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLaunchConfiguration]
$creadListPrec :: ReadPrec [DeleteLaunchConfiguration]
readPrec :: ReadPrec DeleteLaunchConfiguration
$creadPrec :: ReadPrec DeleteLaunchConfiguration
readList :: ReadS [DeleteLaunchConfiguration]
$creadList :: ReadS [DeleteLaunchConfiguration]
readsPrec :: Int -> ReadS DeleteLaunchConfiguration
$creadsPrec :: Int -> ReadS DeleteLaunchConfiguration
Prelude.Read, Int -> DeleteLaunchConfiguration -> ShowS
[DeleteLaunchConfiguration] -> ShowS
DeleteLaunchConfiguration -> String
(Int -> DeleteLaunchConfiguration -> ShowS)
-> (DeleteLaunchConfiguration -> String)
-> ([DeleteLaunchConfiguration] -> ShowS)
-> Show DeleteLaunchConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLaunchConfiguration] -> ShowS
$cshowList :: [DeleteLaunchConfiguration] -> ShowS
show :: DeleteLaunchConfiguration -> String
$cshow :: DeleteLaunchConfiguration -> String
showsPrec :: Int -> DeleteLaunchConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteLaunchConfiguration -> ShowS
Prelude.Show, (forall x.
 DeleteLaunchConfiguration -> Rep DeleteLaunchConfiguration x)
-> (forall x.
    Rep DeleteLaunchConfiguration x -> DeleteLaunchConfiguration)
-> Generic DeleteLaunchConfiguration
forall x.
Rep DeleteLaunchConfiguration x -> DeleteLaunchConfiguration
forall x.
DeleteLaunchConfiguration -> Rep DeleteLaunchConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteLaunchConfiguration x -> DeleteLaunchConfiguration
$cfrom :: forall x.
DeleteLaunchConfiguration -> Rep DeleteLaunchConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLaunchConfiguration' 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:
--
-- 'launchConfigurationName', 'deleteLaunchConfiguration_launchConfigurationName' - The name of the launch configuration.
newDeleteLaunchConfiguration ::
  -- | 'launchConfigurationName'
  Prelude.Text ->
  DeleteLaunchConfiguration
newDeleteLaunchConfiguration :: Text -> DeleteLaunchConfiguration
newDeleteLaunchConfiguration
  Text
pLaunchConfigurationName_ =
    DeleteLaunchConfiguration' :: Text -> DeleteLaunchConfiguration
DeleteLaunchConfiguration'
      { $sel:launchConfigurationName:DeleteLaunchConfiguration' :: Text
launchConfigurationName =
          Text
pLaunchConfigurationName_
      }

-- | The name of the launch configuration.
deleteLaunchConfiguration_launchConfigurationName :: Lens.Lens' DeleteLaunchConfiguration Prelude.Text
deleteLaunchConfiguration_launchConfigurationName :: (Text -> f Text)
-> DeleteLaunchConfiguration -> f DeleteLaunchConfiguration
deleteLaunchConfiguration_launchConfigurationName = (DeleteLaunchConfiguration -> Text)
-> (DeleteLaunchConfiguration -> Text -> DeleteLaunchConfiguration)
-> Lens
     DeleteLaunchConfiguration DeleteLaunchConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLaunchConfiguration' {Text
launchConfigurationName :: Text
$sel:launchConfigurationName:DeleteLaunchConfiguration' :: DeleteLaunchConfiguration -> Text
launchConfigurationName} -> Text
launchConfigurationName) (\s :: DeleteLaunchConfiguration
s@DeleteLaunchConfiguration' {} Text
a -> DeleteLaunchConfiguration
s {$sel:launchConfigurationName:DeleteLaunchConfiguration' :: Text
launchConfigurationName = Text
a} :: DeleteLaunchConfiguration)

instance Core.AWSRequest DeleteLaunchConfiguration where
  type
    AWSResponse DeleteLaunchConfiguration =
      DeleteLaunchConfigurationResponse
  request :: DeleteLaunchConfiguration -> Request DeleteLaunchConfiguration
request = Service
-> DeleteLaunchConfiguration -> Request DeleteLaunchConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteLaunchConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLaunchConfiguration)))
response =
    AWSResponse DeleteLaunchConfiguration
-> Logger
-> Service
-> Proxy DeleteLaunchConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLaunchConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteLaunchConfiguration
DeleteLaunchConfigurationResponse
DeleteLaunchConfigurationResponse'

instance Prelude.Hashable DeleteLaunchConfiguration

instance Prelude.NFData DeleteLaunchConfiguration

instance Core.ToHeaders DeleteLaunchConfiguration where
  toHeaders :: DeleteLaunchConfiguration -> [Header]
toHeaders = [Header] -> DeleteLaunchConfiguration -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DeleteLaunchConfiguration where
  toQuery :: DeleteLaunchConfiguration -> QueryString
toQuery DeleteLaunchConfiguration' {Text
launchConfigurationName :: Text
$sel:launchConfigurationName:DeleteLaunchConfiguration' :: DeleteLaunchConfiguration -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteLaunchConfiguration" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"LaunchConfigurationName"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
launchConfigurationName
      ]

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

-- |
-- Create a value of 'DeleteLaunchConfigurationResponse' 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.
newDeleteLaunchConfigurationResponse ::
  DeleteLaunchConfigurationResponse
newDeleteLaunchConfigurationResponse :: DeleteLaunchConfigurationResponse
newDeleteLaunchConfigurationResponse =
  DeleteLaunchConfigurationResponse
DeleteLaunchConfigurationResponse'

instance
  Prelude.NFData
    DeleteLaunchConfigurationResponse