{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Glue.Types.JobNodeDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glue.Types.JobNodeDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.JobRun
import qualified Amazonka.Prelude as Prelude

-- | The details of a Job node present in the workflow.
--
-- /See:/ 'newJobNodeDetails' smart constructor.
data JobNodeDetails = JobNodeDetails'
  { -- | The information for the job runs represented by the job node.
    JobNodeDetails -> Maybe [JobRun]
jobRuns :: Prelude.Maybe [JobRun]
  }
  deriving (JobNodeDetails -> JobNodeDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobNodeDetails -> JobNodeDetails -> Bool
$c/= :: JobNodeDetails -> JobNodeDetails -> Bool
== :: JobNodeDetails -> JobNodeDetails -> Bool
$c== :: JobNodeDetails -> JobNodeDetails -> Bool
Prelude.Eq, ReadPrec [JobNodeDetails]
ReadPrec JobNodeDetails
Int -> ReadS JobNodeDetails
ReadS [JobNodeDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobNodeDetails]
$creadListPrec :: ReadPrec [JobNodeDetails]
readPrec :: ReadPrec JobNodeDetails
$creadPrec :: ReadPrec JobNodeDetails
readList :: ReadS [JobNodeDetails]
$creadList :: ReadS [JobNodeDetails]
readsPrec :: Int -> ReadS JobNodeDetails
$creadsPrec :: Int -> ReadS JobNodeDetails
Prelude.Read, Int -> JobNodeDetails -> ShowS
[JobNodeDetails] -> ShowS
JobNodeDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobNodeDetails] -> ShowS
$cshowList :: [JobNodeDetails] -> ShowS
show :: JobNodeDetails -> String
$cshow :: JobNodeDetails -> String
showsPrec :: Int -> JobNodeDetails -> ShowS
$cshowsPrec :: Int -> JobNodeDetails -> ShowS
Prelude.Show, forall x. Rep JobNodeDetails x -> JobNodeDetails
forall x. JobNodeDetails -> Rep JobNodeDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobNodeDetails x -> JobNodeDetails
$cfrom :: forall x. JobNodeDetails -> Rep JobNodeDetails x
Prelude.Generic)

-- |
-- Create a value of 'JobNodeDetails' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'jobRuns', 'jobNodeDetails_jobRuns' - The information for the job runs represented by the job node.
newJobNodeDetails ::
  JobNodeDetails
newJobNodeDetails :: JobNodeDetails
newJobNodeDetails =
  JobNodeDetails' {$sel:jobRuns:JobNodeDetails' :: Maybe [JobRun]
jobRuns = forall a. Maybe a
Prelude.Nothing}

-- | The information for the job runs represented by the job node.
jobNodeDetails_jobRuns :: Lens.Lens' JobNodeDetails (Prelude.Maybe [JobRun])
jobNodeDetails_jobRuns :: Lens' JobNodeDetails (Maybe [JobRun])
jobNodeDetails_jobRuns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobNodeDetails' {Maybe [JobRun]
jobRuns :: Maybe [JobRun]
$sel:jobRuns:JobNodeDetails' :: JobNodeDetails -> Maybe [JobRun]
jobRuns} -> Maybe [JobRun]
jobRuns) (\s :: JobNodeDetails
s@JobNodeDetails' {} Maybe [JobRun]
a -> JobNodeDetails
s {$sel:jobRuns:JobNodeDetails' :: Maybe [JobRun]
jobRuns = Maybe [JobRun]
a} :: JobNodeDetails) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON JobNodeDetails where
  parseJSON :: Value -> Parser JobNodeDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"JobNodeDetails"
      ( \Object
x ->
          Maybe [JobRun] -> JobNodeDetails
JobNodeDetails'
            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
"JobRuns" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable JobNodeDetails where
  hashWithSalt :: Int -> JobNodeDetails -> Int
hashWithSalt Int
_salt JobNodeDetails' {Maybe [JobRun]
jobRuns :: Maybe [JobRun]
$sel:jobRuns:JobNodeDetails' :: JobNodeDetails -> Maybe [JobRun]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [JobRun]
jobRuns

instance Prelude.NFData JobNodeDetails where
  rnf :: JobNodeDetails -> ()
rnf JobNodeDetails' {Maybe [JobRun]
jobRuns :: Maybe [JobRun]
$sel:jobRuns:JobNodeDetails' :: JobNodeDetails -> Maybe [JobRun]
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe [JobRun]
jobRuns