{-# 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.StateMachineListItem
-- 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.StateMachineListItem 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
import Amazonka.StepFunctions.Types.StateMachineType

-- | Contains details about the state machine.
--
-- /See:/ 'newStateMachineListItem' smart constructor.
data StateMachineListItem = StateMachineListItem'
  { -- | The Amazon Resource Name (ARN) that identifies the state machine.
    StateMachineListItem -> Text
stateMachineArn :: Prelude.Text,
    -- | The name of the state machine.
    --
    -- A name must /not/ contain:
    --
    -- -   white space
    --
    -- -   brackets @\< > { } [ ]@
    --
    -- -   wildcard characters @? *@
    --
    -- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
    --
    -- -   control characters (@U+0000-001F@, @U+007F-009F@)
    --
    -- To enable logging with CloudWatch Logs, the name should only contain
    -- 0-9, A-Z, a-z, - and _.
    StateMachineListItem -> Text
name :: Prelude.Text,
    StateMachineListItem -> StateMachineType
type' :: StateMachineType,
    -- | The date the state machine is created.
    StateMachineListItem -> POSIX
creationDate :: Data.POSIX
  }
  deriving (StateMachineListItem -> StateMachineListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StateMachineListItem -> StateMachineListItem -> Bool
$c/= :: StateMachineListItem -> StateMachineListItem -> Bool
== :: StateMachineListItem -> StateMachineListItem -> Bool
$c== :: StateMachineListItem -> StateMachineListItem -> Bool
Prelude.Eq, ReadPrec [StateMachineListItem]
ReadPrec StateMachineListItem
Int -> ReadS StateMachineListItem
ReadS [StateMachineListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StateMachineListItem]
$creadListPrec :: ReadPrec [StateMachineListItem]
readPrec :: ReadPrec StateMachineListItem
$creadPrec :: ReadPrec StateMachineListItem
readList :: ReadS [StateMachineListItem]
$creadList :: ReadS [StateMachineListItem]
readsPrec :: Int -> ReadS StateMachineListItem
$creadsPrec :: Int -> ReadS StateMachineListItem
Prelude.Read, Int -> StateMachineListItem -> ShowS
[StateMachineListItem] -> ShowS
StateMachineListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StateMachineListItem] -> ShowS
$cshowList :: [StateMachineListItem] -> ShowS
show :: StateMachineListItem -> String
$cshow :: StateMachineListItem -> String
showsPrec :: Int -> StateMachineListItem -> ShowS
$cshowsPrec :: Int -> StateMachineListItem -> ShowS
Prelude.Show, forall x. Rep StateMachineListItem x -> StateMachineListItem
forall x. StateMachineListItem -> Rep StateMachineListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StateMachineListItem x -> StateMachineListItem
$cfrom :: forall x. StateMachineListItem -> Rep StateMachineListItem x
Prelude.Generic)

-- |
-- Create a value of 'StateMachineListItem' 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:
--
-- 'stateMachineArn', 'stateMachineListItem_stateMachineArn' - The Amazon Resource Name (ARN) that identifies the state machine.
--
-- 'name', 'stateMachineListItem_name' - The name of the state machine.
--
-- A name must /not/ contain:
--
-- -   white space
--
-- -   brackets @\< > { } [ ]@
--
-- -   wildcard characters @? *@
--
-- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
--
-- -   control characters (@U+0000-001F@, @U+007F-009F@)
--
-- To enable logging with CloudWatch Logs, the name should only contain
-- 0-9, A-Z, a-z, - and _.
--
-- 'type'', 'stateMachineListItem_type' -
--
-- 'creationDate', 'stateMachineListItem_creationDate' - The date the state machine is created.
newStateMachineListItem ::
  -- | 'stateMachineArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'type''
  StateMachineType ->
  -- | 'creationDate'
  Prelude.UTCTime ->
  StateMachineListItem
newStateMachineListItem :: Text -> Text -> StateMachineType -> UTCTime -> StateMachineListItem
newStateMachineListItem
  Text
pStateMachineArn_
  Text
pName_
  StateMachineType
pType_
  UTCTime
