{-# 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.StorageGateway.Types.VolumeRecoveryPointInfo
-- 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.StorageGateway.Types.VolumeRecoveryPointInfo where

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

-- | Describes a storage volume recovery point object.
--
-- /See:/ 'newVolumeRecoveryPointInfo' smart constructor.
data VolumeRecoveryPointInfo = VolumeRecoveryPointInfo'
  { -- | The time the recovery point was taken.
    VolumeRecoveryPointInfo -> Maybe Text
volumeRecoveryPointTime :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the volume target.
    VolumeRecoveryPointInfo -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
    -- | The size of the volume in bytes.
    VolumeRecoveryPointInfo -> Maybe Integer
volumeSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The size of the data stored on the volume in bytes.
    --
    -- This value is not available for volumes created prior to May 13, 2015,
    -- until you store data on the volume.
    VolumeRecoveryPointInfo -> Maybe Integer
volumeUsageInBytes :: Prelude.Maybe Prelude.Integer
  }
  deriving (VolumeRecoveryPointInfo -> VolumeRecoveryPointInfo -> Bool
(VolumeRecoveryPointInfo -> VolumeRecoveryPointInfo -> Bool)
-> (VolumeRecoveryPointInfo -> VolumeRecoveryPointInfo -> Bool)
-> Eq VolumeRecoveryPointInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeRecoveryPointInfo -> VolumeRecoveryPointInfo -> Bool
$c/= :: VolumeRecoveryPointInfo -> VolumeRecoveryPointInfo -> Bool
== :: VolumeRecoveryPointInfo -> VolumeRecoveryPointInfo -> Bool
$c== :: VolumeRecoveryPointInfo -> VolumeRecoveryPointInfo -> Bool
Prelude.Eq, ReadPrec [VolumeRecoveryPointInfo]
ReadPrec VolumeRecoveryPointInfo
Int -> ReadS VolumeRecoveryPointInfo
ReadS [VolumeRecoveryPointInfo]
(Int -> ReadS VolumeRecoveryPointInfo)
-> ReadS [VolumeRecoveryPointInfo]
-> ReadPrec VolumeRecoveryPointInfo
-> ReadPrec [VolumeRecoveryPointInfo]
-> Read VolumeRecoveryPointInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeRecoveryPointInfo]
$creadListPrec :: ReadPrec [VolumeRecoveryPointInfo]
readPrec :: ReadPrec VolumeRecoveryPointInfo
$creadPrec :: ReadPrec VolumeRecoveryPointInfo
readList :: ReadS [VolumeRecoveryPointInfo]
$creadList :: ReadS [VolumeRecoveryPointInfo]
readsPrec :: Int -> ReadS VolumeRecoveryPointInfo
$creadsPrec :: Int -> ReadS VolumeRecoveryPointInfo
Prelude.Read, Int -> VolumeRecoveryPointInfo -> ShowS
[VolumeRecoveryPointInfo] -> ShowS
VolumeRecoveryPointInfo -> String
(Int -> VolumeRecoveryPointInfo -> ShowS)
-> (VolumeRecoveryPointInfo -> String)
-> ([VolumeRecoveryPointInfo] -> ShowS)
-> Show VolumeRecoveryPointInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeRecoveryPointInfo] -> ShowS
$cshowList :: [VolumeRecoveryPointInfo] -> ShowS
show :: VolumeRecoveryPointInfo -> String
$cshow :: VolumeRecoveryPointInfo -> String
showsPrec :: Int -> VolumeRecoveryPointInfo -> ShowS
$cshowsPrec :: Int -> VolumeRecoveryPointInfo -> ShowS
Prelude.Show, (forall x.
 VolumeRecoveryPointInfo -> Rep VolumeRecoveryPointInfo x)
-> (forall x.
    Rep VolumeRecoveryPointInfo x -> VolumeRecoveryPointInfo)
-> Generic VolumeRecoveryPointInfo
forall x. Rep VolumeRecoveryPointInfo x -> VolumeRecoveryPointInfo
forall x. VolumeRecoveryPointInfo -> Rep VolumeRecoveryPointInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeRecoveryPointInfo x -> VolumeRecoveryPointInfo
$cfrom :: forall x. VolumeRecoveryPointInfo -> Rep VolumeRecoveryPointInfo x
Prelude.Generic)

