{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Redshift.Types.RestoreStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
data RestoreStatus = RestoreStatus'
{
RestoreStatus -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
RestoreStatus -> Maybe Integer
estimatedTimeToCompletionInSeconds :: Prelude.Maybe Prelude.Integer,
RestoreStatus -> Maybe Double
currentRestoreRateInMegaBytesPerSecond :: Prelude.Maybe Prelude.Double,
RestoreStatus -> Maybe Integer
progressInMegaBytes :: Prelude.Maybe Prelude.Integer,
RestoreStatus -> Maybe Integer
elapsedTimeInSeconds :: Prelude.Maybe Prelude.Integer,
RestoreStatus -> Maybe Integer
snapshotSizeInMegaBytes :: Prelude.Maybe Prelude.Integer
}
deriving (RestoreStatus -> RestoreStatus -> Bool
(RestoreStatus -> RestoreStatus -> Bool)
-> (RestoreStatus -> RestoreStatus -> Bool) -> Eq RestoreStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreStatus -> RestoreStatus -> Bool
$c/= :: RestoreStatus -> RestoreStatus -> Bool
== :: RestoreStatus -> RestoreStatus -> Bool
$c== :: RestoreStatus -> RestoreStatus -> Bool
Prelude.Eq, ReadPrec [RestoreStatus]
ReadPrec RestoreStatus
Int -> ReadS RestoreStatus
ReadS [RestoreStatus]
(Int -> ReadS RestoreStatus)
-> ReadS [RestoreStatus]
-> ReadPrec RestoreStatus
-> ReadPrec [RestoreStatus]
-> Read RestoreStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreStatus]
$creadListPrec :: ReadPrec [RestoreStatus]
readPrec :: ReadPrec RestoreStatus
$creadPrec :: ReadPrec RestoreStatus
readList :: ReadS [RestoreStatus]
$creadList :: ReadS [RestoreStatus]
readsPrec :: Int -> ReadS RestoreStatus
$creadsPrec :: Int -> ReadS RestoreStatus
Prelude.Read, Int -> RestoreStatus -> ShowS
[RestoreStatus] -> ShowS
RestoreStatus -> String
(Int -> RestoreStatus -> ShowS)
-> (RestoreStatus -> String)
-> ([RestoreStatus] -> ShowS)
-> Show RestoreStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreStatus] -> ShowS
$cshowList :: [RestoreStatus] -> ShowS
show :: RestoreStatus -> String
$cshow :: RestoreStatus -> String
showsPrec :: Int -> RestoreStatus -> ShowS
$cshowsPrec :: Int -> RestoreStatus -> ShowS
Prelude.Show, (forall x. RestoreStatus -> Rep RestoreStatus x)
-> (forall x. Rep RestoreStatus x -> RestoreStatus)
-> Generic RestoreStatus
forall x. Rep RestoreStatus x -> RestoreStatus
forall x. RestoreStatus -> Rep RestoreStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RestoreStatus x -> RestoreStatus
$cfrom :: forall x. RestoreStatus -> Rep RestoreStatus x
Prelude.Generic)
newRestoreStatus ::
RestoreStatus
newRestoreStatus :: RestoreStatus
newRestoreStatus =
RestoreStatus' :: Maybe Text
-> Maybe Integer
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> RestoreStatus
RestoreStatus'
{ $sel:status:RestoreStatus' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:estimatedTimeToCompletionInSeconds:RestoreStatus' :: Maybe Integer
estimatedTimeToCompletionInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:currentRestoreRateInMegaBytesPerSecond:RestoreStatus' :: Maybe Double
currentRestoreRateInMegaBytesPerSecond =
Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:progressInMegaBytes:RestoreStatus' :: Maybe Integer
progressInMegaBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:elapsedTimeInSeconds:RestoreStatus' :: Maybe Integer
elapsedTimeInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotSizeInMegaBytes:RestoreStatus' :: Maybe Integer
snapshotSizeInMegaBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
restoreStatus_status :: Lens.Lens' RestoreStatus (Prelude.Maybe Prelude.Text)
restoreStatus_status :: (Maybe Text -> f (Maybe Text)) -> RestoreStatus -> f RestoreStatus
restoreStatus_status = (RestoreStatus -> Maybe Text)
-> (RestoreStatus -> Maybe Text -> RestoreStatus)
-> Lens RestoreStatus RestoreStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreStatus' {Maybe Text
status :: Maybe Text
$sel:status:RestoreStatus' :: RestoreStatus -> Maybe Text
status} -> Maybe Text
status) (\s :: RestoreStatus
s@RestoreStatus' {} Maybe Text
a -> RestoreStatus
s {$sel:status:RestoreStatus' :: Maybe Text
status = Maybe Text
a} :: RestoreStatus)
restoreStatus_estimatedTimeToCompletionInSeconds :: Lens.Lens' RestoreStatus (Prelude.Maybe Prelude.Integer)
restoreStatus_estimatedTimeToCompletionInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> RestoreStatus -> f RestoreStatus
restoreStatus_estimatedTimeToCompletionInSeconds = (RestoreStatus -> Maybe Integer)
-> (RestoreStatus -> Maybe Integer -> RestoreStatus)
-> Lens RestoreStatus RestoreStatus (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreStatus' {Maybe Integer
estimatedTimeToCompletionInSeconds :: Maybe Integer
$sel:estimatedTimeToCompletionInSeconds:RestoreStatus' :: RestoreStatus -> Maybe Integer
estimatedTimeToCompletionInSeconds} -> Maybe Integer
estimatedTimeToCompletionInSeconds) (\s :: RestoreStatus
s@RestoreStatus' {} Maybe Integer
a -> RestoreStatus
s {$sel:estimatedTimeToCompletionInSeconds:RestoreStatus' :: Maybe Integer
estimatedTimeToCompletionInSeconds = Maybe Integer
a} :: RestoreStatus)
restoreStatus_currentRestoreRateInMegaBytesPerSecond :: Lens.Lens' RestoreStatus (Prelude.Maybe Prelude.Double)
restoreStatus_currentRestoreRateInMegaBytesPerSecond :: (Maybe Double -> f (Maybe Double))
-> RestoreStatus -> f RestoreStatus
restoreStatus_currentRestoreRateInMegaBytesPerSecond = (RestoreStatus -> Maybe Double)
-> (RestoreStatus -> Maybe Double -> RestoreStatus)
-> Lens RestoreStatus RestoreStatus (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreStatus' {Maybe Double
currentRestoreRateInMegaBytesPerSecond :: Maybe Double
$sel:currentRestoreRateInMegaBytesPerSecond:RestoreStatus' :: RestoreStatus -> Maybe Double
currentRestoreRateInMegaBytesPerSecond} -> Maybe Double
currentRestoreRateInMegaBytesPerSecond) (\s :: RestoreStatus
s@RestoreStatus' {} Maybe Double
a -> RestoreStatus
s {$sel:currentRestoreRateInMegaBytesPerSecond:RestoreStatus' :: Maybe Double
currentRestoreRateInMegaBytesPerSecond = Maybe Double
a} :: RestoreStatus)
restoreStatus_progressInMegaBytes :: Lens.Lens' RestoreStatus (Prelude.Maybe Prelude.Integer)
restoreStatus_progressInMegaBytes :: (Maybe Integer -> f (Maybe Integer))
-> RestoreStatus -> f RestoreStatus
restoreStatus_progressInMegaBytes = (RestoreStatus -> Maybe Integer)
-> (RestoreStatus -> Maybe Integer -> RestoreStatus)
-> Lens RestoreStatus RestoreStatus (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreStatus' {Maybe Integer
progressInMegaBytes :: Maybe Integer
$sel:progressInMegaBytes:RestoreStatus' :: RestoreStatus -> Maybe Integer
progressInMegaBytes} -> Maybe Integer
progressInMegaBytes) (\s :: RestoreStatus
s@RestoreStatus' {} Maybe Integer
a -> RestoreStatus
s {$sel:progressInMegaBytes:RestoreStatus' :: Maybe Integer
progressInMegaBytes = Maybe Integer
a} :: RestoreStatus)
restoreStatus_elapsedTimeInSeconds :: Lens.Lens' RestoreStatus (Prelude.Maybe Prelude.Integer)
restoreStatus_elapsedTimeInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> RestoreStatus -> f RestoreStatus
restoreStatus_elapsedTimeInSeconds = (RestoreStatus -> Maybe Integer)
-> (RestoreStatus -> Maybe Integer -> RestoreStatus)
-> Lens RestoreStatus RestoreStatus (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreStatus' {Maybe Integer
elapsedTimeInSeconds :: Maybe Integer
$sel:elapsedTimeInSeconds:RestoreStatus' :: RestoreStatus -> Maybe Integer
elapsedTimeInSeconds} -> Maybe Integer
elapsedTimeInSeconds) (\s :: RestoreStatus
s@RestoreStatus' {} Maybe Integer
a -> RestoreStatus
s {$sel:elapsedTimeInSeconds:RestoreStatus' :: Maybe Integer
elapsedTimeInSeconds = Maybe Integer
a} :: RestoreStatus)
restoreStatus_snapshotSizeInMegaBytes :: Lens.Lens' RestoreStatus (Prelude.Maybe Prelude.Integer)
restoreStatus_snapshotSizeInMegaBytes :: (Maybe Integer -> f (Maybe Integer))
-> RestoreStatus -> f RestoreStatus
restoreStatus_snapshotSizeInMegaBytes = (RestoreStatus -> Maybe Integer)
-> (RestoreStatus -> Maybe Integer -> RestoreStatus)
-> Lens RestoreStatus RestoreStatus (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreStatus' {Maybe Integer
snapshotSizeInMegaBytes :: Maybe Integer
$sel:snapshotSizeInMegaBytes:RestoreStatus' :: RestoreStatus -> Maybe Integer
snapshotSizeInMegaBytes} -> Maybe Integer
snapshotSizeInMegaBytes) (\s :: RestoreStatus
s@RestoreStatus' {} Maybe Integer
a -> RestoreStatus
s {$sel:snapshotSizeInMegaBytes:RestoreStatus' :: Maybe Integer
snapshotSizeInMegaBytes = Maybe Integer
a} :: RestoreStatus)
instance Core.FromXML RestoreStatus where
parseXML :: [Node] -> Either String RestoreStatus
parseXML [Node]
x =
Maybe Text
-> Maybe Integer
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> RestoreStatus
RestoreStatus'
(Maybe Text
-> Maybe Integer
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> RestoreStatus)
-> Either String (Maybe Text)
-> Either
String
(Maybe Integer
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> RestoreStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
Either
String
(Maybe Integer
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> RestoreStatus)
-> Either String (Maybe Integer)
-> Either
String
(Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> RestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EstimatedTimeToCompletionInSeconds")
Either
String
(Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> RestoreStatus)
-> Either String (Maybe Double)
-> Either
String
(Maybe Integer -> Maybe Integer -> Maybe Integer -> RestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Double)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CurrentRestoreRateInMegaBytesPerSecond")
Either
String
(Maybe Integer -> Maybe Integer -> Maybe Integer -> RestoreStatus)
-> Either String (Maybe Integer)
-> Either String (Maybe Integer -> Maybe Integer -> RestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ProgressInMegaBytes")
Either String (Maybe Integer -> Maybe Integer -> RestoreStatus)
-> Either String (Maybe Integer)
-> Either String (Maybe Integer -> RestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ElapsedTimeInSeconds")
Either String (Maybe Integer -> RestoreStatus)
-> Either String (Maybe Integer) -> Either String RestoreStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SnapshotSizeInMegaBytes")
instance Prelude.Hashable RestoreStatus
instance Prelude.NFData RestoreStatus