{-# 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.Lightsail.Types.DiskSnapshotInfo 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
data DiskSnapshotInfo = DiskSnapshotInfo'
{
DiskSnapshotInfo -> Maybe Int
sizeInGb :: Prelude.Maybe Prelude.Int
}
deriving (DiskSnapshotInfo -> DiskSnapshotInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiskSnapshotInfo -> DiskSnapshotInfo -> Bool
$c/= :: DiskSnapshotInfo -> DiskSnapshotInfo -> Bool
== :: DiskSnapshotInfo -> DiskSnapshotInfo -> Bool
$c== :: DiskSnapshotInfo -> DiskSnapshotInfo -> Bool
Prelude.Eq, ReadPrec [DiskSnapshotInfo]
ReadPrec DiskSnapshotInfo
Int -> ReadS DiskSnapshotInfo
ReadS [DiskSnapshotInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DiskSnapshotInfo]
$creadListPrec :: ReadPrec [DiskSnapshotInfo]
readPrec :: ReadPrec DiskSnapshotInfo
$creadPrec :: ReadPrec DiskSnapshotInfo
readList :: ReadS [DiskSnapshotInfo]
$creadList :: ReadS [DiskSnapshotInfo]
readsPrec :: Int -> ReadS DiskSnapshotInfo
$creadsPrec :: Int -> ReadS DiskSnapshotInfo
Prelude.Read, Int -> DiskSnapshotInfo -> ShowS
[DiskSnapshotInfo] -> ShowS
DiskSnapshotInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DiskSnapshotInfo] -> ShowS
$cshowList :: [DiskSnapshotInfo] -> ShowS
show :: DiskSnapshotInfo -> String
$cshow :: DiskSnapshotInfo -> String
showsPrec :: Int -> DiskSnapshotInfo -> ShowS
$cshowsPrec :: Int -> DiskSnapshotInfo -> ShowS
Prelude.Show, forall x. Rep DiskSnapshotInfo x -> DiskSnapshotInfo
forall x. DiskSnapshotInfo -> Rep DiskSnapshotInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DiskSnapshotInfo x -> DiskSnapshotInfo
$cfrom :: forall x. DiskSnapshotInfo -> Rep DiskSnapshotInfo x
Prelude.Generic)
newDiskSnapshotInfo ::
DiskSnapshotInfo
newDiskSnapshotInfo :: DiskSnapshotInfo
newDiskSnapshotInfo =
DiskSnapshotInfo' {$sel:sizeInGb:DiskSnapshotInfo' :: Maybe Int
sizeInGb = forall a. Maybe a
Prelude.Nothing}
diskSnapshotInfo_sizeInGb :: Lens.Lens' DiskSnapshotInfo (Prelude.Maybe Prelude.Int)
diskSnapshotInfo_sizeInGb :: Lens' DiskSnapshotInfo (Maybe Int)
diskSnapshotInfo_sizeInGb = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskSnapshotInfo' {Maybe Int
sizeInGb :: Maybe Int
$sel:sizeInGb:DiskSnapshotInfo' :: DiskSnapshotInfo -> Maybe Int
sizeInGb} -> Maybe Int
sizeInGb) (\s :: DiskSnapshotInfo
s@DiskSnapshotInfo' {} Maybe Int
a -> DiskSnapshotInfo
s {$sel:sizeInGb:DiskSnapshotInfo' :: Maybe Int
sizeInGb = Maybe Int
a} :: DiskSnapshotInfo)
instance Data.FromJSON DiskSnapshotInfo where
parseJSON :: Value -> Parser DiskSnapshotInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DiskSnapshotInfo"
( \Object
x ->
Maybe Int -> DiskSnapshotInfo
DiskSnapshotInfo'
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
"sizeInGb")
)
instance Prelude.Hashable DiskSnapshotInfo where
hashWithSalt :: Int -> DiskSnapshotInfo -> Int
hashWithSalt Int
_salt DiskSnapshotInfo' {Maybe Int
sizeInGb :: Maybe Int
$sel:sizeInGb:DiskSnapshotInfo' :: DiskSnapshotInfo -> Maybe Int
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
sizeInGb
instance Prelude.NFData DiskSnapshotInfo where
rnf :: DiskSnapshotInfo -> ()
rnf DiskSnapshotInfo' {Maybe Int
sizeInGb :: Maybe Int
$sel:sizeInGb:DiskSnapshotInfo' :: DiskSnapshotInfo -> Maybe Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
sizeInGb