{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SecurityHub.Types.AwsRedshiftClusterRestoreStatus
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsRedshiftClusterRestoreStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the status of a cluster restore action. It only
-- applies if the cluster was created by restoring a snapshot.
--
-- /See:/ 'newAwsRedshiftClusterRestoreStatus' smart constructor.
data AwsRedshiftClusterRestoreStatus = AwsRedshiftClusterRestoreStatus'
  { -- | The status of the restore action.
    --
    -- Valid values: @starting@ | @restoring@ | @completed@ | @failed@
    AwsRedshiftClusterRestoreStatus -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The estimate of the time remaining before the restore is complete.
    -- Returns 0 for a completed restore.
    --
    -- This field is only updated when you restore to DC2 and DS2 node types.
    AwsRedshiftClusterRestoreStatus -> Maybe Integer
estimatedTimeToCompletionInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The number of megabytes per second being transferred from the backup
    -- storage. Returns the average rate for a completed backup.
    --
    -- This field is only updated when you restore to DC2 and DS2 node types.
    AwsRedshiftClusterRestoreStatus -> Maybe Double
currentRestoreRateInMegaBytesPerSecond :: Prelude.Maybe Prelude.Double,
    -- | The number of megabytes that were transferred from snapshot storage.
    --
    -- This field is only updated when you restore to DC2 and DS2 node types.
    AwsRedshiftClusterRestoreStatus -> Maybe Integer
progressInMegaBytes :: Prelude.Maybe Prelude.Integer,
    -- | The amount of time an in-progress restore has been running, or the
    -- amount of time it took a completed restore to finish.
    --
    -- This field is only updated when you restore to DC2 and DS2 node types.
    AwsRedshiftClusterRestoreStatus -> Maybe Integer
elapsedTimeInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The size of the set of snapshot data that was used to restore the
    -- cluster.
    --
    -- This field is only updated when you restore to DC2 and DS2 node types.
    AwsRedshiftClusterRestoreStatus -> Maybe Integer
snapshotSizeInMegaBytes :: Prelude.Maybe Prelude.Integer
  }
  deriving (AwsRedshiftClusterRestoreStatus
-> AwsRedshiftClusterRestoreStatus -> Bool
(AwsRedshiftClusterRestoreStatus
 -> AwsRedshiftClusterRestoreStatus -> Bool)
-> (AwsRedshiftClusterRestoreStatus
    -> AwsRedshiftClusterRestoreStatus -> Bool)
-> Eq AwsRedshiftClusterRestoreStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRedshiftClusterRestoreStatus
-> AwsRedshiftClusterRestoreStatus -> Bool
$c/= :: AwsRedshiftClusterRestoreStatus
-> AwsRedshiftClusterRestoreStatus -> Bool
== :: AwsRedshiftClusterRestoreStatus
-> AwsRedshiftClusterRestoreStatus -> Bool
$c== :: AwsRedshiftClusterRestoreStatus
-> AwsRedshiftClusterRestoreStatus -> Bool
Prelude.Eq, ReadPrec [AwsRedshiftClusterRestoreStatus]
ReadPrec AwsRedshiftClusterRestoreStatus
Int -> ReadS AwsRedshiftClusterRestoreStatus
ReadS [AwsRedshiftClusterRestoreStatus]
(Int -> ReadS AwsRedshiftClusterRestoreStatus)
-> ReadS [AwsRedshiftClusterRestoreStatus]
-> ReadPrec AwsRedshiftClusterRestoreStatus
-> ReadPrec [AwsRedshiftClusterRestoreStatus]
-> Read AwsRedshiftClusterRestoreStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRedshiftClusterRestoreStatus]
$creadListPrec :: ReadPrec [AwsRedshiftClusterRestoreStatus]
readPrec :: ReadPrec AwsRedshiftClusterRestoreStatus
$creadPrec :: ReadPrec AwsRedshiftClusterRestoreStatus
readList :: ReadS [AwsRedshiftClusterRestoreStatus]
$creadList :: ReadS [AwsRedshiftClusterRestoreStatus]
readsPrec :: Int -> ReadS AwsRedshiftClusterRestoreStatus
$creadsPrec :: Int -> ReadS AwsRedshiftClusterRestoreStatus
Prelude.Read, Int -> AwsRedshiftClusterRestoreStatus -> ShowS
[AwsRedshiftClusterRestoreStatus] -> ShowS
AwsRedshiftClusterRestoreStatus -> String
(Int -> AwsRedshiftClusterRestoreStatus -> ShowS)
-> (AwsRedshiftClusterRestoreStatus -> String)
-> ([AwsRedshiftClusterRestoreStatus] -> ShowS)
-> Show AwsRedshiftClusterRestoreStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRedshiftClusterRestoreStatus] -> ShowS
$cshowList :: [AwsRedshiftClusterRestoreStatus] -> ShowS
show :: AwsRedshiftClusterRestoreStatus -> String
$cshow :: AwsRedshiftClusterRestoreStatus -> String
showsPrec :: Int -> AwsRedshiftClusterRestoreStatus -> ShowS
$cshowsPrec :: Int -> AwsRedshiftClusterRestoreStatus -> ShowS
Prelude.Show, (forall x.
 AwsRedshiftClusterRestoreStatus
 -> Rep AwsRedshiftClusterRestoreStatus x)
