{-# 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.ElasticBeanstalk.DeleteConfigurationTemplate
-- 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 the specified configuration template.
--
-- When you launch an environment using a configuration template, the
-- environment gets a copy of the template. You can delete or modify the
-- environment\'s copy of the template without affecting the running
-- environment.
module Amazonka.ElasticBeanstalk.DeleteConfigurationTemplate
  ( -- * Creating a Request
    DeleteConfigurationTemplate (..),
    newDeleteConfigurationTemplate,

    -- * Request Lenses
    deleteConfigurationTemplate_applicationName,
    deleteConfigurationTemplate_templateName,

    -- * Destructuring the Response
    DeleteConfigurationTemplateResponse (..),
    newDeleteConfigurationTemplateResponse,
  )
where

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

-- | Request to delete a configuration template.
--
-- /See:/ 'newDeleteConfigurationTemplate' smart constructor.
data DeleteConfigurationTemplate = DeleteConfigurationTemplate'
  { -- | The name of the application to delete the configuration template from.
    DeleteConfigurationTemplate -> Text
applicationName :: Prelude.Text,
    -- | The name of the configuration template to delete.
    DeleteConfigurationTemplate -> Text
templateName :: Prelude.Text
  }
  deriving (DeleteConfigurationTemplate -> DeleteConfigurationTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConfigurationTemplate -> DeleteConfigurationTemplate -> Bool
$c/= :: DeleteConfigurationTemplate -> DeleteConfigurationTemplate -> Bool
== :: DeleteConfigurationTemplate -> DeleteConfigurationTemplate -> Bool
$c== :: DeleteConfigurationTemplate -> DeleteConfigurationTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteConfigurationTemplate]
ReadPrec DeleteConfigurationTemplate
Int -> ReadS DeleteConfigurationTemplate
ReadS [DeleteConfigurationTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConfigurationTemplate]
$creadListPrec :: ReadPrec [DeleteConfigurationTemplate]
readPrec :: ReadPrec DeleteConfigurationTemplate
$creadPrec :: ReadPrec DeleteConfigurationTemplate
readList :: ReadS [DeleteConfigurationTemplate]
$creadList :: ReadS [DeleteConfigurationTemplate]
readsPrec :: Int -> ReadS DeleteConfigurationTemplate
$creadsPrec :: Int -> ReadS DeleteConfigurationTemplate
Prelude.Read, Int -> DeleteConfigurationTemplate -> ShowS
[DeleteConfigurationTemplate] -> ShowS
DeleteConfigurationTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConfigurationTemplate] -> ShowS
$cshowList :: [DeleteConfigurationTemplate] -> ShowS
show :: DeleteConfigurationTemplate -> String
$cshow :: DeleteConfigurationTemplate -> String
showsPrec :: Int -> DeleteConfigurationTemplate -> ShowS
$cshowsPrec :: Int -> DeleteConfigurationTemplate -> ShowS
Prelude.Show, forall x.
Rep DeleteConfigurationTemplate x -> DeleteConfigurationTemplate
forall x.
DeleteConfigurationTemplate -> Rep DeleteConfigurationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConfigurationTemplate x -> DeleteConfigurationTemplate
$cfrom :: forall x.
DeleteConfigurationTemplate -> Rep DeleteConfigurationTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteConfigurationTemplate' 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:
--
-- 'applicationName', 'deleteConfigurationTemplate_applicationName' - The name of the application to delete the configuration template from.
--
-- 'templateName', 'deleteConfigurationTemplate_templateName' - The name of the configuration template to delete.
newDeleteConfigurationTemplate ::
  -- | 'applicationName'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  DeleteConfigurationTemplate
newDeleteConfigurationTemplate :: Text -> Text -> DeleteConfigurationTemplate
newDeleteConfigurationTemplate
  Text
pApplicationName_
  Text
pTemplateName_ =
    DeleteConfigurationTemplate'
      { $sel:applicationName:DeleteConfigurationTemplate' :: Text
applicationName =
          Text
pApplicationName_,
        $sel:templateName:DeleteConfigurationTemplate' :: Text
templateName = Text
pTemplateName_
      }

-- | The name of the application to delete the configuration template from.
deleteConfigurationTemplate_applicationName :: Lens.Lens' DeleteConfigurationTemplate Prelude.Text
deleteConfigurationTemplate_applicationName :: Lens' DeleteConfigurationTemplate Text
deleteConfigurationTemplate_applicationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationTemplate' {Text
applicationName :: Text
$sel:applicationName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> Text
applicationName} -> Text
applicationName) (\s :: DeleteConfigurationTemplate
s@DeleteConfigurationTemplate' {} Text
a -> DeleteConfigurationTemplate
s {$sel:applicationName:DeleteConfigurationTemplate' :: Text
applicationName = Text
a} :: DeleteConfigurationTemplate)

-- | The name of the configuration template to delete.
deleteConfigurationTemplate_templateName :: Lens.Lens' DeleteConfigurationTemplate Prelude.Text
deleteConfigurationTemplate_templateName :: Lens' DeleteConfigurationTemplate Text
deleteConfigurationTemplate_templateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationTemplate' {Text
templateName :: Text
$sel:templateName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> Text
templateName} -> Text
templateName) (\s :: DeleteConfigurationTemplate
s@DeleteConfigurationTemplate' {} Text
a -> DeleteConfigurationTemplate
s {$sel:templateName:DeleteConfigurationTemplate' :: Text
templateName = Text
a} :: DeleteConfigurationTemplate)

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

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

instance Prelude.NFData DeleteConfigurationTemplate where
  rnf :: DeleteConfigurationTemplate -> ()
rnf DeleteConfigurationTemplate' {Text
templateName :: Text
applicationName :: Text
$sel:templateName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> Text
$sel:applicationName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
applicationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName

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

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

instance Data.ToQuery DeleteConfigurationTemplate where
  toQuery :: DeleteConfigurationTemplate -> QueryString
toQuery DeleteConfigurationTemplate' {Text
templateName :: Text
applicationName :: Text
$sel:templateName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> Text
$sel:applicationName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DeleteConfigurationTemplate" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ApplicationName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
applicationName,
        ByteString
"TemplateName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
templateName
      ]

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

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

instance
  Prelude.NFData
    DeleteConfigurationTemplateResponse
  where
  rnf :: DeleteConfigurationTemplateResponse -> ()
rnf DeleteConfigurationTemplateResponse
_ = ()