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

-- | Describes a virtual tape.
--
-- /See:/ 'newTapeInfo' smart constructor.
data TapeInfo = TapeInfo'
  { -- | The Amazon Resource Name (ARN) of the gateway. Use the ListGateways
    -- operation to return a list of gateways for your account and Amazon Web
    -- Services Region.
    TapeInfo -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | The date that the tape entered the custom tape pool with tape retention
    -- lock enabled.
    TapeInfo -> Maybe POSIX
poolEntryDate :: Prelude.Maybe Data.POSIX,
    -- | The ID of the pool that you want to add your tape to for archiving. The
    -- tape in this pool is 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.
    TapeInfo -> Maybe Text
poolId :: Prelude.Maybe Prelude.Text,
    -- | The date that the tape became subject to tape retention lock.
    TapeInfo -> Maybe POSIX
retentionStartDate :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of a virtual tape.
    TapeInfo -> Maybe Text
tapeARN :: Prelude.Maybe Prelude.Text,
    -- | The barcode that identifies a specific virtual tape.
    TapeInfo -> Maybe Text
tapeBarcode :: Prelude.Maybe Prelude.Text,
    -- | The size, in bytes, of a virtual tape.
    TapeInfo -> Maybe Integer
tapeSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The status of the tape.
    TapeInfo -> Maybe Text
tapeStatus :: Prelude.Maybe Prelude.Text
  }
  deriving (TapeInfo -> TapeInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TapeInfo -> TapeInfo -> Bool
$c/= :: TapeInfo -> TapeInfo -> Bool
== :: TapeInfo -> TapeInfo -> Bool
$c== :: TapeInfo -> TapeInfo -> Bool
Prelude.Eq, ReadPrec [TapeInfo]
ReadPrec TapeInfo
Int -> ReadS TapeInfo
ReadS [TapeInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TapeInfo]
$creadListPrec :: ReadPrec [TapeInfo]
readPrec :: ReadPrec TapeInfo
$creadPrec :: ReadPrec TapeInfo
readList :: ReadS [TapeInfo]
$creadList :: ReadS [TapeInfo]
readsPrec :: Int -> ReadS TapeInfo
$creadsPrec :: Int -> ReadS TapeInfo
Prelude.Read, Int -> TapeInfo -> ShowS
[TapeInfo] -> ShowS
TapeInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TapeInfo] -> ShowS
$cshowList :: [TapeInfo] -> ShowS
show :: TapeInfo -> String
$cshow :: TapeInfo -> String
showsPrec :: Int -> TapeInfo -> ShowS
$cshowsPrec :: Int -> TapeInfo -> ShowS
Prelude.Show, forall x. Rep TapeInfo x -> TapeInfo
forall x. TapeInfo -> Rep TapeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TapeInfo x -> TapeInfo
$cfrom :: forall x. TapeInfo -> Rep TapeInfo x
Prelude.Generic)

-- |
-- Create a value of 'TapeInfo' 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:
--
-- 'gatewayARN', 'tapeInfo_gatewayARN' - The Amazon Resource Name (ARN) of the gateway. Use the ListGateways
-- operation to return a list of gateways for your account and Amazon Web
-- Services Region.
--
-- 'poolEntryDate', 'tapeInfo_poolEntryDate' - The date that the tape entered the custom tape pool with tape retention
-- lock enabled.
--
-- 'poolId', 'tapeInfo_poolId' - The ID of the pool that you want to add your tape to for archiving. The
-- tape in this pool is 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.
--
-- 'retentionStartDate', 'tapeInfo_retentionStartDate' - The date that the tape became subject to tape retention lock.
--
-- 'tapeARN', 'tapeInfo_tapeARN' - The Amazon Resource Name (ARN) of a virtual tape.
--
-- 'tapeBarcode', 'tapeInfo_tapeBarcode' - The barcode that identifies a specific virtual tape.
--
-- 'tapeSizeInBytes', 'tapeInfo_tapeSizeInBytes' - The size, in bytes, of a virtual tape.
--
-- 'tapeStatus', 'tapeInfo_tapeStatus' - The status of the tape.
newTapeInfo ::
  TapeInfo
