{-# 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.DirectoryService.Types.Snapshot where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectoryService.Types.SnapshotStatus
import Amazonka.DirectoryService.Types.SnapshotType
import qualified Amazonka.Prelude as Prelude
data Snapshot = Snapshot'
{
Snapshot -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text,
Snapshot -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
Snapshot -> Maybe SnapshotStatus
status :: Prelude.Maybe SnapshotStatus,
Snapshot -> Maybe SnapshotType
type' :: Prelude.Maybe SnapshotType
}
deriving (Snapshot -> Snapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Snapshot -> Snapshot -> Bool
$c/= :: Snapshot -> Snapshot -> Bool
== :: Snapshot -> Snapshot -> Bool
$c== :: Snapshot -> Snapshot -> Bool
Prelude.Eq, ReadPrec [Snapshot]
ReadPrec Snapshot
Int -> ReadS Snapshot
ReadS [Snapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Snapshot]
$creadListPrec :: ReadPrec [Snapshot]
readPrec :: ReadPrec Snapshot
$creadPrec :: ReadPrec Snapshot
readList :: ReadS [Snapshot]
$creadList :: ReadS [Snapshot]
readsPrec :: Int -> ReadS Snapshot
$creadsPrec :: Int -> ReadS Snapshot
Prelude.Read, Int -> Snapshot -> ShowS
[Snapshot] -> ShowS
Snapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Snapshot] -> ShowS
$cshowList :: [Snapshot] -> ShowS
show :: Snapshot -> String
$cshow :: Snapshot -> String
showsPrec :: Int -> Snapshot -> ShowS
$cshowsPrec :: Int -> Snapshot -> ShowS
Prelude.Show, forall x. Rep Snapshot x -> Snapshot
forall x. Snapshot -> Rep Snapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Snapshot x -> Snapshot
$cfrom :: forall x. Snapshot -> Rep Snapshot x
Prelude.Generic)
newSnapshot ::
Snapshot
newSnapshot :: Snapshot
newSnapshot =
Snapshot'
{ $sel:directoryId:Snapshot' :: Maybe Text
directoryId = forall a. Maybe a
Prelude.Nothing,
$sel:name:Snapshot' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:snapshotId:Snapshot' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:Snapshot' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
$sel:status:Snapshot' :: Maybe SnapshotStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:type':Snapshot' :: Maybe SnapshotType
type' = forall a. Maybe a
Prelude.Nothing
}
snapshot_directoryId :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_directoryId :: Lens' Snapshot (Maybe Text)
snapshot_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:Snapshot' :: Snapshot -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:directoryId:Snapshot' :: Maybe Text
directoryId = Maybe Text
a} :: Snapshot)
snapshot_name :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_name :: Lens' Snapshot (Maybe Text)
snapshot_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
name :: Maybe Text
$sel:name:Snapshot' :: Snapshot -> Maybe Text
name} -> Maybe Text
name) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:name:Snapshot' :: Maybe Text
name = Maybe Text
a} :: Snapshot)
snapshot_snapshotId :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.Text)
snapshot_snapshotId :: Lens' Snapshot (Maybe Text)
snapshot_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:Snapshot' :: Snapshot -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: Snapshot
s@Snapshot' {} Maybe Text
a -> Snapshot
s {$sel:snapshotId:Snapshot' :: Maybe Text
snapshotId = Maybe Text
a} :: Snapshot)
snapshot_startTime :: Lens.Lens' Snapshot (Prelude.Maybe Prelude.UTCTime)
snapshot_startTime :: Lens' Snapshot (Maybe UTCTime)
snapshot_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:Snapshot' :: Snapshot -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: Snapshot
s@Snapshot' {} Maybe POSIX
a -> Snapshot
s {$sel:startTime:Snapshot' :: Maybe POSIX
startTime = Maybe POSIX
a} :: Snapshot) 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
snapshot_status :: Lens.Lens' Snapshot (Prelude.Maybe SnapshotStatus)
snapshot_status :: Lens' Snapshot (Maybe SnapshotStatus)
snapshot_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe SnapshotStatus
status :: Maybe SnapshotStatus
$sel:status:Snapshot' :: Snapshot -> Maybe SnapshotStatus
status} -> Maybe SnapshotStatus
status) (\s :: Snapshot
s@Snapshot' {} Maybe SnapshotStatus
a -> Snapshot
s {$sel:status:Snapshot' :: Maybe SnapshotStatus
status = Maybe SnapshotStatus
a} :: Snapshot)
snapshot_type :: Lens.Lens' Snapshot (Prelude.Maybe SnapshotType)
snapshot_type :: Lens' Snapshot (Maybe SnapshotType)
snapshot_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Snapshot' {Maybe SnapshotType
type' :: Maybe SnapshotType
$sel:type':Snapshot' :: Snapshot -> Maybe SnapshotType
type'} -> Maybe SnapshotType
type') (\s :: Snapshot
s@Snapshot' {} Maybe SnapshotType
a -> Snapshot
s {$sel:type':Snapshot' :: Maybe SnapshotType
type' = Maybe SnapshotType
a} :: Snapshot)
instance Data.FromJSON Snapshot where
parseJSON :: Value -> Parser Snapshot
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Snapshot"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe SnapshotStatus
-> Maybe SnapshotType
-> Snapshot
Snapshot'
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
"DirectoryId")
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
"Name")
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
"SnapshotId")
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
"StartTime")
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")
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
"Type")
)
instance Prelude.Hashable Snapshot where
hashWithSalt :: Int -> Snapshot -> Int
hashWithSalt Int
_salt Snapshot' {Maybe Text
Maybe POSIX
Maybe SnapshotStatus
Maybe SnapshotType
type' :: Maybe SnapshotType
status :: Maybe SnapshotStatus
startTime :: Maybe POSIX
snapshotId :: Maybe Text
name :: Maybe Text
directoryId :: Maybe Text
$sel:type':Snapshot' :: Snapshot -> Maybe SnapshotType
$sel:status:Snapshot' :: Snapshot -> Maybe SnapshotStatus
$sel:startTime:Snapshot' :: Snapshot -> Maybe POSIX
$sel:snapshotId:Snapshot' :: Snapshot -> Maybe Text
$sel:name:Snapshot' :: Snapshot -> Maybe Text
$sel:directoryId:Snapshot' :: Snapshot -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SnapshotStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SnapshotType
type'
instance Prelude.NFData Snapshot where
rnf :: Snapshot -> ()
rnf Snapshot' {Maybe Text
Maybe POSIX
Maybe SnapshotStatus
Maybe SnapshotType
type' :: Maybe SnapshotType
status :: Maybe SnapshotStatus
startTime :: Maybe POSIX
snapshotId :: Maybe Text
name :: Maybe Text
directoryId :: Maybe Text
$sel:type':Snapshot' :: Snapshot -> Maybe SnapshotType
$sel:status:Snapshot' :: Snapshot -> Maybe SnapshotStatus
$sel:startTime:Snapshot' :: Snapshot -> Maybe POSIX
$sel:snapshotId:Snapshot' :: Snapshot -> Maybe Text
$sel:name:Snapshot' :: Snapshot -> Maybe Text
$sel:directoryId:Snapshot' :: Snapshot -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SnapshotStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SnapshotType
type'