{-# 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.JobExecutionStatusDetails
-- 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.JobExecutionStatusDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details of the job execution status.
--
-- /See:/ 'newJobExecutionStatusDetails' smart constructor.
data JobExecutionStatusDetails = JobExecutionStatusDetails'
  { -- | The job execution status.
    JobExecutionStatusDetails -> Maybe (HashMap Text Text)
detailsMap :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (JobExecutionStatusDetails -> JobExecutionStatusDetails -> Bool
(JobExecutionStatusDetails -> JobExecutionStatusDetails -> Bool)
-> (JobExecutionStatusDetails -> JobExecutionStatusDetails -> Bool)
-> Eq JobExecutionStatusDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobExecutionStatusDetails -> JobExecutionStatusDetails -> Bool
$c/= :: JobExecutionStatusDetails -> JobExecutionStatusDetails -> Bool
== :: JobExecutionStatusDetails -> JobExecutionStatusDetails -> Bool
$c== :: JobExecutionStatusDetails -> JobExecutionStatusDetails -> Bool
Prelude.Eq, ReadPrec [JobExecutionStatusDetails]
ReadPrec JobExecutionStatusDetails
Int -> ReadS JobExecutionStatusDetails
ReadS [JobExecutionStatusDetails]
(Int -> ReadS JobExecutionStatusDetails)
-> ReadS [JobExecutionStatusDetails]
-> ReadPrec JobExecutionStatusDetails
-> ReadPrec [JobExecutionStatusDetails]
-> Read JobExecutionStatusDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobExecutionStatusDetails]
$creadListPrec :: ReadPrec [JobExecutionStatusDetails]
readPrec :: ReadPrec JobExecutionStatusDetails
$creadPrec :: ReadPrec JobExecutionStatusDetails
readList :: ReadS [JobExecutionStatusDetails]
$creadList :: ReadS [JobExecutionStatusDetails]
readsPrec :: Int -> ReadS JobExecutionStatusDetails
$creadsPrec :: Int -> ReadS JobExecutionStatusDetails
Prelude.Read, Int -> JobExecutionStatusDetails -> ShowS
[JobExecutionStatusDetails] -> ShowS
JobExecutionStatusDetails -> String
(Int -> JobExecutionStatusDetails -> ShowS)
-> (JobExecutionStatusDetails -> String)
-> ([JobExecutionStatusDetails] -> ShowS)
-> Show JobExecutionStatusDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobExecutionStatusDetails] -> ShowS
$cshowList :: [JobExecutionStatusDetails] -> ShowS
show :: JobExecutionStatusDetails -> String
$cshow :: JobExecutionStatusDetails -> String
showsPrec :: Int -> JobExecutionStatusDetails -> ShowS
$cshowsPrec :: Int -> JobExecutionStatusDetails -> ShowS
Prelude.Show, (forall x.
 JobExecutionStatusDetails -> Rep JobExecutionStatusDetails x)
-> (forall x.
    Rep JobExecutionStatusDetails x -> JobExecutionStatusDetails)
-> Generic JobExecutionStatusDetails
forall x.
Rep JobExecutionStatusDetails x -> JobExecutionStatusDetails
forall x.
JobExecutionStatusDetails -> Rep JobExecutionStatusDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep JobExecutionStatusDetails x -> JobExecutionStatusDetails
$cfrom :: forall x.
JobExecutionStatusDetails -> Rep JobExecutionStatusDetails x
Prelude.Generic)

-- |
-- Create a value of 'JobExecutionStatusDetails' 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:
--
-- 'detailsMap', 'jobExecutionStatusDetails_detailsMap' - The job execution status.
newJobExecutionStatusDetails ::
  JobExecutionStatusDetails
newJobExecutionStatusDetails :: JobExecutionStatusDetails
newJobExecutionStatusDetails =
  JobExecutionStatusDetails' :: Maybe (HashMap Text Text) -> JobExecutionStatusDetails
JobExecutionStatusDetails'
    { $sel:detailsMap:JobExecutionStatusDetails' :: Maybe (HashMap Text Text)
detailsMap =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The job execution status.
jobExecutionStatusDetails_detailsMap :: Lens.Lens' JobExecutionStatusDetails (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
jobExecutionStatusDetails_detailsMap :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> JobExecutionStatusDetails -> f JobExecutionStatusDetails
jobExecutionStatusDetails_detailsMap = (JobExecutionStatusDetails -> Maybe (HashMap Text Text))
-> (JobExecutionStatusDetails
    -> Maybe (HashMap Text Text) -> JobExecutionStatusDetails)
-> Lens
     JobExecutionStatusDetails
     JobExecutionStatusDetails
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobExecutionStatusDetails' {Maybe (HashMap Text Text)
detailsMap :: Maybe (HashMap Text Text)
$sel:detailsMap:JobExecutionStatusDetails' :: JobExecutionStatusDetails -> Maybe (HashMap Text Text)
detailsMap} -> Maybe (HashMap Text Text)
detailsMap) (\s :: JobExecutionStatusDetails
s@JobExecutionStatusDetails' {} Maybe (HashMap Text Text)
a -> JobExecutionStatusDetails
s {$sel:detailsMap:JobExecutionStatusDetails' :: Maybe (HashMap Text Text)
detailsMap = Maybe (HashMap Text Text)
a} :: JobExecutionStatusDetails) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> JobExecutionStatusDetails -> f JobExecutionStatusDetails)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> JobExecutionStatusDetails
-> f JobExecutionStatusDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON JobExecutionStatusDetails where
  parseJSON :: Value -> Parser JobExecutionStatusDetails
parseJSON =
    String
-> (Object -> Parser JobExecutionStatusDetails)
-> Value
-> Parser JobExecutionStatusDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JobExecutionStatusDetails"
      ( \Object
x ->
          Maybe (HashMap Text Text) -> JobExecutionStatusDetails
JobExecutionStatusDetails'
            (Maybe (HashMap Text Text) -> JobExecutionStatusDetails)
-> Parser (Maybe (HashMap Text Text))
-> Parser JobExecutionStatusDetails
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"detailsMap" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable JobExecutionStatusDetails

instance Prelude.NFData JobExecutionStatusDetails