newTapeInfo :: TapeInfo
newTapeInfo =
  TapeInfo'
    { $sel:gatewayARN:TapeInfo' :: Maybe Text
gatewayARN = forall a. Maybe a
Prelude.Nothing,
      $sel:poolEntryDate:TapeInfo' :: Maybe POSIX
poolEntryDate = forall a. Maybe a
Prelude.Nothing,
      $sel:poolId:TapeInfo' :: Maybe Text
poolId = forall a. Maybe a
Prelude.Nothing,
      $sel:retentionStartDate:TapeInfo' :: Maybe POSIX
retentionStartDate = forall a. Maybe a
Prelude.Nothing,
      $sel:tapeARN:TapeInfo' :: Maybe Text
tapeARN = forall a. Maybe a
Prelude.Nothing,
      $sel:tapeBarcode:TapeInfo' :: Maybe Text
tapeBarcode = forall a. Maybe a
Prelude.Nothing,
      $sel:tapeSizeInBytes:TapeInfo' :: Maybe Integer
tapeSizeInBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:tapeStatus:TapeInfo' :: Maybe Text
tapeStatus = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the gateway. Use the ListGateways
-- operation to return a list of gateways for your account and Amazon Web
-- Services Region.
tapeInfo_gatewayARN :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_gatewayARN :: Lens' TapeInfo (Maybe Text)
tapeInfo_gatewayARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeInfo' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:TapeInfo' :: TapeInfo -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: TapeInfo
s@TapeInfo' {} Maybe Text
a -> TapeInfo
s {$sel:gatewayARN:TapeInfo' :: Maybe Text
gatewayARN = Maybe Text
a} :: TapeInfo)

-- | The date that the tape entered the custom tape pool with tape retention
-- lock enabled.
tapeInfo_poolEntryDate :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.UTCTime)
tapeInfo_poolEntryDate :: Lens' TapeInfo (Maybe UTCTime)
tapeInfo_poolEntryDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeInfo' {Maybe POSIX
poolEntryDate :: Maybe POSIX
$sel:poolEntryDate:TapeInfo' :: TapeInfo -> Maybe POSIX
poolEntryDate} -> Maybe POSIX
poolEntryDate) (\s :: TapeInfo
s@TapeInfo' {} Maybe POSIX
a -> TapeInfo
s {$sel:poolEntryDate:TapeInfo' :: Maybe POSIX
poolEntryDate = Maybe POSIX
a} :: TapeInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ID of the pool that you want to add your tape to for archiving. The
-- tape in this pool is 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.
tapeInfo_poolId :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_poolId :: Lens' TapeInfo (Maybe Text)
tapeInfo_poolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeInfo' {Maybe Text
poolId :: Maybe Text
$sel:poolId:TapeInfo' :: TapeInfo -> Maybe Text
poolId} -> Maybe Text
poolId) (\s :: TapeInfo
s@TapeInfo' {} Maybe Text
a -> TapeInfo
s {$sel:poolId:TapeInfo' :: Maybe Text
poolId = Maybe Text
a} :: TapeInfo)

