{-# 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.DrS.Types.RecoveryInstanceDataReplicationInfoReplicatedDisk
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DrS.Types.RecoveryInstanceDataReplicationInfoReplicatedDisk where

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

-- | A disk that should be replicated.
--
-- /See:/ 'newRecoveryInstanceDataReplicationInfoReplicatedDisk' smart constructor.
data RecoveryInstanceDataReplicationInfoReplicatedDisk = RecoveryInstanceDataReplicationInfoReplicatedDisk'
  { -- | The size of the replication backlog in bytes.
    RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
backloggedStorageBytes :: Prelude.Maybe Prelude.Natural,
    -- | The name of the device.
    RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text,
    -- | The amount of data replicated so far in bytes.
    RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
replicatedStorageBytes :: Prelude.Maybe Prelude.Natural,
    -- | The amount of data to be rescanned in bytes.
    RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
rescannedStorageBytes :: Prelude.Maybe Prelude.Natural,
    -- | The total amount of data to be replicated in bytes.
    RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
totalStorageBytes :: Prelude.Maybe Prelude.Natural
  }
  deriving (RecoveryInstanceDataReplicationInfoReplicatedDisk
-> RecoveryInstanceDataReplicationInfoReplicatedDisk -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecoveryInstanceDataReplicationInfoReplicatedDisk
-> RecoveryInstanceDataReplicationInfoReplicatedDisk -> Bool
$c/= :: RecoveryInstanceDataReplicationInfoReplicatedDisk
-> RecoveryInstanceDataReplicationInfoReplicatedDisk -> Bool
== :: RecoveryInstanceDataReplicationInfoReplicatedDisk
-> RecoveryInstanceDataReplicationInfoReplicatedDisk -> Bool
$c== :: RecoveryInstanceDataReplicationInfoReplicatedDisk
-> RecoveryInstanceDataReplicationInfoReplicatedDisk -> Bool
Prelude.Eq, ReadPrec [RecoveryInstanceDataReplicationInfoReplicatedDisk]
ReadPrec RecoveryInstanceDataReplicationInfoReplicatedDisk
Int -> ReadS RecoveryInstanceDataReplicationInfoReplicatedDisk
ReadS [RecoveryInstanceDataReplicationInfoReplicatedDisk]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecoveryInstanceDataReplicationInfoReplicatedDisk]
$creadListPrec :: ReadPrec [RecoveryInstanceDataReplicationInfoReplicatedDisk]
readPrec :: ReadPrec RecoveryInstanceDataReplicationInfoReplicatedDisk
$creadPrec :: ReadPrec RecoveryInstanceDataReplicationInfoReplicatedDisk
readList :: ReadS [RecoveryInstanceDataReplicationInfoReplicatedDisk]
$creadList :: ReadS [RecoveryInstanceDataReplicationInfoReplicatedDisk]
readsPrec :: Int -> ReadS RecoveryInstanceDataReplicationInfoReplicatedDisk
$creadsPrec :: Int -> ReadS RecoveryInstanceDataReplicationInfoReplicatedDisk
Prelude.Read, Int -> RecoveryInstanceDataReplicationInfoReplicatedDisk -> ShowS
[RecoveryInstanceDataReplicationInfoReplicatedDisk] -> ShowS
RecoveryInstanceDataReplicationInfoReplicatedDisk -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecoveryInstanceDataReplicationInfoReplicatedDisk] -> ShowS
$cshowList :: [RecoveryInstanceDataReplicationInfoReplicatedDisk] -> ShowS
show :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> String
$cshow :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> String
showsPrec :: Int -> RecoveryInstanceDataReplicationInfoReplicatedDisk -> ShowS
$cshowsPrec :: Int -> RecoveryInstanceDataReplicationInfoReplicatedDisk -> ShowS
Prelude.Show, forall x.
Rep RecoveryInstanceDataReplicationInfoReplicatedDisk x
-> RecoveryInstanceDataReplicationInfoReplicatedDisk
forall x.
RecoveryInstanceDataReplicationInfoReplicatedDisk
-> Rep RecoveryInstanceDataReplicationInfoReplicatedDisk x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecoveryInstanceDataReplicationInfoReplicatedDisk x
-> RecoveryInstanceDataReplicationInfoReplicatedDisk
$cfrom :: forall x.
RecoveryInstanceDataReplicationInfoReplicatedDisk
-> Rep RecoveryInstanceDataReplicationInfoReplicatedDisk x
Prelude.Generic)

