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