{-# 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.AutoSnapshotDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.AttachedDisk
import Amazonka.Lightsail.Types.AutoSnapshotStatus
import qualified Amazonka.Prelude as Prelude
data AutoSnapshotDetails = AutoSnapshotDetails'
{
AutoSnapshotDetails -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
AutoSnapshotDetails -> Maybe Text
date :: Prelude.Maybe Prelude.Text,
AutoSnapshotDetails -> Maybe [AttachedDisk]
fromAttachedDisks :: Prelude.Maybe [AttachedDisk],
AutoSnapshotDetails -> Maybe AutoSnapshotStatus
status :: Prelude.Maybe AutoSnapshotStatus
}
deriving (AutoSnapshotDetails -> AutoSnapshotDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoSnapshotDetails -> AutoSnapshotDetails -> Bool
$c/= :: AutoSnapshotDetails -> AutoSnapshotDetails -> Bool
== :: AutoSnapshotDetails -> AutoSnapshotDetails -> Bool
$c== :: AutoSnapshotDetails -> AutoSnapshotDetails -> Bool
Prelude.Eq, ReadPrec [AutoSnapshotDetails]
ReadPrec AutoSnapshotDetails
Int -> ReadS AutoSnapshotDetails
ReadS [AutoSnapshotDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoSnapshotDetails]
$creadListPrec :: ReadPrec [AutoSnapshotDetails]
readPrec :: ReadPrec AutoSnapshotDetails
$creadPrec :: ReadPrec AutoSnapshotDetails
readList :: ReadS [AutoSnapshotDetails]
$creadList :: ReadS [AutoSnapshotDetails]
readsPrec :: Int -> ReadS AutoSnapshotDetails
$creadsPrec :: Int -> ReadS AutoSnapshotDetails
Prelude.Read, Int -> AutoSnapshotDetails -> ShowS
[AutoSnapshotDetails] -> ShowS
AutoSnapshotDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoSnapshotDetails] -> ShowS
$cshowList :: [AutoSnapshotDetails] -> ShowS
show :: AutoSnapshotDetails -> String
$cshow :: AutoSnapshotDetails -> String
showsPrec :: Int -> AutoSnapshotDetails -> ShowS
$cshowsPrec :: Int -> AutoSnapshotDetails -> ShowS
Prelude.Show, forall x. Rep AutoSnapshotDetails x -> AutoSnapshotDetails
forall x. AutoSnapshotDetails -> Rep AutoSnapshotDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoSnapshotDetails x -> AutoSnapshotDetails
$cfrom :: forall x. AutoSnapshotDetails -> Rep AutoSnapshotDetails x
Prelude.Generic)
newAutoSnapshotDetails ::
AutoSnapshotDetails
newAutoSnapshotDetails :: AutoSnapshotDetails
newAutoSnapshotDetails =
AutoSnapshotDetails'
{ $sel:createdAt:AutoSnapshotDetails' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:date:AutoSnapshotDetails' :: Maybe Text
date = forall a. Maybe a
Prelude.Nothing,
$sel:fromAttachedDisks:AutoSnapshotDetails' :: Maybe [AttachedDisk]
fromAttachedDisks = forall a. Maybe a
Prelude.Nothing,
$sel:status:AutoSnapshotDetails' :: Maybe AutoSnapshotStatus
status = forall a. Maybe a
Prelude.Nothing
}
autoSnapshotDetails_createdAt :: Lens.Lens' AutoSnapshotDetails (Prelude.Maybe Prelude.UTCTime)
autoSnapshotDetails_createdAt :: Lens' AutoSnapshotDetails (Maybe UTCTime)
autoSnapshotDetails_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoSnapshotDetails' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: AutoSnapshotDetails
s@AutoSnapshotDetails' {} Maybe POSIX
a -> AutoSnapshotDetails
s {$sel:createdAt:AutoSnapshotDetails' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: AutoSnapshotDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
autoSnapshotDetails_date :: Lens.Lens' AutoSnapshotDetails (Prelude.Maybe Prelude.Text)
autoSnapshotDetails_date :: Lens' AutoSnapshotDetails (Maybe Text)
autoSnapshotDetails_date = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoSnapshotDetails' {Maybe Text
date :: Maybe Text
$sel:date:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe Text
date} -> Maybe Text
date) (\s :: AutoSnapshotDetails
s@AutoSnapshotDetails' {} Maybe Text
a -> AutoSnapshotDetails
s {$sel:date:AutoSnapshotDetails' :: Maybe Text
date = Maybe Text
a} :: AutoSnapshotDetails)
autoSnapshotDetails_fromAttachedDisks :: Lens.Lens' AutoSnapshotDetails (Prelude.Maybe [AttachedDisk])
autoSnapshotDetails_fromAttachedDisks :: Lens' AutoSnapshotDetails (Maybe [AttachedDisk])
autoSnapshotDetails_fromAttachedDisks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoSnapshotDetails' {Maybe [AttachedDisk]
fromAttachedDisks :: Maybe [AttachedDisk]
$sel:fromAttachedDisks:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe [AttachedDisk]
fromAttachedDisks} -> Maybe [AttachedDisk]
fromAttachedDisks) (\s :: AutoSnapshotDetails
s@AutoSnapshotDetails' {} Maybe [AttachedDisk]
a -> AutoSnapshotDetails
s {$sel:fromAttachedDisks:AutoSnapshotDetails' :: Maybe [AttachedDisk]
fromAttachedDisks = Maybe [AttachedDisk]
a} :: AutoSnapshotDetails) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
autoSnapshotDetails_status :: Lens.Lens' AutoSnapshotDetails (Prelude.Maybe AutoSnapshotStatus)
autoSnapshotDetails_status :: Lens' AutoSnapshotDetails (Maybe AutoSnapshotStatus)
autoSnapshotDetails_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoSnapshotDetails' {Maybe AutoSnapshotStatus
status :: Maybe AutoSnapshotStatus
$sel:status:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe AutoSnapshotStatus
status} -> Maybe AutoSnapshotStatus
status) (\s :: AutoSnapshotDetails
s@AutoSnapshotDetails' {} Maybe AutoSnapshotStatus
a -> AutoSnapshotDetails
s {$sel:status:AutoSnapshotDetails' :: Maybe AutoSnapshotStatus
status = Maybe AutoSnapshotStatus
a} :: AutoSnapshotDetails)
instance Data.FromJSON AutoSnapshotDetails where
parseJSON :: Value -> Parser AutoSnapshotDetails
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutoSnapshotDetails"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe [AttachedDisk]
-> Maybe AutoSnapshotStatus
-> AutoSnapshotDetails
AutoSnapshotDetails'
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
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"date")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"fromAttachedDisks"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"status")
)
instance Prelude.Hashable AutoSnapshotDetails where
hashWithSalt :: Int -> AutoSnapshotDetails -> Int
hashWithSalt Int
_salt AutoSnapshotDetails' {Maybe [AttachedDisk]
Maybe Text
Maybe POSIX
Maybe AutoSnapshotStatus
status :: Maybe AutoSnapshotStatus
fromAttachedDisks :: Maybe [AttachedDisk]
date :: Maybe Text
createdAt :: Maybe POSIX
$sel:status:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe AutoSnapshotStatus
$sel:fromAttachedDisks:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe [AttachedDisk]
$sel:date:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe Text
$sel:createdAt:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
date
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AttachedDisk]
fromAttachedDisks
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoSnapshotStatus
status
instance Prelude.NFData AutoSnapshotDetails where
rnf :: AutoSnapshotDetails -> ()
rnf AutoSnapshotDetails' {Maybe [AttachedDisk]
Maybe Text
Maybe POSIX
Maybe AutoSnapshotStatus
status :: Maybe AutoSnapshotStatus
fromAttachedDisks :: Maybe [AttachedDisk]
date :: Maybe Text
createdAt :: Maybe POSIX
$sel:status:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe AutoSnapshotStatus
$sel:fromAttachedDisks:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe [AttachedDisk]
$sel:date:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe Text
$sel:createdAt:AutoSnapshotDetails' :: AutoSnapshotDetails -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
date
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AttachedDisk]
fromAttachedDisks
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoSnapshotStatus
status