{-# 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.TapeRecoveryPointInfo
-- 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.TapeRecoveryPointInfo where

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

-- | Describes a recovery point.
--
-- /See:/ 'newTapeRecoveryPointInfo' smart constructor.
data TapeRecoveryPointInfo = TapeRecoveryPointInfo'
  { -- | The status of the virtual tapes.
    TapeRecoveryPointInfo -> Maybe Text
tapeStatus :: Prelude.Maybe Prelude.Text,
    -- | The time when the point-in-time view of the virtual tape was replicated
    -- for later recovery.
    --
    -- The default timestamp format of the tape recovery point time is in the
    -- ISO8601 extended YYYY-MM-DD\'T\'HH:MM:SS\'Z\' format.
    TapeRecoveryPointInfo -> Maybe POSIX
tapeRecoveryPointTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the virtual tape.
    TapeRecoveryPointInfo -> Maybe Text
tapeARN :: Prelude.Maybe Prelude.Text,
    -- | The size, in bytes, of the virtual tapes to recover.
    TapeRecoveryPointInfo -> Maybe Integer
tapeSizeInBytes :: Prelude.Maybe Prelude.Integer
  }
  deriving (TapeRecoveryPointInfo -> TapeRecoveryPointInfo -> Bool
(TapeRecoveryPointInfo -> TapeRecoveryPointInfo -> Bool)
-> (TapeRecoveryPointInfo -> TapeRecoveryPointInfo -> Bool)
-> Eq TapeRecoveryPointInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TapeRecoveryPointInfo -> TapeRecoveryPointInfo -> Bool
$c/= :: TapeRecoveryPointInfo -> TapeRecoveryPointInfo -> Bool
== :: TapeRecoveryPointInfo -> TapeRecoveryPointInfo -> Bool
$c== :: TapeRecoveryPointInfo -> TapeRecoveryPointInfo -> Bool
Prelude.Eq, ReadPrec [TapeRecoveryPointInfo]
ReadPrec TapeRecoveryPointInfo
Int -> ReadS TapeRecoveryPointInfo
ReadS [TapeRecoveryPointInfo]
(Int -> ReadS TapeRecoveryPointInfo)
-> ReadS [TapeRecoveryPointInfo]
-> ReadPrec TapeRecoveryPointInfo
-> ReadPrec [TapeRecoveryPointInfo]
-> Read TapeRecoveryPointInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TapeRecoveryPointInfo]
$creadListPrec :: ReadPrec [TapeRecoveryPointInfo]
readPrec :: ReadPrec TapeRecoveryPointInfo
$creadPrec :: ReadPrec TapeRecoveryPointInfo
readList :: ReadS [TapeRecoveryPointInfo]
$creadList :: ReadS [TapeRecoveryPointInfo]
readsPrec :: Int -> ReadS TapeRecoveryPointInfo
$creadsPrec :: Int -> ReadS TapeRecoveryPointInfo
Prelude.Read, Int -> TapeRecoveryPointInfo -> ShowS
[TapeRecoveryPointInfo] -> ShowS
TapeRecoveryPointInfo -> String
(Int -> TapeRecoveryPointInfo -> ShowS)
-> (TapeRecoveryPointInfo -> String)
-> ([TapeRecoveryPointInfo] -> ShowS)
-> Show TapeRecoveryPointInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TapeRecoveryPointInfo] -> ShowS
$cshowList :: [TapeRecoveryPointInfo] -> ShowS
show :: TapeRecoveryPointInfo -> String
$cshow :: TapeRecoveryPointInfo -> String
showsPrec :: Int -> TapeRecoveryPointInfo -> ShowS
$cshowsPrec :: Int -> TapeRecoveryPointInfo -> ShowS
Prelude.Show, (forall x. TapeRecoveryPointInfo -> Rep TapeRecoveryPointInfo x)
-> (forall x. Rep TapeRecoveryPointInfo x -> TapeRecoveryPointInfo)
-> Generic TapeRecoveryPointInfo
forall x. Rep TapeRecoveryPointInfo x -> TapeRecoveryPointInfo
forall x. TapeRecoveryPointInfo -> Rep TapeRecoveryPointInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TapeRecoveryPointInfo x -> TapeRecoveryPointInfo
$cfrom :: forall x. TapeRecoveryPointInfo -> Rep TapeRecoveryPointInfo x
Prelude.Generic)

