{-# 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.DiskInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DiskInfo = DiskInfo'
{
DiskInfo -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
DiskInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
DiskInfo -> Maybe Int
sizeInGb :: Prelude.Maybe Prelude.Int,
DiskInfo -> Maybe Bool
isSystemDisk :: Prelude.Maybe Prelude.Bool
}
deriving (DiskInfo -> DiskInfo -> Bool
(DiskInfo -> DiskInfo -> Bool)
-> (DiskInfo -> DiskInfo -> Bool) -> Eq DiskInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiskInfo -> DiskInfo -> Bool
$c/= :: DiskInfo -> DiskInfo -> Bool
== :: DiskInfo -> DiskInfo -> Bool
$c== :: DiskInfo -> DiskInfo -> Bool
Prelude.Eq, ReadPrec [DiskInfo]
ReadPrec DiskInfo
Int -> ReadS DiskInfo
ReadS [DiskInfo]
(Int -> ReadS DiskInfo)
-> ReadS [DiskInfo]
-> ReadPrec DiskInfo
-> ReadPrec [DiskInfo]
-> Read DiskInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DiskInfo]
$creadListPrec :: ReadPrec [DiskInfo]
readPrec :: ReadPrec DiskInfo
$creadPrec :: ReadPrec DiskInfo
readList :: ReadS [DiskInfo]
$creadList :: ReadS [DiskInfo]
readsPrec :: Int -> ReadS DiskInfo
$creadsPrec :: Int -> ReadS DiskInfo
Prelude.Read, Int -> DiskInfo -> ShowS
[DiskInfo] -> ShowS
DiskInfo -> String
(Int -> DiskInfo -> ShowS)
-> (DiskInfo -> String) -> ([DiskInfo] -> ShowS) -> Show DiskInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DiskInfo] -> ShowS
$cshowList :: [DiskInfo] -> ShowS
show :: DiskInfo -> String
$cshow :: DiskInfo -> String
showsPrec :: Int -> DiskInfo -> ShowS
$cshowsPrec :: Int -> DiskInfo -> ShowS
Prelude.Show, (forall x. DiskInfo -> Rep DiskInfo x)
-> (forall x. Rep DiskInfo x -> DiskInfo) -> Generic DiskInfo
forall x. Rep DiskInfo x -> DiskInfo
forall x. DiskInfo -> Rep DiskInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DiskInfo x -> DiskInfo
$cfrom :: forall x. DiskInfo -> Rep DiskInfo x
Prelude.Generic)
newDiskInfo ::
DiskInfo
newDiskInfo :: DiskInfo
newDiskInfo =
DiskInfo' :: Maybe Text -> Maybe Text -> Maybe Int -> Maybe Bool -> DiskInfo
DiskInfo'
{ $sel:path:DiskInfo' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:DiskInfo' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sizeInGb:DiskInfo' :: Maybe Int
sizeInGb = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:isSystemDisk:DiskInfo' :: Maybe Bool
isSystemDisk = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
diskInfo_path :: Lens.Lens' DiskInfo (Prelude.Maybe Prelude.Text)
diskInfo_path :: (Maybe Text -> f (Maybe Text)) -> DiskInfo -> f DiskInfo
diskInfo_path = (DiskInfo -> Maybe Text)
-> (DiskInfo -> Maybe Text -> DiskInfo)
-> Lens DiskInfo DiskInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskInfo' {Maybe Text
path :: Maybe Text
$sel:path:DiskInfo' :: DiskInfo -> Maybe Text
path} -> Maybe Text
path) (\s :: DiskInfo
s@DiskInfo' {} Maybe Text
a -> DiskInfo
s {$sel:path:DiskInfo' :: Maybe Text
path = Maybe Text
a} :: DiskInfo)
diskInfo_name :: Lens.Lens' DiskInfo (Prelude.Maybe Prelude.Text)
diskInfo_name :: (Maybe Text -> f (Maybe Text)) -> DiskInfo -> f DiskInfo
diskInfo_name = (DiskInfo -> Maybe Text)
-> (DiskInfo -> Maybe Text -> DiskInfo)
-> Lens DiskInfo DiskInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskInfo' {Maybe Text
name :: Maybe Text
$sel:name:DiskInfo' :: DiskInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: DiskInfo
s@DiskInfo' {} Maybe Text
a -> DiskInfo
s {$sel:name:DiskInfo' :: Maybe Text
name = Maybe Text
a} :: DiskInfo)
diskInfo_sizeInGb :: Lens.Lens' DiskInfo (Prelude.Maybe Prelude.Int)
diskInfo_sizeInGb :: (Maybe Int -> f (Maybe Int)) -> DiskInfo -> f DiskInfo
diskInfo_sizeInGb = (DiskInfo -> Maybe Int)
-> (DiskInfo -> Maybe Int -> DiskInfo)
-> Lens DiskInfo DiskInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskInfo' {Maybe Int
sizeInGb :: Maybe Int
$sel:sizeInGb:DiskInfo' :: DiskInfo -> Maybe Int
sizeInGb} -> Maybe Int
sizeInGb) (\s :: DiskInfo
s@DiskInfo' {} Maybe Int
a -> DiskInfo
s {$sel:sizeInGb:DiskInfo' :: Maybe Int
sizeInGb = Maybe Int
a} :: DiskInfo)
diskInfo_isSystemDisk :: Lens.Lens' DiskInfo (Prelude.Maybe Prelude.Bool)
diskInfo_isSystemDisk :: (Maybe Bool -> f (Maybe Bool)) -> DiskInfo -> f DiskInfo
diskInfo_isSystemDisk = (DiskInfo -> Maybe Bool)
-> (DiskInfo -> Maybe Bool -> DiskInfo)
-> Lens DiskInfo DiskInfo (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DiskInfo' {Maybe Bool
isSystemDisk :: Maybe Bool
$sel:isSystemDisk:DiskInfo' :: DiskInfo -> Maybe Bool
isSystemDisk} -> Maybe Bool
isSystemDisk) (\s :: DiskInfo
s@DiskInfo' {} Maybe Bool
a -> DiskInfo
s {$sel:isSystemDisk:DiskInfo' :: Maybe Bool
isSystemDisk = Maybe Bool
a} :: DiskInfo)
instance Core.FromJSON DiskInfo where
parseJSON :: Value -> Parser DiskInfo
parseJSON =
String -> (Object -> Parser DiskInfo) -> Value -> Parser DiskInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DiskInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Int -> Maybe Bool -> DiskInfo
DiskInfo'
(Maybe Text -> Maybe Text -> Maybe Int -> Maybe Bool -> DiskInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> Maybe Bool -> DiskInfo)
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
"path")
Parser (Maybe Text -> Maybe Int -> Maybe Bool -> DiskInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Bool -> DiskInfo)
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
"name")
Parser (Maybe Int -> Maybe Bool -> DiskInfo)
-> Parser (Maybe Int) -> Parser (Maybe Bool -> DiskInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sizeInGb")
Parser (Maybe Bool -> DiskInfo)
-> Parser (Maybe Bool) -> Parser DiskInfo
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
"isSystemDisk")
)
instance Prelude.Hashable DiskInfo
instance Prelude.NFData DiskInfo