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

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

-- | Describes a virtual tape object.
--
-- /See:/ 'newTape' smart constructor.
data Tape = Tape'
  { -- | The barcode that identifies a specific virtual tape.
    Tape -> Maybe Text
tapeBarcode :: Prelude.Maybe Prelude.Text,
    -- | The current state of the virtual tape.
    Tape -> Maybe Text
tapeStatus :: Prelude.Maybe Prelude.Text,
    Tape -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the virtual tape.
    Tape -> Maybe Text
tapeARN :: Prelude.Maybe Prelude.Text,
    -- | For archiving virtual tapes, indicates how much data remains to be
    -- uploaded before archiving is complete.
    --
    -- Range: 0 (not started) to 100 (complete).
    Tape -> Maybe Double
progress :: Prelude.Maybe Prelude.Double,
    -- | The size, in bytes, of the virtual tape capacity.
    Tape -> Maybe Integer
tapeSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The virtual tape library (VTL) device that the virtual tape is
    -- associated with.
    Tape -> Maybe Text
vTLDevice :: Prelude.Maybe Prelude.Text,
    -- | The ID of the pool that contains tapes that will be archived. The tapes
    -- in this pool are archived in the S3 storage class that is associated
    -- with the pool. When you use your backup application to eject the tape,
    -- the tape is archived directly into the storage class (S3 Glacier or S3
    -- Glacier Deep Archive) that corresponds to the pool.
    --
    -- Valid Values: @GLACIER@ | @DEEP_ARCHIVE@
    Tape -> Maybe Text
poolId :: Prelude.Maybe Prelude.Text,
    -- | The size, in bytes, of data stored on the virtual tape.
    --
    -- This value is not available for tapes created prior to May 13, 2015.
    Tape -> Maybe Integer
tapeUsedInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The date the virtual tape was created.
    Tape -> Maybe POSIX
tapeCreatedDate :: Prelude.Maybe Core.POSIX,
    -- | The date that the tape enters a custom tape pool.
    Tape -> Maybe POSIX
poolEntryDate :: Prelude.Maybe Core.POSIX,
    -- | If the tape is archived as write-once-read-many (WORM), this value is
    -- @true@.
    Tape -> Maybe Bool
worm :: Prelude.Maybe Prelude.Bool,
    -- | The date that the tape is first archived with tape retention lock
    -- enabled.
    Tape -> Maybe POSIX
retentionStartDate :: Prelude.Maybe Core.POSIX
  }
  deriving (Tape -> Tape -> Bool
(Tape -> Tape -> Bool) -> (Tape -> Tape -> Bool) -> Eq Tape
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tape -> Tape -> Bool
$c/= :: Tape -> Tape -> Bool
== :: Tape -> Tape -> Bool
$c== :: Tape -> Tape -> Bool
Prelude.Eq, ReadPrec [Tape]
ReadPrec Tape
Int -> ReadS Tape
ReadS [Tape]
(Int -> ReadS Tape)
-> ReadS [Tape] -> ReadPrec Tape -> ReadPrec [Tape] -> Read Tape
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Tape]
$creadListPrec :: ReadPrec [Tape]
readPrec :: ReadPrec Tape
$creadPrec :: ReadPrec Tape
readList :: ReadS [Tape]
$creadList :: ReadS [Tape]
readsPrec :: Int -> ReadS Tape
$creadsPrec :: Int -> ReadS Tape
Prelude.Read, Int -> Tape -> ShowS
[Tape] -> ShowS
Tape -> String
(Int -> Tape -> ShowS)
-> (Tape -> String) -> ([Tape] -> ShowS) -> Show Tape
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tape] -> ShowS
$cshowList :: [Tape] -> ShowS
show :: Tape -> String
$cshow :: Tape -> String
showsPrec :: Int -> Tape -> ShowS
$cshowsPrec :: Int -> Tape -> ShowS
Prelude.Show, (forall x. Tape -> Rep Tape x)
-> (forall x. Rep Tape x -> Tape) -> Generic Tape
forall x. Rep Tape x -> Tape
forall x. Tape -> Rep Tape x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Tape x -> Tape
$cfrom :: forall x. Tape -> Rep Tape x
Prelude.Generic)

