{-# 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.Config.DeleteConfigurationRecorder
-- 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 configuration recorder.
--
-- After the configuration recorder is deleted, Config will not record
-- resource configuration changes until you create a new configuration
-- recorder.
--
-- This action does not delete the configuration information that was
-- previously recorded. You will be able to access the previously recorded
-- information by using the @GetResourceConfigHistory@ action, but you will
-- not be able to access this information in the Config console until you
-- create a new configuration recorder.
module Amazonka.Config.DeleteConfigurationRecorder
  ( -- * Creating a Request
    DeleteConfigurationRecorder (..),
    newDeleteConfigurationRecorder,

    -- * Request Lenses
    deleteConfigurationRecorder_configurationRecorderName,

    -- * Destructuring the Response
    DeleteConfigurationRecorderResponse (..),
    newDeleteConfigurationRecorderResponse,
  )
where

import Amazonka.Config.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

-- | The request object for the @DeleteConfigurationRecorder@ action.
--
-- /See:/ 'newDeleteConfigurationRecorder' smart constructor.
data DeleteConfigurationRecorder = DeleteConfigurationRecorder'
  { -- | The name of the configuration recorder to be deleted. You can retrieve
    -- the name of your configuration recorder by using the
    -- @DescribeConfigurationRecorders@ action.
    DeleteConfigurationRecorder -> Text
configurationRecorderName :: Prelude.Text
  }
  deriving (DeleteConfigurationRecorder -> DeleteConfigurationRecorder -> Bool
(DeleteConfigurationRecorder
 -> DeleteConfigurationRecorder -> Bool)
-> (DeleteConfigurationRecorder
    -> DeleteConfigurationRecorder -> Bool)
-> Eq DeleteConfigurationRecorder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConfigurationRecorder -> DeleteConfigurationRecorder -> Bool
$c/= :: DeleteConfigurationRecorder -> DeleteConfigurationRecorder -> Bool
== :: DeleteConfigurationRecorder -> DeleteConfigurationRecorder -> Bool
$c== :: DeleteConfigurationRecorder -> DeleteConfigurationRecorder -> Bool
Prelude.Eq, ReadPrec [DeleteConfigurationRecorder]
ReadPrec DeleteConfigurationRecorder
Int -> ReadS DeleteConfigurationRecorder
ReadS [DeleteConfigurationRecorder]
(Int -> ReadS DeleteConfigurationRecorder)
-> ReadS [DeleteConfigurationRecorder]
-> ReadPrec DeleteConfigurationRecorder
-> ReadPrec [DeleteConfigurationRecorder]
-> Read DeleteConfigurationRecorder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConfigurationRecorder]
$creadListPrec :: ReadPrec [DeleteConfigurationRecorder]
readPrec :: ReadPrec DeleteConfigurationRecorder
$creadPrec :: ReadPrec DeleteConfigurationRecorder
readList :: ReadS [DeleteConfigurationRecorder]
$creadList :: ReadS [DeleteConfigurationRecorder]
readsPrec :: Int -> ReadS DeleteConfigurationRecorder
$creadsPrec :: Int -> ReadS DeleteConfigurationRecorder
Prelude.Read, Int -> DeleteConfigurationRecorder -> ShowS
[DeleteConfigurationRecorder] -> ShowS
DeleteConfigurationRecorder -> String
(Int -> DeleteConfigurationRecorder -> ShowS)
-> (DeleteConfigurationRecorder -> String)
-> ([DeleteConfigurationRecorder] -> ShowS)
-> Show DeleteConfigurationRecorder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConfigurationRecorder] -> ShowS
$cshowList :: [DeleteConfigurationRecorder] -> ShowS
show :: DeleteConfigurationRecorder -> String
$cshow :: DeleteConfigurationRecorder -> String
showsPrec :: Int -> DeleteConfigurationRecorder -> ShowS
$cshowsPrec :: Int -> DeleteConfigurationRecorder -> ShowS
Prelude.Show, (forall x.
 DeleteConfigurationRecorder -> Rep DeleteConfigurationRecorder x)
-> (forall x.
    Rep DeleteConfigurationRecorder x -> DeleteConfigurationRecorder)
-> Generic DeleteConfigurationRecorder
forall x.
Rep DeleteConfigurationRecorder x -> DeleteConfigurationRecorder
forall x.
DeleteConfigurationRecorder -> Rep DeleteConfigurationRecorder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConfigurationRecorder x -> DeleteConfigurationRecorder
$cfrom :: forall x.
DeleteConfigurationRecorder -> Rep DeleteConfigurationRecorder x
Prelude.Generic)

-- |
-- Create a value of 'DeleteConfigurationRecorder' 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:
--
-- 'configurationRecorderName', 'deleteConfigurationRecorder_configurationRecorderName' - The name of the configuration recorder to be deleted. You can retrieve
-- the name of your configuration recorder by using the
-- @DescribeConfigurationRecorders@ action.
newDeleteConfigurationRecorder ::
  -- | 'configurationRecorderName'
  Prelude.Text ->
  DeleteConfigurationRecorder
newDeleteConfigurationRecorder :: Text -> DeleteConfigurationRecorder
newDeleteConfigurationRecorder
  Text
pConfigurationRecorderName_ =
    DeleteConfigurationRecorder' :: Text -> DeleteConfigurationRecorder
DeleteConfigurationRecorder'
      { $sel:configurationRecorderName:DeleteConfigurationRecorder' :: Text
configurationRecorderName =
          Text
pConfigurationRecorderName_
      }

-- | The name of the configuration recorder to be deleted. You can retrieve
-- the name of your configuration recorder by using the
-- @DescribeConfigurationRecorders@ action.
deleteConfigurationRecorder_configurationRecorderName :: Lens.Lens' DeleteConfigurationRecorder Prelude.Text
deleteConfigurationRecorder_configurationRecorderName :: (Text -> f Text)
-> DeleteConfigurationRecorder -> f DeleteConfigurationRecorder
deleteConfigurationRecorder_configurationRecorderName = (DeleteConfigurationRecorder -> Text)
-> (DeleteConfigurationRecorder
    -> Text -> DeleteConfigurationRecorder)
-> Lens
     DeleteConfigurationRecorder DeleteConfigurationRecorder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationRecorder' {Text
configurationRecorderName :: Text
$sel:configurationRecorderName:DeleteConfigurationRecorder' :: DeleteConfigurationRecorder -> Text
configurationRecorderName} -> Text
configurationRecorderName) (\s :: DeleteConfigurationRecorder
s@DeleteConfigurationRecorder' {} Text
a -> DeleteConfigurationRecorder
s {$sel:configurationRecorderName:DeleteConfigurationRecorder' :: Text
configurationRecorderName = Text
a} :: DeleteConfigurationRecorder)

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

instance Prelude.Hashable DeleteConfigurationRecorder

instance Prelude.NFData DeleteConfigurationRecorder

instance Core.ToHeaders DeleteConfigurationRecorder where
  toHeaders :: DeleteConfigurationRecorder -> [Header]
toHeaders =
    [Header] -> DeleteConfigurationRecorder -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"StarlingDoveService.DeleteConfigurationRecorder" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteConfigurationRecorder where
  toJSON :: DeleteConfigurationRecorder -> Value
toJSON DeleteConfigurationRecorder' {Text
configurationRecorderName :: Text
$sel:configurationRecorderName:DeleteConfigurationRecorder' :: DeleteConfigurationRecorder -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ConfigurationRecorderName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
configurationRecorderName
              )
          ]
      )

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

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

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

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

instance
  Prelude.NFData
    DeleteConfigurationRecorderResponse