{-# 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.MapStateStartedEventDetails
-- 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.MapStateStartedEventDetails 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

-- | Details about a Map state that was started.
--
-- /See:/ 'newMapStateStartedEventDetails' smart constructor.
data MapStateStartedEventDetails = MapStateStartedEventDetails'
  { -- | The size of the array for Map state iterations.
    MapStateStartedEventDetails -> Maybe Natural
length :: Prelude.Maybe Prelude.Natural
  }
  deriving (MapStateStartedEventDetails -> MapStateStartedEventDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MapStateStartedEventDetails -> MapStateStartedEventDetails -> Bool
$c/= :: MapStateStartedEventDetails -> MapStateStartedEventDetails -> Bool
== :: MapStateStartedEventDetails -> MapStateStartedEventDetails -> Bool
$c== :: MapStateStartedEventDetails -> MapStateStartedEventDetails -> Bool
Prelude.Eq, ReadPrec [MapStateStartedEventDetails]
ReadPrec MapStateStartedEventDetails
Int -> ReadS MapStateStartedEventDetails
ReadS [MapStateStartedEventDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MapStateStartedEventDetails]
$creadListPrec :: ReadPrec [MapStateStartedEventDetails]
readPrec :: ReadPrec MapStateStartedEventDetails
$creadPrec :: ReadPrec MapStateStartedEventDetails
readList :: ReadS [MapStateStartedEventDetails]
$creadList :: ReadS [MapStateStartedEventDetails]
readsPrec :: Int -> ReadS MapStateStartedEventDetails
$creadsPrec :: Int -> ReadS MapStateStartedEventDetails
Prelude.Read, Int -> MapStateStartedEventDetails -> ShowS
[MapStateStartedEventDetails] -> ShowS
MapStateStartedEventDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MapStateStartedEventDetails] -> ShowS
$cshowList :: [MapStateStartedEventDetails] -> ShowS
show :: MapStateStartedEventDetails -> String
$cshow :: MapStateStartedEventDetails -> String
showsPrec :: Int -> MapStateStartedEventDetails -> ShowS
$cshowsPrec :: Int -> MapStateStartedEventDetails -> ShowS
Prelude.Show, forall x.
Rep MapStateStartedEventDetails x -> MapStateStartedEventDetails
forall x.
MapStateStartedEventDetails -> Rep MapStateStartedEventDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MapStateStartedEventDetails x -> MapStateStartedEventDetails
$cfrom :: forall x.
MapStateStartedEventDetails -> Rep MapStateStartedEventDetails x
Prelude.Generic)

-- |
-- Create a value of 'MapStateStartedEventDetails' 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:
--
-- 'length', 'mapStateStartedEventDetails_length' - The size of the array for Map state iterations.
newMapStateStartedEventDetails ::
  MapStateStartedEventDetails
newMapStateStartedEventDetails :: MapStateStartedEventDetails
newMapStateStartedEventDetails =
  MapStateStartedEventDetails'
    { $sel:length:MapStateStartedEventDetails' :: Maybe Natural
length =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The size of the array for Map state iterations.
mapStateStartedEventDetails_length :: Lens.Lens' MapStateStartedEventDetails (Prelude.Maybe Prelude.Natural)
mapStateStartedEventDetails_length :: Lens' MapStateStartedEventDetails (Maybe Natural)
mapStateStartedEventDetails_length = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapStateStartedEventDetails' {Maybe Natural
length :: Maybe Natural
$sel:length:MapStateStartedEventDetails' :: MapStateStartedEventDetails -> Maybe Natural
length} -> Maybe Natural
length) (\s :: MapStateStartedEventDetails
s@MapStateStartedEventDetails' {} Maybe Natural
a -> MapStateStartedEventDetails
s {$sel:length:MapStateStartedEventDetails' :: Maybe Natural
length = Maybe Natural
a} :: MapStateStartedEventDetails)

instance Data.FromJSON MapStateStartedEventDetails where
  parseJSON :: Value -> Parser MapStateStartedEventDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MapStateStartedEventDetails"
      ( \Object
x ->
          Maybe Natural -> MapStateStartedEventDetails
MapStateStartedEventDetails'
            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
"length")
      )

instance Prelude.Hashable MapStateStartedEventDetails where
  hashWithSalt :: Int -> MapStateStartedEventDetails -> Int
hashWithSalt Int
_salt MapStateStartedEventDetails' {Maybe Natural
length :: Maybe Natural
$sel:length:MapStateStartedEventDetails' :: MapStateStartedEventDetails -> Maybe Natural
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
length

instance Prelude.NFData MapStateStartedEventDetails where
  rnf :: MapStateStartedEventDetails -> ()
rnf MapStateStartedEventDetails' {Maybe Natural
length :: Maybe Natural
$sel:length:MapStateStartedEventDetails' :: MapStateStartedEventDetails -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
length