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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 :: Core.POSIX
  }
  deriving (StateMachineListItem -> StateMachineListItem -> Bool
(StateMachineListItem -> StateMachineListItem -> Bool)
-> (StateMachineListItem -> StateMachineListItem -> Bool)
-> Eq StateMachineListItem
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]
(Int -> ReadS StateMachineListItem)
-> ReadS [StateMachineListItem]
-> ReadPrec StateMachineListItem
-> ReadPrec [StateMachineListItem]
-> Read 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
(Int -> StateMachineListItem -> ShowS)
-> (StateMachineListItem -> String)
-> ([StateMachineListItem] -> ShowS)
-> Show StateMachineListItem
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. StateMachineListItem -> Rep StateMachineListItem x)
-> (forall x. Rep StateMachineListItem x -> StateMachineListItem)
-> Generic StateMachineListItem
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' :: Text -> Text -> StateMachineType -> POSIX -> StateMachineListItem
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 = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
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 :: (Text -> f Text) -> StateMachineListItem -> f StateMachineListItem
stateMachineListItem_stateMachineArn = (StateMachineListItem -> Text)
-> (StateMachineListItem -> Text -> StateMachineListItem)
-> Lens StateMachineListItem StateMachineListItem Text Text
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 :: (Text -> f Text) -> StateMachineListItem -> f StateMachineListItem
stateMachineListItem_name = (StateMachineListItem -> Text)
-> (StateMachineListItem -> Text -> StateMachineListItem)
-> Lens StateMachineListItem StateMachineListItem Text Text
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 :: (StateMachineType -> f StateMachineType)
-> StateMachineListItem -> f StateMachineListItem
stateMachineListItem_type = (StateMachineListItem -> StateMachineType)
-> (StateMachineListItem
    -> StateMachineType -> StateMachineListItem)
-> Lens
     StateMachineListItem
     StateMachineListItem
     StateMachineType
     StateMachineType
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 :: (UTCTime -> f UTCTime)
-> StateMachineListItem -> f StateMachineListItem
stateMachineListItem_creationDate = (StateMachineListItem -> POSIX)
-> (StateMachineListItem -> POSIX -> StateMachineListItem)
-> Lens StateMachineListItem StateMachineListItem POSIX POSIX
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) ((POSIX -> f POSIX)
 -> StateMachineListItem -> f StateMachineListItem)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> StateMachineListItem
-> f StateMachineListItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON StateMachineListItem where
  parseJSON :: Value -> Parser StateMachineListItem
parseJSON =
    String
-> (Object -> Parser StateMachineListItem)
-> Value
-> Parser StateMachineListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StateMachineListItem"
      ( \Object
x ->
          Text -> Text -> StateMachineType -> POSIX -> StateMachineListItem
StateMachineListItem'
            (Text -> Text -> StateMachineType -> POSIX -> StateMachineListItem)
-> Parser Text
-> Parser
     (Text -> StateMachineType -> POSIX -> StateMachineListItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"stateMachineArn")
            Parser (Text -> StateMachineType -> POSIX -> StateMachineListItem)
-> Parser Text
-> Parser (StateMachineType -> POSIX -> StateMachineListItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
            Parser (StateMachineType -> POSIX -> StateMachineListItem)
-> Parser StateMachineType
-> Parser (POSIX -> StateMachineListItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser StateMachineType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type")
            Parser (POSIX -> StateMachineListItem)
-> Parser POSIX -> Parser StateMachineListItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"creationDate")
      )

instance Prelude.Hashable StateMachineListItem

instance Prelude.NFData StateMachineListItem