{-# 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.EFS.Types.Destination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EFS.Types.ReplicationStatus
import qualified Amazonka.Prelude as Prelude
data Destination = Destination'
{
Destination -> Maybe POSIX
lastReplicatedTimestamp :: Prelude.Maybe Data.POSIX,
Destination -> ReplicationStatus
status :: ReplicationStatus,
Destination -> Text
fileSystemId :: Prelude.Text,
Destination -> Text
region :: Prelude.Text
}
deriving (Destination -> Destination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Destination -> Destination -> Bool
$c/= :: Destination -> Destination -> Bool
== :: Destination -> Destination -> Bool
$c== :: Destination -> Destination -> Bool
Prelude.Eq, ReadPrec [Destination]
ReadPrec Destination
Int -> ReadS Destination
ReadS [Destination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Destination]
$creadListPrec :: ReadPrec [Destination]
readPrec :: ReadPrec Destination
$creadPrec :: ReadPrec Destination
readList :: ReadS [Destination]
$creadList :: ReadS [Destination]
readsPrec :: Int -> ReadS Destination
$creadsPrec :: Int -> ReadS Destination
Prelude.Read, Int -> Destination -> ShowS
[Destination] -> ShowS
Destination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Destination] -> ShowS
$cshowList :: [Destination] -> ShowS
show :: Destination -> String
$cshow :: Destination -> String
showsPrec :: Int -> Destination -> ShowS
$cshowsPrec :: Int -> Destination -> ShowS
Prelude.Show, forall x. Rep Destination x -> Destination
forall x. Destination -> Rep Destination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Destination x -> Destination
$cfrom :: forall x. Destination -> Rep Destination x
Prelude.Generic)
newDestination ::
ReplicationStatus ->
Prelude.Text ->
Prelude.Text ->
Destination
newDestination :: ReplicationStatus -> Text -> Text -> Destination
newDestination ReplicationStatus
pStatus_ Text
pFileSystemId_ Text
pRegion_ =
Destination'
{ $sel:lastReplicatedTimestamp:Destination' :: Maybe POSIX
lastReplicatedTimestamp =
forall a. Maybe a
Prelude.Nothing,
$sel:status:Destination' :: ReplicationStatus
status = ReplicationStatus
pStatus_,
$sel:fileSystemId:Destination' :: Text
fileSystemId = Text
pFileSystemId_,
$sel:region:Destination' :: Text
region = Text
pRegion_
}
destination_lastReplicatedTimestamp :: Lens.Lens' Destination (Prelude.Maybe Prelude.UTCTime)
destination_lastReplicatedTimestamp :: Lens' Destination (Maybe UTCTime)
destination_lastReplicatedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe POSIX
lastReplicatedTimestamp :: Maybe POSIX
$sel:lastReplicatedTimestamp:Destination' :: Destination -> Maybe POSIX
lastReplicatedTimestamp} -> Maybe POSIX
lastReplicatedTimestamp) (\s :: Destination
s@Destination' {} Maybe POSIX
a -> Destination
s {$sel:lastReplicatedTimestamp:Destination' :: Maybe POSIX
lastReplicatedTimestamp = Maybe POSIX
a} :: Destination) 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
destination_status :: Lens.Lens' Destination ReplicationStatus
destination_status :: Lens' Destination ReplicationStatus
destination_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {ReplicationStatus
status :: ReplicationStatus
$sel:status:Destination' :: Destination -> ReplicationStatus
status} -> ReplicationStatus
status) (\s :: Destination
s@Destination' {} ReplicationStatus
a -> Destination
s {$sel:status:Destination' :: ReplicationStatus
status = ReplicationStatus
a} :: Destination)
destination_fileSystemId :: Lens.Lens' Destination Prelude.Text
destination_fileSystemId :: Lens' Destination Text
destination_fileSystemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Text
fileSystemId :: Text
$sel:fileSystemId:Destination' :: Destination -> Text
fileSystemId} -> Text
fileSystemId) (\s :: Destination
s@Destination' {} Text
a -> Destination
s {$sel:fileSystemId:Destination' :: Text
fileSystemId = Text
a} :: Destination)
destination_region :: Lens.Lens' Destination Prelude.Text
destination_region :: Lens' Destination Text
destination_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Text
region :: Text
$sel:region:Destination' :: Destination -> Text
region} -> Text
region) (\s :: Destination
s@Destination' {} Text
a -> Destination
s {$sel:region:Destination' :: Text
region = Text
a} :: Destination)
instance Data.FromJSON Destination where
parseJSON :: Value -> Parser Destination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Destination"
( \Object
x ->
Maybe POSIX -> ReplicationStatus -> Text -> Text -> Destination
Destination'
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
"LastReplicatedTimestamp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"FileSystemId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Region")
)
instance Prelude.Hashable Destination where
hashWithSalt :: Int -> Destination -> Int
hashWithSalt Int
_salt Destination' {Maybe POSIX
Text
ReplicationStatus
region :: Text
fileSystemId :: Text
status :: ReplicationStatus
lastReplicatedTimestamp :: Maybe POSIX
$sel:region:Destination' :: Destination -> Text
$sel:fileSystemId:Destination' :: Destination -> Text
$sel:status:Destination' :: Destination -> ReplicationStatus
$sel:lastReplicatedTimestamp:Destination' :: Destination -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastReplicatedTimestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ReplicationStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fileSystemId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
region
instance Prelude.NFData Destination where
rnf :: Destination -> ()
rnf Destination' {Maybe POSIX
Text
ReplicationStatus
region :: Text
fileSystemId :: Text
status :: ReplicationStatus
lastReplicatedTimestamp :: Maybe POSIX
$sel:region:Destination' :: Destination -> Text
$sel:fileSystemId:Destination' :: Destination -> Text
$sel:status:Destination' :: Destination -> ReplicationStatus
$sel:lastReplicatedTimestamp:Destination' :: Destination -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastReplicatedTimestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ReplicationStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fileSystemId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
region