{-# 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.IoT.Types.JobExecutionSummaryForThing
-- 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.IoT.Types.JobExecutionSummaryForThing where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.JobExecutionSummary
import qualified Amazonka.Prelude as Prelude

-- | The job execution summary for a thing.
--
-- /See:/ 'newJobExecutionSummaryForThing' smart constructor.
data JobExecutionSummaryForThing = JobExecutionSummaryForThing'
  { -- | Contains a subset of information about a job execution.
    JobExecutionSummaryForThing -> Maybe JobExecutionSummary
jobExecutionSummary :: Prelude.Maybe JobExecutionSummary,
    -- | The unique identifier you assigned to this job when it was created.
    JobExecutionSummaryForThing -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text
  }
  deriving (JobExecutionSummaryForThing -> JobExecutionSummaryForThing -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobExecutionSummaryForThing -> JobExecutionSummaryForThing -> Bool
$c/= :: JobExecutionSummaryForThing -> JobExecutionSummaryForThing -> Bool
== :: JobExecutionSummaryForThing -> JobExecutionSummaryForThing -> Bool
$c== :: JobExecutionSummaryForThing -> JobExecutionSummaryForThing -> Bool
Prelude.Eq, ReadPrec [JobExecutionSummaryForThing]
ReadPrec JobExecutionSummaryForThing
Int -> ReadS JobExecutionSummaryForThing
ReadS [JobExecutionSummaryForThing]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobExecutionSummaryForThing]
$creadListPrec :: ReadPrec [JobExecutionSummaryForThing]
readPrec :: ReadPrec JobExecutionSummaryForThing
$creadPrec :: ReadPrec JobExecutionSummaryForThing
readList :: ReadS [JobExecutionSummaryForThing]
$creadList :: ReadS [JobExecutionSummaryForThing]
readsPrec :: Int -> ReadS JobExecutionSummaryForThing
$creadsPrec :: Int -> ReadS JobExecutionSummaryForThing
Prelude.Read, Int -> JobExecutionSummaryForThing -> ShowS
[JobExecutionSummaryForThing] -> ShowS
JobExecutionSummaryForThing -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobExecutionSummaryForThing] -> ShowS
$cshowList :: [JobExecutionSummaryForThing] -> ShowS
show :: JobExecutionSummaryForThing -> String
$cshow :: JobExecutionSummaryForThing -> String
showsPrec :: Int -> JobExecutionSummaryForThing -> ShowS
$cshowsPrec :: Int -> JobExecutionSummaryForThing -> ShowS
Prelude.Show, forall x.
Rep JobExecutionSummaryForThing x -> JobExecutionSummaryForThing
forall x.
JobExecutionSummaryForThing -> Rep JobExecutionSummaryForThing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep JobExecutionSummaryForThing x -> JobExecutionSummaryForThing
$cfrom :: forall x.
JobExecutionSummaryForThing -> Rep JobExecutionSummaryForThing x
Prelude.Generic)

-- |
-- Create a value of 'JobExecutionSummaryForThing' 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:
--
-- 'jobExecutionSummary', 'jobExecutionSummaryForThing_jobExecutionSummary' - Contains a subset of information about a job execution.
--
-- 'jobId', 'jobExecutionSummaryForThing_jobId' - The unique identifier you assigned to this job when it was created.
newJobExecutionSummaryForThing ::
  JobExecutionSummaryForThing
newJobExecutionSummaryForThing :: JobExecutionSummaryForThing
newJobExecutionSummaryForThing =
  JobExecutionSummaryForThing'
    { $sel:jobExecutionSummary:JobExecutionSummaryForThing' :: Maybe JobExecutionSummary
jobExecutionSummary =
        forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:JobExecutionSummaryForThing' :: Maybe Text
jobId = forall a. Maybe a
Prelude.Nothing
    }

-- | Contains a subset of information about a job execution.
jobExecutionSummaryForThing_jobExecutionSummary :: Lens.Lens' JobExecutionSummaryForThing (Prelude.Maybe JobExecutionSummary)
jobExecutionSummaryForThing_jobExecutionSummary :: Lens' JobExecutionSummaryForThing (Maybe JobExecutionSummary)
jobExecutionSummaryForThing_jobExecutionSummary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobExecutionSummaryForThing' {Maybe JobExecutionSummary
jobExecutionSummary :: Maybe JobExecutionSummary
$sel:jobExecutionSummary:JobExecutionSummaryForThing' :: JobExecutionSummaryForThing -> Maybe JobExecutionSummary
jobExecutionSummary} -> Maybe JobExecutionSummary
jobExecutionSummary) (\s :: JobExecutionSummaryForThing
s@JobExecutionSummaryForThing' {} Maybe JobExecutionSummary
a -> JobExecutionSummaryForThing
s {$sel:jobExecutionSummary:JobExecutionSummaryForThing' :: Maybe JobExecutionSummary
jobExecutionSummary = Maybe JobExecutionSummary
a} :: JobExecutionSummaryForThing)

-- | The unique identifier you assigned to this job when it was created.
jobExecutionSummaryForThing_jobId :: Lens.Lens' JobExecutionSummaryForThing (Prelude.Maybe Prelude.Text)
jobExecutionSummaryForThing_jobId :: Lens' JobExecutionSummaryForThing (Maybe Text)
jobExecutionSummaryForThing_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobExecutionSummaryForThing' {Maybe Text
jobId :: Maybe Text
$sel:jobId:JobExecutionSummaryForThing' :: JobExecutionSummaryForThing -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: JobExecutionSummaryForThing
s@JobExecutionSummaryForThing' {} Maybe Text
a -> JobExecutionSummaryForThing
s {$sel:jobId:JobExecutionSummaryForThing' :: Maybe Text
jobId = Maybe Text
a} :: JobExecutionSummaryForThing)

instance Data.FromJSON JobExecutionSummaryForThing where
  parseJSON :: Value -> Parser JobExecutionSummaryForThing
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"JobExecutionSummaryForThing"
      ( \Object
x ->
          Maybe JobExecutionSummary
-> Maybe Text -> JobExecutionSummaryForThing
JobExecutionSummaryForThing'
            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
"jobExecutionSummary")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"jobId")
      )

instance Prelude.Hashable JobExecutionSummaryForThing where
  hashWithSalt :: Int -> JobExecutionSummaryForThing -> Int
hashWithSalt Int
_salt JobExecutionSummaryForThing' {Maybe Text
Maybe JobExecutionSummary
jobId :: Maybe Text
jobExecutionSummary :: Maybe JobExecutionSummary
$sel:jobId:JobExecutionSummaryForThing' :: JobExecutionSummaryForThing -> Maybe Text
$sel:jobExecutionSummary:JobExecutionSummaryForThing' :: JobExecutionSummaryForThing -> Maybe JobExecutionSummary
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobExecutionSummary
jobExecutionSummary
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobId

instance Prelude.NFData JobExecutionSummaryForThing where
  rnf :: JobExecutionSummaryForThing -> ()
rnf JobExecutionSummaryForThing' {Maybe Text
Maybe JobExecutionSummary
jobId :: Maybe Text
jobExecutionSummary :: Maybe JobExecutionSummary
$sel:jobId:JobExecutionSummaryForThing' :: JobExecutionSummaryForThing -> Maybe Text
$sel:jobExecutionSummary:JobExecutionSummaryForThing' :: JobExecutionSummaryForThing -> Maybe JobExecutionSummary
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe JobExecutionSummary
jobExecutionSummary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobId