{-# 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.RDS.DeleteDBInstance
(
DeleteDBInstance (..),
newDeleteDBInstance,
deleteDBInstance_deleteAutomatedBackups,
deleteDBInstance_finalDBSnapshotIdentifier,
deleteDBInstance_skipFinalSnapshot,
deleteDBInstance_dbInstanceIdentifier,
DeleteDBInstanceResponse (..),
newDeleteDBInstanceResponse,
deleteDBInstanceResponse_dbInstance,
deleteDBInstanceResponse_httpStatus,
)
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 Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteDBInstance = DeleteDBInstance'
{
DeleteDBInstance -> Maybe Bool
deleteAutomatedBackups :: Prelude.Maybe Prelude.Bool,
DeleteDBInstance -> Maybe Text
finalDBSnapshotIdentifier :: Prelude.Maybe Prelude.Text,
DeleteDBInstance -> Maybe Bool
skipFinalSnapshot :: Prelude.Maybe Prelude.Bool,
DeleteDBInstance -> Text
dbInstanceIdentifier :: Prelude.Text
}
deriving (DeleteDBInstance -> DeleteDBInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDBInstance -> DeleteDBInstance -> Bool
$c/= :: DeleteDBInstance -> DeleteDBInstance -> Bool
== :: DeleteDBInstance -> DeleteDBInstance -> Bool
$c== :: DeleteDBInstance -> DeleteDBInstance -> Bool
Prelude.Eq, ReadPrec [DeleteDBInstance]
ReadPrec DeleteDBInstance
Int -> ReadS DeleteDBInstance
ReadS [DeleteDBInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDBInstance]
$creadListPrec :: ReadPrec [DeleteDBInstance]
readPrec :: ReadPrec DeleteDBInstance
$creadPrec :: ReadPrec DeleteDBInstance
readList :: ReadS [DeleteDBInstance]
$creadList :: ReadS [DeleteDBInstance]
readsPrec :: Int -> ReadS DeleteDBInstance
$creadsPrec :: Int -> ReadS DeleteDBInstance
Prelude.Read, Int -> DeleteDBInstance -> ShowS
[DeleteDBInstance] -> ShowS
DeleteDBInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDBInstance] -> ShowS
$cshowList :: [DeleteDBInstance] -> ShowS
show :: DeleteDBInstance -> String
$cshow :: DeleteDBInstance -> String
showsPrec :: Int -> DeleteDBInstance -> ShowS
$cshowsPrec :: Int -> DeleteDBInstance -> ShowS
Prelude.Show, forall x. Rep DeleteDBInstance x -> DeleteDBInstance
forall x. DeleteDBInstance -> Rep DeleteDBInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDBInstance x -> DeleteDBInstance
$cfrom :: forall x. DeleteDBInstance -> Rep DeleteDBInstance x
Prelude.Generic)
newDeleteDBInstance ::
Prelude.Text ->
DeleteDBInstance
newDeleteDBInstance :: Text -> DeleteDBInstance
newDeleteDBInstance Text
pDBInstanceIdentifier_ =
DeleteDBInstance'
{ $sel:deleteAutomatedBackups:DeleteDBInstance' :: Maybe Bool
deleteAutomatedBackups =
forall a. Maybe a
Prelude.Nothing,
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: Maybe Text
finalDBSnapshotIdentifier = forall a. Maybe a
Prelude.Nothing,
$sel:skipFinalSnapshot:DeleteDBInstance' :: Maybe Bool
skipFinalSnapshot = forall a. Maybe a
Prelude.Nothing,
$sel:dbInstanceIdentifier:DeleteDBInstance' :: Text
dbInstanceIdentifier = Text
pDBInstanceIdentifier_
}
deleteDBInstance_deleteAutomatedBackups :: Lens.Lens' DeleteDBInstance (Prelude.Maybe Prelude.Bool)
deleteDBInstance_deleteAutomatedBackups :: Lens' DeleteDBInstance (Maybe Bool)
deleteDBInstance_deleteAutomatedBackups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Maybe Bool
deleteAutomatedBackups :: Maybe Bool
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
deleteAutomatedBackups} -> Maybe Bool
deleteAutomatedBackups) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Maybe Bool
a -> DeleteDBInstance
s {$sel:deleteAutomatedBackups:DeleteDBInstance' :: Maybe Bool
deleteAutomatedBackups = Maybe Bool
a} :: DeleteDBInstance)
deleteDBInstance_finalDBSnapshotIdentifier :: Lens.Lens' DeleteDBInstance (Prelude.Maybe Prelude.Text)
deleteDBInstance_finalDBSnapshotIdentifier :: Lens' DeleteDBInstance (Maybe Text)
deleteDBInstance_finalDBSnapshotIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Maybe Text
finalDBSnapshotIdentifier :: Maybe Text
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
finalDBSnapshotIdentifier} -> Maybe Text
finalDBSnapshotIdentifier) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Maybe Text
a -> DeleteDBInstance
s {$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: Maybe Text
finalDBSnapshotIdentifier = Maybe Text
a} :: DeleteDBInstance)
deleteDBInstance_skipFinalSnapshot :: Lens.Lens' DeleteDBInstance (Prelude.Maybe Prelude.Bool)
deleteDBInstance_skipFinalSnapshot :: Lens' DeleteDBInstance (Maybe Bool)
deleteDBInstance_skipFinalSnapshot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Maybe Bool
skipFinalSnapshot :: Maybe Bool
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
skipFinalSnapshot} -> Maybe Bool
skipFinalSnapshot) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Maybe Bool
a -> DeleteDBInstance
s {$sel:skipFinalSnapshot:DeleteDBInstance' :: Maybe Bool
skipFinalSnapshot = Maybe Bool
a} :: DeleteDBInstance)
deleteDBInstance_dbInstanceIdentifier :: Lens.Lens' DeleteDBInstance Prelude.Text
deleteDBInstance_dbInstanceIdentifier :: Lens' DeleteDBInstance Text
deleteDBInstance_dbInstanceIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstance' {Text
dbInstanceIdentifier :: Text
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
dbInstanceIdentifier} -> Text
dbInstanceIdentifier) (\s :: DeleteDBInstance
s@DeleteDBInstance' {} Text
a -> DeleteDBInstance
s {$sel:dbInstanceIdentifier:DeleteDBInstance' :: Text
dbInstanceIdentifier = Text
a} :: DeleteDBInstance)
instance Core.AWSRequest DeleteDBInstance where
type
AWSResponse DeleteDBInstance =
DeleteDBInstanceResponse
request :: (Service -> Service)
-> DeleteDBInstance -> Request DeleteDBInstance
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBInstance)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteDBInstanceResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBInstance -> Int -> DeleteDBInstanceResponse
DeleteDBInstanceResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DBInstance")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteDBInstance where
hashWithSalt :: Int -> DeleteDBInstance -> Int
hashWithSalt Int
_salt DeleteDBInstance' {Maybe Bool
Maybe Text
Text
dbInstanceIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
deleteAutomatedBackups :: Maybe Bool
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteAutomatedBackups
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
finalDBSnapshotIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
skipFinalSnapshot
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dbInstanceIdentifier
instance Prelude.NFData DeleteDBInstance where
rnf :: DeleteDBInstance -> ()
rnf DeleteDBInstance' {Maybe Bool
Maybe Text
Text
dbInstanceIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
deleteAutomatedBackups :: Maybe Bool
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteAutomatedBackups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
finalDBSnapshotIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
skipFinalSnapshot
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dbInstanceIdentifier
instance Data.ToHeaders DeleteDBInstance where
toHeaders :: DeleteDBInstance -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteDBInstance where
toPath :: DeleteDBInstance -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteDBInstance where
toQuery :: DeleteDBInstance -> QueryString
toQuery DeleteDBInstance' {Maybe Bool
Maybe Text
Text
dbInstanceIdentifier :: Text
skipFinalSnapshot :: Maybe Bool
finalDBSnapshotIdentifier :: Maybe Text
deleteAutomatedBackups :: Maybe Bool
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Text
$sel:skipFinalSnapshot:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
$sel:finalDBSnapshotIdentifier:DeleteDBInstance' :: DeleteDBInstance -> Maybe Text
$sel:deleteAutomatedBackups:DeleteDBInstance' :: DeleteDBInstance -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteDBInstance" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"DeleteAutomatedBackups"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
deleteAutomatedBackups,
ByteString
"FinalDBSnapshotIdentifier"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
finalDBSnapshotIdentifier,
ByteString
"SkipFinalSnapshot" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
skipFinalSnapshot,
ByteString
"DBInstanceIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
dbInstanceIdentifier
]
data DeleteDBInstanceResponse = DeleteDBInstanceResponse'
{ DeleteDBInstanceResponse -> Maybe DBInstance
dbInstance :: Prelude.Maybe DBInstance,
DeleteDBInstanceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
$c/= :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
== :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
$c== :: DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDBInstanceResponse]
ReadPrec DeleteDBInstanceResponse
Int -> ReadS DeleteDBInstanceResponse
ReadS [DeleteDBInstanceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDBInstanceResponse]
$creadListPrec :: ReadPrec [DeleteDBInstanceResponse]
readPrec :: ReadPrec DeleteDBInstanceResponse
$creadPrec :: ReadPrec DeleteDBInstanceResponse
readList :: ReadS [DeleteDBInstanceResponse]
$creadList :: ReadS [DeleteDBInstanceResponse]
readsPrec :: Int -> ReadS DeleteDBInstanceResponse
$creadsPrec :: Int -> ReadS DeleteDBInstanceResponse
Prelude.Read, Int -> DeleteDBInstanceResponse -> ShowS
[DeleteDBInstanceResponse] -> ShowS
DeleteDBInstanceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDBInstanceResponse] -> ShowS
$cshowList :: [DeleteDBInstanceResponse] -> ShowS
show :: DeleteDBInstanceResponse -> String
$cshow :: DeleteDBInstanceResponse -> String
showsPrec :: Int -> DeleteDBInstanceResponse -> ShowS
$cshowsPrec :: Int -> DeleteDBInstanceResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteDBInstanceResponse x -> DeleteDBInstanceResponse
forall x.
DeleteDBInstanceResponse -> Rep DeleteDBInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDBInstanceResponse x -> DeleteDBInstanceResponse
$cfrom :: forall x.
DeleteDBInstanceResponse -> Rep DeleteDBInstanceResponse x
Prelude.Generic)
newDeleteDBInstanceResponse ::
Prelude.Int ->
DeleteDBInstanceResponse
newDeleteDBInstanceResponse :: Int -> DeleteDBInstanceResponse
newDeleteDBInstanceResponse Int
pHttpStatus_ =
DeleteDBInstanceResponse'
{ $sel:dbInstance:DeleteDBInstanceResponse' :: Maybe DBInstance
dbInstance =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteDBInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteDBInstanceResponse_dbInstance :: Lens.Lens' DeleteDBInstanceResponse (Prelude.Maybe DBInstance)
deleteDBInstanceResponse_dbInstance :: Lens' DeleteDBInstanceResponse (Maybe DBInstance)
deleteDBInstanceResponse_dbInstance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstanceResponse' {Maybe DBInstance
dbInstance :: Maybe DBInstance
$sel:dbInstance:DeleteDBInstanceResponse' :: DeleteDBInstanceResponse -> Maybe DBInstance
dbInstance} -> Maybe DBInstance
dbInstance) (\s :: DeleteDBInstanceResponse
s@DeleteDBInstanceResponse' {} Maybe DBInstance
a -> DeleteDBInstanceResponse
s {$sel:dbInstance:DeleteDBInstanceResponse' :: Maybe DBInstance
dbInstance = Maybe DBInstance
a} :: DeleteDBInstanceResponse)
deleteDBInstanceResponse_httpStatus :: Lens.Lens' DeleteDBInstanceResponse Prelude.Int
deleteDBInstanceResponse_httpStatus :: Lens' DeleteDBInstanceResponse Int
deleteDBInstanceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDBInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDBInstanceResponse' :: DeleteDBInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDBInstanceResponse
s@DeleteDBInstanceResponse' {} Int
a -> DeleteDBInstanceResponse
s {$sel:httpStatus:DeleteDBInstanceResponse' :: Int
httpStatus = Int
a} :: DeleteDBInstanceResponse)
instance Prelude.NFData DeleteDBInstanceResponse where
rnf :: DeleteDBInstanceResponse -> ()
rnf DeleteDBInstanceResponse' {Int
Maybe DBInstance
httpStatus :: Int
dbInstance :: Maybe DBInstance
$sel:httpStatus:DeleteDBInstanceResponse' :: DeleteDBInstanceResponse -> Int
$sel:dbInstance:DeleteDBInstanceResponse' :: DeleteDBInstanceResponse -> Maybe DBInstance
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DBInstance
dbInstance
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus