{-# 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.Disk where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.AddOn
import Amazonka.Lightsail.Types.DiskState
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude
data Disk = Disk'
{
Disk -> Maybe DiskState
state :: Prelude.Maybe DiskState,
Disk -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
Disk -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Disk -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
Disk -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
Disk -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
Disk -> Maybe Int
iops :: Prelude.Maybe Prelude.Int,
Disk -> Maybe Bool
isAttached :: Prelude.Maybe Prelude.Bool,
Disk -> Maybe [AddOn]
addOns :: Prelude.Maybe [AddOn],
Disk -> Maybe Text
attachmentState :: Prelude.Maybe Prelude.Text,
Disk -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Disk -> Maybe Int
sizeInGb :: Prelude.Maybe Prelude.Int,
Disk -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
Disk -> Maybe Bool
isSystemDisk :: Prelude.Maybe Prelude.Bool,
Disk -> Maybe Text
attachedTo :: Prelude.Maybe Prelude.Text,
Disk -> Maybe Int
gbInUse :: Prelude.Maybe Prelude.Int,
Disk -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (Disk -> Disk -> Bool
(Disk -> Disk -> Bool) -> (Disk -> Disk -> Bool) -> Eq Disk
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Disk -> Disk -> Bool
$c/= :: Disk -> Disk -> Bool
== :: Disk -> Disk -> Bool
$c== :: Disk -> Disk -> Bool
Prelude.Eq, ReadPrec [Disk]
ReadPrec Disk
Int -> ReadS Disk
ReadS [Disk]
(Int -> ReadS Disk)
-> ReadS [Disk] -> ReadPrec Disk -> ReadPrec [Disk] -> Read Disk
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Disk]
$creadListPrec :: ReadPrec [Disk]
readPrec :: ReadPrec Disk
$creadPrec :: ReadPrec Disk
readList :: ReadS [Disk]
$creadList :: ReadS [Disk]
readsPrec :: Int -> ReadS Disk
$creadsPrec :: Int -> ReadS Disk
Prelude.Read, Int -> Disk -> ShowS
[Disk] -> ShowS
Disk -> String
(Int -> Disk -> ShowS)
-> (Disk -> String) -> ([Disk] -> ShowS) -> Show Disk
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Disk] -> ShowS
$cshowList :: [Disk] -> ShowS
show :: Disk -> String
$cshow :: Disk -> String
showsPrec :: Int -> Disk -> ShowS
$cshowsPrec :: Int -> Disk -> ShowS
Prelude.Show, (forall x. Disk -> Rep Disk x)
-> (forall x. Rep Disk x -> Disk) -> Generic Disk
forall x. Rep Disk x -> Disk
forall x. Disk -> Rep Disk x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Disk x -> Disk
$cfrom :: forall x. Disk -> Rep Disk x
Prelude.Generic)
newDisk ::
Disk
newDisk :: Disk
newDisk =
Disk' :: Maybe DiskState
-> Maybe ResourceType
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk
Disk'
{ $sel:state:Disk' :: Maybe DiskState
state = Maybe DiskState
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:Disk' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Disk' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:path:Disk' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Disk' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:location:Disk' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
$sel:iops:Disk' :: Maybe Int
iops = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:isAttached:Disk' :: Maybe Bool
isAttached = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:addOns:Disk' :: Maybe [AddOn]
addOns = Maybe [AddOn]
forall a. Maybe a
Prelude.Nothing,
$sel:attachmentState:Disk' :: Maybe Text
attachmentState = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Disk' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sizeInGb:Disk' :: Maybe Int
sizeInGb = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:Disk' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:isSystemDisk:Disk' :: Maybe Bool
isSystemDisk = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:attachedTo:Disk' :: Maybe Text
attachedTo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gbInUse:Disk' :: Maybe Int
gbInUse = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:tags:Disk' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
disk_state :: Lens.Lens' Disk (Prelude.Maybe DiskState)
disk_state :: (Maybe DiskState -> f (Maybe DiskState)) -> Disk -> f Disk
disk_state = (Disk -> Maybe DiskState)
-> (Disk -> Maybe DiskState -> Disk)
-> Lens Disk Disk (Maybe DiskState) (Maybe DiskState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe DiskState
state :: Maybe DiskState
$sel:state:Disk' :: Disk -> Maybe DiskState
state} -> Maybe DiskState
state) (\s :: Disk
s@Disk' {} Maybe DiskState
a -> Disk
s {$sel:state:Disk' :: Maybe DiskState
state = Maybe DiskState
a} :: Disk)
disk_resourceType :: Lens.Lens' Disk (Prelude.Maybe ResourceType)
disk_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType)) -> Disk -> f Disk
disk_resourceType = (Disk -> Maybe ResourceType)
-> (Disk -> Maybe ResourceType -> Disk)
-> Lens Disk Disk (Maybe ResourceType) (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:Disk' :: Disk -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: Disk
s@Disk' {} Maybe ResourceType
a -> Disk
s {$sel:resourceType:Disk' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: Disk)
disk_arn :: Lens.Lens' Disk (Prelude.Maybe Prelude.Text)
disk_arn :: (Maybe Text -> f (Maybe Text)) -> Disk -> f Disk
disk_arn = (Disk -> Maybe Text)
-> (Disk -> Maybe Text -> Disk)
-> Lens Disk Disk (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Text
arn :: Maybe Text
$sel:arn:Disk' :: Disk -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Disk
s@Disk' {} Maybe Text
a -> Disk
s {$sel:arn:Disk' :: Maybe Text
arn = Maybe Text
a} :: Disk)
disk_path :: Lens.Lens' Disk (Prelude.Maybe Prelude.Text)
disk_path :: (Maybe Text -> f (Maybe Text)) -> Disk -> f Disk
disk_path = (Disk -> Maybe Text)
-> (Disk -> Maybe Text -> Disk)
-> Lens Disk Disk (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Text
path :: Maybe Text
$sel:path:Disk' :: Disk -> Maybe Text
path} -> Maybe Text
path) (\s :: Disk
s@Disk' {} Maybe Text
a -> Disk
s {$sel:path:Disk' :: Maybe Text
path = Maybe Text
a} :: Disk)
disk_createdAt :: Lens.Lens' Disk (Prelude.Maybe Prelude.UTCTime)
disk_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Disk -> f Disk
disk_createdAt = (Disk -> Maybe POSIX)
-> (Disk -> Maybe POSIX -> Disk)
-> Lens Disk Disk (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Disk' :: Disk -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Disk
s@Disk' {} Maybe POSIX
a -> Disk
s {$sel:createdAt:Disk' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Disk) ((Maybe POSIX -> f (Maybe POSIX)) -> Disk -> f Disk)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Disk
-> f Disk
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
disk_location :: Lens.Lens' Disk (Prelude.Maybe ResourceLocation)
disk_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> Disk -> f Disk
disk_location = (Disk -> Maybe ResourceLocation)
-> (Disk -> Maybe ResourceLocation -> Disk)
-> Lens Disk Disk (Maybe ResourceLocation) (Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:Disk' :: Disk -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: Disk
s@Disk' {} Maybe ResourceLocation
a -> Disk
s {$sel:location:Disk' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: Disk)
disk_iops :: Lens.Lens' Disk (Prelude.Maybe Prelude.Int)
disk_iops :: (Maybe Int -> f (Maybe Int)) -> Disk -> f Disk
disk_iops = (Disk -> Maybe Int)
-> (Disk -> Maybe Int -> Disk)
-> Lens Disk Disk (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Int
iops :: Maybe Int
$sel:iops:Disk' :: Disk -> Maybe Int
iops} -> Maybe Int
iops) (\s :: Disk
s@Disk' {} Maybe Int
a -> Disk
s {$sel:iops:Disk' :: Maybe Int
iops = Maybe Int
a} :: Disk)
disk_isAttached :: Lens.Lens' Disk (Prelude.Maybe Prelude.Bool)
disk_isAttached :: (Maybe Bool -> f (Maybe Bool)) -> Disk -> f Disk
disk_isAttached = (Disk -> Maybe Bool)
-> (Disk -> Maybe Bool -> Disk)
-> Lens Disk Disk (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Bool
isAttached :: Maybe Bool
$sel:isAttached:Disk' :: Disk -> Maybe Bool
isAttached} -> Maybe Bool
isAttached) (\s :: Disk
s@Disk' {} Maybe Bool
a -> Disk
s {$sel:isAttached:Disk' :: Maybe Bool
isAttached = Maybe Bool
a} :: Disk)
disk_addOns :: Lens.Lens' Disk (Prelude.Maybe [AddOn])
disk_addOns :: (Maybe [AddOn] -> f (Maybe [AddOn])) -> Disk -> f Disk
disk_addOns = (Disk -> Maybe [AddOn])
-> (Disk -> Maybe [AddOn] -> Disk)
-> Lens Disk Disk (Maybe [AddOn]) (Maybe [AddOn])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe [AddOn]
addOns :: Maybe [AddOn]
$sel:addOns:Disk' :: Disk -> Maybe [AddOn]
addOns} -> Maybe [AddOn]
addOns) (\s :: Disk
s@Disk' {} Maybe [AddOn]
a -> Disk
s {$sel:addOns:Disk' :: Maybe [AddOn]
addOns = Maybe [AddOn]
a} :: Disk) ((Maybe [AddOn] -> f (Maybe [AddOn])) -> Disk -> f Disk)
-> ((Maybe [AddOn] -> f (Maybe [AddOn]))
-> Maybe [AddOn] -> f (Maybe [AddOn]))
-> (Maybe [AddOn] -> f (Maybe [AddOn]))
-> Disk
-> f Disk
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AddOn] [AddOn] [AddOn] [AddOn]
-> Iso
(Maybe [AddOn]) (Maybe [AddOn]) (Maybe [AddOn]) (Maybe [AddOn])
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 [AddOn] [AddOn] [AddOn] [AddOn]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
disk_attachmentState :: Lens.Lens' Disk (Prelude.Maybe Prelude.Text)
disk_attachmentState :: (Maybe Text -> f (Maybe Text)) -> Disk -> f Disk
disk_attachmentState = (Disk -> Maybe Text)
-> (Disk -> Maybe Text -> Disk)
-> Lens Disk Disk (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Text
attachmentState :: Maybe Text
$sel:attachmentState:Disk' :: Disk -> Maybe Text
attachmentState} -> Maybe Text
attachmentState) (\s :: Disk
s@Disk' {} Maybe Text
a -> Disk
s {$sel:attachmentState:Disk' :: Maybe Text
attachmentState = Maybe Text
a} :: Disk)
disk_name :: Lens.Lens' Disk (Prelude.Maybe Prelude.Text)
disk_name :: (Maybe Text -> f (Maybe Text)) -> Disk -> f Disk
disk_name = (Disk -> Maybe Text)
-> (Disk -> Maybe Text -> Disk)
-> Lens Disk Disk (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Text
name :: Maybe Text
$sel:name:Disk' :: Disk -> Maybe Text
name} -> Maybe Text
name) (\s :: Disk
s@Disk' {} Maybe Text
a -> Disk
s {$sel:name:Disk' :: Maybe Text
name = Maybe Text
a} :: Disk)
disk_sizeInGb :: Lens.Lens' Disk (Prelude.Maybe Prelude.Int)
disk_sizeInGb :: (Maybe Int -> f (Maybe Int)) -> Disk -> f Disk
disk_sizeInGb = (Disk -> Maybe Int)
-> (Disk -> Maybe Int -> Disk)
-> Lens Disk Disk (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Int
sizeInGb :: Maybe Int
$sel:sizeInGb:Disk' :: Disk -> Maybe Int
sizeInGb} -> Maybe Int
sizeInGb) (\s :: Disk
s@Disk' {} Maybe Int
a -> Disk
s {$sel:sizeInGb:Disk' :: Maybe Int
sizeInGb = Maybe Int
a} :: Disk)
disk_supportCode :: Lens.Lens' Disk (Prelude.Maybe Prelude.Text)
disk_supportCode :: (Maybe Text -> f (Maybe Text)) -> Disk -> f Disk
disk_supportCode = (Disk -> Maybe Text)
-> (Disk -> Maybe Text -> Disk)
-> Lens Disk Disk (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:Disk' :: Disk -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: Disk
s@Disk' {} Maybe Text
a -> Disk
s {$sel:supportCode:Disk' :: Maybe Text
supportCode = Maybe Text
a} :: Disk)
disk_isSystemDisk :: Lens.Lens' Disk (Prelude.Maybe Prelude.Bool)
disk_isSystemDisk :: (Maybe Bool -> f (Maybe Bool)) -> Disk -> f Disk
disk_isSystemDisk = (Disk -> Maybe Bool)
-> (Disk -> Maybe Bool -> Disk)
-> Lens Disk Disk (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Bool
isSystemDisk :: Maybe Bool
$sel:isSystemDisk:Disk' :: Disk -> Maybe Bool
isSystemDisk} -> Maybe Bool
isSystemDisk) (\s :: Disk
s@Disk' {} Maybe Bool
a -> Disk
s {$sel:isSystemDisk:Disk' :: Maybe Bool
isSystemDisk = Maybe Bool
a} :: Disk)
disk_attachedTo :: Lens.Lens' Disk (Prelude.Maybe Prelude.Text)
disk_attachedTo :: (Maybe Text -> f (Maybe Text)) -> Disk -> f Disk
disk_attachedTo = (Disk -> Maybe Text)
-> (Disk -> Maybe Text -> Disk)
-> Lens Disk Disk (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Text
attachedTo :: Maybe Text
$sel:attachedTo:Disk' :: Disk -> Maybe Text
attachedTo} -> Maybe Text
attachedTo) (\s :: Disk
s@Disk' {} Maybe Text
a -> Disk
s {$sel:attachedTo:Disk' :: Maybe Text
attachedTo = Maybe Text
a} :: Disk)
disk_gbInUse :: Lens.Lens' Disk (Prelude.Maybe Prelude.Int)
disk_gbInUse :: (Maybe Int -> f (Maybe Int)) -> Disk -> f Disk
disk_gbInUse = (Disk -> Maybe Int)
-> (Disk -> Maybe Int -> Disk)
-> Lens Disk Disk (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe Int
gbInUse :: Maybe Int
$sel:gbInUse:Disk' :: Disk -> Maybe Int
gbInUse} -> Maybe Int
gbInUse) (\s :: Disk
s@Disk' {} Maybe Int
a -> Disk
s {$sel:gbInUse:Disk' :: Maybe Int
gbInUse = Maybe Int
a} :: Disk)
disk_tags :: Lens.Lens' Disk (Prelude.Maybe [Tag])
disk_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> Disk -> f Disk
disk_tags = (Disk -> Maybe [Tag])
-> (Disk -> Maybe [Tag] -> Disk)
-> Lens Disk Disk (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Disk' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Disk' :: Disk -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Disk
s@Disk' {} Maybe [Tag]
a -> Disk
s {$sel:tags:Disk' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Disk) ((Maybe [Tag] -> f (Maybe [Tag])) -> Disk -> f Disk)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Disk
-> f Disk
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Disk where
parseJSON :: Value -> Parser Disk
parseJSON =
String -> (Object -> Parser Disk) -> Value -> Parser Disk
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Disk"
( \Object
x ->
Maybe DiskState
-> Maybe ResourceType
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk
Disk'
(Maybe DiskState
-> Maybe ResourceType
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe DiskState)
-> Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DiskState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe ResourceType)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
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
"arn")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
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
"path")
Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
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
"createdAt")
Parser
(Maybe ResourceLocation
-> Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe ResourceLocation)
-> Parser
(Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser
(Maybe Int
-> Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe Int)
-> Parser
(Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
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
"iops")
Parser
(Maybe Bool
-> Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe Bool)
-> Parser
(Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
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
"isAttached")
Parser
(Maybe [AddOn]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe [AddOn])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AddOn]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"addOns" Parser (Maybe (Maybe [AddOn]))
-> Maybe [AddOn] -> Parser (Maybe [AddOn])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AddOn]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
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
"attachmentState")
Parser
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
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 Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Disk)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Bool -> Maybe Text -> Maybe Int -> Maybe [Tag] -> Disk)
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 Text
-> Maybe Bool -> Maybe Text -> Maybe Int -> Maybe [Tag] -> Disk)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool -> Maybe Text -> Maybe Int -> Maybe [Tag] -> Disk)
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
"supportCode")
Parser
(Maybe Bool -> Maybe Text -> Maybe Int -> Maybe [Tag] -> Disk)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Int -> Maybe [Tag] -> Disk)
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")
Parser (Maybe Text -> Maybe Int -> Maybe [Tag] -> Disk)
-> Parser (Maybe Text) -> Parser (Maybe Int -> Maybe [Tag] -> Disk)
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
"attachedTo")
Parser (Maybe Int -> Maybe [Tag] -> Disk)
-> Parser (Maybe Int) -> Parser (Maybe [Tag] -> Disk)
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
"gbInUse")
Parser (Maybe [Tag] -> Disk) -> Parser (Maybe [Tag]) -> Parser Disk
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Disk
instance Prelude.NFData Disk