{-# 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.ActivityListItem
-- 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.ActivityListItem 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 an activity.
--
-- /See:/ 'newActivityListItem' smart constructor.
data ActivityListItem = ActivityListItem'
  { -- | The Amazon Resource Name (ARN) that identifies the activity.
    ActivityListItem -> Text
activityArn :: Prelude.Text,
    -- | The name of the activity.
    --
    -- 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 _.
    ActivityListItem -> Text
name :: Prelude.Text,
    -- | The date the activity is created.
    ActivityListItem -> POSIX
creationDate :: Data.POSIX
  }
  deriving (ActivityListItem -> ActivityListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivityListItem -> ActivityListItem -> Bool
$c/= :: ActivityListItem -> ActivityListItem -> Bool
== :: ActivityListItem -> ActivityListItem -> Bool
$c== :: ActivityListItem -> ActivityListItem -> Bool
Prelude.Eq, ReadPrec [ActivityListItem]
ReadPrec ActivityListItem
Int -> ReadS ActivityListItem
ReadS [ActivityListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActivityListItem]
$creadListPrec :: ReadPrec [ActivityListItem]
readPrec :: ReadPrec ActivityListItem
$creadPrec :: ReadPrec ActivityListItem
readList :: ReadS [ActivityListItem]
$creadList :: ReadS [ActivityListItem]
readsPrec :: Int -> ReadS ActivityListItem
$creadsPrec :: Int -> ReadS ActivityListItem
Prelude.Read, Int -> ActivityListItem -> ShowS
[ActivityListItem] -> ShowS
ActivityListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivityListItem] -> ShowS
$cshowList :: [ActivityListItem] -> ShowS
show :: ActivityListItem -> String
$cshow :: ActivityListItem -> String
showsPrec :: Int -> ActivityListItem -> ShowS
$cshowsPrec :: Int -> ActivityListItem -> ShowS
Prelude.Show, forall x. Rep ActivityListItem x -> ActivityListItem
forall x. ActivityListItem -> Rep ActivityListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActivityListItem x -> ActivityListItem
$cfrom :: forall x. ActivityListItem -> Rep ActivityListItem x
Prelude.Generic)

-- |
-- Create a value of 'ActivityListItem' 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:
--
-- 'activityArn', 'activityListItem_activityArn' - The Amazon Resource Name (ARN) that identifies the activity.
--
-- 'name', 'activityListItem_name' - The name of the activity.
--
-- 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 _.
--
-- 'creationDate', 'activityListItem_creationDate' - The date the activity is created.
newActivityListItem ::
  -- | 'activityArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'creationDate'
  Prelude.UTCTime ->
  ActivityListItem
newActivityListItem :: Text -> Text -> UTCTime -> ActivityListItem
newActivityListItem
  Text
pActivityArn_
  Text
pName_
  UTCTime
pCreationDate_ =
    ActivityListItem'
      { $sel:activityArn:ActivityListItem' :: Text
activityArn = Text
pActivityArn_,
        $sel:name:ActivityListItem' :: Text
name = Text
pName_,
        $sel:creationDate:ActivityListItem' :: 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 activity.
activityListItem_activityArn :: Lens.Lens' ActivityListItem Prelude.Text
activityListItem_activityArn :: Lens' ActivityListItem Text
activityListItem_activityArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityListItem' {Text
activityArn :: Text
$sel:activityArn:ActivityListItem' :: ActivityListItem -> Text
activityArn} -> Text
activityArn) (\s :: ActivityListItem
s@ActivityListItem' {} Text
a -> ActivityListItem
s {$sel:activityArn:ActivityListItem' :: Text
activityArn = Text
a} :: ActivityListItem)

-- | The name of the activity.
--
-- 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 _.
activityListItem_name :: Lens.Lens' ActivityListItem Prelude.Text
activityListItem_name :: Lens' ActivityListItem Text
activityListItem_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityListItem' {Text
name :: Text
$sel:name:ActivityListItem' :: ActivityListItem -> Text
name} -> Text
name) (\s :: ActivityListItem
s@ActivityListItem' {} Text
a -> ActivityListItem
s {$sel:name:ActivityListItem' :: Text
name = Text
a} :: ActivityListItem)

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

instance Data.FromJSON ActivityListItem where
  parseJSON :: Value -> Parser ActivityListItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActivityListItem"
      ( \Object
x ->
          Text -> Text -> POSIX -> ActivityListItem
ActivityListItem'
            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
"activityArn")
            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
"creationDate")
      )

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

instance Prelude.NFData ActivityListItem where
  rnf :: ActivityListItem -> ()
rnf ActivityListItem' {Text
POSIX
creationDate :: POSIX
name :: Text
activityArn :: Text
$sel:creationDate:ActivityListItem' :: ActivityListItem -> POSIX
$sel:name:ActivityListItem' :: ActivityListItem -> Text
$sel:activityArn:ActivityListItem' :: ActivityListItem -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
activityArn
      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 POSIX
creationDate