{-# 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.Route53RecoveryReadiness.DeleteRecoveryGroup
-- 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 a recovery group.
module Amazonka.Route53RecoveryReadiness.DeleteRecoveryGroup
  ( -- * Creating a Request
    DeleteRecoveryGroup (..),
    newDeleteRecoveryGroup,

    -- * Request Lenses
    deleteRecoveryGroup_recoveryGroupName,

    -- * Destructuring the Response
    DeleteRecoveryGroupResponse (..),
    newDeleteRecoveryGroupResponse,
  )
where

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
import Amazonka.Route53RecoveryReadiness.Types

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

-- |
-- Create a value of 'DeleteRecoveryGroup' 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:
--
-- 'recoveryGroupName', 'deleteRecoveryGroup_recoveryGroupName' - The name of a recovery group.
newDeleteRecoveryGroup ::
  -- | 'recoveryGroupName'
  Prelude.Text ->
  DeleteRecoveryGroup
newDeleteRecoveryGroup :: Text -> DeleteRecoveryGroup
newDeleteRecoveryGroup Text
pRecoveryGroupName_ =
  DeleteRecoveryGroup'
    { $sel:recoveryGroupName:DeleteRecoveryGroup' :: Text
recoveryGroupName =
        Text
pRecoveryGroupName_
    }

-- | The name of a recovery group.
deleteRecoveryGroup_recoveryGroupName :: Lens.Lens' DeleteRecoveryGroup Prelude.Text
deleteRecoveryGroup_recoveryGroupName :: Lens' DeleteRecoveryGroup Text
deleteRecoveryGroup_recoveryGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRecoveryGroup' {Text
recoveryGroupName :: Text
$sel:recoveryGroupName:DeleteRecoveryGroup' :: DeleteRecoveryGroup -> Text
recoveryGroupName} -> Text
recoveryGroupName) (\s :: DeleteRecoveryGroup
s@DeleteRecoveryGroup' {} Text
a -> DeleteRecoveryGroup
s {$sel:recoveryGroupName:DeleteRecoveryGroup' :: Text
recoveryGroupName = Text
a} :: DeleteRecoveryGroup)

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

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

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

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

instance Data.ToPath DeleteRecoveryGroup where
  toPath :: DeleteRecoveryGroup -> ByteString
toPath DeleteRecoveryGroup' {Text
recoveryGroupName :: Text
$sel:recoveryGroupName:DeleteRecoveryGroup' :: DeleteRecoveryGroup -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/recoverygroups/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
recoveryGroupName]

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

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

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

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