-- |
-- Create a value of 'Tape' 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:
--
-- 'tapeBarcode', 'tape_tapeBarcode' - The barcode that identifies a specific virtual tape.
--
-- 'tapeStatus', 'tape_tapeStatus' - The current state of the virtual tape.
--
-- 'kmsKey', 'tape_kmsKey' - Undocumented member.
--
-- 'tapeARN', 'tape_tapeARN' - The Amazon Resource Name (ARN) of the virtual tape.
--
-- 'progress', 'tape_progress' - For archiving virtual tapes, indicates how much data remains to be
-- uploaded before archiving is complete.
--
-- Range: 0 (not started) to 100 (complete).
--
-- 'tapeSizeInBytes', 'tape_tapeSizeInBytes' - The size, in bytes, of the virtual tape capacity.
--
-- 'vTLDevice', 'tape_vTLDevice' - The virtual tape library (VTL) device that the virtual tape is
-- associated with.
--
-- 'poolId', 'tape_poolId' - The ID of the pool that contains tapes that will be archived. The tapes
-- in this pool are archived in the S3 storage class that is associated
-- with the pool. When you use your backup application to eject the tape,
-- the tape is archived directly into the storage class (S3 Glacier or S3
-- Glacier Deep Archive) that corresponds to the pool.
--
-- Valid Values: @GLACIER@ | @DEEP_ARCHIVE@
--
-- 'tapeUsedInBytes', 'tape_tapeUsedInBytes' - The size, in bytes, of data stored on the virtual tape.
--
-- This value is not available for tapes created prior to May 13, 2015.
--
-- 'tapeCreatedDate', 'tape_tapeCreatedDate' - The date the virtual tape was created.
--
-- 'poolEntryDate', 'tape_poolEntryDate' - The date that the tape enters a custom tape pool.
--
-- 'worm', 'tape_worm' - If the tape is archived as write-once-read-many (WORM), this value is
-- @true@.
--
-- 'retentionStartDate', 'tape_retentionStartDate' - The date that the tape is first archived with tape retention lock
-- enabled.
newTape ::
  Tape
newTape :: Tape
newTape =
  Tape' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Bool
-> Maybe POSIX
-> Tape
Tape'
    { $sel:tapeBarcode:Tape' :: Maybe Text
tapeBarcode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeStatus:Tape' :: Maybe Text
tapeStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKey:Tape' :: Maybe Text
kmsKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeARN:Tape' :: Maybe Text
tapeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:progress:Tape' :: Maybe Double
progress = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeSizeInBytes:Tape' :: Maybe Integer
tapeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:vTLDevice:Tape' :: Maybe Text
vTLDevice = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:poolId:Tape' :: Maybe Text
poolId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeUsedInBytes:Tape' :: Maybe Integer
tapeUsedInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeCreatedDate:Tape' :: Maybe POSIX
tapeCreatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:poolEntryDate:Tape' :: Maybe POSIX
poolEntryDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:worm:Tape' :: Maybe Bool
worm = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:retentionStartDate:Tape' :: Maybe POSIX
retentionStartDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | The barcode that identifies a specific virtual tape.
tape_tapeBarcode :: Lens.Lens' Tape (Prelude.Maybe Prelude.Text)
tape_tapeBarcode :: (Maybe Text -> f (Maybe Text)) -> Tape -> f Tape
tape_tapeBarcode = (Tape -> Maybe Text)
-> (Tape -> Maybe Text -> Tape)
-> Lens Tape Tape (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Text
tapeBarcode :: Maybe Text
$sel:tapeBarcode:Tape' :: Tape -> Maybe Text
tapeBarcode} -> Maybe Text
tapeBarcode) (\s :: Tape
s@Tape' {} Maybe Text
a -> Tape
s {$sel:tapeBarcode:Tape' :: Maybe Text
tapeBarcode = Maybe Text
a} :: Tape)