-- |
-- Create a value of 'RecoveryInstanceDataReplicationInfoReplicatedDisk' 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:
--
-- 'backloggedStorageBytes', 'recoveryInstanceDataReplicationInfoReplicatedDisk_backloggedStorageBytes' - The size of the replication backlog in bytes.
--
-- 'deviceName', 'recoveryInstanceDataReplicationInfoReplicatedDisk_deviceName' - The name of the device.
--
-- 'replicatedStorageBytes', 'recoveryInstanceDataReplicationInfoReplicatedDisk_replicatedStorageBytes' - The amount of data replicated so far in bytes.
--
-- 'rescannedStorageBytes', 'recoveryInstanceDataReplicationInfoReplicatedDisk_rescannedStorageBytes' - The amount of data to be rescanned in bytes.
--
-- 'totalStorageBytes', 'recoveryInstanceDataReplicationInfoReplicatedDisk_totalStorageBytes' - The total amount of data to be replicated in bytes.
newRecoveryInstanceDataReplicationInfoReplicatedDisk ::
  RecoveryInstanceDataReplicationInfoReplicatedDisk
newRecoveryInstanceDataReplicationInfoReplicatedDisk :: RecoveryInstanceDataReplicationInfoReplicatedDisk
newRecoveryInstanceDataReplicationInfoReplicatedDisk =
  RecoveryInstanceDataReplicationInfoReplicatedDisk'
    { $sel:backloggedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
backloggedStorageBytes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:deviceName:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Text
deviceName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:replicatedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
replicatedStorageBytes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:rescannedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
rescannedStorageBytes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:totalStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
totalStorageBytes =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The size of the replication backlog in bytes.
recoveryInstanceDataReplicationInfoReplicatedDisk_backloggedStorageBytes :: Lens.Lens' RecoveryInstanceDataReplicationInfoReplicatedDisk (Prelude.Maybe Prelude.Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_backloggedStorageBytes :: Lens'
  RecoveryInstanceDataReplicationInfoReplicatedDisk (Maybe Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_backloggedStorageBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceDataReplicationInfoReplicatedDisk' {Maybe Natural
backloggedStorageBytes :: Maybe Natural
$sel:backloggedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
backloggedStorageBytes} -> Maybe Natural
backloggedStorageBytes) (\s :: RecoveryInstanceDataReplicationInfoReplicatedDisk
s@RecoveryInstanceDataReplicationInfoReplicatedDisk' {} Maybe Natural
a -> RecoveryInstanceDataReplicationInfoReplicatedDisk
s {$sel:backloggedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
backloggedStorageBytes = Maybe Natural
a} :: RecoveryInstanceDataReplicationInfoReplicatedDisk)

-- | The name of the device.
recoveryInstanceDataReplicationInfoReplicatedDisk_deviceName :: Lens.Lens' RecoveryInstanceDataReplicationInfoReplicatedDisk (Prelude.Maybe Prelude.Text)
recoveryInstanceDataReplicationInfoReplicatedDisk_deviceName :: Lens'
  RecoveryInstanceDataReplicationInfoReplicatedDisk (Maybe Text)
recoveryInstanceDataReplicationInfoReplicatedDisk_deviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceDataReplicationInfoReplicatedDisk' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: RecoveryInstanceDataReplicationInfoReplicatedDisk
s@RecoveryInstanceDataReplicationInfoReplicatedDisk' {} Maybe Text
a -> RecoveryInstanceDataReplicationInfoReplicatedDisk
s {$sel:deviceName:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Text
deviceName = Maybe Text
a} :: RecoveryInstanceDataReplicationInfoReplicatedDisk)

-- | The amount of data replicated so far in bytes.
recoveryInstanceDataReplicationInfoReplicatedDisk_replicatedStorageBytes :: Lens.Lens' RecoveryInstanceDataReplicationInfoReplicatedDisk (Prelude.Maybe Prelude.Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_replicatedStorageBytes :: Lens'
  RecoveryInstanceDataReplicationInfoReplicatedDisk (Maybe Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_replicatedStorageBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceDataReplicationInfoReplicatedDisk' {Maybe Natural
replicatedStorageBytes :: Maybe Natural
$sel:replicatedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
replicatedStorageBytes} -> Maybe Natural
replicatedStorageBytes) (\s :: RecoveryInstanceDataReplicationInfoReplicatedDisk
s@RecoveryInstanceDataReplicationInfoReplicatedDisk' {} Maybe Natural
a -> RecoveryInstanceDataReplicationInfoReplicatedDisk
s {$sel:replicatedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
replicatedStorageBytes = Maybe Natural
a} :: RecoveryInstanceDataReplicationInfoReplicatedDisk)

