{-# 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 #-}
module Amazonka.SWF.Types.ActivityTypeInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SWF.Types.ActivityType
import Amazonka.SWF.Types.RegistrationStatus
data ActivityTypeInfo = ActivityTypeInfo'
{
ActivityTypeInfo -> Maybe POSIX
deprecationDate :: Prelude.Maybe Core.POSIX,
ActivityTypeInfo -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ActivityTypeInfo -> ActivityType
activityType :: ActivityType,
ActivityTypeInfo -> RegistrationStatus
status :: RegistrationStatus,
ActivityTypeInfo -> POSIX
creationDate :: Core.POSIX
}
deriving (ActivityTypeInfo -> ActivityTypeInfo -> Bool
(ActivityTypeInfo -> ActivityTypeInfo -> Bool)
-> (ActivityTypeInfo -> ActivityTypeInfo -> Bool)
-> Eq ActivityTypeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActivityTypeInfo -> ActivityTypeInfo -> Bool
$c/= :: ActivityTypeInfo -> ActivityTypeInfo -> Bool
== :: ActivityTypeInfo -> ActivityTypeInfo -> Bool
$c== :: ActivityTypeInfo -> ActivityTypeInfo -> Bool
Prelude.Eq, ReadPrec [ActivityTypeInfo]
ReadPrec ActivityTypeInfo
Int -> ReadS ActivityTypeInfo
ReadS [ActivityTypeInfo]
(Int -> ReadS ActivityTypeInfo)
-> ReadS [ActivityTypeInfo]
-> ReadPrec ActivityTypeInfo
-> ReadPrec [ActivityTypeInfo]
-> Read ActivityTypeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActivityTypeInfo]
$creadListPrec :: ReadPrec [ActivityTypeInfo]
readPrec :: ReadPrec ActivityTypeInfo
$creadPrec :: ReadPrec ActivityTypeInfo
readList :: ReadS [ActivityTypeInfo]
$creadList :: ReadS [ActivityTypeInfo]
readsPrec :: Int -> ReadS ActivityTypeInfo
$creadsPrec :: Int -> ReadS ActivityTypeInfo
Prelude.Read, Int -> ActivityTypeInfo -> ShowS
[ActivityTypeInfo] -> ShowS
ActivityTypeInfo -> String
(Int -> ActivityTypeInfo -> ShowS)
-> (ActivityTypeInfo -> String)
-> ([ActivityTypeInfo] -> ShowS)
-> Show ActivityTypeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActivityTypeInfo] -> ShowS
$cshowList :: [ActivityTypeInfo] -> ShowS
show :: ActivityTypeInfo -> String
$cshow :: ActivityTypeInfo -> String
showsPrec :: Int -> ActivityTypeInfo -> ShowS
$cshowsPrec :: Int -> ActivityTypeInfo -> ShowS
Prelude.Show, (forall x. ActivityTypeInfo -> Rep ActivityTypeInfo x)
-> (forall x. Rep ActivityTypeInfo x -> ActivityTypeInfo)
-> Generic ActivityTypeInfo
forall x. Rep ActivityTypeInfo x -> ActivityTypeInfo
forall x. ActivityTypeInfo -> Rep ActivityTypeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActivityTypeInfo x -> ActivityTypeInfo
$cfrom :: forall x. ActivityTypeInfo -> Rep ActivityTypeInfo x
Prelude.Generic)
newActivityTypeInfo ::
ActivityType ->
RegistrationStatus ->
Prelude.UTCTime ->
ActivityTypeInfo
newActivityTypeInfo :: ActivityType -> RegistrationStatus -> UTCTime -> ActivityTypeInfo
newActivityTypeInfo
ActivityType
pActivityType_
RegistrationStatus
pStatus_
UTCTime
pCreationDate_ =
ActivityTypeInfo' :: Maybe POSIX
-> Maybe Text
-> ActivityType
-> RegistrationStatus
-> POSIX
-> ActivityTypeInfo
ActivityTypeInfo'
{ $sel:deprecationDate:ActivityTypeInfo' :: Maybe POSIX
deprecationDate =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:description:ActivityTypeInfo' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:activityType:ActivityTypeInfo' :: ActivityType
activityType = ActivityType
pActivityType_,
$sel:status:ActivityTypeInfo' :: RegistrationStatus
status = RegistrationStatus
pStatus_,
$sel:creationDate:ActivityTypeInfo' :: 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_
}
activityTypeInfo_deprecationDate :: Lens.Lens' ActivityTypeInfo (Prelude.Maybe Prelude.UTCTime)
activityTypeInfo_deprecationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ActivityTypeInfo -> f ActivityTypeInfo
activityTypeInfo_deprecationDate = (ActivityTypeInfo -> Maybe POSIX)
-> (ActivityTypeInfo -> Maybe POSIX -> ActivityTypeInfo)
-> Lens
ActivityTypeInfo ActivityTypeInfo (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTypeInfo' {Maybe POSIX
deprecationDate :: Maybe POSIX
$sel:deprecationDate:ActivityTypeInfo' :: ActivityTypeInfo -> Maybe POSIX
deprecationDate} -> Maybe POSIX
deprecationDate) (\s :: ActivityTypeInfo
s@ActivityTypeInfo' {} Maybe POSIX
a -> ActivityTypeInfo
s {$sel:deprecationDate:ActivityTypeInfo' :: Maybe POSIX
deprecationDate = Maybe POSIX
a} :: ActivityTypeInfo) ((Maybe POSIX -> f (Maybe POSIX))
-> ActivityTypeInfo -> f ActivityTypeInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ActivityTypeInfo
-> f ActivityTypeInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
activityTypeInfo_description :: Lens.Lens' ActivityTypeInfo (Prelude.Maybe Prelude.Text)
activityTypeInfo_description :: (Maybe Text -> f (Maybe Text))
-> ActivityTypeInfo -> f ActivityTypeInfo
activityTypeInfo_description = (ActivityTypeInfo -> Maybe Text)
-> (ActivityTypeInfo -> Maybe Text -> ActivityTypeInfo)
-> Lens ActivityTypeInfo ActivityTypeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTypeInfo' {Maybe Text
description :: Maybe Text
$sel:description:ActivityTypeInfo' :: ActivityTypeInfo -> Maybe Text
description} -> Maybe Text
description) (\s :: ActivityTypeInfo
s@ActivityTypeInfo' {} Maybe Text
a -> ActivityTypeInfo
s {$sel:description:ActivityTypeInfo' :: Maybe Text
description = Maybe Text
a} :: ActivityTypeInfo)
activityTypeInfo_activityType :: Lens.Lens' ActivityTypeInfo ActivityType
activityTypeInfo_activityType :: (ActivityType -> f ActivityType)
-> ActivityTypeInfo -> f ActivityTypeInfo
activityTypeInfo_activityType = (ActivityTypeInfo -> ActivityType)
-> (ActivityTypeInfo -> ActivityType -> ActivityTypeInfo)
-> Lens ActivityTypeInfo ActivityTypeInfo ActivityType ActivityType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTypeInfo' {ActivityType
activityType :: ActivityType
$sel:activityType:ActivityTypeInfo' :: ActivityTypeInfo -> ActivityType
activityType} -> ActivityType
activityType) (\s :: ActivityTypeInfo
s@ActivityTypeInfo' {} ActivityType
a -> ActivityTypeInfo
s {$sel:activityType:ActivityTypeInfo' :: ActivityType
activityType = ActivityType
a} :: ActivityTypeInfo)
activityTypeInfo_status :: Lens.Lens' ActivityTypeInfo RegistrationStatus
activityTypeInfo_status :: (RegistrationStatus -> f RegistrationStatus)
-> ActivityTypeInfo -> f ActivityTypeInfo
activityTypeInfo_status = (ActivityTypeInfo -> RegistrationStatus)
-> (ActivityTypeInfo -> RegistrationStatus -> ActivityTypeInfo)
-> Lens
ActivityTypeInfo
ActivityTypeInfo
RegistrationStatus
RegistrationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTypeInfo' {RegistrationStatus
status :: RegistrationStatus
$sel:status:ActivityTypeInfo' :: ActivityTypeInfo -> RegistrationStatus
status} -> RegistrationStatus
status) (\s :: ActivityTypeInfo
s@ActivityTypeInfo' {} RegistrationStatus
a -> ActivityTypeInfo
s {$sel:status:ActivityTypeInfo' :: RegistrationStatus
status = RegistrationStatus
a} :: ActivityTypeInfo)
activityTypeInfo_creationDate :: Lens.Lens' ActivityTypeInfo Prelude.UTCTime
activityTypeInfo_creationDate :: (UTCTime -> f UTCTime) -> ActivityTypeInfo -> f ActivityTypeInfo
activityTypeInfo_creationDate = (ActivityTypeInfo -> POSIX)
-> (ActivityTypeInfo -> POSIX -> ActivityTypeInfo)
-> Lens ActivityTypeInfo ActivityTypeInfo POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActivityTypeInfo' {POSIX
creationDate :: POSIX
$sel:creationDate:ActivityTypeInfo' :: ActivityTypeInfo -> POSIX
creationDate} -> POSIX
creationDate) (\s :: ActivityTypeInfo
s@ActivityTypeInfo' {} POSIX
a -> ActivityTypeInfo
s {$sel:creationDate:ActivityTypeInfo' :: POSIX
creationDate = POSIX
a} :: ActivityTypeInfo) ((POSIX -> f POSIX) -> ActivityTypeInfo -> f ActivityTypeInfo)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ActivityTypeInfo
-> f ActivityTypeInfo
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 ActivityTypeInfo where
parseJSON :: Value -> Parser ActivityTypeInfo
parseJSON =
String
-> (Object -> Parser ActivityTypeInfo)
-> Value
-> Parser ActivityTypeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ActivityTypeInfo"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> ActivityType
-> RegistrationStatus
-> POSIX
-> ActivityTypeInfo
ActivityTypeInfo'
(Maybe POSIX
-> Maybe Text
-> ActivityType
-> RegistrationStatus
-> POSIX
-> ActivityTypeInfo)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> ActivityType -> RegistrationStatus -> POSIX -> ActivityTypeInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deprecationDate")
Parser
(Maybe Text
-> ActivityType -> RegistrationStatus -> POSIX -> ActivityTypeInfo)
-> Parser (Maybe Text)
-> Parser
(ActivityType -> RegistrationStatus -> POSIX -> ActivityTypeInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
Parser
(ActivityType -> RegistrationStatus -> POSIX -> ActivityTypeInfo)
-> Parser ActivityType
-> Parser (RegistrationStatus -> POSIX -> ActivityTypeInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActivityType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"activityType")
Parser (RegistrationStatus -> POSIX -> ActivityTypeInfo)
-> Parser RegistrationStatus -> Parser (POSIX -> ActivityTypeInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RegistrationStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
Parser (POSIX -> ActivityTypeInfo)
-> Parser POSIX -> Parser ActivityTypeInfo
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 ActivityTypeInfo
instance Prelude.NFData ActivityTypeInfo