-- |
-- Create a value of 'VolumeRecoveryPointInfo' 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:
--
-- 'volumeRecoveryPointTime', 'volumeRecoveryPointInfo_volumeRecoveryPointTime' - The time the recovery point was taken.
--
-- 'volumeARN', 'volumeRecoveryPointInfo_volumeARN' - The Amazon Resource Name (ARN) of the volume target.
--
-- 'volumeSizeInBytes', 'volumeRecoveryPointInfo_volumeSizeInBytes' - The size of the volume in bytes.
--
-- 'volumeUsageInBytes', 'volumeRecoveryPointInfo_volumeUsageInBytes' - The size of the data stored on the volume in bytes.
--
-- This value is not available for volumes created prior to May 13, 2015,
-- until you store data on the volume.
newVolumeRecoveryPointInfo ::
  VolumeRecoveryPointInfo
newVolumeRecoveryPointInfo :: VolumeRecoveryPointInfo
newVolumeRecoveryPointInfo =
  VolumeRecoveryPointInfo' :: Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> VolumeRecoveryPointInfo
VolumeRecoveryPointInfo'
    { $sel:volumeRecoveryPointTime:VolumeRecoveryPointInfo' :: Maybe Text
volumeRecoveryPointTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeARN:VolumeRecoveryPointInfo' :: Maybe Text
volumeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSizeInBytes:VolumeRecoveryPointInfo' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeUsageInBytes:VolumeRecoveryPointInfo' :: Maybe Integer
volumeUsageInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The time the recovery point was taken.
volumeRecoveryPointInfo_volumeRecoveryPointTime :: Lens.Lens' VolumeRecoveryPointInfo (Prelude.Maybe Prelude.Text)
volumeRecoveryPointInfo_volumeRecoveryPointTime :: (Maybe Text -> f (Maybe Text))
-> VolumeRecoveryPointInfo -> f VolumeRecoveryPointInfo
volumeRecoveryPointInfo_volumeRecoveryPointTime = (VolumeRecoveryPointInfo -> Maybe Text)
-> (VolumeRecoveryPointInfo
    -> Maybe Text -> VolumeRecoveryPointInfo)
-> Lens
     VolumeRecoveryPointInfo
     VolumeRecoveryPointInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeRecoveryPointInfo' {Maybe Text
volumeRecoveryPointTime :: Maybe Text
$sel:volumeRecoveryPointTime:VolumeRecoveryPointInfo' :: VolumeRecoveryPointInfo -> Maybe Text
volumeRecoveryPointTime} -> Maybe Text
volumeRecoveryPointTime) (\s :: VolumeRecoveryPointInfo
s@VolumeRecoveryPointInfo' {} Maybe Text
a -> VolumeRecoveryPointInfo
s {$sel:volumeRecoveryPointTime:VolumeRecoveryPointInfo' :: Maybe Text
volumeRecoveryPointTime = Maybe Text
a} :: VolumeRecoveryPointInfo)

-- | The Amazon Resource Name (ARN) of the volume target.
volumeRecoveryPointInfo_volumeARN :: Lens.Lens' VolumeRecoveryPointInfo (Prelude.Maybe Prelude.Text)
volumeRecoveryPointInfo_volumeARN :: (Maybe Text -> f (Maybe Text))
-> VolumeRecoveryPointInfo -> f VolumeRecoveryPointInfo
volumeRecoveryPointInfo_volumeARN = (VolumeRecoveryPointInfo -> Maybe Text)
-> (VolumeRecoveryPointInfo
    -> Maybe Text -> VolumeRecoveryPointInfo)
-> Lens
     VolumeRecoveryPointInfo
     VolumeRecoveryPointInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeRecoveryPointInfo' {Maybe Text
volumeARN :: Maybe Text
$sel:volumeARN:VolumeRecoveryPointInfo' :: VolumeRecoveryPointInfo -> Maybe Text
volumeARN} -> Maybe Text
volumeARN) (\s :: VolumeRecoveryPointInfo
s@VolumeRecoveryPointInfo' {} Maybe Text
a -> VolumeRecoveryPointInfo
s {$sel:volumeARN:VolumeRecoveryPointInfo' :: Maybe Text
volumeARN = Maybe Text
a} :: VolumeRecoveryPointInfo)