-> (forall x.
    Rep AwsRedshiftClusterRestoreStatus x
    -> AwsRedshiftClusterRestoreStatus)
-> Generic AwsRedshiftClusterRestoreStatus
forall x.
Rep AwsRedshiftClusterRestoreStatus x
-> AwsRedshiftClusterRestoreStatus
forall x.
AwsRedshiftClusterRestoreStatus
-> Rep AwsRedshiftClusterRestoreStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRedshiftClusterRestoreStatus x
-> AwsRedshiftClusterRestoreStatus
$cfrom :: forall x.
AwsRedshiftClusterRestoreStatus
-> Rep AwsRedshiftClusterRestoreStatus x
Prelude.Generic)

-- |
-- Create a value of 'AwsRedshiftClusterRestoreStatus' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'awsRedshiftClusterRestoreStatus_status' - The status of the restore action.
--
-- Valid values: @starting@ | @restoring@ | @completed@ | @failed@
--
-- 'estimatedTimeToCompletionInSeconds', 'awsRedshiftClusterRestoreStatus_estimatedTimeToCompletionInSeconds' - The estimate of the time remaining before the restore is complete.
-- Returns 0 for a completed restore.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
--
-- 'currentRestoreRateInMegaBytesPerSecond', 'awsRedshiftClusterRestoreStatus_currentRestoreRateInMegaBytesPerSecond' - The number of megabytes per second being transferred from the backup
-- storage. Returns the average rate for a completed backup.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
--
-- 'progressInMegaBytes', 'awsRedshiftClusterRestoreStatus_progressInMegaBytes' - The number of megabytes that were transferred from snapshot storage.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
--
-- 'elapsedTimeInSeconds', 'awsRedshiftClusterRestoreStatus_elapsedTimeInSeconds' - The amount of time an in-progress restore has been running, or the
-- amount of time it took a completed restore to finish.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
--
-- 'snapshotSizeInMegaBytes', 'awsRedshiftClusterRestoreStatus_snapshotSizeInMegaBytes' - The size of the set of snapshot data that was used to restore the
-- cluster.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
newAwsRedshiftClusterRestoreStatus ::
  AwsRedshiftClusterRestoreStatus
newAwsRedshiftClusterRestoreStatus :: AwsRedshiftClusterRestoreStatus
newAwsRedshiftClusterRestoreStatus =
  AwsRedshiftClusterRestoreStatus' :: Maybe Text
