{-# 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.CodePipeline.Types.Job where
import Amazonka.CodePipeline.Types.JobData
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Job = Job'
{
Job -> Maybe JobData
data' :: Prelude.Maybe JobData,
Job -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
Job -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Job -> Maybe Text
nonce :: Prelude.Maybe 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 ::
Job
newJob :: Job
newJob =
Job' :: Maybe JobData -> Maybe Text -> Maybe Text -> Maybe Text -> Job
Job'
{ $sel:data':Job' :: Maybe JobData
data' = Maybe JobData
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:Job' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Job' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nonce:Job' :: Maybe Text
nonce = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
job_data :: Lens.Lens' Job (Prelude.Maybe JobData)
job_data :: (Maybe JobData -> f (Maybe JobData)) -> Job -> f Job
job_data = (Job -> Maybe JobData)
-> (Job -> Maybe JobData -> Job)
-> Lens Job Job (Maybe JobData) (Maybe JobData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobData
data' :: Maybe JobData
$sel:data':Job' :: Job -> Maybe JobData
data'} -> Maybe JobData
data') (\s :: Job
s@Job' {} Maybe JobData
a -> Job
s {$sel:data':Job' :: Maybe JobData
data' = Maybe JobData
a} :: Job)
job_accountId :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_accountId :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_accountId = (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
accountId :: Maybe Text
$sel:accountId:Job' :: Job -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:accountId:Job' :: Maybe Text
accountId = Maybe Text
a} :: Job)
job_id :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_id :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_id = (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
id :: Maybe Text
$sel:id:Job' :: Job -> Maybe Text
id} -> Maybe Text
id) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:id:Job' :: Maybe Text
id = Maybe Text
a} :: Job)
job_nonce :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_nonce :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_nonce = (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
nonce :: Maybe Text
$sel:nonce:Job' :: Job -> Maybe Text
nonce} -> Maybe Text
nonce) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:nonce:Job' :: Maybe Text
nonce = Maybe 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 JobData -> Maybe Text -> Maybe Text -> Maybe Text -> Job
Job'
(Maybe JobData -> Maybe Text -> Maybe Text -> Maybe Text -> Job)
-> Parser (Maybe JobData)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Job)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe JobData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"data")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Job)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Maybe 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
"accountId")
Parser (Maybe Text -> Maybe Text -> Job)
-> Parser (Maybe Text) -> Parser (Maybe 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
"id")
Parser (Maybe Text -> Job) -> Parser (Maybe Text) -> Parser 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
"nonce")
)
instance Prelude.Hashable Job
instance Prelude.NFData Job