{-# 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.StopDBCluster
(
StopDBCluster (..),
newStopDBCluster,
stopDBCluster_dbClusterIdentifier,
StopDBClusterResponse (..),
newStopDBClusterResponse,
stopDBClusterResponse_dbCluster,
stopDBClusterResponse_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 StopDBCluster = StopDBCluster'
{
StopDBCluster -> Text
dbClusterIdentifier :: Prelude.Text
}
deriving (StopDBCluster -> StopDBCluster -> Bool
(StopDBCluster -> StopDBCluster -> Bool)
-> (StopDBCluster -> StopDBCluster -> Bool) -> Eq StopDBCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopDBCluster -> StopDBCluster -> Bool
$c/= :: StopDBCluster -> StopDBCluster -> Bool
== :: StopDBCluster -> StopDBCluster -> Bool
$c== :: StopDBCluster -> StopDBCluster -> Bool
Prelude.Eq, ReadPrec [StopDBCluster]
ReadPrec StopDBCluster
Int -> ReadS StopDBCluster
ReadS [StopDBCluster]
(Int -> ReadS StopDBCluster)
-> ReadS [StopDBCluster]
-> ReadPrec StopDBCluster
-> ReadPrec [StopDBCluster]
-> Read StopDBCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopDBCluster]
$creadListPrec :: ReadPrec [StopDBCluster]
readPrec :: ReadPrec StopDBCluster
$creadPrec :: ReadPrec StopDBCluster
readList :: ReadS [StopDBCluster]
$creadList :: ReadS [StopDBCluster]
readsPrec :: Int -> ReadS StopDBCluster
$creadsPrec :: Int -> ReadS StopDBCluster
Prelude.Read, Int -> StopDBCluster -> ShowS
[StopDBCluster] -> ShowS
StopDBCluster -> String
(Int -> StopDBCluster -> ShowS)
-> (StopDBCluster -> String)
-> ([StopDBCluster] -> ShowS)
-> Show StopDBCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopDBCluster] -> ShowS
$cshowList :: [StopDBCluster] -> ShowS
show :: StopDBCluster -> String
$cshow :: StopDBCluster -> String
showsPrec :: Int -> StopDBCluster -> ShowS
$cshowsPrec :: Int -> StopDBCluster -> ShowS
Prelude.Show, (forall x. StopDBCluster -> Rep StopDBCluster x)
-> (forall x. Rep StopDBCluster x -> StopDBCluster)
-> Generic StopDBCluster
forall x. Rep StopDBCluster x -> StopDBCluster
forall x. StopDBCluster -> Rep StopDBCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopDBCluster x -> StopDBCluster
$cfrom :: forall x. StopDBCluster -> Rep StopDBCluster x
Prelude.Generic)
newStopDBCluster ::
Prelude.Text ->
StopDBCluster
newStopDBCluster :: Text -> StopDBCluster
newStopDBCluster Text
pDBClusterIdentifier_ =
StopDBCluster' :: Text -> StopDBCluster
StopDBCluster'
{ $sel:dbClusterIdentifier:StopDBCluster' :: Text
dbClusterIdentifier =
Text
pDBClusterIdentifier_
}
stopDBCluster_dbClusterIdentifier :: Lens.Lens' StopDBCluster Prelude.Text
stopDBCluster_dbClusterIdentifier :: (Text -> f Text) -> StopDBCluster -> f StopDBCluster
stopDBCluster_dbClusterIdentifier = (StopDBCluster -> Text)
-> (StopDBCluster -> Text -> StopDBCluster)
-> Lens StopDBCluster StopDBCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopDBCluster' {Text
dbClusterIdentifier :: Text
$sel:dbClusterIdentifier:StopDBCluster' :: StopDBCluster -> Text
dbClusterIdentifier} -> Text
dbClusterIdentifier) (\s :: StopDBCluster
s@StopDBCluster' {} Text
a -> StopDBCluster
s {$sel:dbClusterIdentifier:StopDBCluster' :: Text
dbClusterIdentifier = Text
a} :: StopDBCluster)
instance Core.AWSRequest StopDBCluster where
type
AWSResponse StopDBCluster =
StopDBClusterResponse
request :: StopDBCluster -> Request StopDBCluster
request = Service -> StopDBCluster -> Request StopDBCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy StopDBCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopDBCluster)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse StopDBCluster))
-> Logger
-> Service
-> Proxy StopDBCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopDBCluster)))
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
"StopDBClusterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBCluster -> Int -> StopDBClusterResponse
StopDBClusterResponse'
(Maybe DBCluster -> Int -> StopDBClusterResponse)
-> Either String (Maybe DBCluster)
-> Either String (Int -> StopDBClusterResponse)
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 -> StopDBClusterResponse)
-> Either String Int -> Either String StopDBClusterResponse
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 StopDBCluster
instance Prelude.NFData StopDBCluster
instance Core.ToHeaders StopDBCluster where
toHeaders :: StopDBCluster -> ResponseHeaders
toHeaders = ResponseHeaders -> StopDBCluster -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath StopDBCluster where
toPath :: StopDBCluster -> ByteString
toPath = ByteString -> StopDBCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopDBCluster where
toQuery :: StopDBCluster -> QueryString
toQuery StopDBCluster' {Text
dbClusterIdentifier :: Text
$sel:dbClusterIdentifier:StopDBCluster' :: StopDBCluster -> 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
"StopDBCluster" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"DBClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbClusterIdentifier
]
data StopDBClusterResponse = StopDBClusterResponse'
{ StopDBClusterResponse -> Maybe DBCluster
dbCluster :: Prelude.Maybe DBCluster,
StopDBClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopDBClusterResponse -> StopDBClusterResponse -> Bool
(StopDBClusterResponse -> StopDBClusterResponse -> Bool)
-> (StopDBClusterResponse -> StopDBClusterResponse -> Bool)
-> Eq StopDBClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopDBClusterResponse -> StopDBClusterResponse -> Bool
$c/= :: StopDBClusterResponse -> StopDBClusterResponse -> Bool
== :: StopDBClusterResponse -> StopDBClusterResponse -> Bool
$c== :: StopDBClusterResponse -> StopDBClusterResponse -> Bool
Prelude.Eq, ReadPrec [StopDBClusterResponse]
ReadPrec StopDBClusterResponse
Int -> ReadS StopDBClusterResponse
ReadS [StopDBClusterResponse]
(Int -> ReadS StopDBClusterResponse)
-> ReadS [StopDBClusterResponse]
-> ReadPrec StopDBClusterResponse
-> ReadPrec [StopDBClusterResponse]
-> Read StopDBClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopDBClusterResponse]
$creadListPrec :: ReadPrec [StopDBClusterResponse]
readPrec :: ReadPrec StopDBClusterResponse
$creadPrec :: ReadPrec StopDBClusterResponse
readList :: ReadS [StopDBClusterResponse]
$creadList :: ReadS [StopDBClusterResponse]
readsPrec :: Int -> ReadS StopDBClusterResponse
$creadsPrec :: Int -> ReadS StopDBClusterResponse
Prelude.Read, Int -> StopDBClusterResponse -> ShowS
[StopDBClusterResponse] -> ShowS
StopDBClusterResponse -> String
(Int -> StopDBClusterResponse -> ShowS)
-> (StopDBClusterResponse -> String)
-> ([StopDBClusterResponse] -> ShowS)
-> Show StopDBClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopDBClusterResponse] -> ShowS
$cshowList :: [StopDBClusterResponse] -> ShowS
show :: StopDBClusterResponse -> String
$cshow :: StopDBClusterResponse -> String
showsPrec :: Int -> StopDBClusterResponse -> ShowS
$cshowsPrec :: Int -> StopDBClusterResponse -> ShowS
Prelude.Show, (forall x. StopDBClusterResponse -> Rep StopDBClusterResponse x)
-> (forall x. Rep StopDBClusterResponse x -> StopDBClusterResponse)
-> Generic StopDBClusterResponse
forall x. Rep StopDBClusterResponse x -> StopDBClusterResponse
forall x. StopDBClusterResponse -> Rep StopDBClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopDBClusterResponse x -> StopDBClusterResponse
$cfrom :: forall x. StopDBClusterResponse -> Rep StopDBClusterResponse x
Prelude.Generic)
newStopDBClusterResponse ::
Prelude.Int ->
StopDBClusterResponse
newStopDBClusterResponse :: Int -> StopDBClusterResponse
newStopDBClusterResponse Int
pHttpStatus_ =
StopDBClusterResponse' :: Maybe DBCluster -> Int -> StopDBClusterResponse
StopDBClusterResponse'
{ $sel:dbCluster:StopDBClusterResponse' :: Maybe DBCluster
dbCluster = Maybe DBCluster
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopDBClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopDBClusterResponse_dbCluster :: Lens.Lens' StopDBClusterResponse (Prelude.Maybe DBCluster)
stopDBClusterResponse_dbCluster :: (Maybe DBCluster -> f (Maybe DBCluster))
-> StopDBClusterResponse -> f StopDBClusterResponse
stopDBClusterResponse_dbCluster = (StopDBClusterResponse -> Maybe DBCluster)
-> (StopDBClusterResponse
-> Maybe DBCluster -> StopDBClusterResponse)
-> Lens
StopDBClusterResponse
StopDBClusterResponse
(Maybe DBCluster)
(Maybe DBCluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopDBClusterResponse' {Maybe DBCluster
dbCluster :: Maybe DBCluster
$sel:dbCluster:StopDBClusterResponse' :: StopDBClusterResponse -> Maybe DBCluster
dbCluster} -> Maybe DBCluster
dbCluster) (\s :: StopDBClusterResponse
s@StopDBClusterResponse' {} Maybe DBCluster
a -> StopDBClusterResponse
s {$sel:dbCluster:StopDBClusterResponse' :: Maybe DBCluster
dbCluster = Maybe DBCluster
a} :: StopDBClusterResponse)
stopDBClusterResponse_httpStatus :: Lens.Lens' StopDBClusterResponse Prelude.Int
stopDBClusterResponse_httpStatus :: (Int -> f Int) -> StopDBClusterResponse -> f StopDBClusterResponse
stopDBClusterResponse_httpStatus = (StopDBClusterResponse -> Int)
-> (StopDBClusterResponse -> Int -> StopDBClusterResponse)
-> Lens StopDBClusterResponse StopDBClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopDBClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopDBClusterResponse' :: StopDBClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopDBClusterResponse
s@StopDBClusterResponse' {} Int
a -> StopDBClusterResponse
s {$sel:httpStatus:StopDBClusterResponse' :: Int
httpStatus = Int
a} :: StopDBClusterResponse)
instance Prelude.NFData StopDBClusterResponse