-- |
-- Create a value of 'TapeRecoveryPointInfo' 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:
--
-- 'tapeStatus', 'tapeRecoveryPointInfo_tapeStatus' - The status of the virtual tapes.
--
-- 'tapeRecoveryPointTime', 'tapeRecoveryPointInfo_tapeRecoveryPointTime' - The time when the point-in-time view of the virtual tape was replicated
-- for later recovery.
--
-- The default timestamp format of the tape recovery point time is in the
-- ISO8601 extended YYYY-MM-DD\'T\'HH:MM:SS\'Z\' format.
--
-- 'tapeARN', 'tapeRecoveryPointInfo_tapeARN' - The Amazon Resource Name (ARN) of the virtual tape.
--
-- 'tapeSizeInBytes', 'tapeRecoveryPointInfo_tapeSizeInBytes' - The size, in bytes, of the virtual tapes to recover.
newTapeRecoveryPointInfo ::
  TapeRecoveryPointInfo
newTapeRecoveryPointInfo :: TapeRecoveryPointInfo
newTapeRecoveryPointInfo =
  TapeRecoveryPointInfo' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> TapeRecoveryPointInfo
TapeRecoveryPointInfo'
    { $sel:tapeStatus:TapeRecoveryPointInfo' :: Maybe Text
tapeStatus =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeRecoveryPointTime:TapeRecoveryPointInfo' :: Maybe POSIX
tapeRecoveryPointTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeARN:TapeRecoveryPointInfo' :: Maybe Text
tapeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeSizeInBytes:TapeRecoveryPointInfo' :: Maybe Integer
tapeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the virtual tapes.
tapeRecoveryPointInfo_tapeStatus :: Lens.Lens' TapeRecoveryPointInfo (Prelude.Maybe Prelude.Text)
tapeRecoveryPointInfo_tapeStatus :: (Maybe Text -> f (Maybe Text))
-> TapeRecoveryPointInfo -> f TapeRecoveryPointInfo
tapeRecoveryPointInfo_tapeStatus = (TapeRecoveryPointInfo -> Maybe Text)
-> (TapeRecoveryPointInfo -> Maybe Text -> TapeRecoveryPointInfo)
-> Lens
     TapeRecoveryPointInfo
     TapeRecoveryPointInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeRecoveryPointInfo' {Maybe Text
tapeStatus :: Maybe Text
$sel:tapeStatus:TapeRecoveryPointInfo' :: TapeRecoveryPointInfo -> Maybe Text
tapeStatus} -> Maybe Text
tapeStatus) (\s :: TapeRecoveryPointInfo
s@TapeRecoveryPointInfo' {} Maybe Text
a -> TapeRecoveryPointInfo
s {$sel:tapeStatus:TapeRecoveryPointInfo' :: Maybe Text
tapeStatus = Maybe Text
a} :: TapeRecoveryPointInfo)