-- | The current state of the virtual tape.
tape_tapeStatus :: Lens.Lens' Tape (Prelude.Maybe Prelude.Text)
tape_tapeStatus :: (Maybe Text -> f (Maybe Text)) -> Tape -> f Tape
tape_tapeStatus = (Tape -> Maybe Text)
-> (Tape -> Maybe Text -> Tape)
-> Lens Tape Tape (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Text
tapeStatus :: Maybe Text
$sel:tapeStatus:Tape' :: Tape -> Maybe Text
tapeStatus} -> Maybe Text
tapeStatus) (\s :: Tape
s@Tape' {} Maybe Text
a -> Tape
s {$sel:tapeStatus:Tape' :: Maybe Text
tapeStatus = Maybe Text
a} :: Tape)

-- | Undocumented member.
tape_kmsKey :: Lens.Lens' Tape (Prelude.Maybe Prelude.Text)
tape_kmsKey :: (Maybe Text -> f (Maybe Text)) -> Tape -> f Tape
tape_kmsKey = (Tape -> Maybe Text)
-> (Tape -> Maybe Text -> Tape)
-> Lens Tape Tape (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:Tape' :: Tape -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: Tape
s@Tape' {} Maybe Text
a -> Tape
s {$sel:kmsKey:Tape' :: Maybe Text
kmsKey = Maybe Text
a} :: Tape)

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

-- | For archiving virtual tapes, indicates how much data remains to be
-- uploaded before archiving is complete.
--
-- Range: 0 (not started) to 100 (complete).
tape_progress :: Lens.Lens' Tape (Prelude.Maybe Prelude.Double)
tape_progress :: (Maybe Double -> f (Maybe Double)) -> Tape -> f Tape
tape_progress = (Tape -> Maybe Double)
-> (Tape -> Maybe Double -> Tape)
-> Lens Tape Tape (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Double
progress :: Maybe Double
$sel:progress:Tape' :: Tape -> Maybe Double
progress} -> Maybe Double
progress) (\s :: Tape
s@Tape' {} Maybe Double
a -> Tape
s {$sel:progress:Tape' :: Maybe Double
progress = Maybe Double
a} :: Tape)

-- | The size, in bytes, of the virtual tape capacity.
tape_tapeSizeInBytes :: Lens.Lens' Tape (Prelude.Maybe Prelude.Integer)
tape_tapeSizeInBytes :: (Maybe Integer -> f (Maybe Integer)) -> Tape -> f Tape
tape_tapeSizeInBytes = (Tape -> Maybe Integer)
-> (Tape -> Maybe Integer -> Tape)
-> Lens Tape Tape (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Integer
tapeSizeInBytes :: Maybe Integer
$sel:tapeSizeInBytes:Tape' :: Tape -> Maybe Integer
tapeSizeInBytes} -> Maybe Integer
tapeSizeInBytes) (\s :: Tape
s@Tape' {} Maybe Integer
a -> Tape
s {$sel:tapeSizeInBytes:Tape' :: Maybe Integer
tapeSizeInBytes = Maybe Integer
a} :: Tape)

-- | The virtual tape library (VTL) device that the virtual tape is
-- associated with.
tape_vTLDevice :: Lens.Lens' Tape (Prelude.Maybe Prelude.Text)
tape_vTLDevice :: (Maybe Text -> f (Maybe Text)) -> Tape -> f Tape
tape_vTLDevice = (Tape -> Maybe Text)
-> (Tape -> Maybe Text -> Tape)
-> Lens Tape Tape (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Text
vTLDevice :: Maybe Text
$sel:vTLDevice:Tape' :: Tape -> Maybe Text
vTLDevice} -> Maybe Text
vTLDevice) (\s :: Tape
s@Tape' {} Maybe Text
a -> Tape
s {$sel:vTLDevice:Tape' :: Maybe Text
vTLDevice = Maybe Text
a} :: Tape)

