{-# 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.Glue.Types.Predecessor where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Predecessor = Predecessor'
{
Predecessor -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
Predecessor -> Maybe Text
runId :: Prelude.Maybe Prelude.Text
}
deriving (Predecessor -> Predecessor -> Bool
(Predecessor -> Predecessor -> Bool)
-> (Predecessor -> Predecessor -> Bool) -> Eq Predecessor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Predecessor -> Predecessor -> Bool
$c/= :: Predecessor -> Predecessor -> Bool
== :: Predecessor -> Predecessor -> Bool
$c== :: Predecessor -> Predecessor -> Bool
Prelude.Eq, ReadPrec [Predecessor]
ReadPrec Predecessor
Int -> ReadS Predecessor
ReadS [Predecessor]
(Int -> ReadS Predecessor)
-> ReadS [Predecessor]
-> ReadPrec Predecessor
-> ReadPrec [Predecessor]
-> Read Predecessor
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Predecessor]
$creadListPrec :: ReadPrec [Predecessor]
readPrec :: ReadPrec Predecessor
$creadPrec :: ReadPrec Predecessor
readList :: ReadS [Predecessor]
$creadList :: ReadS [Predecessor]
readsPrec :: Int -> ReadS Predecessor
$creadsPrec :: Int -> ReadS Predecessor
Prelude.Read, Int -> Predecessor -> ShowS
[Predecessor] -> ShowS
Predecessor -> String
(Int -> Predecessor -> ShowS)
-> (Predecessor -> String)
-> ([Predecessor] -> ShowS)
-> Show Predecessor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Predecessor] -> ShowS
$cshowList :: [Predecessor] -> ShowS
show :: Predecessor -> String
$cshow :: Predecessor -> String
showsPrec :: Int -> Predecessor -> ShowS
$cshowsPrec :: Int -> Predecessor -> ShowS
Prelude.Show, (forall x. Predecessor -> Rep Predecessor x)
-> (forall x. Rep Predecessor x -> Predecessor)
-> Generic Predecessor
forall x. Rep Predecessor x -> Predecessor
forall x. Predecessor -> Rep Predecessor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Predecessor x -> Predecessor
$cfrom :: forall x. Predecessor -> Rep Predecessor x
Prelude.Generic)
newPredecessor ::
Predecessor
newPredecessor :: Predecessor
newPredecessor =
Predecessor' :: Maybe Text -> Maybe Text -> Predecessor
Predecessor'
{ $sel:jobName:Predecessor' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:runId:Predecessor' :: Maybe Text
runId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
predecessor_jobName :: Lens.Lens' Predecessor (Prelude.Maybe Prelude.Text)
predecessor_jobName :: (Maybe Text -> f (Maybe Text)) -> Predecessor -> f Predecessor
predecessor_jobName = (Predecessor -> Maybe Text)
-> (Predecessor -> Maybe Text -> Predecessor)
-> Lens Predecessor Predecessor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Predecessor' {Maybe Text
jobName :: Maybe Text
$sel:jobName:Predecessor' :: Predecessor -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: Predecessor
s@Predecessor' {} Maybe Text
a -> Predecessor
s {$sel:jobName:Predecessor' :: Maybe Text
jobName = Maybe Text
a} :: Predecessor)
predecessor_runId :: Lens.Lens' Predecessor (Prelude.Maybe Prelude.Text)
predecessor_runId :: (Maybe Text -> f (Maybe Text)) -> Predecessor -> f Predecessor
predecessor_runId = (Predecessor -> Maybe Text)
-> (Predecessor -> Maybe Text -> Predecessor)
-> Lens Predecessor Predecessor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Predecessor' {Maybe Text
runId :: Maybe Text
$sel:runId:Predecessor' :: Predecessor -> Maybe Text
runId} -> Maybe Text
runId) (\s :: Predecessor
s@Predecessor' {} Maybe Text
a -> Predecessor
s {$sel:runId:Predecessor' :: Maybe Text
runId = Maybe Text
a} :: Predecessor)
instance Core.FromJSON Predecessor where
parseJSON :: Value -> Parser Predecessor
parseJSON =
String
-> (Object -> Parser Predecessor) -> Value -> Parser Predecessor
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Predecessor"
( \Object
x ->
Maybe Text -> Maybe Text -> Predecessor
Predecessor'
(Maybe Text -> Maybe Text -> Predecessor)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Predecessor)
forall (f :: * -> *) a b. Functor 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
"JobName")
Parser (Maybe Text -> Predecessor)
-> Parser (Maybe Text) -> Parser Predecessor
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
"RunId")
)
instance Prelude.Hashable Predecessor
instance Prelude.NFData Predecessor