{-# 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 #-}
module Amazonka.StorageGateway.Types.TapeInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TapeInfo = TapeInfo'
{
TapeInfo -> Maybe Text
tapeBarcode :: Prelude.Maybe Prelude.Text,
TapeInfo -> Maybe Text
tapeStatus :: Prelude.Maybe Prelude.Text,
TapeInfo -> Maybe Text
tapeARN :: Prelude.Maybe Prelude.Text,
TapeInfo -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
TapeInfo -> Maybe Integer
tapeSizeInBytes :: Prelude.Maybe Prelude.Integer,
TapeInfo -> Maybe Text
poolId :: Prelude.Maybe Prelude.Text,
TapeInfo -> Maybe POSIX
poolEntryDate :: Prelude.Maybe Core.POSIX,
TapeInfo -> Maybe POSIX
retentionStartDate :: Prelude.Maybe Core.POSIX
}
deriving (TapeInfo -> TapeInfo -> Bool
(TapeInfo -> TapeInfo -> Bool)
-> (TapeInfo -> TapeInfo -> Bool) -> Eq TapeInfo
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]
(Int -> ReadS TapeInfo)
-> ReadS [TapeInfo]
-> ReadPrec TapeInfo
-> ReadPrec [TapeInfo]
-> Read 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
(Int -> TapeInfo -> ShowS)
-> (TapeInfo -> String) -> ([TapeInfo] -> ShowS) -> Show TapeInfo
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. TapeInfo -> Rep TapeInfo x)
-> (forall x. Rep TapeInfo x -> TapeInfo) -> Generic TapeInfo
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)
newTapeInfo ::
TapeInfo
newTapeInfo :: TapeInfo
newTapeInfo =
TapeInfo' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo
TapeInfo'
{ $sel:tapeBarcode:TapeInfo' :: Maybe Text
tapeBarcode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tapeStatus:TapeInfo' :: Maybe Text
tapeStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tapeARN:TapeInfo' :: Maybe Text
tapeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayARN:TapeInfo' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tapeSizeInBytes:TapeInfo' :: Maybe Integer
tapeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:poolId:TapeInfo' :: Maybe Text
poolId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:poolEntryDate:TapeInfo' :: Maybe POSIX
poolEntryDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:retentionStartDate:TapeInfo' :: Maybe POSIX
retentionStartDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
tapeInfo_tapeBarcode :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_tapeBarcode :: (Maybe Text -> f (Maybe Text)) -> TapeInfo -> f TapeInfo
tapeInfo_tapeBarcode = (TapeInfo -> Maybe Text)
-> (TapeInfo -> Maybe Text -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe Text) (Maybe Text)
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)
tapeInfo_tapeStatus :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_tapeStatus :: (Maybe Text -> f (Maybe Text)) -> TapeInfo -> f TapeInfo
tapeInfo_tapeStatus = (TapeInfo -> Maybe Text)
-> (TapeInfo -> Maybe Text -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe Text) (Maybe Text)
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)
tapeInfo_tapeARN :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_tapeARN :: (Maybe Text -> f (Maybe Text)) -> TapeInfo -> f TapeInfo
tapeInfo_tapeARN = (TapeInfo -> Maybe Text)
-> (TapeInfo -> Maybe Text -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe Text) (Maybe Text)
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)
tapeInfo_gatewayARN :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_gatewayARN :: (Maybe Text -> f (Maybe Text)) -> TapeInfo -> f TapeInfo
tapeInfo_gatewayARN = (TapeInfo -> Maybe Text)
-> (TapeInfo -> Maybe Text -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe Text) (Maybe Text)
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)
tapeInfo_tapeSizeInBytes :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Integer)
tapeInfo_tapeSizeInBytes :: (Maybe Integer -> f (Maybe Integer)) -> TapeInfo -> f TapeInfo
tapeInfo_tapeSizeInBytes = (TapeInfo -> Maybe Integer)
-> (TapeInfo -> Maybe Integer -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe Integer) (Maybe Integer)
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)
tapeInfo_poolId :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.Text)
tapeInfo_poolId :: (Maybe Text -> f (Maybe Text)) -> TapeInfo -> f TapeInfo
tapeInfo_poolId = (TapeInfo -> Maybe Text)
-> (TapeInfo -> Maybe Text -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe Text) (Maybe Text)
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)
tapeInfo_poolEntryDate :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.UTCTime)
tapeInfo_poolEntryDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> TapeInfo -> f TapeInfo
tapeInfo_poolEntryDate = (TapeInfo -> Maybe POSIX)
-> (TapeInfo -> Maybe POSIX -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> TapeInfo -> f TapeInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TapeInfo
-> f TapeInfo
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
tapeInfo_retentionStartDate :: Lens.Lens' TapeInfo (Prelude.Maybe Prelude.UTCTime)
tapeInfo_retentionStartDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> TapeInfo -> f TapeInfo
tapeInfo_retentionStartDate = (TapeInfo -> Maybe POSIX)
-> (TapeInfo -> Maybe POSIX -> TapeInfo)
-> Lens TapeInfo TapeInfo (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> TapeInfo -> f TapeInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TapeInfo
-> f TapeInfo
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 TapeInfo where
parseJSON :: Value -> Parser TapeInfo
parseJSON =
String -> (Object -> Parser TapeInfo) -> Value -> Parser TapeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TapeInfo"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo
TapeInfo'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo)
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 Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo)
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 Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo)
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 Text
-> Maybe Integer
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> TapeInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Integer
-> Maybe Text -> Maybe POSIX -> Maybe POSIX -> TapeInfo)
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
"GatewayARN")
Parser
(Maybe Integer
-> Maybe Text -> Maybe POSIX -> Maybe POSIX -> TapeInfo)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe POSIX -> Maybe POSIX -> TapeInfo)
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 POSIX -> Maybe POSIX -> TapeInfo)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe POSIX -> TapeInfo)
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 POSIX -> Maybe POSIX -> TapeInfo)
-> Parser (Maybe POSIX) -> Parser (Maybe POSIX -> TapeInfo)
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 POSIX -> TapeInfo)
-> Parser (Maybe POSIX) -> Parser TapeInfo
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 TapeInfo
instance Prelude.NFData TapeInfo