pCreationDate_ =
    StateMachineListItem'
      { $sel:stateMachineArn:StateMachineListItem' :: Text
stateMachineArn =
          Text
pStateMachineArn_,
        $sel:name:StateMachineListItem' :: Text
name = Text
pName_,
        $sel:type':StateMachineListItem' :: StateMachineType
type' = StateMachineType
pType_,
        $sel:creationDate:StateMachineListItem' :: POSIX
creationDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDate_
      }

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

-- | The name of the state machine.
--
-- A name must /not/ contain:
--
-- -   white space
--
-- -   brackets @\< > { } [ ]@
--
-- -   wildcard characters @? *@
--
-- -   special characters @\" # % \\ ^ | ~ \` $ & , ; : \/@
--
-- -   control characters (@U+0000-001F@, @U+007F-009F@)
--
-- To enable logging with CloudWatch Logs, the name should only contain
-- 0-9, A-Z, a-z, - and _.
stateMachineListItem_name :: Lens.Lens' StateMachineListItem Prelude.Text
stateMachineListItem_name :: Lens' StateMachineListItem Text
stateMachineListItem_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StateMachineListItem' {Text
name :: Text
$sel:name:StateMachineListItem' :: StateMachineListItem -> Text
name} -> Text
name) (\s :: StateMachineListItem
s@StateMachineListItem' {} Text
a -> StateMachineListItem
s {$sel:name:StateMachineListItem' :: Text
name = Text
a} :: StateMachineListItem)

stateMachineListItem_type :: Lens.Lens' StateMachineListItem StateMachineType
stateMachineListItem_type :: Lens' StateMachineListItem StateMachineType
stateMachineListItem_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StateMachineListItem' {StateMachineType
type' :: StateMachineType
$sel:type':StateMachineListItem' :: StateMachineListItem -> StateMachineType
type'} -> StateMachineType
type') (\s :: StateMachineListItem
s@StateMachineListItem' {} StateMachineType
a -> StateMachineListItem
s {$sel:type':StateMachineListItem' :: StateMachineType
type' = StateMachineType
a} :: StateMachineListItem)

-- | The date the state machine is created.
stateMachineListItem_creationDate :: Lens.Lens' StateMachineListItem Prelude.UTCTime
stateMachineListItem_creationDate :: Lens' StateMachineListItem UTCTime
stateMachineListItem_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StateMachineListItem' {POSIX
creationDate :: POSIX
$sel:creationDate:StateMachineListItem' :: StateMachineListItem -> POSIX
creationDate} -> POSIX
creationDate) (\s :: StateMachineListItem
s@StateMachineListItem' {} POSIX
a -> StateMachineListItem
s {$sel:creationDate:StateMachineListItem' :: POSIX
creationDate = POSIX
a} :: StateMachineListItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON StateMachineListItem where
  parseJSON :: Value -> Parser StateMachineListItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StateMachineListItem"
      ( \Object
x ->
          Text -> Text -> StateMachineType -> POSIX -> StateMachineListItem
StateMachineListItem'
            forall (f :: * -> *) a b. Functor 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
"name")
            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
"type")
            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
"creationDate")
      )

instance Prelude.Hashable StateMachineListItem where
  hashWithSalt :: Int -> StateMachineListItem -> Int
hashWithSalt Int
_salt StateMachineListItem' {Text
POSIX
StateMachineType
creationDate :: POSIX
type' :: StateMachineType
name :: Text
stateMachineArn :: Text
$sel:creationDate:StateMachineListItem' :: StateMachineListItem -> POSIX
$sel:type':StateMachineListItem' :: StateMachineListItem -> StateMachineType
$sel:name:StateMachineListItem' :: StateMachineListItem -> Text
$sel:stateMachineArn:StateMachineListItem' :: StateMachineListItem -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stateMachineArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StateMachineType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationDate

instance Prelude.NFData StateMachineListItem where
  rnf :: StateMachineListItem -> ()
rnf StateMachineListItem' {Text
POSIX
StateMachineType
creationDate :: POSIX
type' :: StateMachineType
name :: Text
stateMachineArn :: Text
$sel:creationDate:StateMachineListItem' :: StateMachineListItem -> POSIX
$sel:type':StateMachineListItem' :: StateMachineListItem -> StateMachineType
$sel:name:StateMachineListItem' :: StateMachineListItem -> Text
$sel:stateMachineArn:StateMachineListItem' :: StateMachineListItem -> Text
..} =
    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 Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StateMachineType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationDate