{-# 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-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 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 Amazonka.ElasticBeanstalk.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

-- | 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
(DeleteConfigurationTemplate
 -> DeleteConfigurationTemplate -> Bool)
-> (DeleteConfigurationTemplate
    -> DeleteConfigurationTemplate -> Bool)
-> Eq DeleteConfigurationTemplate
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]
(Int -> ReadS DeleteConfigurationTemplate)
-> ReadS [DeleteConfigurationTemplate]
-> ReadPrec DeleteConfigurationTemplate
-> ReadPrec [DeleteConfigurationTemplate]
-> Read 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
(Int -> DeleteConfigurationTemplate -> ShowS)
-> (DeleteConfigurationTemplate -> String)
-> ([DeleteConfigurationTemplate] -> ShowS)
-> Show DeleteConfigurationTemplate
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.
 DeleteConfigurationTemplate -> Rep DeleteConfigurationTemplate x)
-> (forall x.
    Rep DeleteConfigurationTemplate x -> DeleteConfigurationTemplate)
-> Generic DeleteConfigurationTemplate
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' :: Text -> Text -> DeleteConfigurationTemplate
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 :: (Text -> f Text)
-> DeleteConfigurationTemplate -> f DeleteConfigurationTemplate
deleteConfigurationTemplate_applicationName = (DeleteConfigurationTemplate -> Text)
-> (DeleteConfigurationTemplate
    -> Text -> DeleteConfigurationTemplate)
-> Lens
     DeleteConfigurationTemplate DeleteConfigurationTemplate Text Text
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 :: (Text -> f Text)
-> DeleteConfigurationTemplate -> f DeleteConfigurationTemplate
deleteConfigurationTemplate_templateName = (DeleteConfigurationTemplate -> Text)
-> (DeleteConfigurationTemplate
    -> Text -> DeleteConfigurationTemplate)
-> Lens
     DeleteConfigurationTemplate DeleteConfigurationTemplate Text Text
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 :: DeleteConfigurationTemplate -> Request DeleteConfigurationTemplate
request = Service
-> DeleteConfigurationTemplate
-> Request DeleteConfigurationTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteConfigurationTemplate)))
response =
    AWSResponse DeleteConfigurationTemplate
-> Logger
-> Service
-> Proxy DeleteConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteConfigurationTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteConfigurationTemplate
DeleteConfigurationTemplateResponse
DeleteConfigurationTemplateResponse'

instance Prelude.Hashable DeleteConfigurationTemplate

instance Prelude.NFData DeleteConfigurationTemplate

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

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

instance Core.ToQuery DeleteConfigurationTemplate where
  toQuery :: DeleteConfigurationTemplate -> QueryString
toQuery DeleteConfigurationTemplate' {Text
templateName :: Text
applicationName :: Text
$sel:templateName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> Text
$sel:applicationName:DeleteConfigurationTemplate' :: DeleteConfigurationTemplate -> 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
"DeleteConfigurationTemplate" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"ApplicationName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
applicationName,
        ByteString
"TemplateName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
templateName
      ]

-- | /See:/ 'newDeleteConfigurationTemplateResponse' smart constructor.
data DeleteConfigurationTemplateResponse = DeleteConfigurationTemplateResponse'
  {
  }
  deriving (DeleteConfigurationTemplateResponse
-> DeleteConfigurationTemplateResponse -> Bool
(DeleteConfigurationTemplateResponse
 -> DeleteConfigurationTemplateResponse -> Bool)
-> (DeleteConfigurationTemplateResponse
    -> DeleteConfigurationTemplateResponse -> Bool)
-> Eq DeleteConfigurationTemplateResponse
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]
(Int -> ReadS DeleteConfigurationTemplateResponse)
-> ReadS [DeleteConfigurationTemplateResponse]
-> ReadPrec DeleteConfigurationTemplateResponse
-> ReadPrec [DeleteConfigurationTemplateResponse]
-> Read 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
(Int -> DeleteConfigurationTemplateResponse -> ShowS)
-> (DeleteConfigurationTemplateResponse -> String)
-> ([DeleteConfigurationTemplateResponse] -> ShowS)
-> Show DeleteConfigurationTemplateResponse
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.
 DeleteConfigurationTemplateResponse
 -> Rep DeleteConfigurationTemplateResponse x)
-> (forall x.
    Rep DeleteConfigurationTemplateResponse x
    -> DeleteConfigurationTemplateResponse)
-> Generic DeleteConfigurationTemplateResponse
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