-- | The ID of the pool that contains tapes that will be archived. The tapes
-- in this pool are archived in the S3 storage class that is associated
-- with the pool. When you use your backup application to eject the tape,
-- the tape is archived directly into the storage class (S3 Glacier or S3
-- Glacier Deep Archive) that corresponds to the pool.
--
-- Valid Values: @GLACIER@ | @DEEP_ARCHIVE@
tape_poolId :: Lens.Lens' Tape (Prelude.Maybe Prelude.Text)
tape_poolId :: (Maybe Text -> f (Maybe Text)) -> Tape -> f Tape
tape_poolId = (Tape -> Maybe Text)
-> (Tape -> Maybe Text -> Tape)
-> Lens Tape Tape (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Text
poolId :: Maybe Text
$sel:poolId:Tape' :: Tape -> Maybe Text
poolId} -> Maybe Text
poolId) (\s :: Tape
s@Tape' {} Maybe Text
a -> Tape
s {$sel:poolId:Tape' :: Maybe Text
poolId = Maybe Text
a} :: Tape)

-- | The size, in bytes, of data stored on the virtual tape.
--
-- This value is not available for tapes created prior to May 13, 2015.
tape_tapeUsedInBytes :: Lens.Lens' Tape (Prelude.Maybe Prelude.Integer)
tape_tapeUsedInBytes :: (Maybe Integer -> f (Maybe Integer)) -> Tape -> f Tape
tape_tapeUsedInBytes = (Tape -> Maybe Integer)
-> (Tape -> Maybe Integer -> Tape)
-> Lens Tape Tape (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Integer
tapeUsedInBytes :: Maybe Integer
$sel:tapeUsedInBytes:Tape' :: Tape -> Maybe Integer
tapeUsedInBytes} -> Maybe Integer
tapeUsedInBytes) (\s :: Tape
s@Tape' {} Maybe Integer
a -> Tape
s {$sel:tapeUsedInBytes:Tape' :: Maybe Integer
tapeUsedInBytes = Maybe Integer
a} :: Tape)

-- | The date the virtual tape was created.
tape_tapeCreatedDate :: Lens.Lens' Tape (Prelude.Maybe Prelude.UTCTime)
tape_tapeCreatedDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Tape -> f Tape
tape_tapeCreatedDate = (Tape -> Maybe POSIX)
-> (Tape -> Maybe POSIX -> Tape)
-> Lens Tape Tape (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe POSIX
tapeCreatedDate :: Maybe POSIX
$sel:tapeCreatedDate:Tape' :: Tape -> Maybe POSIX
tapeCreatedDate} -> Maybe POSIX
tapeCreatedDate) (\s :: Tape
s@Tape' {} Maybe POSIX
a -> Tape
s {$sel:tapeCreatedDate:Tape' :: Maybe POSIX
tapeCreatedDate = Maybe POSIX
a} :: Tape) ((Maybe POSIX -> f (Maybe POSIX)) -> Tape -> f Tape)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Tape
-> f Tape
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 date that the tape enters a custom tape pool.
tape_poolEntryDate :: Lens.Lens' Tape (Prelude.Maybe Prelude.UTCTime)
tape_poolEntryDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Tape -> f Tape
tape_poolEntryDate = (Tape -> Maybe POSIX)
-> (Tape -> Maybe POSIX -> Tape)
-> Lens Tape Tape (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe POSIX
poolEntryDate :: Maybe POSIX
$sel:poolEntryDate:Tape' :: Tape -> Maybe POSIX
poolEntryDate} -> Maybe POSIX
poolEntryDate) (\s :: Tape
s@Tape' {} Maybe POSIX
a -> Tape
s {$sel:poolEntryDate:Tape' :: Maybe POSIX
poolEntryDate = Maybe POSIX
a} :: Tape) ((Maybe POSIX -> f (Maybe POSIX)) -> Tape -> f Tape)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Tape
-> f Tape
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

