{-# 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 #-}
module Amazonka.Neptune.DeleteDBCluster
(
DeleteDBCluster (..),
newDeleteDBCluster,
deleteDBCluster_finalDBSnapshotIdentifier,
deleteDBCluster_skipFinalSnapshot,
deleteDBCluster_dbClusterIdentifier,
DeleteDBClusterResponse (..),
newDeleteDBClusterResponse,
deleteDBClusterResponse_dbCluster,
deleteDBClusterResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Neptune.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteDBCluster = DeleteDBCluster'
{
DeleteDBCluster -> Maybe Text
finalDBSnapshotIdentifier :: Prelude.Maybe Prelude.Text,
DeleteDBCluster -> Maybe Bool
skipFinalSnapshot :: Prelude.Maybe Prelude.Bool,
DeleteDBCluster -> Text
dbClusterIdentifier :: Prelude.Text
}
deriving (DeleteDBCluster -> DeleteDBCluster -> Bool
(DeleteDBCluster -> DeleteDBCluster -> Bool)
-> (DeleteDBCluster -> DeleteDBCluster -> Bool)
-> Eq DeleteDBCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDBCluster -> DeleteDBCluster -> Bool
$c/= :: DeleteDBCluster -> DeleteDBCluster -> Bool
== :: DeleteDBCluster -> DeleteDBCluster -> Bool
$c== :: DeleteDBCluster -> DeleteDBCluster -> Bool
Prelude.Eq, ReadPrec [DeleteDBCluster]
ReadPrec DeleteDBCluster
Int -> ReadS DeleteDBCluster
ReadS [DeleteDBCluster]
(Int -> ReadS DeleteDBCluster)
-> ReadS [DeleteDBCluster]
-> ReadPrec DeleteDBCluster
-> ReadPrec [DeleteDBCluster]
-> Read DeleteDBCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDBCluster]
$creadListPrec :: ReadPrec [DeleteDBCluster]
readPrec :: ReadPrec DeleteDBCluster
$creadPrec :: ReadPrec DeleteDBCluster
readList :: ReadS [DeleteDBCluster]
$creadList :: ReadS [DeleteDBCluster]
readsPrec :: Int -> ReadS DeleteDBCluster
$creadsPrec :: Int -> ReadS DeleteDBCluster
Prelude.Read, Int -> DeleteDBCluster -> ShowS
[DeleteDBCluster] -> ShowS
DeleteDBCluster -> String
(Int -> DeleteDBCluster -> ShowS)
-> (DeleteDBCluster -> String)
-> ([DeleteDBCluster] -> ShowS)
-> Show DeleteDBCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDBCluster] -> ShowS
$cshowList :: [DeleteDBCluster] -> ShowS
show :: DeleteDBCluster -> String
$cshow :: DeleteDBCluster -> String
showsPrec :: Int -> DeleteDBCluster -> ShowS
$cshowsPrec :: Int -> DeleteDBCluster -> ShowS
Prelude.Show, (forall x. DeleteDBCluster -> Rep DeleteDBCluster x)
-> (forall x. Rep DeleteDBCluster x -> DeleteDBCluster)
-> Generic DeleteDBCluster
forall x. Rep DeleteDBCluster x -> DeleteDBCluster
forall x. DeleteDBCluster -> Rep DeleteDBCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDBCluster x -> DeleteDBCluster
$cfrom :: forall x. DeleteDBCluster -> Rep DeleteDBCluster x
Prelude.Generic)
newDeleteDBCluster ::
Prelude.Text ->
DeleteDBCluster
newDeleteDBCluster :: Text -> DeleteDBCluster
newDeleteDBCluster Text
pDBClusterIdentifier_ =
DeleteDBCluster' :: Maybe Text -> Maybe Bool -> Text -> DeleteDBCluster
DeleteDBCluster'
{ $sel:finalDBSnapshotIdentifier:DeleteDBCluster' :: Maybe Text
finalDBSnapshotIdentifier =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:skipFinalSnapshot:DeleteDBCluster' :: Maybe Bool
skipFinalSnapshot = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:dbClusterIdentifier:DeleteDBCluster' :: Text
dbClusterIdentifier = Text
pDBClusterIdentifier_
}
deleteDBCluster_finalDBSnapshotIdentifier :: Lens.Lens' DeleteDBCluster (Prelude.Maybe Prelude.Text)
deleteDBCluster_finalDBSnapshotIdentifier :: (Maybe Text -> f (Maybe Text))
-> DeleteDBCluster -> f DeleteDBCluster
deleteDBCluster_finalDBSnapshotIdentifier = (DeleteDBCluster -> Maybe Text)
-> (DeleteDBCluster -> Maybe Text -> DeleteDBCluster)
-> Lens DeleteDBCluster DeleteDBCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBCluster' {Maybe Text
finalDBSnapshotIdentifier :: Maybe Text
$sel:finalDBSnapshotIdentifier:DeleteDBCluster' :: DeleteDBCluster -> Maybe Text
finalDBSnapshotIdentifier} -> Maybe Text
finalDBSnapshotIdentifier) (\s :: DeleteDBCluster
s@DeleteDBCluster' {} Maybe Text
a -> DeleteDBCluster
s {$sel:finalDBSnapshotIdentifier:DeleteDBCluster' :: Maybe Text
finalDBSnapshotIdentifier = Maybe Text
a} :: DeleteDBCluster)
deleteDBCluster_skipFinalSnapshot :: Lens.Lens' DeleteDBCluster (Prelude.Maybe Prelude.Bool)
deleteDBCluster_skipFinalSnapshot :: (Maybe Bool -> f (Maybe Bool))
-> DeleteDBCluster -> f DeleteDBCluster
deleteDBCluster_skipFinalSnapshot = (DeleteDBCluster -> Maybe Bool)
-> (DeleteDBCluster -> Maybe Bool -> DeleteDBCluster)
-> Lens DeleteDBCluster DeleteDBCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBCluster' {Maybe Bool
skipFinalSnapshot :: Maybe Bool
$sel:skipFinalSnapshot:DeleteDBCluster' :: DeleteDBCluster -> Maybe Bool
skipFinalSnapshot} -> Maybe Bool
skipFinalSnapshot) (\s :: DeleteDBCluster
s@DeleteDBCluster' {} Maybe Bool
a -> DeleteDBCluster
s {$sel:skipFinalSnapshot:DeleteDBCluster' :: Maybe Bool
skipFinalSnapshot = Maybe Bool
a} :: DeleteDBCluster)
deleteDBCluster_dbClusterIdentifier :: Lens.Lens' DeleteDBCluster Prelude.Text
deleteDBCluster_dbClusterIdentifier :: (Text -> f Text) -> DeleteDBCluster -> f DeleteDBCluster
deleteDBCluster_dbClusterIdentifier = (DeleteDBCluster -> Text)
-> (DeleteDBCluster -> Text -> DeleteDBCluster)
-> Lens DeleteDBCluster DeleteDBCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBCluster' {Text
dbClusterIdentifier :: Text
$sel:dbClusterIdentifier:DeleteDBCluster' :: DeleteDBCluster -> Text
dbClusterIdentifier} -> Text
dbClusterIdentifier) (\s :: DeleteDBCluster
s@DeleteDBCluster' {} Text
a -> DeleteDBCluster
s {$sel:dbClusterIdentifier:DeleteDBCluster' :: Text
dbClusterIdentifier = Text
a} :: DeleteDBCluster)
instance Core.AWSRequest DeleteDBCluster where
type
AWSResponse DeleteDBCluster =
DeleteDBClusterResponse
request :: DeleteDBCluster -> Request DeleteDBCluster
request = Service -> DeleteDBCluster -> Request DeleteDBCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDBCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBCluster)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteDBCluster))
-> Logger
-> Service
-> Proxy DeleteDBCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBCluster)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteDBClusterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBCluster -> Int -> DeleteDBClusterResponse
DeleteDBClusterResponse'
(Maybe DBCluster -> Int -> DeleteDBClusterResponse)
-> Either String (Maybe DBCluster)
-> Either String (Int -> DeleteDBClusterResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBCluster)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBCluster")
Either String (Int -> DeleteDBClusterResponse)
-> Either String Int -> Either String DeleteDBClusterResponse
forall (f :: * -> *) a b. Applicative f => 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 DeleteDBCluster
instance Prelude.NFData DeleteDBCluster
instance Core.ToHeaders DeleteDBCluster where
toHeaders :: DeleteDBCluster -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteDBCluster -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteDBCluster where
toPath :: DeleteDBCluster -> ByteString
toPath = ByteString -> DeleteDBCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteDBCluster where
toQuery :: DeleteDBCluster -> QueryString
toQuery DeleteDBCluster' {Maybe Bool
Maybe Text
Text
dbClusterIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
$sel:dbClusterIdentifier:DeleteDBCluster' :: DeleteDBCluster -> Text
$sel:skipFinalSnapshot:DeleteDBCluster' :: DeleteDBCluster -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBCluster' :: DeleteDBCluster -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteDBCluster" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"FinalDBSnapshotIdentifier"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
finalDBSnapshotIdentifier,
ByteString
"SkipFinalSnapshot" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
skipFinalSnapshot,
ByteString
"DBClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbClusterIdentifier
]
data DeleteDBClusterResponse = DeleteDBClusterResponse'
{ DeleteDBClusterResponse -> Maybe DBCluster
dbCluster :: Prelude.Maybe DBCluster,
DeleteDBClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDBClusterResponse -> DeleteDBClusterResponse -> Bool
(DeleteDBClusterResponse -> DeleteDBClusterResponse -> Bool)
-> (DeleteDBClusterResponse -> DeleteDBClusterResponse -> Bool)
-> Eq DeleteDBClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDBClusterResponse -> DeleteDBClusterResponse -> Bool
$c/= :: DeleteDBClusterResponse -> DeleteDBClusterResponse -> Bool
== :: DeleteDBClusterResponse -> DeleteDBClusterResponse -> Bool
$c== :: DeleteDBClusterResponse -> DeleteDBClusterResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDBClusterResponse]
ReadPrec DeleteDBClusterResponse
Int -> ReadS DeleteDBClusterResponse
ReadS [DeleteDBClusterResponse]
(Int -> ReadS DeleteDBClusterResponse)
-> ReadS [DeleteDBClusterResponse]
-> ReadPrec DeleteDBClusterResponse
-> ReadPrec [DeleteDBClusterResponse]
-> Read DeleteDBClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDBClusterResponse]
$creadListPrec :: ReadPrec [DeleteDBClusterResponse]
readPrec :: ReadPrec DeleteDBClusterResponse
$creadPrec :: ReadPrec DeleteDBClusterResponse
readList :: ReadS [DeleteDBClusterResponse]
$creadList :: ReadS [DeleteDBClusterResponse]
readsPrec :: Int -> ReadS DeleteDBClusterResponse
$creadsPrec :: Int -> ReadS DeleteDBClusterResponse
Prelude.Read, Int -> DeleteDBClusterResponse -> ShowS
[DeleteDBClusterResponse] -> ShowS
DeleteDBClusterResponse -> String
(Int -> DeleteDBClusterResponse -> ShowS)
-> (DeleteDBClusterResponse -> String)
-> ([DeleteDBClusterResponse] -> ShowS)
-> Show DeleteDBClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDBClusterResponse] -> ShowS
$cshowList :: [DeleteDBClusterResponse] -> ShowS
show :: DeleteDBClusterResponse -> String
$cshow :: DeleteDBClusterResponse -> String
showsPrec :: Int -> DeleteDBClusterResponse -> ShowS
$cshowsPrec :: Int -> DeleteDBClusterResponse -> ShowS
Prelude.Show, (forall x.
DeleteDBClusterResponse -> Rep DeleteDBClusterResponse x)
-> (forall x.
Rep DeleteDBClusterResponse x -> DeleteDBClusterResponse)
-> Generic DeleteDBClusterResponse
forall x. Rep DeleteDBClusterResponse x -> DeleteDBClusterResponse
forall x. DeleteDBClusterResponse -> Rep DeleteDBClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDBClusterResponse x -> DeleteDBClusterResponse
$cfrom :: forall x. DeleteDBClusterResponse -> Rep DeleteDBClusterResponse x
Prelude.Generic)
newDeleteDBClusterResponse ::
Prelude.Int ->
DeleteDBClusterResponse
newDeleteDBClusterResponse :: Int -> DeleteDBClusterResponse
newDeleteDBClusterResponse Int
pHttpStatus_ =
DeleteDBClusterResponse' :: Maybe DBCluster -> Int -> DeleteDBClusterResponse
DeleteDBClusterResponse'
{ $sel:dbCluster:DeleteDBClusterResponse' :: Maybe DBCluster
dbCluster =
Maybe DBCluster
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteDBClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteDBClusterResponse_dbCluster :: Lens.Lens' DeleteDBClusterResponse (Prelude.Maybe DBCluster)
deleteDBClusterResponse_dbCluster :: (Maybe DBCluster -> f (Maybe DBCluster))
-> DeleteDBClusterResponse -> f DeleteDBClusterResponse
deleteDBClusterResponse_dbCluster = (DeleteDBClusterResponse -> Maybe DBCluster)
-> (DeleteDBClusterResponse
-> Maybe DBCluster -> DeleteDBClusterResponse)
-> Lens
DeleteDBClusterResponse
DeleteDBClusterResponse
(Maybe DBCluster)
(Maybe DBCluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBClusterResponse' {Maybe DBCluster
dbCluster :: Maybe DBCluster
$sel:dbCluster:DeleteDBClusterResponse' :: DeleteDBClusterResponse -> Maybe DBCluster
dbCluster} -> Maybe DBCluster
dbCluster) (\s :: DeleteDBClusterResponse
s@DeleteDBClusterResponse' {} Maybe DBCluster
a -> DeleteDBClusterResponse
s {$sel:dbCluster:DeleteDBClusterResponse' :: Maybe DBCluster
dbCluster = Maybe DBCluster
a} :: DeleteDBClusterResponse)
deleteDBClusterResponse_httpStatus :: Lens.Lens' DeleteDBClusterResponse Prelude.Int
deleteDBClusterResponse_httpStatus :: (Int -> f Int)
-> DeleteDBClusterResponse -> f DeleteDBClusterResponse
deleteDBClusterResponse_httpStatus = (DeleteDBClusterResponse -> Int)
-> (DeleteDBClusterResponse -> Int -> DeleteDBClusterResponse)
-> Lens DeleteDBClusterResponse DeleteDBClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDBClusterResponse' :: DeleteDBClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDBClusterResponse
s@DeleteDBClusterResponse' {} Int
a -> DeleteDBClusterResponse
s {$sel:httpStatus:DeleteDBClusterResponse' :: Int
httpStatus = Int
a} :: DeleteDBClusterResponse)
instance Prelude.NFData DeleteDBClusterResponse