{-# 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.DeleteCell
-- 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 an existing Cell.
module Amazonka.Route53RecoveryReadiness.DeleteCell
  ( -- * Creating a Request
    DeleteCell (..),
    newDeleteCell,

    -- * Request Lenses
    deleteCell_cellName,

    -- * Destructuring the Response
    DeleteCellResponse (..),
    newDeleteCellResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteCell' 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:
--
-- 'cellName', 'deleteCell_cellName' - The Cell to delete
newDeleteCell ::
  -- | 'cellName'
  Prelude.Text ->
  DeleteCell
newDeleteCell :: Text -> DeleteCell
newDeleteCell Text
pCellName_ =
  DeleteCell' :: Text -> DeleteCell
DeleteCell' {$sel:cellName:DeleteCell' :: Text
cellName = Text
pCellName_}

-- | The Cell to delete
deleteCell_cellName :: Lens.Lens' DeleteCell Prelude.Text
deleteCell_cellName :: (Text -> f Text) -> DeleteCell -> f DeleteCell
deleteCell_cellName = (DeleteCell -> Text)
-> (DeleteCell -> Text -> DeleteCell)
-> Lens DeleteCell DeleteCell Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCell' {Text
cellName :: Text
$sel:cellName:DeleteCell' :: DeleteCell -> Text
cellName} -> Text
cellName) (\s :: DeleteCell
s@DeleteCell' {} Text
a -> DeleteCell
s {$sel:cellName:DeleteCell' :: Text
cellName = Text
a} :: DeleteCell)

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

instance Prelude.Hashable DeleteCell

instance Prelude.NFData DeleteCell

instance Core.ToHeaders DeleteCell where
  toHeaders :: DeleteCell -> [Header]
toHeaders =
    [Header] -> DeleteCell -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeleteCell where
  toPath :: DeleteCell -> ByteString
toPath DeleteCell' {Text
cellName :: Text
$sel:cellName:DeleteCell' :: DeleteCell -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/cells/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
cellName]

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

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

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

instance Prelude.NFData DeleteCellResponse