-- | The date that the tape became subject to tape retention lock.
tapeInfo_retentionStartDate :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.UTCTime)
tapeInfo_retentionStartDate :: Lens' TapeInfo (Maybe UTCTime)
tapeInfo_retentionStartDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeInfo' {Maybe POSIX
retentionStartDate :: Maybe POSIX
$sel:retentionStartDate:TapeInfo' :: TapeInfo -> Maybe POSIX
retentionStartDate} -> Maybe POSIX
retentionStartDate) (\s :: TapeInfo
s@TapeInfo' {} Maybe POSIX
a -> TapeInfo
s {$sel:retentionStartDate:TapeInfo' :: Maybe POSIX
retentionStartDate = Maybe POSIX
a} :: TapeInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

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

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

-- | The status of the tape.
tapeInfo_tapeStatus :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_tapeStatus :: Lens' TapeInfo (Maybe Text)
tapeInfo_tapeStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TapeInfo' {Maybe Text
tapeStatus :: Maybe Text
$sel:tapeStatus:TapeInfo' :: TapeInfo -> Maybe Text
tapeStatus} -> Maybe Text
tapeStatus) (\s :: TapeInfo
s@TapeInfo' {} Maybe Text
a -> TapeInfo
s {$sel:tapeStatus:TapeInfo' :: Maybe Text
tapeStatus = Maybe Text
a} :: TapeInfo)

instance Data.FromJSON TapeInfo where
  parseJSON :: Value -> Parser TapeInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TapeInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> TapeInfo
TapeInfo'
            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
"GatewayARN")
            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
"PoolEntryDate")
            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
"PoolId")
            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
"RetentionStartDate")
            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
"TapeARN")
            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
"TapeBarcode")
            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
"TapeSizeInBytes")
            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
"TapeStatus")
      )

instance Prelude.Hashable TapeInfo where
  hashWithSalt :: Int -> TapeInfo -> Int
hashWithSalt Int
_salt TapeInfo' {Maybe Integer
Maybe Text
Maybe POSIX
tapeStatus :: Maybe Text
tapeSizeInBytes :: Maybe Integer
tapeBarcode :: Maybe Text
tapeARN :: Maybe Text
retentionStartDate :: Maybe POSIX
poolId :: Maybe Text
poolEntryDate :: Maybe POSIX
gatewayARN :: Maybe Text
$sel:tapeStatus:TapeInfo' :: TapeInfo -> Maybe Text
$sel:tapeSizeInBytes:TapeInfo' :: TapeInfo -> Maybe Integer
$sel:tapeBarcode:TapeInfo' :: TapeInfo -> Maybe Text
$sel:tapeARN:TapeInfo' :: TapeInfo -> Maybe Text
$sel:retentionStartDate:TapeInfo' :: TapeInfo -> Maybe POSIX
$sel:poolId:TapeInfo' :: TapeInfo -> Maybe Text
$sel:poolEntryDate:TapeInfo' :: TapeInfo -> Maybe POSIX
$sel:gatewayARN:TapeInfo' :: TapeInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
poolEntryDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
poolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
retentionStartDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tapeARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tapeBarcode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
tapeSizeInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tapeStatus

instance Prelude.NFData TapeInfo where
  rnf :: TapeInfo -> ()
rnf TapeInfo' {Maybe Integer
Maybe Text
Maybe POSIX
tapeStatus :: Maybe Text
tapeSizeInBytes :: Maybe Integer
tapeBarcode :: Maybe Text
tapeARN :: Maybe Text
retentionStartDate :: Maybe POSIX
poolId :: Maybe Text
poolEntryDate :: Maybe POSIX
gatewayARN :: Maybe Text
$sel:tapeStatus:TapeInfo' :: TapeInfo -> Maybe Text
$sel:tapeSizeInBytes:TapeInfo' :: TapeInfo -> Maybe Integer
$sel:tapeBarcode:TapeInfo' :: TapeInfo -> Maybe Text
$sel:tapeARN:TapeInfo' :: TapeInfo -> Maybe Text
$sel:retentionStartDate:TapeInfo' :: TapeInfo -> Maybe POSIX
$sel:poolId:TapeInfo' :: TapeInfo -> Maybe Text
$sel:poolEntryDate:TapeInfo' :: TapeInfo -> Maybe POSIX
$sel:gatewayARN:TapeInfo' :: TapeInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
poolEntryDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
poolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
retentionStartDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tapeARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tapeBarcode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
tapeSizeInBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tapeStatus