{-# 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.StartDBInstance
(
StartDBInstance (..),
newStartDBInstance,
startDBInstance_dbInstanceIdentifier,
StartDBInstanceResponse (..),
newStartDBInstanceResponse,
startDBInstanceResponse_dbInstance,
startDBInstanceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartDBInstance = StartDBInstance'
{
StartDBInstance -> Text
dbInstanceIdentifier :: Prelude.Text
}
deriving (StartDBInstance -> StartDBInstance -> Bool
(StartDBInstance -> StartDBInstance -> Bool)
-> (StartDBInstance -> StartDBInstance -> Bool)
-> Eq StartDBInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartDBInstance -> StartDBInstance -> Bool
$c/= :: StartDBInstance -> StartDBInstance -> Bool
== :: StartDBInstance -> StartDBInstance -> Bool
$c== :: StartDBInstance -> StartDBInstance -> Bool
Prelude.Eq, ReadPrec [StartDBInstance]
ReadPrec StartDBInstance
Int -> ReadS StartDBInstance
ReadS [StartDBInstance]
(Int -> ReadS StartDBInstance)
-> ReadS [StartDBInstance]
-> ReadPrec StartDBInstance
-> ReadPrec [StartDBInstance]
-> Read StartDBInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartDBInstance]
$creadListPrec :: ReadPrec [StartDBInstance]
readPrec :: ReadPrec StartDBInstance
$creadPrec :: ReadPrec StartDBInstance
readList :: ReadS [StartDBInstance]
$creadList :: ReadS [StartDBInstance]
readsPrec :: Int -> ReadS StartDBInstance
$creadsPrec :: Int -> ReadS StartDBInstance
Prelude.Read, Int -> StartDBInstance -> ShowS
[StartDBInstance] -> ShowS
StartDBInstance -> String
(Int -> StartDBInstance -> ShowS)
-> (StartDBInstance -> String)
-> ([StartDBInstance] -> ShowS)
-> Show StartDBInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartDBInstance] -> ShowS
$cshowList :: [StartDBInstance] -> ShowS
show :: StartDBInstance -> String
$cshow :: StartDBInstance -> String
showsPrec :: Int -> StartDBInstance -> ShowS
$cshowsPrec :: Int -> StartDBInstance -> ShowS
Prelude.Show, (forall x. StartDBInstance -> Rep StartDBInstance x)
-> (forall x. Rep StartDBInstance x -> StartDBInstance)
-> Generic StartDBInstance
forall x. Rep StartDBInstance x -> StartDBInstance
forall x. StartDBInstance -> Rep StartDBInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartDBInstance x -> StartDBInstance
$cfrom :: forall x. StartDBInstance -> Rep StartDBInstance x
Prelude.Generic)
newStartDBInstance ::
Prelude.Text ->
StartDBInstance
newStartDBInstance :: Text -> StartDBInstance
newStartDBInstance Text
pDBInstanceIdentifier_ =
StartDBInstance' :: Text -> StartDBInstance
StartDBInstance'
{ $sel:dbInstanceIdentifier:StartDBInstance' :: Text
dbInstanceIdentifier =
Text
pDBInstanceIdentifier_
}
startDBInstance_dbInstanceIdentifier :: Lens.Lens' StartDBInstance Prelude.Text
startDBInstance_dbInstanceIdentifier :: (Text -> f Text) -> StartDBInstance -> f StartDBInstance
startDBInstance_dbInstanceIdentifier = (StartDBInstance -> Text)
-> (StartDBInstance -> Text -> StartDBInstance)
-> Lens StartDBInstance StartDBInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstance' {Text
dbInstanceIdentifier :: Text
$sel:dbInstanceIdentifier:StartDBInstance' :: StartDBInstance -> Text
dbInstanceIdentifier} -> Text
dbInstanceIdentifier) (\s :: StartDBInstance
s@StartDBInstance' {} Text
a -> StartDBInstance
s {$sel:dbInstanceIdentifier:StartDBInstance' :: Text
dbInstanceIdentifier = Text
a} :: StartDBInstance)
instance Core.AWSRequest StartDBInstance where
type
AWSResponse StartDBInstance =
StartDBInstanceResponse
request :: StartDBInstance -> Request StartDBInstance
request = Service -> StartDBInstance -> Request StartDBInstance
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy StartDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartDBInstance)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse StartDBInstance))
-> Logger
-> Service
-> Proxy StartDBInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartDBInstance)))
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
"StartDBInstanceResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBInstance -> Int -> StartDBInstanceResponse
StartDBInstanceResponse'
(Maybe DBInstance -> Int -> StartDBInstanceResponse)
-> Either String (Maybe DBInstance)
-> Either String (Int -> StartDBInstanceResponse)
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 -> StartDBInstanceResponse)
-> Either String Int -> Either String StartDBInstanceResponse
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 StartDBInstance
instance Prelude.NFData StartDBInstance
instance Core.ToHeaders StartDBInstance where
toHeaders :: StartDBInstance -> ResponseHeaders
toHeaders = ResponseHeaders -> StartDBInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath StartDBInstance where
toPath :: StartDBInstance -> ByteString
toPath = ByteString -> StartDBInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartDBInstance where
toQuery :: StartDBInstance -> QueryString
toQuery StartDBInstance' {Text
dbInstanceIdentifier :: Text
$sel:dbInstanceIdentifier:StartDBInstance' :: StartDBInstance -> 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
"StartDBInstance" :: 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 StartDBInstanceResponse = StartDBInstanceResponse'
{ StartDBInstanceResponse -> Maybe DBInstance
dbInstance :: Prelude.Maybe DBInstance,
StartDBInstanceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartDBInstanceResponse -> StartDBInstanceResponse -> Bool
(StartDBInstanceResponse -> StartDBInstanceResponse -> Bool)
-> (StartDBInstanceResponse -> StartDBInstanceResponse -> Bool)
-> Eq StartDBInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartDBInstanceResponse -> StartDBInstanceResponse -> Bool
$c/= :: StartDBInstanceResponse -> StartDBInstanceResponse -> Bool
== :: StartDBInstanceResponse -> StartDBInstanceResponse -> Bool
$c== :: StartDBInstanceResponse -> StartDBInstanceResponse -> Bool
Prelude.Eq, ReadPrec [StartDBInstanceResponse]
ReadPrec StartDBInstanceResponse
Int -> ReadS StartDBInstanceResponse
ReadS [StartDBInstanceResponse]
(Int -> ReadS StartDBInstanceResponse)
-> ReadS [StartDBInstanceResponse]
-> ReadPrec StartDBInstanceResponse
-> ReadPrec [StartDBInstanceResponse]
-> Read StartDBInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartDBInstanceResponse]
$creadListPrec :: ReadPrec [StartDBInstanceResponse]
readPrec :: ReadPrec StartDBInstanceResponse
$creadPrec :: ReadPrec StartDBInstanceResponse
readList :: ReadS [StartDBInstanceResponse]
$creadList :: ReadS [StartDBInstanceResponse]
readsPrec :: Int -> ReadS StartDBInstanceResponse
$creadsPrec :: Int -> ReadS StartDBInstanceResponse
Prelude.Read, Int -> StartDBInstanceResponse -> ShowS
[StartDBInstanceResponse] -> ShowS
StartDBInstanceResponse -> String
(Int -> StartDBInstanceResponse -> ShowS)
-> (StartDBInstanceResponse -> String)
-> ([StartDBInstanceResponse] -> ShowS)
-> Show StartDBInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartDBInstanceResponse] -> ShowS
$cshowList :: [StartDBInstanceResponse] -> ShowS
show :: StartDBInstanceResponse -> String
$cshow :: StartDBInstanceResponse -> String
showsPrec :: Int -> StartDBInstanceResponse -> ShowS
$cshowsPrec :: Int -> StartDBInstanceResponse -> ShowS
Prelude.Show, (forall x.
StartDBInstanceResponse -> Rep StartDBInstanceResponse x)
-> (forall x.
Rep StartDBInstanceResponse x -> StartDBInstanceResponse)
-> Generic StartDBInstanceResponse
forall x. Rep StartDBInstanceResponse x -> StartDBInstanceResponse
forall x. StartDBInstanceResponse -> Rep StartDBInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartDBInstanceResponse x -> StartDBInstanceResponse
$cfrom :: forall x. StartDBInstanceResponse -> Rep StartDBInstanceResponse x
Prelude.Generic)
newStartDBInstanceResponse ::
Prelude.Int ->
StartDBInstanceResponse
newStartDBInstanceResponse :: Int -> StartDBInstanceResponse
newStartDBInstanceResponse Int
pHttpStatus_ =
StartDBInstanceResponse' :: Maybe DBInstance -> Int -> StartDBInstanceResponse
StartDBInstanceResponse'
{ $sel:dbInstance:StartDBInstanceResponse' :: Maybe DBInstance
dbInstance =
Maybe DBInstance
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartDBInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startDBInstanceResponse_dbInstance :: Lens.Lens' StartDBInstanceResponse (Prelude.Maybe DBInstance)
startDBInstanceResponse_dbInstance :: (Maybe DBInstance -> f (Maybe DBInstance))
-> StartDBInstanceResponse -> f StartDBInstanceResponse
startDBInstanceResponse_dbInstance = (StartDBInstanceResponse -> Maybe DBInstance)
-> (StartDBInstanceResponse
-> Maybe DBInstance -> StartDBInstanceResponse)
-> Lens
StartDBInstanceResponse
StartDBInstanceResponse
(Maybe DBInstance)
(Maybe DBInstance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceResponse' {Maybe DBInstance
dbInstance :: Maybe DBInstance
$sel:dbInstance:StartDBInstanceResponse' :: StartDBInstanceResponse -> Maybe DBInstance
dbInstance} -> Maybe DBInstance
dbInstance) (\s :: StartDBInstanceResponse
s@StartDBInstanceResponse' {} Maybe DBInstance
a -> StartDBInstanceResponse
s {$sel:dbInstance:StartDBInstanceResponse' :: Maybe DBInstance
dbInstance = Maybe DBInstance
a} :: StartDBInstanceResponse)
startDBInstanceResponse_httpStatus :: Lens.Lens' StartDBInstanceResponse Prelude.Int
startDBInstanceResponse_httpStatus :: (Int -> f Int)
-> StartDBInstanceResponse -> f StartDBInstanceResponse
startDBInstanceResponse_httpStatus = (StartDBInstanceResponse -> Int)
-> (StartDBInstanceResponse -> Int -> StartDBInstanceResponse)
-> Lens StartDBInstanceResponse StartDBInstanceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartDBInstanceResponse' :: StartDBInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartDBInstanceResponse
s@StartDBInstanceResponse' {} Int
a -> StartDBInstanceResponse
s {$sel:httpStatus:StartDBInstanceResponse' :: Int
httpStatus = Int
a} :: StartDBInstanceResponse)
instance Prelude.NFData StartDBInstanceResponse