{-# 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.BacktrackDBCluster
(
BacktrackDBCluster (..),
newBacktrackDBCluster,
backtrackDBCluster_force,
backtrackDBCluster_useEarliestTimeOnPointInTimeUnavailable,
backtrackDBCluster_dbClusterIdentifier,
backtrackDBCluster_backtrackTo,
DBClusterBacktrack (..),
newDBClusterBacktrack,
dbClusterBacktrack_status,
dbClusterBacktrack_backtrackIdentifier,
dbClusterBacktrack_backtrackTo,
dbClusterBacktrack_dbClusterIdentifier,
dbClusterBacktrack_backtrackedFrom,
dbClusterBacktrack_backtrackRequestCreationTime,
)
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 BacktrackDBCluster = BacktrackDBCluster'
{
BacktrackDBCluster -> Maybe Bool
force :: Prelude.Maybe Prelude.Bool,
BacktrackDBCluster -> Maybe Bool
useEarliestTimeOnPointInTimeUnavailable :: Prelude.Maybe Prelude.Bool,
BacktrackDBCluster -> Text
dbClusterIdentifier :: Prelude.Text,
BacktrackDBCluster -> ISO8601
backtrackTo :: Core.ISO8601
}
deriving (BacktrackDBCluster -> BacktrackDBCluster -> Bool
(BacktrackDBCluster -> BacktrackDBCluster -> Bool)
-> (BacktrackDBCluster -> BacktrackDBCluster -> Bool)
-> Eq BacktrackDBCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BacktrackDBCluster -> BacktrackDBCluster -> Bool
$c/= :: BacktrackDBCluster -> BacktrackDBCluster -> Bool
== :: BacktrackDBCluster -> BacktrackDBCluster -> Bool
$c== :: BacktrackDBCluster -> BacktrackDBCluster -> Bool
Prelude.Eq, ReadPrec [BacktrackDBCluster]
ReadPrec BacktrackDBCluster
Int -> ReadS BacktrackDBCluster
ReadS [BacktrackDBCluster]
(Int -> ReadS BacktrackDBCluster)
-> ReadS [BacktrackDBCluster]
-> ReadPrec BacktrackDBCluster
-> ReadPrec [BacktrackDBCluster]
-> Read BacktrackDBCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BacktrackDBCluster]
$creadListPrec :: ReadPrec [BacktrackDBCluster]
readPrec :: ReadPrec BacktrackDBCluster
$creadPrec :: ReadPrec BacktrackDBCluster
readList :: ReadS [BacktrackDBCluster]
$creadList :: ReadS [BacktrackDBCluster]
readsPrec :: Int -> ReadS BacktrackDBCluster
$creadsPrec :: Int -> ReadS BacktrackDBCluster
Prelude.Read, Int -> BacktrackDBCluster -> ShowS
[BacktrackDBCluster] -> ShowS
BacktrackDBCluster -> String
(Int -> BacktrackDBCluster -> ShowS)
-> (BacktrackDBCluster -> String)
-> ([BacktrackDBCluster] -> ShowS)
-> Show BacktrackDBCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BacktrackDBCluster] -> ShowS
$cshowList :: [BacktrackDBCluster] -> ShowS
show :: BacktrackDBCluster -> String
$cshow :: BacktrackDBCluster -> String
showsPrec :: Int -> BacktrackDBCluster -> ShowS
$cshowsPrec :: Int -> BacktrackDBCluster -> ShowS
Prelude.Show, (forall x. BacktrackDBCluster -> Rep BacktrackDBCluster x)
-> (forall x. Rep BacktrackDBCluster x -> BacktrackDBCluster)
-> Generic BacktrackDBCluster
forall x. Rep BacktrackDBCluster x -> BacktrackDBCluster
forall x. BacktrackDBCluster -> Rep BacktrackDBCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BacktrackDBCluster x -> BacktrackDBCluster
$cfrom :: forall x. BacktrackDBCluster -> Rep BacktrackDBCluster x
Prelude.Generic)
newBacktrackDBCluster ::
Prelude.Text ->
Prelude.UTCTime ->
BacktrackDBCluster
newBacktrackDBCluster :: Text -> UTCTime -> BacktrackDBCluster
newBacktrackDBCluster
Text
pDBClusterIdentifier_
UTCTime
pBacktrackTo_ =
BacktrackDBCluster' :: Maybe Bool -> Maybe Bool -> Text -> ISO8601 -> BacktrackDBCluster
BacktrackDBCluster'
{ $sel:force:BacktrackDBCluster' :: Maybe Bool
force = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:useEarliestTimeOnPointInTimeUnavailable:BacktrackDBCluster' :: Maybe Bool
useEarliestTimeOnPointInTimeUnavailable =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:dbClusterIdentifier:BacktrackDBCluster' :: Text
dbClusterIdentifier = Text
pDBClusterIdentifier_,
$sel:backtrackTo:BacktrackDBCluster' :: ISO8601
backtrackTo = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pBacktrackTo_
}
backtrackDBCluster_force :: Lens.Lens' BacktrackDBCluster (Prelude.Maybe Prelude.Bool)
backtrackDBCluster_force :: (Maybe Bool -> f (Maybe Bool))
-> BacktrackDBCluster -> f BacktrackDBCluster
backtrackDBCluster_force = (BacktrackDBCluster -> Maybe Bool)
-> (BacktrackDBCluster -> Maybe Bool -> BacktrackDBCluster)
-> Lens
BacktrackDBCluster BacktrackDBCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BacktrackDBCluster' {Maybe Bool
force :: Maybe Bool
$sel:force:BacktrackDBCluster' :: BacktrackDBCluster -> Maybe Bool
force} -> Maybe Bool
force) (\s :: BacktrackDBCluster
s@BacktrackDBCluster' {} Maybe Bool
a -> BacktrackDBCluster
s {$sel:force:BacktrackDBCluster' :: Maybe Bool
force = Maybe Bool
a} :: BacktrackDBCluster)
backtrackDBCluster_useEarliestTimeOnPointInTimeUnavailable :: Lens.Lens' BacktrackDBCluster (Prelude.Maybe Prelude.Bool)
backtrackDBCluster_useEarliestTimeOnPointInTimeUnavailable :: (Maybe Bool -> f (Maybe Bool))
-> BacktrackDBCluster -> f BacktrackDBCluster
backtrackDBCluster_useEarliestTimeOnPointInTimeUnavailable = (BacktrackDBCluster -> Maybe Bool)
-> (BacktrackDBCluster -> Maybe Bool -> BacktrackDBCluster)
-> Lens
BacktrackDBCluster BacktrackDBCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BacktrackDBCluster' {Maybe Bool
useEarliestTimeOnPointInTimeUnavailable :: Maybe Bool
$sel:useEarliestTimeOnPointInTimeUnavailable:BacktrackDBCluster' :: BacktrackDBCluster -> Maybe Bool
useEarliestTimeOnPointInTimeUnavailable} -> Maybe Bool
useEarliestTimeOnPointInTimeUnavailable) (\s :: BacktrackDBCluster
s@BacktrackDBCluster' {} Maybe Bool
a -> BacktrackDBCluster
s {$sel:useEarliestTimeOnPointInTimeUnavailable:BacktrackDBCluster' :: Maybe Bool
useEarliestTimeOnPointInTimeUnavailable = Maybe Bool
a} :: BacktrackDBCluster)
backtrackDBCluster_dbClusterIdentifier :: Lens.Lens' BacktrackDBCluster Prelude.Text
backtrackDBCluster_dbClusterIdentifier :: (Text -> f Text) -> BacktrackDBCluster -> f BacktrackDBCluster
backtrackDBCluster_dbClusterIdentifier = (BacktrackDBCluster -> Text)
-> (BacktrackDBCluster -> Text -> BacktrackDBCluster)
-> Lens BacktrackDBCluster BacktrackDBCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BacktrackDBCluster' {Text
dbClusterIdentifier :: Text
$sel:dbClusterIdentifier:BacktrackDBCluster' :: BacktrackDBCluster -> Text
dbClusterIdentifier} -> Text
dbClusterIdentifier) (\s :: BacktrackDBCluster
s@BacktrackDBCluster' {} Text
a -> BacktrackDBCluster
s {$sel:dbClusterIdentifier:BacktrackDBCluster' :: Text
dbClusterIdentifier = Text
a} :: BacktrackDBCluster)
backtrackDBCluster_backtrackTo :: Lens.Lens' BacktrackDBCluster Prelude.UTCTime
backtrackDBCluster_backtrackTo :: (UTCTime -> f UTCTime)
-> BacktrackDBCluster -> f BacktrackDBCluster
backtrackDBCluster_backtrackTo = (BacktrackDBCluster -> ISO8601)
-> (BacktrackDBCluster -> ISO8601 -> BacktrackDBCluster)
-> Lens BacktrackDBCluster BacktrackDBCluster ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BacktrackDBCluster' {ISO8601
backtrackTo :: ISO8601
$sel:backtrackTo:BacktrackDBCluster' :: BacktrackDBCluster -> ISO8601
backtrackTo} -> ISO8601
backtrackTo) (\s :: BacktrackDBCluster
s@BacktrackDBCluster' {} ISO8601
a -> BacktrackDBCluster
s {$sel:backtrackTo:BacktrackDBCluster' :: ISO8601
backtrackTo = ISO8601
a} :: BacktrackDBCluster) ((ISO8601 -> f ISO8601)
-> BacktrackDBCluster -> f BacktrackDBCluster)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> BacktrackDBCluster
-> f BacktrackDBCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.AWSRequest BacktrackDBCluster where
type
AWSResponse BacktrackDBCluster =
DBClusterBacktrack
request :: BacktrackDBCluster -> Request BacktrackDBCluster
request = Service -> BacktrackDBCluster -> Request BacktrackDBCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy BacktrackDBCluster
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BacktrackDBCluster)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse BacktrackDBCluster))
-> Logger
-> Service
-> Proxy BacktrackDBCluster
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BacktrackDBCluster)))
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
"BacktrackDBClusterResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String DBClusterBacktrack
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable BacktrackDBCluster
instance Prelude.NFData BacktrackDBCluster
instance Core.ToHeaders BacktrackDBCluster where
toHeaders :: BacktrackDBCluster -> ResponseHeaders
toHeaders = ResponseHeaders -> BacktrackDBCluster -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath BacktrackDBCluster where
toPath :: BacktrackDBCluster -> ByteString
toPath = ByteString -> BacktrackDBCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery BacktrackDBCluster where
toQuery :: BacktrackDBCluster -> QueryString
toQuery BacktrackDBCluster' {Maybe Bool
Text
ISO8601
backtrackTo :: ISO8601
dbClusterIdentifier :: Text
useEarliestTimeOnPointInTimeUnavailable :: Maybe Bool
force :: Maybe Bool
$sel:backtrackTo:BacktrackDBCluster' :: BacktrackDBCluster -> ISO8601
$sel:dbClusterIdentifier:BacktrackDBCluster' :: BacktrackDBCluster -> Text
$sel:useEarliestTimeOnPointInTimeUnavailable:BacktrackDBCluster' :: BacktrackDBCluster -> Maybe Bool
$sel:force:BacktrackDBCluster' :: BacktrackDBCluster -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"BacktrackDBCluster" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"Force" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
force,
ByteString
"UseEarliestTimeOnPointInTimeUnavailable"
ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
useEarliestTimeOnPointInTimeUnavailable,
ByteString
"DBClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbClusterIdentifier,
ByteString
"BacktrackTo" ByteString -> ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ISO8601
backtrackTo
]