{-# 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.StepFunctions.Types.MapRunListItem
-- 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.StepFunctions.Types.MapRunListItem where

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

-- | Contains details about a specific Map Run.
--
-- /See:/ 'newMapRunListItem' smart constructor.
data MapRunListItem = MapRunListItem'
  { -- | The date on which the Map Run stopped.
    MapRunListItem -> Maybe POSIX
stopDate :: Prelude.Maybe Data.POSIX,
    -- | The @executionArn@ of the execution from which the Map Run was started.
    MapRunListItem -> Text
executionArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Map Run.
    MapRunListItem -> Text
mapRunArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the executed state machine.
    MapRunListItem -> Text
stateMachineArn :: Prelude.Text,
    -- | The date on which the Map Run started.
    MapRunListItem -> POSIX
startDate :: Data.POSIX
  }
  deriving (MapRunListItem -> MapRunListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MapRunListItem -> MapRunListItem -> Bool
$c/= :: MapRunListItem -> MapRunListItem -> Bool
== :: MapRunListItem -> MapRunListItem -> Bool
$c== :: MapRunListItem -> MapRunListItem -> Bool
Prelude.Eq, ReadPrec [MapRunListItem]
ReadPrec MapRunListItem
Int -> ReadS MapRunListItem
ReadS [MapRunListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MapRunListItem]
$creadListPrec :: ReadPrec [MapRunListItem]
readPrec :: ReadPrec MapRunListItem
$creadPrec :: ReadPrec MapRunListItem
readList :: ReadS [MapRunListItem]
$creadList :: ReadS [MapRunListItem]
readsPrec :: Int -> ReadS MapRunListItem
$creadsPrec :: Int -> ReadS MapRunListItem
Prelude.Read, Int -> MapRunListItem -> ShowS
[MapRunListItem] -> ShowS
MapRunListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MapRunListItem] -> ShowS
$cshowList :: [MapRunListItem] -> ShowS
show :: MapRunListItem -> String
$cshow :: MapRunListItem -> String
showsPrec :: Int -> MapRunListItem -> ShowS
$cshowsPrec :: Int -> MapRunListItem -> ShowS
Prelude.Show, forall x. Rep MapRunListItem x -> MapRunListItem
forall x. MapRunListItem -> Rep MapRunListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MapRunListItem x -> MapRunListItem
$cfrom :: forall x. MapRunListItem -> Rep MapRunListItem x
Prelude.Generic)

-- |
-- Create a value of 'MapRunListItem' 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:
--
-- 'stopDate', 'mapRunListItem_stopDate' - The date on which the Map Run stopped.
--
-- 'executionArn', 'mapRunListItem_executionArn' - The @executionArn@ of the execution from which the Map Run was started.
--
-- 'mapRunArn', 'mapRunListItem_mapRunArn' - The Amazon Resource Name (ARN) of the Map Run.
--
-- 'stateMachineArn', 'mapRunListItem_stateMachineArn' - The Amazon Resource Name (ARN) of the executed state machine.
--
-- 'startDate', 'mapRunListItem_startDate' - The date on which the Map Run started.
newMapRunListItem ::
  -- | 'executionArn'
  Prelude.Text ->
  -- | 'mapRunArn'
  Prelude.Text ->
  -- | 'stateMachineArn'
  Prelude.Text ->
  -- | 'startDate'
  Prelude.UTCTime ->
  MapRunListItem
newMapRunListItem :: Text -> Text -> Text -> UTCTime -> MapRunListItem
newMapRunListItem
  Text
pExecutionArn_
  Text
pMapRunArn_
  Text
pStateMachineArn_
  UTCTime
pStartDate_ =
    MapRunListItem'
      { $sel:stopDate:MapRunListItem' :: Maybe POSIX
stopDate = forall a. Maybe a
Prelude.Nothing,
        $sel:executionArn:MapRunListItem' :: Text
executionArn = Text
pExecutionArn_,
        $sel:mapRunArn:MapRunListItem' :: Text
mapRunArn = Text
pMapRunArn_,
        $sel:stateMachineArn:MapRunListItem' :: Text
stateMachineArn = Text
pStateMachineArn_,
        $sel:startDate:MapRunListItem' :: POSIX
startDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartDate_
      }

