{-# 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.DeleteRetentionConfiguration
-- 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 retention configuration.
module Amazonka.Config.DeleteRetentionConfiguration
  ( -- * Creating a Request
    DeleteRetentionConfiguration (..),
    newDeleteRetentionConfiguration,

    -- * Request Lenses
    deleteRetentionConfiguration_retentionConfigurationName,

    -- * Destructuring the Response
    DeleteRetentionConfigurationResponse (..),
    newDeleteRetentionConfigurationResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteRetentionConfiguration' 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:
--
-- 'retentionConfigurationName', 'deleteRetentionConfiguration_retentionConfigurationName' - The name of the retention configuration to delete.
newDeleteRetentionConfiguration ::
  -- | 'retentionConfigurationName'
  Prelude.Text ->
  DeleteRetentionConfiguration
newDeleteRetentionConfiguration :: Text -> DeleteRetentionConfiguration
newDeleteRetentionConfiguration
  Text
pRetentionConfigurationName_ =
    DeleteRetentionConfiguration'
      { $sel:retentionConfigurationName:DeleteRetentionConfiguration' :: Text
retentionConfigurationName =
          Text
pRetentionConfigurationName_
      }

-- | The name of the retention configuration to delete.
deleteRetentionConfiguration_retentionConfigurationName :: Lens.Lens' DeleteRetentionConfiguration Prelude.Text
deleteRetentionConfiguration_retentionConfigurationName :: Lens' DeleteRetentionConfiguration Text
deleteRetentionConfiguration_retentionConfigurationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRetentionConfiguration' {Text
retentionConfigurationName :: Text
$sel:retentionConfigurationName:DeleteRetentionConfiguration' :: DeleteRetentionConfiguration -> Text
retentionConfigurationName} -> Text
retentionConfigurationName) (\s :: DeleteRetentionConfiguration
s@DeleteRetentionConfiguration' {} Text
a -> DeleteRetentionConfiguration
s {$sel:retentionConfigurationName:DeleteRetentionConfiguration' :: Text
retentionConfigurationName = Text
a} :: DeleteRetentionConfiguration)

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

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

instance Prelude.NFData DeleteRetentionConfiguration where
  rnf :: DeleteRetentionConfiguration -> ()
rnf DeleteRetentionConfiguration' {Text
retentionConfigurationName :: Text
$sel:retentionConfigurationName:DeleteRetentionConfiguration' :: DeleteRetentionConfiguration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
retentionConfigurationName

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

instance Data.ToJSON DeleteRetentionConfiguration where
  toJSON :: DeleteRetentionConfiguration -> Value
toJSON DeleteRetentionConfiguration' {Text
retentionConfigurationName :: Text
$sel:retentionConfigurationName:DeleteRetentionConfiguration' :: DeleteRetentionConfiguration -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"RetentionConfigurationName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
retentionConfigurationName
              )
          ]
      )

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

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

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

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

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