-- | If the tape is archived as write-once-read-many (WORM), this value is
-- @true@.
tape_worm :: Lens.Lens' Tape (Prelude.Maybe Prelude.Bool)
tape_worm :: (Maybe Bool -> f (Maybe Bool)) -> Tape -> f Tape
tape_worm = (Tape -> Maybe Bool)
-> (Tape -> Maybe Bool -> Tape)
-> Lens Tape Tape (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe Bool
worm :: Maybe Bool
$sel:worm:Tape' :: Tape -> Maybe Bool
worm} -> Maybe Bool
worm) (\s :: Tape
s@Tape' {} Maybe Bool
a -> Tape
s {$sel:worm:Tape' :: Maybe Bool
worm = Maybe Bool
a} :: Tape)

-- | The date that the tape is first archived with tape retention lock
-- enabled.
tape_retentionStartDate :: Lens.Lens' Tape (Prelude.Maybe Prelude.UTCTime)
tape_retentionStartDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Tape -> f Tape
tape_retentionStartDate = (Tape -> Maybe POSIX)
-> (Tape -> Maybe POSIX -> Tape)
-> Lens Tape Tape (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Tape' {Maybe POSIX
retentionStartDate :: Maybe POSIX
$sel:retentionStartDate:Tape' :: Tape -> Maybe POSIX
retentionStartDate} -> Maybe POSIX
retentionStartDate) (\s :: Tape
s@Tape' {} Maybe POSIX
a -> Tape
s {$sel:retentionStartDate:Tape' :: Maybe POSIX
retentionStartDate = Maybe POSIX
a} :: Tape) ((Maybe POSIX -> f (Maybe POSIX)) -> Tape -> f Tape)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Tape
-> f Tape
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

instance Core.FromJSON Tape where
  parseJSON :: Value -> Parser Tape
parseJSON =
    String -> (Object -> Parser Tape) -> Value -> Parser Tape
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Tape"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Bool
-> Maybe POSIX
-> Tape
Tape'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Double
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe POSIX
 -> Tape)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Tape)
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
"TapeBarcode")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Tape)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Tape)
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
"TapeStatus")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Tape)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Double
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Tape)
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
"KMSKey")
            Parser
  (Maybe Text
   -> Maybe Double
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Tape)
-> Parser (Maybe Text)
-> Parser
     (Maybe Double
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Tape)
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 Double
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Tape)
-> Parser (Maybe Double)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Tape)
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
"Progress")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Tape)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Tape)
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")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Tape)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Tape)
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
"VTLDevice")
            Parser
  (Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Tape)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe POSIX -> Maybe POSIX -> Maybe Bool -> Maybe POSIX -> Tape)
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
"PoolId")
            Parser
  (Maybe Integer
   -> Maybe POSIX -> Maybe POSIX -> Maybe Bool -> Maybe POSIX -> Tape)
-> Parser (Maybe Integer)
-> Parser
     (Maybe POSIX -> Maybe POSIX -> Maybe Bool -> Maybe POSIX -> Tape)
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
"TapeUsedInBytes")
            Parser
  (Maybe POSIX -> Maybe POSIX -> Maybe Bool -> Maybe POSIX -> Tape)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe Bool -> Maybe POSIX -> Tape)
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
"TapeCreatedDate")
            Parser (Maybe POSIX -> Maybe Bool -> Maybe POSIX -> Tape)
-> Parser (Maybe POSIX)
-> Parser (Maybe Bool -> Maybe POSIX -> Tape)
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
"PoolEntryDate")
            Parser (Maybe Bool -> Maybe POSIX -> Tape)
-> Parser (Maybe Bool) -> Parser (Maybe POSIX -> Tape)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Worm")
            Parser (Maybe POSIX -> Tape) -> Parser (Maybe POSIX) -> Parser Tape
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
"RetentionStartDate")
      )

instance Prelude.Hashable Tape

instance Prelude.NFData Tape