-> Maybe Integer
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> AwsRedshiftClusterRestoreStatus
AwsRedshiftClusterRestoreStatus'
    { $sel:status:AwsRedshiftClusterRestoreStatus' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:estimatedTimeToCompletionInSeconds:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
estimatedTimeToCompletionInSeconds =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:currentRestoreRateInMegaBytesPerSecond:AwsRedshiftClusterRestoreStatus' :: Maybe Double
currentRestoreRateInMegaBytesPerSecond =
        Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:progressInMegaBytes:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
progressInMegaBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:elapsedTimeInSeconds:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
elapsedTimeInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotSizeInMegaBytes:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
snapshotSizeInMegaBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the restore action.
--
-- Valid values: @starting@ | @restoring@ | @completed@ | @failed@
awsRedshiftClusterRestoreStatus_status :: Lens.Lens' AwsRedshiftClusterRestoreStatus (Prelude.Maybe Prelude.Text)
awsRedshiftClusterRestoreStatus_status :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterRestoreStatus
-> f AwsRedshiftClusterRestoreStatus
awsRedshiftClusterRestoreStatus_status = (AwsRedshiftClusterRestoreStatus -> Maybe Text)
-> (AwsRedshiftClusterRestoreStatus
    -> Maybe Text -> AwsRedshiftClusterRestoreStatus)
-> Lens
     AwsRedshiftClusterRestoreStatus
     AwsRedshiftClusterRestoreStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterRestoreStatus' {Maybe Text
status :: Maybe Text
$sel:status:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsRedshiftClusterRestoreStatus
s@AwsRedshiftClusterRestoreStatus' {} Maybe Text
a -> AwsRedshiftClusterRestoreStatus
s {$sel:status:AwsRedshiftClusterRestoreStatus' :: Maybe Text
status = Maybe Text
a} :: AwsRedshiftClusterRestoreStatus)

-- | The estimate of the time remaining before the restore is complete.
-- Returns 0 for a completed restore.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
awsRedshiftClusterRestoreStatus_estimatedTimeToCompletionInSeconds :: Lens.Lens' AwsRedshiftClusterRestoreStatus (Prelude.Maybe Prelude.Integer)
awsRedshiftClusterRestoreStatus_estimatedTimeToCompletionInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> AwsRedshiftClusterRestoreStatus
-> f AwsRedshiftClusterRestoreStatus
awsRedshiftClusterRestoreStatus_estimatedTimeToCompletionInSeconds = (AwsRedshiftClusterRestoreStatus -> Maybe Integer)
-> (AwsRedshiftClusterRestoreStatus
    -> Maybe Integer -> AwsRedshiftClusterRestoreStatus)
-> Lens
     AwsRedshiftClusterRestoreStatus
     AwsRedshiftClusterRestoreStatus
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterRestoreStatus' {Maybe Integer
estimatedTimeToCompletionInSeconds :: Maybe Integer
$sel:estimatedTimeToCompletionInSeconds:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
estimatedTimeToCompletionInSeconds} -> Maybe Integer
estimatedTimeToCompletionInSeconds) (\s :: AwsRedshiftClusterRestoreStatus
s@AwsRedshiftClusterRestoreStatus' {} Maybe Integer
a -> AwsRedshiftClusterRestoreStatus
s {$sel:estimatedTimeToCompletionInSeconds:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
estimatedTimeToCompletionInSeconds = Maybe Integer
a} :: AwsRedshiftClusterRestoreStatus)

-- | The number of megabytes per second being transferred from the backup
-- storage. Returns the average rate for a completed backup.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
awsRedshiftClusterRestoreStatus_currentRestoreRateInMegaBytesPerSecond :: Lens.Lens' AwsRedshiftClusterRestoreStatus (Prelude.Maybe Prelude.Double)
awsRedshiftClusterRestoreStatus_currentRestoreRateInMegaBytesPerSecond :: (Maybe Double -> f (Maybe Double))
-> AwsRedshiftClusterRestoreStatus
-> f AwsRedshiftClusterRestoreStatus
awsRedshiftClusterRestoreStatus_currentRestoreRateInMegaBytesPerSecond = (AwsRedshiftClusterRestoreStatus -> Maybe Double)
-> (AwsRedshiftClusterRestoreStatus
    -> Maybe Double -> AwsRedshiftClusterRestoreStatus)
-> Lens
     AwsRedshiftClusterRestoreStatus
     AwsRedshiftClusterRestoreStatus
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterRestoreStatus' {Maybe Double
currentRestoreRateInMegaBytesPerSecond :: Maybe Double
$sel:currentRestoreRateInMegaBytesPerSecond:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Double
currentRestoreRateInMegaBytesPerSecond} -> Maybe Double
currentRestoreRateInMegaBytesPerSecond) (\s :: AwsRedshiftClusterRestoreStatus
s@AwsRedshiftClusterRestoreStatus' {} Maybe Double
a -> AwsRedshiftClusterRestoreStatus
s {$sel:currentRestoreRateInMegaBytesPerSecond:AwsRedshiftClusterRestoreStatus' :: Maybe Double
currentRestoreRateInMegaBytesPerSecond = Maybe Double
a} :: AwsRedshiftClusterRestoreStatus)

