{-# 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.DeleteConfigurationAggregator
-- 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 aggregator and the aggregated data
-- associated with the aggregator.
module Amazonka.Config.DeleteConfigurationAggregator
  ( -- * Creating a Request
    DeleteConfigurationAggregator (..),
    newDeleteConfigurationAggregator,

    -- * Request Lenses
    deleteConfigurationAggregator_configurationAggregatorName,

    -- * Destructuring the Response
    DeleteConfigurationAggregatorResponse (..),
    newDeleteConfigurationAggregatorResponse,
  )
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

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

-- |
-- Create a value of 'DeleteConfigurationAggregator' 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:
--
-- 'configurationAggregatorName', 'deleteConfigurationAggregator_configurationAggregatorName' - The name of the configuration aggregator.
newDeleteConfigurationAggregator ::
  -- | 'configurationAggregatorName'
  Prelude.Text ->
  DeleteConfigurationAggregator
newDeleteConfigurationAggregator :: Text -> DeleteConfigurationAggregator
newDeleteConfigurationAggregator
  Text
pConfigurationAggregatorName_ =
    DeleteConfigurationAggregator' :: Text -> DeleteConfigurationAggregator
DeleteConfigurationAggregator'
      { $sel:configurationAggregatorName:DeleteConfigurationAggregator' :: Text
configurationAggregatorName =
          Text
pConfigurationAggregatorName_
      }

-- | The name of the configuration aggregator.
deleteConfigurationAggregator_configurationAggregatorName :: Lens.Lens' DeleteConfigurationAggregator Prelude.Text
deleteConfigurationAggregator_configurationAggregatorName :: (Text -> f Text)
-> DeleteConfigurationAggregator -> f DeleteConfigurationAggregator
deleteConfigurationAggregator_configurationAggregatorName = (DeleteConfigurationAggregator -> Text)
-> (DeleteConfigurationAggregator
    -> Text -> DeleteConfigurationAggregator)
-> Lens
     DeleteConfigurationAggregator
     DeleteConfigurationAggregator
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationAggregator' {Text
configurationAggregatorName :: Text
$sel:configurationAggregatorName:DeleteConfigurationAggregator' :: DeleteConfigurationAggregator -> Text
configurationAggregatorName} -> Text
configurationAggregatorName) (\s :: DeleteConfigurationAggregator
s@DeleteConfigurationAggregator' {} Text
a -> DeleteConfigurationAggregator
s {$sel:configurationAggregatorName:DeleteConfigurationAggregator' :: Text
configurationAggregatorName = Text
a} :: DeleteConfigurationAggregator)

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

instance
  Prelude.Hashable
    DeleteConfigurationAggregator

instance Prelude.NFData DeleteConfigurationAggregator

instance Core.ToHeaders DeleteConfigurationAggregator where
  toHeaders :: DeleteConfigurationAggregator -> [Header]
toHeaders =
    [Header] -> DeleteConfigurationAggregator -> [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.DeleteConfigurationAggregator" ::
                          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 DeleteConfigurationAggregator where
  toJSON :: DeleteConfigurationAggregator -> Value
toJSON DeleteConfigurationAggregator' {Text
configurationAggregatorName :: Text
$sel:configurationAggregatorName:DeleteConfigurationAggregator' :: DeleteConfigurationAggregator -> 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
"ConfigurationAggregatorName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
configurationAggregatorName
              )
          ]
      )

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

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

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

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

instance
  Prelude.NFData
    DeleteConfigurationAggregatorResponse