-- | The date on which the Map Run stopped.
mapRunListItem_stopDate :: Lens.Lens' MapRunListItem (Prelude.Maybe Prelude.UTCTime)
mapRunListItem_stopDate :: Lens' MapRunListItem (Maybe UTCTime)
mapRunListItem_stopDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunListItem' {Maybe POSIX
stopDate :: Maybe POSIX
$sel:stopDate:MapRunListItem' :: MapRunListItem -> Maybe POSIX
stopDate} -> Maybe POSIX
stopDate) (\s :: MapRunListItem
s@MapRunListItem' {} Maybe POSIX
a -> MapRunListItem
s {$sel:stopDate:MapRunListItem' :: Maybe POSIX
stopDate = Maybe POSIX
a} :: MapRunListItem) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The @executionArn@ of the execution from which the Map Run was started.
mapRunListItem_executionArn :: Lens.Lens' MapRunListItem Prelude.Text
mapRunListItem_executionArn :: Lens' MapRunListItem Text
mapRunListItem_executionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunListItem' {Text
executionArn :: Text
$sel:executionArn:MapRunListItem' :: MapRunListItem -> Text
executionArn} -> Text
executionArn) (\s :: MapRunListItem
s@MapRunListItem' {} Text
a -> MapRunListItem
s {$sel:executionArn:MapRunListItem' :: Text
executionArn = Text
a} :: MapRunListItem)

-- | The Amazon Resource Name (ARN) of the Map Run.
mapRunListItem_mapRunArn :: Lens.Lens' MapRunListItem Prelude.Text
mapRunListItem_mapRunArn :: Lens' MapRunListItem Text
mapRunListItem_mapRunArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunListItem' {Text
mapRunArn :: Text
$sel:mapRunArn:MapRunListItem' :: MapRunListItem -> Text
mapRunArn} -> Text
mapRunArn) (\s :: MapRunListItem
s@MapRunListItem' {} Text
a -> MapRunListItem
s {$sel:mapRunArn:MapRunListItem' :: Text
mapRunArn = Text
a} :: MapRunListItem)

-- | The Amazon Resource Name (ARN) of the executed state machine.
mapRunListItem_stateMachineArn :: Lens.Lens' MapRunListItem Prelude.Text
mapRunListItem_stateMachineArn :: Lens' MapRunListItem Text
mapRunListItem_stateMachineArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunListItem' {Text
stateMachineArn :: Text
$sel:stateMachineArn:MapRunListItem' :: MapRunListItem -> Text
stateMachineArn} -> Text
stateMachineArn) (\s :: MapRunListItem
s@MapRunListItem' {} Text
a -> MapRunListItem
s {$sel:stateMachineArn:MapRunListItem' :: Text
stateMachineArn = Text
a} :: MapRunListItem)

-- | The date on which the Map Run started.
mapRunListItem_startDate :: Lens.Lens' MapRunListItem Prelude.UTCTime
mapRunListItem_startDate :: Lens' MapRunListItem UTCTime
mapRunListItem_startDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunListItem' {POSIX
startDate :: POSIX
$sel:startDate:MapRunListItem' :: MapRunListItem -> POSIX
startDate} -> POSIX
startDate) (\s :: MapRunListItem
s@MapRunListItem' {} POSIX
a -> MapRunListItem
s {$sel:startDate:MapRunListItem' :: POSIX
startDate = POSIX
a} :: MapRunListItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON MapRunListItem where
  parseJSON :: Value -> Parser MapRunListItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MapRunListItem"
      ( \Object
x ->
          Maybe POSIX -> Text -> Text -> Text -> POSIX -> MapRunListItem
MapRunListItem'
            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
"stopDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"executionArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"mapRunArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"stateMachineArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"startDate")
      )

instance Prelude.Hashable MapRunListItem where
  hashWithSalt :: Int -> MapRunListItem -> Int
hashWithSalt Int
_salt MapRunListItem' {Maybe POSIX
Text
POSIX
startDate :: POSIX
stateMachineArn :: Text
mapRunArn :: Text
executionArn :: Text
stopDate :: Maybe POSIX
$sel:startDate:MapRunListItem' :: MapRunListItem -> POSIX
$sel:stateMachineArn:MapRunListItem' :: MapRunListItem -> Text
$sel:mapRunArn:MapRunListItem' :: MapRunListItem -> Text
$sel:executionArn:MapRunListItem' :: MapRunListItem -> Text
$sel:stopDate:MapRunListItem' :: MapRunListItem -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
stopDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
executionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
mapRunArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stateMachineArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
startDate

instance Prelude.NFData MapRunListItem where
  rnf :: MapRunListItem -> ()
rnf MapRunListItem' {Maybe POSIX
Text
POSIX
startDate :: POSIX
stateMachineArn :: Text
mapRunArn :: Text
executionArn :: Text
stopDate :: Maybe POSIX
$sel:startDate:MapRunListItem' :: MapRunListItem -> POSIX
$sel:stateMachineArn:MapRunListItem' :: MapRunListItem -> Text
$sel:mapRunArn:MapRunListItem' :: MapRunListItem -> Text
$sel:executionArn:MapRunListItem' :: MapRunListItem -> Text
$sel:stopDate:MapRunListItem' :: MapRunListItem -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
stopDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
executionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
mapRunArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stateMachineArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
startDate