-- | The time when the point-in-time view of the virtual tape was replicated
-- for later recovery.
--
-- The default timestamp format of the tape recovery point time is in the
-- ISO8601 extended YYYY-MM-DD\'T\'HH:MM:SS\'Z\' format.
tapeRecoveryPointInfo_tapeRecoveryPointTime :: Lens.Lens' TapeRecoveryPointInfo (Prelude.Maybe Prelude.UTCTime)
tapeRecoveryPointInfo_tapeRecoveryPointTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TapeRecoveryPointInfo -> f TapeRecoveryPointInfo
tapeRecoveryPointInfo_tapeRecoveryPointTime = (TapeRecoveryPointInfo -> Maybe POSIX)
-> (TapeRecoveryPointInfo -> Maybe POSIX -> TapeRecoveryPointInfo)
-> Lens
     TapeRecoveryPointInfo
     TapeRecoveryPointInfo
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeRecoveryPointInfo' {Maybe POSIX
tapeRecoveryPointTime :: Maybe POSIX
$sel:tapeRecoveryPointTime:TapeRecoveryPointInfo' :: TapeRecoveryPointInfo -> Maybe POSIX
tapeRecoveryPointTime} -> Maybe POSIX
tapeRecoveryPointTime) (\s :: TapeRecoveryPointInfo
s@TapeRecoveryPointInfo' {} Maybe POSIX
a -> TapeRecoveryPointInfo
s {$sel:tapeRecoveryPointTime:TapeRecoveryPointInfo' :: Maybe POSIX
tapeRecoveryPointTime = Maybe POSIX
a} :: TapeRecoveryPointInfo) ((Maybe POSIX -> f (Maybe POSIX))
 -> TapeRecoveryPointInfo -> f TapeRecoveryPointInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TapeRecoveryPointInfo
-> f TapeRecoveryPointInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name (ARN) of the virtual tape.
tapeRecoveryPointInfo_tapeARN :: Lens.Lens' TapeRecoveryPointInfo (Prelude.Maybe Prelude.Text)
tapeRecoveryPointInfo_tapeARN :: (Maybe Text -> f (Maybe Text))
-> TapeRecoveryPointInfo -> f TapeRecoveryPointInfo
tapeRecoveryPointInfo_tapeARN = (TapeRecoveryPointInfo -> Maybe Text)
-> (TapeRecoveryPointInfo -> Maybe Text -> TapeRecoveryPointInfo)
-> Lens
     TapeRecoveryPointInfo
     TapeRecoveryPointInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeRecoveryPointInfo' {Maybe Text
tapeARN :: Maybe Text
$sel:tapeARN:TapeRecoveryPointInfo' :: TapeRecoveryPointInfo -> Maybe Text
tapeARN} -> Maybe Text
tapeARN) (\s :: TapeRecoveryPointInfo
s@TapeRecoveryPointInfo' {} Maybe Text
a -> TapeRecoveryPointInfo
s {$sel:tapeARN:TapeRecoveryPointInfo' :: Maybe Text
tapeARN = Maybe Text
a} :: TapeRecoveryPointInfo)

-- | The size, in bytes, of the virtual tapes to recover.
tapeRecoveryPointInfo_tapeSizeInBytes :: Lens.Lens' TapeRecoveryPointInfo (Prelude.Maybe Prelude.Integer)
tapeRecoveryPointInfo_tapeSizeInBytes :: (Maybe Integer -> f (Maybe Integer))
-> TapeRecoveryPointInfo -> f TapeRecoveryPointInfo
tapeRecoveryPointInfo_tapeSizeInBytes = (TapeRecoveryPointInfo -> Maybe Integer)
-> (TapeRecoveryPointInfo
    -> Maybe Integer -> TapeRecoveryPointInfo)
-> Lens
     TapeRecoveryPointInfo
     TapeRecoveryPointInfo
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeRecoveryPointInfo' {Maybe Integer
tapeSizeInBytes :: Maybe Integer
$sel:tapeSizeInBytes:TapeRecoveryPointInfo' :: TapeRecoveryPointInfo -> Maybe Integer
tapeSizeInBytes} -> Maybe Integer
tapeSizeInBytes) (\s :: TapeRecoveryPointInfo
s@TapeRecoveryPointInfo' {} Maybe Integer
a -> TapeRecoveryPointInfo
s {$sel:tapeSizeInBytes:TapeRecoveryPointInfo' :: Maybe Integer
tapeSizeInBytes = Maybe Integer
a} :: TapeRecoveryPointInfo)

instance Core.FromJSON TapeRecoveryPointInfo where
  parseJSON :: Value -> Parser TapeRecoveryPointInfo
parseJSON =
    String
-> (Object -> Parser TapeRecoveryPointInfo)
-> Value
-> Parser TapeRecoveryPointInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TapeRecoveryPointInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Integer
-> TapeRecoveryPointInfo
TapeRecoveryPointInfo'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Integer
 -> TapeRecoveryPointInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Integer -> TapeRecoveryPointInfo)
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
"TapeStatus")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Integer -> TapeRecoveryPointInfo)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Integer -> TapeRecoveryPointInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TapeRecoveryPointTime")
            Parser (Maybe Text -> Maybe Integer -> TapeRecoveryPointInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> TapeRecoveryPointInfo)
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
"TapeARN")
            Parser (Maybe Integer -> TapeRecoveryPointInfo)
-> Parser (Maybe Integer) -> Parser TapeRecoveryPointInfo
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
"TapeSizeInBytes")
      )

instance Prelude.Hashable TapeRecoveryPointInfo

instance Prelude.NFData TapeRecoveryPointInfo