{-# 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.DocumentDB.DeleteDBInstance
(
DeleteDBInstance (..),
newDeleteDBInstance,
deleteDBInstance_dbInstanceIdentifier,
DeleteDBInstanceResponse (..),
newDeleteDBInstanceResponse,
deleteDBInstanceResponse_dbInstance,
deleteDBInstanceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DocumentDB.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteDBInstance = DeleteDBInstance'
{
DeleteDBInstance -> Text
dbInstanceIdentifier :: Prelude.Text
}
deriving (DeleteDBInstance -> DeleteDBInstance -> Bool
(DeleteDBInstance -> DeleteDBInstance -> Bool)
-> (DeleteDBInstance -> DeleteDBInstance -> Bool)
-> Eq DeleteDBInstance
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]
(Int -> ReadS DeleteDBInstance)
-> ReadS [DeleteDBInstance]
-> ReadPrec DeleteDBInstance
-> ReadPrec [DeleteDBInstance]
-> Read 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
(Int -> DeleteDBInstance -> ShowS)
-> (DeleteDBInstance -> String)
-> ([DeleteDBInstance] -> ShowS)
-> Show DeleteDBInstance
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. DeleteDBInstance -> Rep DeleteDBInstance x)
-> (forall x. Rep DeleteDBInstance x -> DeleteDBInstance)
-> Generic DeleteDBInstance
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' :: Text -> DeleteDBInstance
DeleteDBInstance'
{ $sel:dbInstanceIdentifier:DeleteDBInstance' :: Text
dbInstanceIdentifier =
Text
pDBInstanceIdentifier_
}
deleteDBInstance_dbInstanceIdentifier :: Lens.Lens' DeleteDBInstance Prelude.Text
deleteDBInstance_dbInstanceIdentifier :: (Text -> f Text) -> DeleteDBInstance -> f DeleteDBInstance
deleteDBInstance_dbInstanceIdentifier = (DeleteDBInstance -> Text)
-> (DeleteDBInstance -> Text -> DeleteDBInstance)
-> Lens DeleteDBInstance DeleteDBInstance Text Text
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 :: DeleteDBInstance -> Request DeleteDBInstance
request = Service -> DeleteDBInstance -> Request DeleteDBInstance
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBInstance)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteDBInstance))
-> Logger
-> Service
-> Proxy DeleteDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDBInstance)))
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
"DeleteDBInstanceResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBInstance -> Int -> DeleteDBInstanceResponse
DeleteDBInstanceResponse'
(Maybe DBInstance -> Int -> DeleteDBInstanceResponse)
-> Either String (Maybe DBInstance)
-> Either String (Int -> DeleteDBInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBInstance)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBInstance")
Either String (Int -> DeleteDBInstanceResponse)
-> Either String Int -> Either String DeleteDBInstanceResponse
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 DeleteDBInstance
instance Prelude.NFData DeleteDBInstance
instance Core.ToHeaders DeleteDBInstance where
toHeaders :: DeleteDBInstance -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteDBInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteDBInstance where
toPath :: DeleteDBInstance -> ByteString
toPath = ByteString -> DeleteDBInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteDBInstance where
toQuery :: DeleteDBInstance -> QueryString
toQuery DeleteDBInstance' {Text
dbInstanceIdentifier :: Text
$sel:dbInstanceIdentifier:DeleteDBInstance' :: DeleteDBInstance -> 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
"DeleteDBInstance" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"DBInstanceIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbInstanceIdentifier
]
data DeleteDBInstanceResponse = DeleteDBInstanceResponse'
{ DeleteDBInstanceResponse -> Maybe DBInstance
dbInstance :: Prelude.Maybe DBInstance,
DeleteDBInstanceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool
(DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool)
-> (DeleteDBInstanceResponse -> DeleteDBInstanceResponse -> Bool)
-> Eq DeleteDBInstanceResponse
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]
(Int -> ReadS DeleteDBInstanceResponse)
-> ReadS [DeleteDBInstanceResponse]
-> ReadPrec DeleteDBInstanceResponse
-> ReadPrec [DeleteDBInstanceResponse]
-> Read 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
(Int -> DeleteDBInstanceResponse -> ShowS)
-> (DeleteDBInstanceResponse -> String)
-> ([DeleteDBInstanceResponse] -> ShowS)
-> Show DeleteDBInstanceResponse
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.
DeleteDBInstanceResponse -> Rep DeleteDBInstanceResponse x)
-> (forall x.
Rep DeleteDBInstanceResponse x -> DeleteDBInstanceResponse)
-> Generic DeleteDBInstanceResponse
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' :: Maybe DBInstance -> Int -> DeleteDBInstanceResponse
DeleteDBInstanceResponse'
{ $sel:dbInstance:DeleteDBInstanceResponse' :: Maybe DBInstance
dbInstance =
Maybe DBInstance
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteDBInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteDBInstanceResponse_dbInstance :: Lens.Lens' DeleteDBInstanceResponse (Prelude.Maybe DBInstance)
deleteDBInstanceResponse_dbInstance :: (Maybe DBInstance -> f (Maybe DBInstance))
-> DeleteDBInstanceResponse -> f DeleteDBInstanceResponse
deleteDBInstanceResponse_dbInstance = (DeleteDBInstanceResponse -> Maybe DBInstance)
-> (DeleteDBInstanceResponse
-> Maybe DBInstance -> DeleteDBInstanceResponse)
-> Lens
DeleteDBInstanceResponse
DeleteDBInstanceResponse
(Maybe DBInstance)
(Maybe 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 :: (Int -> f Int)
-> DeleteDBInstanceResponse -> f DeleteDBInstanceResponse
deleteDBInstanceResponse_httpStatus = (DeleteDBInstanceResponse -> Int)
-> (DeleteDBInstanceResponse -> Int -> DeleteDBInstanceResponse)
-> Lens DeleteDBInstanceResponse DeleteDBInstanceResponse Int Int
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