-- | The size of the volume in bytes.
volumeRecoveryPointInfo_volumeSizeInBytes :: Lens.Lens' VolumeRecoveryPointInfo (Prelude.Maybe Prelude.Integer)
volumeRecoveryPointInfo_volumeSizeInBytes :: (Maybe Integer -> f (Maybe Integer))
-> VolumeRecoveryPointInfo -> f VolumeRecoveryPointInfo
volumeRecoveryPointInfo_volumeSizeInBytes = (VolumeRecoveryPointInfo -> Maybe Integer)
-> (VolumeRecoveryPointInfo
    -> Maybe Integer -> VolumeRecoveryPointInfo)
-> Lens
     VolumeRecoveryPointInfo
     VolumeRecoveryPointInfo
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeRecoveryPointInfo' {Maybe Integer
volumeSizeInBytes :: Maybe Integer
$sel:volumeSizeInBytes:VolumeRecoveryPointInfo' :: VolumeRecoveryPointInfo -> Maybe Integer
volumeSizeInBytes} -> Maybe Integer
volumeSizeInBytes) (\s :: VolumeRecoveryPointInfo
s@VolumeRecoveryPointInfo' {} Maybe Integer
a -> VolumeRecoveryPointInfo
s {$sel:volumeSizeInBytes:VolumeRecoveryPointInfo' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
a} :: VolumeRecoveryPointInfo)

-- | The size of the data stored on the volume in bytes.
--
-- This value is not available for volumes created prior to May 13, 2015,
-- until you store data on the volume.
volumeRecoveryPointInfo_volumeUsageInBytes :: Lens.Lens' VolumeRecoveryPointInfo (Prelude.Maybe Prelude.Integer)
volumeRecoveryPointInfo_volumeUsageInBytes :: (Maybe Integer -> f (Maybe Integer))
-> VolumeRecoveryPointInfo -> f VolumeRecoveryPointInfo
volumeRecoveryPointInfo_volumeUsageInBytes = (VolumeRecoveryPointInfo -> Maybe Integer)
-> (VolumeRecoveryPointInfo
    -> Maybe Integer -> VolumeRecoveryPointInfo)
-> Lens
     VolumeRecoveryPointInfo
     VolumeRecoveryPointInfo
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeRecoveryPointInfo' {Maybe Integer
volumeUsageInBytes :: Maybe Integer
$sel:volumeUsageInBytes:VolumeRecoveryPointInfo' :: VolumeRecoveryPointInfo -> Maybe Integer
volumeUsageInBytes} -> Maybe Integer
volumeUsageInBytes) (\s :: VolumeRecoveryPointInfo
s@VolumeRecoveryPointInfo' {} Maybe Integer
a -> VolumeRecoveryPointInfo
s {$sel:volumeUsageInBytes:VolumeRecoveryPointInfo' :: Maybe Integer
volumeUsageInBytes = Maybe Integer
a} :: VolumeRecoveryPointInfo)

instance Core.FromJSON VolumeRecoveryPointInfo where
  parseJSON :: Value -> Parser VolumeRecoveryPointInfo
parseJSON =
    String
-> (Object -> Parser VolumeRecoveryPointInfo)
-> Value
-> Parser VolumeRecoveryPointInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VolumeRecoveryPointInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> VolumeRecoveryPointInfo
VolumeRecoveryPointInfo'
            (Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Integer
 -> VolumeRecoveryPointInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Integer -> Maybe Integer -> VolumeRecoveryPointInfo)
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
"VolumeRecoveryPointTime")
            Parser
  (Maybe Text
   -> Maybe Integer -> Maybe Integer -> VolumeRecoveryPointInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer -> Maybe Integer -> VolumeRecoveryPointInfo)
forall (f :: * -> *) a b. Applicative f => 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
"VolumeARN")
            Parser (Maybe Integer -> Maybe Integer -> VolumeRecoveryPointInfo)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> VolumeRecoveryPointInfo)
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
"VolumeSizeInBytes")
            Parser (Maybe Integer -> VolumeRecoveryPointInfo)
-> Parser (Maybe Integer) -> Parser VolumeRecoveryPointInfo
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
"VolumeUsageInBytes")
      )

instance Prelude.Hashable VolumeRecoveryPointInfo

instance Prelude.NFData VolumeRecoveryPointInfo