{-# 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.MGN.Types.Job where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types.InitiatedBy
import Amazonka.MGN.Types.JobStatus
import Amazonka.MGN.Types.JobType
import Amazonka.MGN.Types.ParticipatingServer
import qualified Amazonka.Prelude as Prelude
data Job = Job'
{
Job -> Maybe InitiatedBy
initiatedBy :: Prelude.Maybe InitiatedBy,
Job -> Maybe JobStatus
status :: Prelude.Maybe JobStatus,
Job -> Maybe [ParticipatingServer]
participatingServers :: Prelude.Maybe [ParticipatingServer],
Job -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Job -> Maybe Text
creationDateTime :: Prelude.Maybe Prelude.Text,
Job -> Maybe JobType
type' :: Prelude.Maybe JobType,
Job -> Maybe Text
endDateTime :: Prelude.Maybe Prelude.Text,
Job -> Maybe (Sensitive (HashMap Text Text))
tags :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
Job -> Text
jobID :: Prelude.Text
}
deriving (Job -> Job -> Bool
(Job -> Job -> Bool) -> (Job -> Job -> Bool) -> Eq Job
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Job -> Job -> Bool
$c/= :: Job -> Job -> Bool
== :: Job -> Job -> Bool
$c== :: Job -> Job -> Bool
Prelude.Eq, Int -> Job -> ShowS
[Job] -> ShowS
Job -> String
(Int -> Job -> ShowS)
-> (Job -> String) -> ([Job] -> ShowS) -> Show Job
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Job] -> ShowS
$cshowList :: [Job] -> ShowS
show :: Job -> String
$cshow :: Job -> String
showsPrec :: Int -> Job -> ShowS
$cshowsPrec :: Int -> Job -> ShowS
Prelude.Show, (forall x. Job -> Rep Job x)
-> (forall x. Rep Job x -> Job) -> Generic Job
forall x. Rep Job x -> Job
forall x. Job -> Rep Job x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Job x -> Job
$cfrom :: forall x. Job -> Rep Job x
Prelude.Generic)
newJob ::
Prelude.Text ->
Job
newJob :: Text -> Job
newJob Text
pJobID_ =
Job' :: Maybe InitiatedBy
-> Maybe JobStatus
-> Maybe [ParticipatingServer]
-> Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job
Job'
{ $sel:initiatedBy:Job' :: Maybe InitiatedBy
initiatedBy = Maybe InitiatedBy
forall a. Maybe a
Prelude.Nothing,
$sel:status:Job' :: Maybe JobStatus
status = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
$sel:participatingServers:Job' :: Maybe [ParticipatingServer]
participatingServers = Maybe [ParticipatingServer]
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Job' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDateTime:Job' :: Maybe Text
creationDateTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':Job' :: Maybe JobType
type' = Maybe JobType
forall a. Maybe a
Prelude.Nothing,
$sel:endDateTime:Job' :: Maybe Text
endDateTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:Job' :: Maybe (Sensitive (HashMap Text Text))
tags = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
$sel:jobID:Job' :: Text
jobID = Text
pJobID_
}
job_initiatedBy :: Lens.Lens' Job (Prelude.Maybe InitiatedBy)
job_initiatedBy :: (Maybe InitiatedBy -> f (Maybe InitiatedBy)) -> Job -> f Job
job_initiatedBy = (Job -> Maybe InitiatedBy)
-> (Job -> Maybe InitiatedBy -> Job)
-> Lens Job Job (Maybe InitiatedBy) (Maybe InitiatedBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe InitiatedBy
initiatedBy :: Maybe InitiatedBy
$sel:initiatedBy:Job' :: Job -> Maybe InitiatedBy
initiatedBy} -> Maybe InitiatedBy
initiatedBy) (\s :: Job
s@Job' {} Maybe InitiatedBy
a -> Job
s {$sel:initiatedBy:Job' :: Maybe InitiatedBy
initiatedBy = Maybe InitiatedBy
a} :: Job)
job_status :: Lens.Lens' Job (Prelude.Maybe JobStatus)
job_status :: (Maybe JobStatus -> f (Maybe JobStatus)) -> Job -> f Job
job_status = (Job -> Maybe JobStatus)
-> (Job -> Maybe JobStatus -> Job)
-> Lens Job Job (Maybe JobStatus) (Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobStatus
status :: Maybe JobStatus
$sel:status:Job' :: Job -> Maybe JobStatus
status} -> Maybe JobStatus
status) (\s :: Job
s@Job' {} Maybe JobStatus
a -> Job
s {$sel:status:Job' :: Maybe JobStatus
status = Maybe JobStatus
a} :: Job)
job_participatingServers :: Lens.Lens' Job (Prelude.Maybe [ParticipatingServer])
job_participatingServers :: (Maybe [ParticipatingServer] -> f (Maybe [ParticipatingServer]))
-> Job -> f Job
job_participatingServers = (Job -> Maybe [ParticipatingServer])
-> (Job -> Maybe [ParticipatingServer] -> Job)
-> Lens
Job Job (Maybe [ParticipatingServer]) (Maybe [ParticipatingServer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe [ParticipatingServer]
participatingServers :: Maybe [ParticipatingServer]
$sel:participatingServers:Job' :: Job -> Maybe [ParticipatingServer]
participatingServers} -> Maybe [ParticipatingServer]
participatingServers) (\s :: Job
s@Job' {} Maybe [ParticipatingServer]
a -> Job
s {$sel:participatingServers:Job' :: Maybe [ParticipatingServer]
participatingServers = Maybe [ParticipatingServer]
a} :: Job) ((Maybe [ParticipatingServer] -> f (Maybe [ParticipatingServer]))
-> Job -> f Job)
-> ((Maybe [ParticipatingServer]
-> f (Maybe [ParticipatingServer]))
-> Maybe [ParticipatingServer] -> f (Maybe [ParticipatingServer]))
-> (Maybe [ParticipatingServer] -> f (Maybe [ParticipatingServer]))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ParticipatingServer]
[ParticipatingServer]
[ParticipatingServer]
[ParticipatingServer]
-> Iso
(Maybe [ParticipatingServer])
(Maybe [ParticipatingServer])
(Maybe [ParticipatingServer])
(Maybe [ParticipatingServer])
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
[ParticipatingServer]
[ParticipatingServer]
[ParticipatingServer]
[ParticipatingServer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
job_arn :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_arn :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_arn = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
arn :: Maybe Text
$sel:arn:Job' :: Job -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:arn:Job' :: Maybe Text
arn = Maybe Text
a} :: Job)
job_creationDateTime :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_creationDateTime :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_creationDateTime = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
creationDateTime :: Maybe Text
$sel:creationDateTime:Job' :: Job -> Maybe Text
creationDateTime} -> Maybe Text
creationDateTime) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:creationDateTime:Job' :: Maybe Text
creationDateTime = Maybe Text
a} :: Job)
job_type :: Lens.Lens' Job (Prelude.Maybe JobType)
job_type :: (Maybe JobType -> f (Maybe JobType)) -> Job -> f Job
job_type = (Job -> Maybe JobType)
-> (Job -> Maybe JobType -> Job)
-> Lens Job Job (Maybe JobType) (Maybe JobType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobType
type' :: Maybe JobType
$sel:type':Job' :: Job -> Maybe JobType
type'} -> Maybe JobType
type') (\s :: Job
s@Job' {} Maybe JobType
a -> Job
s {$sel:type':Job' :: Maybe JobType
type' = Maybe JobType
a} :: Job)
job_endDateTime :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_endDateTime :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_endDateTime = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
endDateTime :: Maybe Text
$sel:endDateTime:Job' :: Job -> Maybe Text
endDateTime} -> Maybe Text
endDateTime) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:endDateTime:Job' :: Maybe Text
endDateTime = Maybe Text
a} :: Job)
job_tags :: Lens.Lens' Job (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
job_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Job -> f Job
job_tags = (Job -> Maybe (Sensitive (HashMap Text Text)))
-> (Job -> Maybe (Sensitive (HashMap Text Text)) -> Job)
-> Lens
Job
Job
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe (Sensitive (HashMap Text Text))
tags :: Maybe (Sensitive (HashMap Text Text))
$sel:tags:Job' :: Job -> Maybe (Sensitive (HashMap Text Text))
tags} -> Maybe (Sensitive (HashMap Text Text))
tags) (\s :: Job
s@Job' {} Maybe (Sensitive (HashMap Text Text))
a -> Job
s {$sel:tags:Job' :: Maybe (Sensitive (HashMap Text Text))
tags = Maybe (Sensitive (HashMap Text Text))
a} :: Job) ((Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> Job -> f Job)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text)))
-> AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
job_jobID :: Lens.Lens' Job Prelude.Text
job_jobID :: (Text -> f Text) -> Job -> f Job
job_jobID = (Job -> Text) -> (Job -> Text -> Job) -> Lens Job Job Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Text
jobID :: Text
$sel:jobID:Job' :: Job -> Text
jobID} -> Text
jobID) (\s :: Job
s@Job' {} Text
a -> Job
s {$sel:jobID:Job' :: Text
jobID = Text
a} :: Job)
instance Core.FromJSON Job where
parseJSON :: Value -> Parser Job
parseJSON =
String -> (Object -> Parser Job) -> Value -> Parser Job
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Job"
( \Object
x ->
Maybe InitiatedBy
-> Maybe JobStatus
-> Maybe [ParticipatingServer]
-> Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job
Job'
(Maybe InitiatedBy
-> Maybe JobStatus
-> Maybe [ParticipatingServer]
-> Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
-> Parser (Maybe InitiatedBy)
-> Parser
(Maybe JobStatus
-> Maybe [ParticipatingServer]
-> Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InitiatedBy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"initiatedBy")
Parser
(Maybe JobStatus
-> Maybe [ParticipatingServer]
-> Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
-> Parser (Maybe JobStatus)
-> Parser
(Maybe [ParticipatingServer]
-> Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe [ParticipatingServer]
-> Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
-> Parser (Maybe [ParticipatingServer])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ParticipatingServer]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"participatingServers"
Parser (Maybe (Maybe [ParticipatingServer]))
-> Maybe [ParticipatingServer]
-> Parser (Maybe [ParticipatingServer])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ParticipatingServer]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Text
-> Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
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 JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
-> Parser (Maybe Text)
-> Parser
(Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
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
"creationDateTime")
Parser
(Maybe JobType
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Text
-> Job)
-> Parser (Maybe JobType)
-> Parser
(Maybe Text
-> Maybe (Sensitive (HashMap Text Text)) -> Text -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
Parser
(Maybe Text
-> Maybe (Sensitive (HashMap Text Text)) -> Text -> Job)
-> Parser (Maybe Text)
-> Parser (Maybe (Sensitive (HashMap Text Text)) -> Text -> Job)
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
"endDateTime")
Parser (Maybe (Sensitive (HashMap Text Text)) -> Text -> Job)
-> Parser (Maybe (Sensitive (HashMap Text Text)))
-> Parser (Text -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
-> Maybe (Sensitive (HashMap Text Text))
-> Parser (Maybe (Sensitive (HashMap Text Text)))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (Sensitive (HashMap Text Text))
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> Job) -> Parser Text -> Parser Job
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobID")
)
instance Prelude.Hashable Job
instance Prelude.NFData Job