{-# 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.DeleteRemediationConfiguration
-- 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 remediation configuration.
module Amazonka.Config.DeleteRemediationConfiguration
  ( -- * Creating a Request
    DeleteRemediationConfiguration (..),
    newDeleteRemediationConfiguration,

    -- * Request Lenses
    deleteRemediationConfiguration_resourceType,
    deleteRemediationConfiguration_configRuleName,

    -- * Destructuring the Response
    DeleteRemediationConfigurationResponse (..),
    newDeleteRemediationConfigurationResponse,

    -- * Response Lenses
    deleteRemediationConfigurationResponse_httpStatus,
  )
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:/ 'newDeleteRemediationConfiguration' smart constructor.
data DeleteRemediationConfiguration = DeleteRemediationConfiguration'
  { -- | The type of a resource.
    DeleteRemediationConfiguration -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | The name of the Config rule for which you want to delete remediation
    -- configuration.
    DeleteRemediationConfiguration -> Text
configRuleName :: Prelude.Text
  }
  deriving (DeleteRemediationConfiguration
-> DeleteRemediationConfiguration -> Bool
(DeleteRemediationConfiguration
 -> DeleteRemediationConfiguration -> Bool)
-> (DeleteRemediationConfiguration
    -> DeleteRemediationConfiguration -> Bool)
-> Eq DeleteRemediationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRemediationConfiguration
-> DeleteRemediationConfiguration -> Bool
$c/= :: DeleteRemediationConfiguration
-> DeleteRemediationConfiguration -> Bool
== :: DeleteRemediationConfiguration
-> DeleteRemediationConfiguration -> Bool
$c== :: DeleteRemediationConfiguration
-> DeleteRemediationConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteRemediationConfiguration]
ReadPrec DeleteRemediationConfiguration
Int -> ReadS DeleteRemediationConfiguration
ReadS [DeleteRemediationConfiguration]
(Int -> ReadS DeleteRemediationConfiguration)
-> ReadS [DeleteRemediationConfiguration]
-> ReadPrec DeleteRemediationConfiguration
-> ReadPrec [DeleteRemediationConfiguration]
-> Read DeleteRemediationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRemediationConfiguration]
$creadListPrec :: ReadPrec [DeleteRemediationConfiguration]
readPrec :: ReadPrec DeleteRemediationConfiguration
$creadPrec :: ReadPrec DeleteRemediationConfiguration
readList :: ReadS [DeleteRemediationConfiguration]
$creadList :: ReadS [DeleteRemediationConfiguration]
readsPrec :: Int -> ReadS DeleteRemediationConfiguration
$creadsPrec :: Int -> ReadS DeleteRemediationConfiguration
Prelude.Read, Int -> DeleteRemediationConfiguration -> ShowS
[DeleteRemediationConfiguration] -> ShowS
DeleteRemediationConfiguration -> String
(Int -> DeleteRemediationConfiguration -> ShowS)
-> (DeleteRemediationConfiguration -> String)
-> ([DeleteRemediationConfiguration] -> ShowS)
-> Show DeleteRemediationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRemediationConfiguration] -> ShowS
$cshowList :: [DeleteRemediationConfiguration] -> ShowS
show :: DeleteRemediationConfiguration -> String
$cshow :: DeleteRemediationConfiguration -> String
showsPrec :: Int -> DeleteRemediationConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteRemediationConfiguration -> ShowS
Prelude.Show, (forall x.
 DeleteRemediationConfiguration
 -> Rep DeleteRemediationConfiguration x)
-> (forall x.
    Rep DeleteRemediationConfiguration x
    -> DeleteRemediationConfiguration)
-> Generic DeleteRemediationConfiguration
forall x.
Rep DeleteRemediationConfiguration x
-> DeleteRemediationConfiguration
forall x.
DeleteRemediationConfiguration
-> Rep DeleteRemediationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRemediationConfiguration x
-> DeleteRemediationConfiguration
$cfrom :: forall x.
DeleteRemediationConfiguration
-> Rep DeleteRemediationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRemediationConfiguration' 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:
--
-- 'resourceType', 'deleteRemediationConfiguration_resourceType' - The type of a resource.
--
-- 'configRuleName', 'deleteRemediationConfiguration_configRuleName' - The name of the Config rule for which you want to delete remediation
-- configuration.
newDeleteRemediationConfiguration ::
  -- | 'configRuleName'
  Prelude.Text ->
  DeleteRemediationConfiguration
newDeleteRemediationConfiguration :: Text -> DeleteRemediationConfiguration
newDeleteRemediationConfiguration Text
pConfigRuleName_ =
  DeleteRemediationConfiguration' :: Maybe Text -> Text -> DeleteRemediationConfiguration
DeleteRemediationConfiguration'
    { $sel:resourceType:DeleteRemediationConfiguration' :: Maybe Text
resourceType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configRuleName:DeleteRemediationConfiguration' :: Text
configRuleName = Text
pConfigRuleName_
    }

