{-# 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-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.ActivityListItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 :: Core.POSIX
  }
  deriving (ActivityListItem -> ActivityListItem -> Bool
(ActivityListItem -> ActivityListItem -> Bool)
-> (ActivityListItem -> ActivityListItem -> Bool)
-> Eq ActivityListItem
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]
(Int -> ReadS ActivityListItem)
-> ReadS [ActivityListItem]
-> ReadPrec ActivityListItem
-> ReadPrec [ActivityListItem]
-> Read 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
(Int -> ActivityListItem -> ShowS)
-> (ActivityListItem -> String)
-> ([ActivityListItem] -> ShowS)
-> Show ActivityListItem
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. ActivityListItem -> Rep ActivityListItem x)
-> (forall x. Rep ActivityListItem x -> ActivityListItem)
-> Generic ActivityListItem
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' :: Text -> Text -> POSIX -> ActivityListItem
ActivityListItem'
      { $sel:activityArn:ActivityListItem' :: Text
activityArn = Text
pActivityArn_,
        $sel:name:ActivityListItem' :: Text
name = Text
pName_,
        $sel:creationDate:ActivityListItem' :: 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 activity.
activityListItem_activityArn :: Lens.Lens' ActivityListItem Prelude.Text
activityListItem_activityArn :: (Text -> f Text) -> ActivityListItem -> f ActivityListItem
activityListItem_activityArn = (ActivityListItem -> Text)
-> (ActivityListItem -> Text -> ActivityListItem)
-> Lens ActivityListItem ActivityListItem Text Text
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 :: (Text -> f Text) -> ActivityListItem -> f ActivityListItem
activityListItem_name = (ActivityListItem -> Text)
-> (ActivityListItem -> Text -> ActivityListItem)
-> Lens ActivityListItem ActivityListItem Text Text
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 :: (UTCTime -> f UTCTime) -> ActivityListItem -> f ActivityListItem
activityListItem_creationDate = (ActivityListItem -> POSIX)
-> (ActivityListItem -> POSIX -> ActivityListItem)
-> Lens ActivityListItem ActivityListItem POSIX POSIX
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) ((POSIX -> f POSIX) -> ActivityListItem -> f ActivityListItem)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ActivityListItem
-> f ActivityListItem
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 ActivityListItem where
  parseJSON :: Value -> Parser ActivityListItem
parseJSON =
    String
-> (Object -> Parser ActivityListItem)
-> Value
-> Parser ActivityListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActivityListItem"
      ( \Object
x ->
          Text -> Text -> POSIX -> ActivityListItem
ActivityListItem'
            (Text -> Text -> POSIX -> ActivityListItem)
-> Parser Text -> Parser (Text -> POSIX -> ActivityListItem)
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
"activityArn")
            Parser (Text -> POSIX -> ActivityListItem)
-> Parser Text -> Parser (POSIX -> ActivityListItem)
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 (POSIX -> ActivityListItem)
-> Parser POSIX -> Parser ActivityListItem
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 ActivityListItem

instance Prelude.NFData ActivityListItem