{-# 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.VolumeInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VolumeInfo = VolumeInfo'
{ VolumeInfo -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
VolumeInfo -> Maybe Text
volumeAttachmentStatus :: Prelude.Maybe Prelude.Text,
VolumeInfo -> Maybe Text
volumeARN :: Prelude.Maybe Prelude.Text,
VolumeInfo -> Maybe Integer
volumeSizeInBytes :: Prelude.Maybe Prelude.Integer,
VolumeInfo -> Maybe Text
volumeId :: Prelude.Maybe Prelude.Text,
VolumeInfo -> Maybe Text
gatewayId :: Prelude.Maybe Prelude.Text,
VolumeInfo -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text
}
deriving (VolumeInfo -> VolumeInfo -> Bool
(VolumeInfo -> VolumeInfo -> Bool)
-> (VolumeInfo -> VolumeInfo -> Bool) -> Eq VolumeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeInfo -> VolumeInfo -> Bool
$c/= :: VolumeInfo -> VolumeInfo -> Bool
== :: VolumeInfo -> VolumeInfo -> Bool
$c== :: VolumeInfo -> VolumeInfo -> Bool
Prelude.Eq, ReadPrec [VolumeInfo]
ReadPrec VolumeInfo
Int -> ReadS VolumeInfo
ReadS [VolumeInfo]
(Int -> ReadS VolumeInfo)
-> ReadS [VolumeInfo]
-> ReadPrec VolumeInfo
-> ReadPrec [VolumeInfo]
-> Read VolumeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeInfo]
$creadListPrec :: ReadPrec [VolumeInfo]
readPrec :: ReadPrec VolumeInfo
$creadPrec :: ReadPrec VolumeInfo
readList :: ReadS [VolumeInfo]
$creadList :: ReadS [VolumeInfo]
readsPrec :: Int -> ReadS VolumeInfo
$creadsPrec :: Int -> ReadS VolumeInfo
Prelude.Read, Int -> VolumeInfo -> ShowS
[VolumeInfo] -> ShowS
VolumeInfo -> String
(Int -> VolumeInfo -> ShowS)
-> (VolumeInfo -> String)
-> ([VolumeInfo] -> ShowS)
-> Show VolumeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeInfo] -> ShowS
$cshowList :: [VolumeInfo] -> ShowS
show :: VolumeInfo -> String
$cshow :: VolumeInfo -> String
showsPrec :: Int -> VolumeInfo -> ShowS
$cshowsPrec :: Int -> VolumeInfo -> ShowS
Prelude.Show, (forall x. VolumeInfo -> Rep VolumeInfo x)
-> (forall x. Rep VolumeInfo x -> VolumeInfo) -> Generic VolumeInfo
forall x. Rep VolumeInfo x -> VolumeInfo
forall x. VolumeInfo -> Rep VolumeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeInfo x -> VolumeInfo
$cfrom :: forall x. VolumeInfo -> Rep VolumeInfo x
Prelude.Generic)
newVolumeInfo ::
VolumeInfo
newVolumeInfo :: VolumeInfo
newVolumeInfo =
VolumeInfo' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo
VolumeInfo'
{ $sel:gatewayARN:VolumeInfo' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeAttachmentStatus:VolumeInfo' :: Maybe Text
volumeAttachmentStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeARN:VolumeInfo' :: Maybe Text
volumeARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeSizeInBytes:VolumeInfo' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:volumeId:VolumeInfo' :: Maybe Text
volumeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gatewayId:VolumeInfo' :: Maybe Text
gatewayId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:volumeType:VolumeInfo' :: Maybe Text
volumeType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
volumeInfo_gatewayARN :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_gatewayARN :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_gatewayARN = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:VolumeInfo' :: VolumeInfo -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:gatewayARN:VolumeInfo' :: Maybe Text
gatewayARN = Maybe Text
a} :: VolumeInfo)
volumeInfo_volumeAttachmentStatus :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeAttachmentStatus :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeAttachmentStatus = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
volumeAttachmentStatus :: Maybe Text
$sel:volumeAttachmentStatus:VolumeInfo' :: VolumeInfo -> Maybe Text
volumeAttachmentStatus} -> Maybe Text
volumeAttachmentStatus) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:volumeAttachmentStatus:VolumeInfo' :: Maybe Text
volumeAttachmentStatus = Maybe Text
a} :: VolumeInfo)
volumeInfo_volumeARN :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeARN :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeARN = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
volumeARN :: Maybe Text
$sel:volumeARN:VolumeInfo' :: VolumeInfo -> Maybe Text
volumeARN} -> Maybe Text
volumeARN) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:volumeARN:VolumeInfo' :: Maybe Text
volumeARN = Maybe Text
a} :: VolumeInfo)
volumeInfo_volumeSizeInBytes :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Integer)
volumeInfo_volumeSizeInBytes :: (Maybe Integer -> f (Maybe Integer)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeSizeInBytes = (VolumeInfo -> Maybe Integer)
-> (VolumeInfo -> Maybe Integer -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Integer
volumeSizeInBytes :: Maybe Integer
$sel:volumeSizeInBytes:VolumeInfo' :: VolumeInfo -> Maybe Integer
volumeSizeInBytes} -> Maybe Integer
volumeSizeInBytes) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Integer
a -> VolumeInfo
s {$sel:volumeSizeInBytes:VolumeInfo' :: Maybe Integer
volumeSizeInBytes = Maybe Integer
a} :: VolumeInfo)
volumeInfo_volumeId :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeId :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeId = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
volumeId :: Maybe Text
$sel:volumeId:VolumeInfo' :: VolumeInfo -> Maybe Text
volumeId} -> Maybe Text
volumeId) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:volumeId:VolumeInfo' :: Maybe Text
volumeId = Maybe Text
a} :: VolumeInfo)
volumeInfo_gatewayId :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_gatewayId :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_gatewayId = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:VolumeInfo' :: VolumeInfo -> Maybe Text
gatewayId} -> Maybe Text
gatewayId) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:gatewayId:VolumeInfo' :: Maybe Text
gatewayId = Maybe Text
a} :: VolumeInfo)
volumeInfo_volumeType :: Lens.Lens' VolumeInfo (Prelude.Maybe Prelude.Text)
volumeInfo_volumeType :: (Maybe Text -> f (Maybe Text)) -> VolumeInfo -> f VolumeInfo
volumeInfo_volumeType = (VolumeInfo -> Maybe Text)
-> (VolumeInfo -> Maybe Text -> VolumeInfo)
-> Lens VolumeInfo VolumeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeInfo' {Maybe Text
volumeType :: Maybe Text
$sel:volumeType:VolumeInfo' :: VolumeInfo -> Maybe Text
volumeType} -> Maybe Text
volumeType) (\s :: VolumeInfo
s@VolumeInfo' {} Maybe Text
a -> VolumeInfo
s {$sel:volumeType:VolumeInfo' :: Maybe Text
volumeType = Maybe Text
a} :: VolumeInfo)
instance Core.FromJSON VolumeInfo where
parseJSON :: Value -> Parser VolumeInfo
parseJSON =
String
-> (Object -> Parser VolumeInfo) -> Value -> Parser VolumeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VolumeInfo"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo
VolumeInfo'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo)
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
"GatewayARN")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo)
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
"VolumeAttachmentStatus")
Parser
(Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VolumeInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Integer
-> Maybe Text -> Maybe Text -> Maybe Text -> VolumeInfo)
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 Text -> Maybe Text -> Maybe Text -> VolumeInfo)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> VolumeInfo)
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 Text -> Maybe Text -> Maybe Text -> VolumeInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> VolumeInfo)
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
"VolumeId")
Parser (Maybe Text -> Maybe Text -> VolumeInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> VolumeInfo)
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
"GatewayId")
Parser (Maybe Text -> VolumeInfo)
-> Parser (Maybe Text) -> Parser VolumeInfo
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
"VolumeType")
)
instance Prelude.Hashable VolumeInfo
instance Prelude.NFData VolumeInfo