-- | The type of a resource.
deleteRemediationConfiguration_resourceType :: Lens.Lens' DeleteRemediationConfiguration (Prelude.Maybe Prelude.Text)
deleteRemediationConfiguration_resourceType :: (Maybe Text -> f (Maybe Text))
-> DeleteRemediationConfiguration
-> f DeleteRemediationConfiguration
deleteRemediationConfiguration_resourceType = (DeleteRemediationConfiguration -> Maybe Text)
-> (DeleteRemediationConfiguration
    -> Maybe Text -> DeleteRemediationConfiguration)
-> Lens
     DeleteRemediationConfiguration
     DeleteRemediationConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRemediationConfiguration' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:DeleteRemediationConfiguration' :: DeleteRemediationConfiguration -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: DeleteRemediationConfiguration
s@DeleteRemediationConfiguration' {} Maybe Text
a -> DeleteRemediationConfiguration
s {$sel:resourceType:DeleteRemediationConfiguration' :: Maybe Text
resourceType = Maybe Text
a} :: DeleteRemediationConfiguration)

-- | The name of the Config rule for which you want to delete remediation
-- configuration.
deleteRemediationConfiguration_configRuleName :: Lens.Lens' DeleteRemediationConfiguration Prelude.Text
deleteRemediationConfiguration_configRuleName :: (Text -> f Text)
-> DeleteRemediationConfiguration
-> f DeleteRemediationConfiguration
deleteRemediationConfiguration_configRuleName = (DeleteRemediationConfiguration -> Text)
-> (DeleteRemediationConfiguration
    -> Text -> DeleteRemediationConfiguration)
-> Lens
     DeleteRemediationConfiguration
     DeleteRemediationConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRemediationConfiguration' {Text
configRuleName :: Text
$sel:configRuleName:DeleteRemediationConfiguration' :: DeleteRemediationConfiguration -> Text
configRuleName} -> Text
configRuleName) (\s :: DeleteRemediationConfiguration
s@DeleteRemediationConfiguration' {} Text
a -> DeleteRemediationConfiguration
s {$sel:configRuleName:DeleteRemediationConfiguration' :: Text
configRuleName = Text
a} :: DeleteRemediationConfiguration)

instance
  Core.AWSRequest
    DeleteRemediationConfiguration
  where
  type
    AWSResponse DeleteRemediationConfiguration =
      DeleteRemediationConfigurationResponse
  request :: DeleteRemediationConfiguration
-> Request DeleteRemediationConfiguration
request = Service
-> DeleteRemediationConfiguration
-> Request DeleteRemediationConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteRemediationConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteRemediationConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteRemediationConfiguration))
-> Logger
-> Service
-> Proxy DeleteRemediationConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteRemediationConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteRemediationConfigurationResponse
DeleteRemediationConfigurationResponse'
            (Int -> DeleteRemediationConfigurationResponse)
-> Either String Int
-> Either String DeleteRemediationConfigurationResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DeleteRemediationConfiguration

instance
  Prelude.NFData
    DeleteRemediationConfiguration

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

instance Core.ToJSON DeleteRemediationConfiguration where
  toJSON :: DeleteRemediationConfiguration -> Value
toJSON DeleteRemediationConfiguration' {Maybe Text
Text
configRuleName :: Text
resourceType :: Maybe Text
$sel:configRuleName:DeleteRemediationConfiguration' :: DeleteRemediationConfiguration -> Text
$sel:resourceType:DeleteRemediationConfiguration' :: DeleteRemediationConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ResourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceType,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ConfigRuleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
configRuleName)
          ]
      )

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

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

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

-- |
-- Create a value of 'DeleteRemediationConfigurationResponse' 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:
--
-- 'httpStatus', 'deleteRemediationConfigurationResponse_httpStatus' - The response's http status code.
newDeleteRemediationConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteRemediationConfigurationResponse
newDeleteRemediationConfigurationResponse :: Int -> DeleteRemediationConfigurationResponse
newDeleteRemediationConfigurationResponse
  Int
pHttpStatus_ =
    DeleteRemediationConfigurationResponse' :: Int -> DeleteRemediationConfigurationResponse
DeleteRemediationConfigurationResponse'
      { $sel:httpStatus:DeleteRemediationConfigurationResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
deleteRemediationConfigurationResponse_httpStatus :: Lens.Lens' DeleteRemediationConfigurationResponse Prelude.Int
deleteRemediationConfigurationResponse_httpStatus :: (Int -> f Int)
-> DeleteRemediationConfigurationResponse
-> f DeleteRemediationConfigurationResponse
deleteRemediationConfigurationResponse_httpStatus = (DeleteRemediationConfigurationResponse -> Int)
-> (DeleteRemediationConfigurationResponse
    -> Int -> DeleteRemediationConfigurationResponse)
-> Lens
     DeleteRemediationConfigurationResponse
     DeleteRemediationConfigurationResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRemediationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRemediationConfigurationResponse' :: DeleteRemediationConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteRemediationConfigurationResponse
s@DeleteRemediationConfigurationResponse' {} Int
a -> DeleteRemediationConfigurationResponse
s {$sel:httpStatus:DeleteRemediationConfigurationResponse' :: Int
httpStatus = Int
a} :: DeleteRemediationConfigurationResponse)

instance
  Prelude.NFData
    DeleteRemediationConfigurationResponse