{-# 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.StopConfigurationRecorder
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Stops recording configurations of the Amazon Web Services resources you
-- have selected to record in your Amazon Web Services account.
module Amazonka.Config.StopConfigurationRecorder
  ( -- * Creating a Request
    StopConfigurationRecorder (..),
    newStopConfigurationRecorder,

    -- * Request Lenses
    stopConfigurationRecorder_configurationRecorderName,

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

-- | The input for the StopConfigurationRecorder action.
--
-- /See:/ 'newStopConfigurationRecorder' smart constructor.
data StopConfigurationRecorder = StopConfigurationRecorder'
  { -- | The name of the recorder object that records each configuration change
    -- made to the resources.
    StopConfigurationRecorder -> Text
configurationRecorderName :: Prelude.Text
  }
  deriving (StopConfigurationRecorder -> StopConfigurationRecorder -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopConfigurationRecorder -> StopConfigurationRecorder -> Bool
$c/= :: StopConfigurationRecorder -> StopConfigurationRecorder -> Bool
== :: StopConfigurationRecorder -> StopConfigurationRecorder -> Bool
$c== :: StopConfigurationRecorder -> StopConfigurationRecorder -> Bool
Prelude.Eq, ReadPrec [StopConfigurationRecorder]
ReadPrec StopConfigurationRecorder
Int -> ReadS StopConfigurationRecorder
ReadS [StopConfigurationRecorder]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopConfigurationRecorder]
$creadListPrec :: ReadPrec [StopConfigurationRecorder]
readPrec :: ReadPrec StopConfigurationRecorder
$creadPrec :: ReadPrec StopConfigurationRecorder
readList :: ReadS [StopConfigurationRecorder]
$creadList :: ReadS [StopConfigurationRecorder]
readsPrec :: Int -> ReadS StopConfigurationRecorder
$creadsPrec :: Int -> ReadS StopConfigurationRecorder
Prelude.Read, Int -> StopConfigurationRecorder -> ShowS
[StopConfigurationRecorder] -> ShowS
StopConfigurationRecorder -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopConfigurationRecorder] -> ShowS
$cshowList :: [StopConfigurationRecorder] -> ShowS
show :: StopConfigurationRecorder -> String
$cshow :: StopConfigurationRecorder -> String
showsPrec :: Int -> StopConfigurationRecorder -> ShowS
$cshowsPrec :: Int -> StopConfigurationRecorder -> ShowS
Prelude.Show, forall x.
Rep StopConfigurationRecorder x -> StopConfigurationRecorder
forall x.
StopConfigurationRecorder -> Rep StopConfigurationRecorder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopConfigurationRecorder x -> StopConfigurationRecorder
$cfrom :: forall x.
StopConfigurationRecorder -> Rep StopConfigurationRecorder x
Prelude.Generic)

-- |
-- Create a value of 'StopConfigurationRecorder' 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', 'stopConfigurationRecorder_configurationRecorderName' - The name of the recorder object that records each configuration change
-- made to the resources.
newStopConfigurationRecorder ::
  -- | 'configurationRecorderName'
  Prelude.Text ->
  StopConfigurationRecorder
newStopConfigurationRecorder :: Text -> StopConfigurationRecorder
newStopConfigurationRecorder
  Text
pConfigurationRecorderName_ =
    StopConfigurationRecorder'
      { $sel:configurationRecorderName:StopConfigurationRecorder' :: Text
configurationRecorderName =
          Text
pConfigurationRecorderName_
      }

-- | The name of the recorder object that records each configuration change
-- made to the resources.
stopConfigurationRecorder_configurationRecorderName :: Lens.Lens' StopConfigurationRecorder Prelude.Text
stopConfigurationRecorder_configurationRecorderName :: Lens' StopConfigurationRecorder Text
stopConfigurationRecorder_configurationRecorderName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopConfigurationRecorder' {Text
configurationRecorderName :: Text
$sel:configurationRecorderName:StopConfigurationRecorder' :: StopConfigurationRecorder -> Text
configurationRecorderName} -> Text
configurationRecorderName) (\s :: StopConfigurationRecorder
s@StopConfigurationRecorder' {} Text
a -> StopConfigurationRecorder
s {$sel:configurationRecorderName:StopConfigurationRecorder' :: Text
configurationRecorderName = Text
a} :: StopConfigurationRecorder)

instance Core.AWSRequest StopConfigurationRecorder where
  type
    AWSResponse StopConfigurationRecorder =
      StopConfigurationRecorderResponse
  request :: (Service -> Service)
-> StopConfigurationRecorder -> Request StopConfigurationRecorder
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 StopConfigurationRecorder
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StopConfigurationRecorder)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      StopConfigurationRecorderResponse
StopConfigurationRecorderResponse'

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

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

instance Data.ToHeaders StopConfigurationRecorder where
  toHeaders :: StopConfigurationRecorder -> [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.StopConfigurationRecorder" ::
                          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 StopConfigurationRecorder where
  toJSON :: StopConfigurationRecorder -> Value
toJSON StopConfigurationRecorder' {Text
configurationRecorderName :: Text
$sel:configurationRecorderName:StopConfigurationRecorder' :: StopConfigurationRecorder -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"ConfigurationRecorderName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
configurationRecorderName
              )
          ]
      )

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

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

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

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

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