-- | The number of megabytes that were transferred from snapshot storage.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
awsRedshiftClusterRestoreStatus_progressInMegaBytes :: Lens.Lens' AwsRedshiftClusterRestoreStatus (Prelude.Maybe Prelude.Integer)
awsRedshiftClusterRestoreStatus_progressInMegaBytes :: (Maybe Integer -> f (Maybe Integer))
-> AwsRedshiftClusterRestoreStatus
-> f AwsRedshiftClusterRestoreStatus
awsRedshiftClusterRestoreStatus_progressInMegaBytes = (AwsRedshiftClusterRestoreStatus -> Maybe Integer)
-> (AwsRedshiftClusterRestoreStatus
    -> Maybe Integer -> AwsRedshiftClusterRestoreStatus)
-> Lens
     AwsRedshiftClusterRestoreStatus
     AwsRedshiftClusterRestoreStatus
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterRestoreStatus' {Maybe Integer
progressInMegaBytes :: Maybe Integer
$sel:progressInMegaBytes:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
progressInMegaBytes} -> Maybe Integer
progressInMegaBytes) (\s :: AwsRedshiftClusterRestoreStatus
s@AwsRedshiftClusterRestoreStatus' {} Maybe Integer
a -> AwsRedshiftClusterRestoreStatus
s {$sel:progressInMegaBytes:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
progressInMegaBytes = Maybe Integer
a} :: AwsRedshiftClusterRestoreStatus)

-- | The amount of time an in-progress restore has been running, or the
-- amount of time it took a completed restore to finish.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
awsRedshiftClusterRestoreStatus_elapsedTimeInSeconds :: Lens.Lens' AwsRedshiftClusterRestoreStatus (Prelude.Maybe Prelude.Integer)
awsRedshiftClusterRestoreStatus_elapsedTimeInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> AwsRedshiftClusterRestoreStatus
-> f AwsRedshiftClusterRestoreStatus
awsRedshiftClusterRestoreStatus_elapsedTimeInSeconds = (AwsRedshiftClusterRestoreStatus -> Maybe Integer)
-> (AwsRedshiftClusterRestoreStatus
    -> Maybe Integer -> AwsRedshiftClusterRestoreStatus)
-> Lens
     AwsRedshiftClusterRestoreStatus
     AwsRedshiftClusterRestoreStatus
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterRestoreStatus' {Maybe Integer
elapsedTimeInSeconds :: Maybe Integer
$sel:elapsedTimeInSeconds:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
elapsedTimeInSeconds} -> Maybe Integer
elapsedTimeInSeconds) (\s :: AwsRedshiftClusterRestoreStatus
s@AwsRedshiftClusterRestoreStatus' {} Maybe Integer
a -> AwsRedshiftClusterRestoreStatus
s {$sel:elapsedTimeInSeconds:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
elapsedTimeInSeconds = Maybe Integer
a} :: AwsRedshiftClusterRestoreStatus)

-- | The size of the set of snapshot data that was used to restore the
-- cluster.
--
-- This field is only updated when you restore to DC2 and DS2 node types.
awsRedshiftClusterRestoreStatus_snapshotSizeInMegaBytes :: Lens.Lens' AwsRedshiftClusterRestoreStatus (Prelude.Maybe Prelude.Integer)
awsRedshiftClusterRestoreStatus_snapshotSizeInMegaBytes :: (Maybe Integer -> f (Maybe Integer))
-> AwsRedshiftClusterRestoreStatus
-> f AwsRedshiftClusterRestoreStatus
awsRedshiftClusterRestoreStatus_snapshotSizeInMegaBytes = (AwsRedshiftClusterRestoreStatus -> Maybe Integer)
-> (AwsRedshiftClusterRestoreStatus
    -> Maybe Integer -> AwsRedshiftClusterRestoreStatus)
