{-# 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.MigrationHub.Types.MigrationTask where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MigrationHub.Types.ResourceAttribute
import Amazonka.MigrationHub.Types.Task
import qualified Amazonka.Prelude as Prelude
data MigrationTask = MigrationTask'
{
MigrationTask -> Maybe POSIX
updateDateTime :: Prelude.Maybe Core.POSIX,
MigrationTask -> Maybe [ResourceAttribute]
resourceAttributeList :: Prelude.Maybe [ResourceAttribute],
MigrationTask -> Maybe Task
task :: Prelude.Maybe Task,
MigrationTask -> Maybe Text
progressUpdateStream :: Prelude.Maybe Prelude.Text,
MigrationTask -> Maybe Text
migrationTaskName :: Prelude.Maybe Prelude.Text
}
deriving (MigrationTask -> MigrationTask -> Bool
(MigrationTask -> MigrationTask -> Bool)
-> (MigrationTask -> MigrationTask -> Bool) -> Eq MigrationTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MigrationTask -> MigrationTask -> Bool
$c/= :: MigrationTask -> MigrationTask -> Bool
== :: MigrationTask -> MigrationTask -> Bool
$c== :: MigrationTask -> MigrationTask -> Bool
Prelude.Eq, ReadPrec [MigrationTask]
ReadPrec MigrationTask
Int -> ReadS MigrationTask
ReadS [MigrationTask]
(Int -> ReadS MigrationTask)
-> ReadS [MigrationTask]
-> ReadPrec MigrationTask
-> ReadPrec [MigrationTask]
-> Read MigrationTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MigrationTask]
$creadListPrec :: ReadPrec [MigrationTask]
readPrec :: ReadPrec MigrationTask
$creadPrec :: ReadPrec MigrationTask
readList :: ReadS [MigrationTask]
$creadList :: ReadS [MigrationTask]
readsPrec :: Int -> ReadS MigrationTask
$creadsPrec :: Int -> ReadS MigrationTask
Prelude.Read, Int -> MigrationTask -> ShowS
[MigrationTask] -> ShowS
MigrationTask -> String
(Int -> MigrationTask -> ShowS)
-> (MigrationTask -> String)
-> ([MigrationTask] -> ShowS)
-> Show MigrationTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MigrationTask] -> ShowS
$cshowList :: [MigrationTask] -> ShowS
show :: MigrationTask -> String
$cshow :: MigrationTask -> String
showsPrec :: Int -> MigrationTask -> ShowS
$cshowsPrec :: Int -> MigrationTask -> ShowS
Prelude.Show, (forall x. MigrationTask -> Rep MigrationTask x)
-> (forall x. Rep MigrationTask x -> MigrationTask)
-> Generic MigrationTask
forall x. Rep MigrationTask x -> MigrationTask
forall x. MigrationTask -> Rep MigrationTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MigrationTask x -> MigrationTask
$cfrom :: forall x. MigrationTask -> Rep MigrationTask x
Prelude.Generic)
newMigrationTask ::
MigrationTask
newMigrationTask :: MigrationTask
newMigrationTask =
MigrationTask' :: Maybe POSIX
-> Maybe [ResourceAttribute]
-> Maybe Task
-> Maybe Text
-> Maybe Text
-> MigrationTask
MigrationTask'
{ $sel:updateDateTime:MigrationTask' :: Maybe POSIX
updateDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:resourceAttributeList:MigrationTask' :: Maybe [ResourceAttribute]
resourceAttributeList = Maybe [ResourceAttribute]
forall a. Maybe a
Prelude.Nothing,
$sel:task:MigrationTask' :: Maybe Task
task = Maybe Task
forall a. Maybe a
Prelude.Nothing,
$sel:progressUpdateStream:MigrationTask' :: Maybe Text
progressUpdateStream = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:migrationTaskName:MigrationTask' :: Maybe Text
migrationTaskName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
migrationTask_updateDateTime :: Lens.Lens' MigrationTask (Prelude.Maybe Prelude.UTCTime)
migrationTask_updateDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> MigrationTask -> f MigrationTask
migrationTask_updateDateTime = (MigrationTask -> Maybe POSIX)
-> (MigrationTask -> Maybe POSIX -> MigrationTask)
-> Lens MigrationTask MigrationTask (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationTask' {Maybe POSIX
updateDateTime :: Maybe POSIX
$sel:updateDateTime:MigrationTask' :: MigrationTask -> Maybe POSIX
updateDateTime} -> Maybe POSIX
updateDateTime) (\s :: MigrationTask
s@MigrationTask' {} Maybe POSIX
a -> MigrationTask
s {$sel:updateDateTime:MigrationTask' :: Maybe POSIX
updateDateTime = Maybe POSIX
a} :: MigrationTask) ((Maybe POSIX -> f (Maybe POSIX))
-> MigrationTask -> f MigrationTask)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> MigrationTask
-> f MigrationTask
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
migrationTask_resourceAttributeList :: Lens.Lens' MigrationTask (Prelude.Maybe [ResourceAttribute])
migrationTask_resourceAttributeList :: (Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> MigrationTask -> f MigrationTask
migrationTask_resourceAttributeList = (MigrationTask -> Maybe [ResourceAttribute])
-> (MigrationTask -> Maybe [ResourceAttribute] -> MigrationTask)
-> Lens
MigrationTask
MigrationTask
(Maybe [ResourceAttribute])
(Maybe [ResourceAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationTask' {Maybe [ResourceAttribute]
resourceAttributeList :: Maybe [ResourceAttribute]
$sel:resourceAttributeList:MigrationTask' :: MigrationTask -> Maybe [ResourceAttribute]
resourceAttributeList} -> Maybe [ResourceAttribute]
resourceAttributeList) (\s :: MigrationTask
s@MigrationTask' {} Maybe [ResourceAttribute]
a -> MigrationTask
s {$sel:resourceAttributeList:MigrationTask' :: Maybe [ResourceAttribute]
resourceAttributeList = Maybe [ResourceAttribute]
a} :: MigrationTask) ((Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> MigrationTask -> f MigrationTask)
-> ((Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> (Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> MigrationTask
-> f MigrationTask
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ResourceAttribute]
[ResourceAttribute]
[ResourceAttribute]
[ResourceAttribute]
-> Iso
(Maybe [ResourceAttribute])
(Maybe [ResourceAttribute])
(Maybe [ResourceAttribute])
(Maybe [ResourceAttribute])
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
[ResourceAttribute]
[ResourceAttribute]
[ResourceAttribute]
[ResourceAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
migrationTask_task :: Lens.Lens' MigrationTask (Prelude.Maybe Task)
migrationTask_task :: (Maybe Task -> f (Maybe Task)) -> MigrationTask -> f MigrationTask
migrationTask_task = (MigrationTask -> Maybe Task)
-> (MigrationTask -> Maybe Task -> MigrationTask)
-> Lens MigrationTask MigrationTask (Maybe Task) (Maybe Task)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationTask' {Maybe Task
task :: Maybe Task
$sel:task:MigrationTask' :: MigrationTask -> Maybe Task
task} -> Maybe Task
task) (\s :: MigrationTask
s@MigrationTask' {} Maybe Task
a -> MigrationTask
s {$sel:task:MigrationTask' :: Maybe Task
task = Maybe Task
a} :: MigrationTask)
migrationTask_progressUpdateStream :: Lens.Lens' MigrationTask (Prelude.Maybe Prelude.Text)
migrationTask_progressUpdateStream :: (Maybe Text -> f (Maybe Text)) -> MigrationTask -> f MigrationTask
migrationTask_progressUpdateStream = (MigrationTask -> Maybe Text)
-> (MigrationTask -> Maybe Text -> MigrationTask)
-> Lens MigrationTask MigrationTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationTask' {Maybe Text
progressUpdateStream :: Maybe Text
$sel:progressUpdateStream:MigrationTask' :: MigrationTask -> Maybe Text
progressUpdateStream} -> Maybe Text
progressUpdateStream) (\s :: MigrationTask
s@MigrationTask' {} Maybe Text
a -> MigrationTask
s {$sel:progressUpdateStream:MigrationTask' :: Maybe Text
progressUpdateStream = Maybe Text
a} :: MigrationTask)
migrationTask_migrationTaskName :: Lens.Lens' MigrationTask (Prelude.Maybe Prelude.Text)
migrationTask_migrationTaskName :: (Maybe Text -> f (Maybe Text)) -> MigrationTask -> f MigrationTask
migrationTask_migrationTaskName = (MigrationTask -> Maybe Text)
-> (MigrationTask -> Maybe Text -> MigrationTask)
-> Lens MigrationTask MigrationTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MigrationTask' {Maybe Text
migrationTaskName :: Maybe Text
$sel:migrationTaskName:MigrationTask' :: MigrationTask -> Maybe Text
migrationTaskName} -> Maybe Text
migrationTaskName) (\s :: MigrationTask
s@MigrationTask' {} Maybe Text
a -> MigrationTask
s {$sel:migrationTaskName:MigrationTask' :: Maybe Text
migrationTaskName = Maybe Text
a} :: MigrationTask)
instance Core.FromJSON MigrationTask where
parseJSON :: Value -> Parser MigrationTask
parseJSON =
String
-> (Object -> Parser MigrationTask)
-> Value
-> Parser MigrationTask
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MigrationTask"
( \Object
x ->
Maybe POSIX
-> Maybe [ResourceAttribute]
-> Maybe Task
-> Maybe Text
-> Maybe Text
-> MigrationTask
MigrationTask'
(Maybe POSIX
-> Maybe [ResourceAttribute]
-> Maybe Task
-> Maybe Text
-> Maybe Text
-> MigrationTask)
-> Parser (Maybe POSIX)
-> Parser
(Maybe [ResourceAttribute]
-> Maybe Task -> Maybe Text -> Maybe Text -> MigrationTask)
forall (f :: * -> *) a b. Functor 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
"UpdateDateTime")
Parser
(Maybe [ResourceAttribute]
-> Maybe Task -> Maybe Text -> Maybe Text -> MigrationTask)
-> Parser (Maybe [ResourceAttribute])
-> Parser (Maybe Task -> Maybe Text -> Maybe Text -> MigrationTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ResourceAttribute]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceAttributeList"
Parser (Maybe (Maybe [ResourceAttribute]))
-> Maybe [ResourceAttribute] -> Parser (Maybe [ResourceAttribute])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ResourceAttribute]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Task -> Maybe Text -> Maybe Text -> MigrationTask)
-> Parser (Maybe Task)
-> Parser (Maybe Text -> Maybe Text -> MigrationTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Task)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Task")
Parser (Maybe Text -> Maybe Text -> MigrationTask)
-> Parser (Maybe Text) -> Parser (Maybe Text -> MigrationTask)
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
"ProgressUpdateStream")
Parser (Maybe Text -> MigrationTask)
-> Parser (Maybe Text) -> Parser MigrationTask
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
"MigrationTaskName")
)
instance Prelude.Hashable MigrationTask
instance Prelude.NFData MigrationTask