-- | The amount of data to be rescanned in bytes.
recoveryInstanceDataReplicationInfoReplicatedDisk_rescannedStorageBytes :: Lens.Lens' RecoveryInstanceDataReplicationInfoReplicatedDisk (Prelude.Maybe Prelude.Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_rescannedStorageBytes :: Lens'
  RecoveryInstanceDataReplicationInfoReplicatedDisk (Maybe Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_rescannedStorageBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceDataReplicationInfoReplicatedDisk' {Maybe Natural
rescannedStorageBytes :: Maybe Natural
$sel:rescannedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
rescannedStorageBytes} -> Maybe Natural
rescannedStorageBytes) (\s :: RecoveryInstanceDataReplicationInfoReplicatedDisk
s@RecoveryInstanceDataReplicationInfoReplicatedDisk' {} Maybe Natural
a -> RecoveryInstanceDataReplicationInfoReplicatedDisk
s {$sel:rescannedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
rescannedStorageBytes = Maybe Natural
a} :: RecoveryInstanceDataReplicationInfoReplicatedDisk)

-- | The total amount of data to be replicated in bytes.
recoveryInstanceDataReplicationInfoReplicatedDisk_totalStorageBytes :: Lens.Lens' RecoveryInstanceDataReplicationInfoReplicatedDisk (Prelude.Maybe Prelude.Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_totalStorageBytes :: Lens'
  RecoveryInstanceDataReplicationInfoReplicatedDisk (Maybe Natural)
recoveryInstanceDataReplicationInfoReplicatedDisk_totalStorageBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceDataReplicationInfoReplicatedDisk' {Maybe Natural
totalStorageBytes :: Maybe Natural
$sel:totalStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
totalStorageBytes} -> Maybe Natural
totalStorageBytes) (\s :: RecoveryInstanceDataReplicationInfoReplicatedDisk
s@RecoveryInstanceDataReplicationInfoReplicatedDisk' {} Maybe Natural
a -> RecoveryInstanceDataReplicationInfoReplicatedDisk
s {$sel:totalStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: Maybe Natural
totalStorageBytes = Maybe Natural
a} :: RecoveryInstanceDataReplicationInfoReplicatedDisk)

instance
  Data.FromJSON
    RecoveryInstanceDataReplicationInfoReplicatedDisk
  where
  parseJSON :: Value -> Parser RecoveryInstanceDataReplicationInfoReplicatedDisk
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecoveryInstanceDataReplicationInfoReplicatedDisk"
      ( \Object
x ->
          Maybe Natural
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> RecoveryInstanceDataReplicationInfoReplicatedDisk
RecoveryInstanceDataReplicationInfoReplicatedDisk'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"backloggedStorageBytes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"deviceName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"replicatedStorageBytes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"rescannedStorageBytes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"totalStorageBytes")
      )

instance
  Prelude.Hashable
    RecoveryInstanceDataReplicationInfoReplicatedDisk
  where
  hashWithSalt :: Int -> RecoveryInstanceDataReplicationInfoReplicatedDisk -> Int
hashWithSalt
    Int
_salt
    RecoveryInstanceDataReplicationInfoReplicatedDisk' {Maybe Natural
Maybe Text
totalStorageBytes :: Maybe Natural
rescannedStorageBytes :: Maybe Natural
replicatedStorageBytes :: Maybe Natural
deviceName :: Maybe Text
backloggedStorageBytes :: Maybe Natural
$sel:totalStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
$sel:rescannedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
$sel:replicatedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
$sel:deviceName:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Text
$sel:backloggedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
backloggedStorageBytes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
replicatedStorageBytes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
rescannedStorageBytes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
totalStorageBytes

instance
  Prelude.NFData
    RecoveryInstanceDataReplicationInfoReplicatedDisk
  where
  rnf :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> ()
rnf
    RecoveryInstanceDataReplicationInfoReplicatedDisk' {Maybe Natural
Maybe Text
totalStorageBytes :: Maybe Natural
rescannedStorageBytes :: Maybe Natural
replicatedStorageBytes :: Maybe Natural
deviceName :: Maybe Text
backloggedStorageBytes :: Maybe Natural
$sel:totalStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
$sel:rescannedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
$sel:replicatedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
$sel:deviceName:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Text
$sel:backloggedStorageBytes:RecoveryInstanceDataReplicationInfoReplicatedDisk' :: RecoveryInstanceDataReplicationInfoReplicatedDisk -> Maybe Natural
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
backloggedStorageBytes
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceName
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
replicatedStorageBytes
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
rescannedStorageBytes
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
totalStorageBytes