-> Lens
     AwsRedshiftClusterRestoreStatus
     AwsRedshiftClusterRestoreStatus
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterRestoreStatus' {Maybe Integer
snapshotSizeInMegaBytes :: Maybe Integer
$sel:snapshotSizeInMegaBytes:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
snapshotSizeInMegaBytes} -> Maybe Integer
snapshotSizeInMegaBytes) (\s :: AwsRedshiftClusterRestoreStatus
s@AwsRedshiftClusterRestoreStatus' {} Maybe Integer
a -> AwsRedshiftClusterRestoreStatus
s {$sel:snapshotSizeInMegaBytes:AwsRedshiftClusterRestoreStatus' :: Maybe Integer
snapshotSizeInMegaBytes = Maybe Integer
a} :: AwsRedshiftClusterRestoreStatus)

instance
  Core.FromJSON
    AwsRedshiftClusterRestoreStatus
  where
  parseJSON :: Value -> Parser AwsRedshiftClusterRestoreStatus
parseJSON =
    String
-> (Object -> Parser AwsRedshiftClusterRestoreStatus)
-> Value
-> Parser AwsRedshiftClusterRestoreStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRedshiftClusterRestoreStatus"
      ( \Object
x ->
          Maybe Text
-> Maybe Integer
-> Maybe Double
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> AwsRedshiftClusterRestoreStatus
AwsRedshiftClusterRestoreStatus'
            (Maybe Text
 -> Maybe Integer
 -> Maybe Double
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe Integer
 -> AwsRedshiftClusterRestoreStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe Integer
      -> AwsRedshiftClusterRestoreStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Integer
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe Integer
   -> AwsRedshiftClusterRestoreStatus)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Double
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe Integer
      -> AwsRedshiftClusterRestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EstimatedTimeToCompletionInSeconds")
            Parser
  (Maybe Double
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe Integer
   -> AwsRedshiftClusterRestoreStatus)
-> Parser (Maybe Double)
-> Parser
     (Maybe Integer
      -> Maybe Integer
      -> Maybe Integer
      -> AwsRedshiftClusterRestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentRestoreRateInMegaBytesPerSecond")
            Parser
  (Maybe Integer
   -> Maybe Integer
   -> Maybe Integer
   -> AwsRedshiftClusterRestoreStatus)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer -> Maybe Integer -> AwsRedshiftClusterRestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProgressInMegaBytes")
            Parser
  (Maybe Integer -> Maybe Integer -> AwsRedshiftClusterRestoreStatus)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> AwsRedshiftClusterRestoreStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ElapsedTimeInSeconds")
            Parser (Maybe Integer -> AwsRedshiftClusterRestoreStatus)
-> Parser (Maybe Integer) -> Parser AwsRedshiftClusterRestoreStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SnapshotSizeInMegaBytes")
      )

instance
  Prelude.Hashable
    AwsRedshiftClusterRestoreStatus

instance
  Prelude.NFData
    AwsRedshiftClusterRestoreStatus

instance Core.ToJSON AwsRedshiftClusterRestoreStatus where
  toJSON :: AwsRedshiftClusterRestoreStatus -> Value
toJSON AwsRedshiftClusterRestoreStatus' {Maybe Double
Maybe Integer
Maybe Text
snapshotSizeInMegaBytes :: Maybe Integer
elapsedTimeInSeconds :: Maybe Integer
progressInMegaBytes :: Maybe Integer
currentRestoreRateInMegaBytesPerSecond :: Maybe Double
estimatedTimeToCompletionInSeconds :: Maybe Integer
status :: Maybe Text
$sel:snapshotSizeInMegaBytes:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
$sel:elapsedTimeInSeconds:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
$sel:progressInMegaBytes:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
$sel:currentRestoreRateInMegaBytesPerSecond:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Double
$sel:estimatedTimeToCompletionInSeconds:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Integer
$sel:status:AwsRedshiftClusterRestoreStatus' :: AwsRedshiftClusterRestoreStatus -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
status,
            (Text
"EstimatedTimeToCompletionInSeconds" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
estimatedTimeToCompletionInSeconds,
            (Text
"CurrentRestoreRateInMegaBytesPerSecond" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
currentRestoreRateInMegaBytesPerSecond,
            (Text
"ProgressInMegaBytes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
progressInMegaBytes,
            (Text
"ElapsedTimeInSeconds" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
elapsedTimeInSeconds,
            (Text
"SnapshotSizeInMegaBytes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
snapshotSizeInMegaBytes
          ]
      )