{-# 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.SWF.Types.ActivityTypeInfo
-- 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.SWF.Types.ActivityTypeInfo 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.SWF.Types.ActivityType
import Amazonka.SWF.Types.RegistrationStatus

-- | Detailed information about an activity type.
--
-- /See:/ 'newActivityTypeInfo' smart constructor.
data ActivityTypeInfo = ActivityTypeInfo'
  { -- | If DEPRECATED, the date and time DeprecateActivityType was called.
    ActivityTypeInfo -> Maybe POSIX
deprecationDate :: Prelude.Maybe Data.POSIX,
    -- | The description of the activity type provided in RegisterActivityType.
    ActivityTypeInfo -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ActivityType type structure representing the activity type.
    ActivityTypeInfo -> ActivityType
activityType :: ActivityType,
    -- | The current status of the activity type.
    ActivityTypeInfo -> RegistrationStatus
status :: RegistrationStatus,
    -- | The date and time this activity type was created through
    -- RegisterActivityType.
    ActivityTypeInfo -> POSIX
creationDate :: Data.POSIX
  }
  deriving (ActivityTypeInfo -> ActivityTypeInfo -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'ActivityTypeInfo' 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:
--
-- 'deprecationDate', 'activityTypeInfo_deprecationDate' - If DEPRECATED, the date and time DeprecateActivityType was called.
--
-- 'description', 'activityTypeInfo_description' - The description of the activity type provided in RegisterActivityType.
--
-- 'activityType', 'activityTypeInfo_activityType' - The ActivityType type structure representing the activity type.
--
-- 'status', 'activityTypeInfo_status' - The current status of the activity type.
--
-- 'creationDate', 'activityTypeInfo_creationDate' - The date and time this activity type was created through
-- RegisterActivityType.
newActivityTypeInfo ::
  -- | 'activityType'
  ActivityType ->
  -- | 'status'
  RegistrationStatus ->
  -- | 'creationDate'
  Prelude.UTCTime ->
  ActivityTypeInfo
newActivityTypeInfo :: ActivityType -> RegistrationStatus -> UTCTime -> ActivityTypeInfo
newActivityTypeInfo
  ActivityType
pActivityType_
  RegistrationStatus
pStatus_
  UTCTime
pCreationDate_ =
    ActivityTypeInfo'
      { $sel:deprecationDate:ActivityTypeInfo' :: Maybe POSIX
deprecationDate =
          forall a. Maybe a
Prelude.Nothing,
        $sel:description:ActivityTypeInfo' :: Maybe Text
description = 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 = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDate_
      }

-- | If DEPRECATED, the date and time DeprecateActivityType was called.
activityTypeInfo_deprecationDate :: Lens.Lens' ActivityTypeInfo (Prelude.Maybe Prelude.UTCTime)
activityTypeInfo_deprecationDate :: Lens' ActivityTypeInfo (Maybe UTCTime)
activityTypeInfo_deprecationDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The description of the activity type provided in RegisterActivityType.
activityTypeInfo_description :: Lens.Lens' ActivityTypeInfo (Prelude.Maybe Prelude.Text)
activityTypeInfo_description :: Lens' ActivityTypeInfo (Maybe Text)
activityTypeInfo_description = 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)

-- | The ActivityType type structure representing the activity type.
activityTypeInfo_activityType :: Lens.Lens' ActivityTypeInfo ActivityType
activityTypeInfo_activityType :: Lens' ActivityTypeInfo ActivityType
activityTypeInfo_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)

-- | The current status of the activity type.
activityTypeInfo_status :: Lens.Lens' ActivityTypeInfo RegistrationStatus
activityTypeInfo_status :: Lens' ActivityTypeInfo RegistrationStatus
activityTypeInfo_status = 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)

-- | The date and time this activity type was created through
-- RegisterActivityType.
activityTypeInfo_creationDate :: Lens.Lens' ActivityTypeInfo Prelude.UTCTime
activityTypeInfo_creationDate :: Lens' ActivityTypeInfo UTCTime
activityTypeInfo_creationDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ActivityTypeInfo where
  parseJSON :: Value -> Parser ActivityTypeInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActivityTypeInfo"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> ActivityType
-> RegistrationStatus
-> POSIX
-> ActivityTypeInfo
ActivityTypeInfo'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"deprecationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            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
"activityType")
            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
"status")
            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 ActivityTypeInfo where
  hashWithSalt :: Int -> ActivityTypeInfo -> Int
hashWithSalt Int
_salt ActivityTypeInfo' {Maybe Text
Maybe POSIX
POSIX
ActivityType
RegistrationStatus
creationDate :: POSIX
status :: RegistrationStatus
activityType :: ActivityType
description :: Maybe Text
deprecationDate :: Maybe POSIX
$sel:creationDate:ActivityTypeInfo' :: ActivityTypeInfo -> POSIX
$sel:status:ActivityTypeInfo' :: ActivityTypeInfo -> RegistrationStatus
$sel:activityType:ActivityTypeInfo' :: ActivityTypeInfo -> ActivityType
$sel:description:ActivityTypeInfo' :: ActivityTypeInfo -> Maybe Text
$sel:deprecationDate:ActivityTypeInfo' :: ActivityTypeInfo -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
deprecationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ActivityType
activityType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RegistrationStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationDate

instance Prelude.NFData ActivityTypeInfo where
  rnf :: ActivityTypeInfo -> ()
rnf ActivityTypeInfo' {Maybe Text
Maybe POSIX
POSIX
ActivityType
RegistrationStatus
creationDate :: POSIX
status :: RegistrationStatus
activityType :: ActivityType
description :: Maybe Text
deprecationDate :: Maybe POSIX
$sel:creationDate:ActivityTypeInfo' :: ActivityTypeInfo -> POSIX
$sel:status:ActivityTypeInfo' :: ActivityTypeInfo -> RegistrationStatus
$sel:activityType:ActivityTypeInfo' :: ActivityTypeInfo -> ActivityType
$sel:description:ActivityTypeInfo' :: ActivityTypeInfo -> Maybe Text
$sel:deprecationDate:ActivityTypeInfo' :: ActivityTypeInfo -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
deprecationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ActivityType
activityType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RegistrationStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationDate