{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.JobExecutionSummaryForThing where

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

-- | The job execution summary for a thing.
--
-- /See:/ 'newJobExecutionSummaryForThing' smart constructor.
data JobExecutionSummaryForThing = JobExecutionSummaryForThing'
  { -- | The unique identifier you assigned to this job when it was created.
    JobExecutionSummaryForThing -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | Contains a subset of information about a job execution.
    JobExecutionSummaryForThing -> Maybe JobExecutionSummary
jobExecutionSummary :: Prelude.Maybe JobExecutionSummary
  }
  deriving (JobExecutionSummaryForThing -> JobExecutionSummaryForThing -> Bool
(JobExecutionSummaryForThing
 -> JobExecutionSummaryForThing -> Bool)
-> (JobExecutionSummaryForThing
    -> JobExecutionSummaryForThing -> Bool)
-> Eq JobExecutionSummaryForThing
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]
(Int -> ReadS JobExecutionSummaryForThing)
-> ReadS [JobExecutionSummaryForThing]
-> ReadPrec JobExecutionSummaryForThing
-> ReadPrec [JobExecutionSummaryForThing]
-> Read 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
(Int -> JobExecutionSummaryForThing -> ShowS)
-> (JobExecutionSummaryForThing -> String)
-> ([JobExecutionSummaryForThing] -> ShowS)
-> Show JobExecutionSummaryForThing
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.
 JobExecutionSummaryForThing -> Rep JobExecutionSummaryForThing x)
-> (forall x.
    Rep JobExecutionSummaryForThing x -> JobExecutionSummaryForThing)
-> Generic JobExecutionSummaryForThing
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:
--
-- 'jobId', 'jobExecutionSummaryForThing_jobId' - The unique identifier you assigned to this job when it was created.
--
-- 'jobExecutionSummary', 'jobExecutionSummaryForThing_jobExecutionSummary' - Contains a subset of information about a job execution.
newJobExecutionSummaryForThing ::
  JobExecutionSummaryForThing
newJobExecutionSummaryForThing :: JobExecutionSummaryForThing
newJobExecutionSummaryForThing =
  JobExecutionSummaryForThing' :: Maybe Text
-> Maybe JobExecutionSummary -> JobExecutionSummaryForThing
JobExecutionSummaryForThing'
    { $sel:jobId:JobExecutionSummaryForThing' :: Maybe Text
jobId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobExecutionSummary:JobExecutionSummaryForThing' :: Maybe JobExecutionSummary
jobExecutionSummary = Maybe JobExecutionSummary
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier you assigned to this job when it was created.
jobExecutionSummaryForThing_jobId :: Lens.Lens' JobExecutionSummaryForThing (Prelude.Maybe Prelude.Text)
jobExecutionSummaryForThing_jobId :: (Maybe Text -> f (Maybe Text))
-> JobExecutionSummaryForThing -> f JobExecutionSummaryForThing
jobExecutionSummaryForThing_jobId = (JobExecutionSummaryForThing -> Maybe Text)
-> (JobExecutionSummaryForThing
    -> Maybe Text -> JobExecutionSummaryForThing)
-> Lens
     JobExecutionSummaryForThing
     JobExecutionSummaryForThing
     (Maybe Text)
     (Maybe Text)
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)

-- | Contains a subset of information about a job execution.
jobExecutionSummaryForThing_jobExecutionSummary :: Lens.Lens' JobExecutionSummaryForThing (Prelude.Maybe JobExecutionSummary)
jobExecutionSummaryForThing_jobExecutionSummary :: (Maybe JobExecutionSummary -> f (Maybe JobExecutionSummary))
-> JobExecutionSummaryForThing -> f JobExecutionSummaryForThing
jobExecutionSummaryForThing_jobExecutionSummary = (JobExecutionSummaryForThing -> Maybe JobExecutionSummary)
-> (JobExecutionSummaryForThing
    -> Maybe JobExecutionSummary -> JobExecutionSummaryForThing)
-> Lens
     JobExecutionSummaryForThing
     JobExecutionSummaryForThing
     (Maybe JobExecutionSummary)
     (Maybe 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)

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

instance Prelude.Hashable JobExecutionSummaryForThing

instance Prelude.NFData JobExecutionSummaryForThing