{-# 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.WorkDocs.Types.Activity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkDocs.Types.ActivityType
import Amazonka.WorkDocs.Types.CommentMetadata
import Amazonka.WorkDocs.Types.Participants
import Amazonka.WorkDocs.Types.ResourceMetadata
import Amazonka.WorkDocs.Types.UserMetadata
data Activity = Activity'
{
Activity -> Maybe ResourceMetadata
resourceMetadata :: Prelude.Maybe ResourceMetadata,
Activity -> Maybe Bool
isIndirectActivity :: Prelude.Maybe Prelude.Bool,
Activity -> Maybe UserMetadata
initiator :: Prelude.Maybe UserMetadata,
Activity -> Maybe Participants
participants :: Prelude.Maybe Participants,
Activity -> Maybe ResourceMetadata
originalParent :: Prelude.Maybe ResourceMetadata,
Activity -> Maybe ActivityType
type' :: Prelude.Maybe ActivityType,
:: Prelude.Maybe CommentMetadata,
Activity -> Maybe POSIX
timeStamp :: Prelude.Maybe Core.POSIX,
Activity -> Maybe Text
organizationId :: Prelude.Maybe Prelude.Text
}
deriving (Activity -> Activity -> Bool
(Activity -> Activity -> Bool)
-> (Activity -> Activity -> Bool) -> Eq Activity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Activity -> Activity -> Bool
$c/= :: Activity -> Activity -> Bool
== :: Activity -> Activity -> Bool
$c== :: Activity -> Activity -> Bool
Prelude.Eq, ReadPrec [Activity]
ReadPrec Activity
Int -> ReadS Activity
ReadS [Activity]
(Int -> ReadS Activity)
-> ReadS [Activity]
-> ReadPrec Activity
-> ReadPrec [Activity]
-> Read Activity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Activity]
$creadListPrec :: ReadPrec [Activity]
readPrec :: ReadPrec Activity
$creadPrec :: ReadPrec Activity
readList :: ReadS [Activity]
$creadList :: ReadS [Activity]
readsPrec :: Int -> ReadS Activity
$creadsPrec :: Int -> ReadS Activity
Prelude.Read, Int -> Activity -> ShowS
[Activity] -> ShowS
Activity -> String
(Int -> Activity -> ShowS)
-> (Activity -> String) -> ([Activity] -> ShowS) -> Show Activity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Activity] -> ShowS
$cshowList :: [Activity] -> ShowS
show :: Activity -> String
$cshow :: Activity -> String
showsPrec :: Int -> Activity -> ShowS
$cshowsPrec :: Int -> Activity -> ShowS
Prelude.Show, (forall x. Activity -> Rep Activity x)
-> (forall x. Rep Activity x -> Activity) -> Generic Activity
forall x. Rep Activity x -> Activity
forall x. Activity -> Rep Activity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Activity x -> Activity
$cfrom :: forall x. Activity -> Rep Activity x
Prelude.Generic)
newActivity ::
Activity
newActivity :: Activity
newActivity =
Activity' :: Maybe ResourceMetadata
-> Maybe Bool
-> Maybe UserMetadata
-> Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity
Activity'
{ $sel:resourceMetadata:Activity' :: Maybe ResourceMetadata
resourceMetadata = Maybe ResourceMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:isIndirectActivity:Activity' :: Maybe Bool
isIndirectActivity = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:initiator:Activity' :: Maybe UserMetadata
initiator = Maybe UserMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:participants:Activity' :: Maybe Participants
participants = Maybe Participants
forall a. Maybe a
Prelude.Nothing,
$sel:originalParent:Activity' :: Maybe ResourceMetadata
originalParent = Maybe ResourceMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:type':Activity' :: Maybe ActivityType
type' = Maybe ActivityType
forall a. Maybe a
Prelude.Nothing,
$sel:commentMetadata:Activity' :: Maybe CommentMetadata
commentMetadata = Maybe CommentMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:timeStamp:Activity' :: Maybe POSIX
timeStamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:organizationId:Activity' :: Maybe Text
organizationId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
activity_resourceMetadata :: Lens.Lens' Activity (Prelude.Maybe ResourceMetadata)
activity_resourceMetadata :: (Maybe ResourceMetadata -> f (Maybe ResourceMetadata))
-> Activity -> f Activity
activity_resourceMetadata = (Activity -> Maybe ResourceMetadata)
-> (Activity -> Maybe ResourceMetadata -> Activity)
-> Lens
Activity Activity (Maybe ResourceMetadata) (Maybe ResourceMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe ResourceMetadata
resourceMetadata :: Maybe ResourceMetadata
$sel:resourceMetadata:Activity' :: Activity -> Maybe ResourceMetadata
resourceMetadata} -> Maybe ResourceMetadata
resourceMetadata) (\s :: Activity
s@Activity' {} Maybe ResourceMetadata
a -> Activity
s {$sel:resourceMetadata:Activity' :: Maybe ResourceMetadata
resourceMetadata = Maybe ResourceMetadata
a} :: Activity)
activity_isIndirectActivity :: Lens.Lens' Activity (Prelude.Maybe Prelude.Bool)
activity_isIndirectActivity :: (Maybe Bool -> f (Maybe Bool)) -> Activity -> f Activity
activity_isIndirectActivity = (Activity -> Maybe Bool)
-> (Activity -> Maybe Bool -> Activity)
-> Lens Activity Activity (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe Bool
isIndirectActivity :: Maybe Bool
$sel:isIndirectActivity:Activity' :: Activity -> Maybe Bool
isIndirectActivity} -> Maybe Bool
isIndirectActivity) (\s :: Activity
s@Activity' {} Maybe Bool
a -> Activity
s {$sel:isIndirectActivity:Activity' :: Maybe Bool
isIndirectActivity = Maybe Bool
a} :: Activity)
activity_initiator :: Lens.Lens' Activity (Prelude.Maybe UserMetadata)
activity_initiator :: (Maybe UserMetadata -> f (Maybe UserMetadata))
-> Activity -> f Activity
activity_initiator = (Activity -> Maybe UserMetadata)
-> (Activity -> Maybe UserMetadata -> Activity)
-> Lens Activity Activity (Maybe UserMetadata) (Maybe UserMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe UserMetadata
initiator :: Maybe UserMetadata
$sel:initiator:Activity' :: Activity -> Maybe UserMetadata
initiator} -> Maybe UserMetadata
initiator) (\s :: Activity
s@Activity' {} Maybe UserMetadata
a -> Activity
s {$sel:initiator:Activity' :: Maybe UserMetadata
initiator = Maybe UserMetadata
a} :: Activity)
activity_participants :: Lens.Lens' Activity (Prelude.Maybe Participants)
activity_participants :: (Maybe Participants -> f (Maybe Participants))
-> Activity -> f Activity
activity_participants = (Activity -> Maybe Participants)
-> (Activity -> Maybe Participants -> Activity)
-> Lens Activity Activity (Maybe Participants) (Maybe Participants)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe Participants
participants :: Maybe Participants
$sel:participants:Activity' :: Activity -> Maybe Participants
participants} -> Maybe Participants
participants) (\s :: Activity
s@Activity' {} Maybe Participants
a -> Activity
s {$sel:participants:Activity' :: Maybe Participants
participants = Maybe Participants
a} :: Activity)
activity_originalParent :: Lens.Lens' Activity (Prelude.Maybe ResourceMetadata)
activity_originalParent :: (Maybe ResourceMetadata -> f (Maybe ResourceMetadata))
-> Activity -> f Activity
activity_originalParent = (Activity -> Maybe ResourceMetadata)
-> (Activity -> Maybe ResourceMetadata -> Activity)
-> Lens
Activity Activity (Maybe ResourceMetadata) (Maybe ResourceMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe ResourceMetadata
originalParent :: Maybe ResourceMetadata
$sel:originalParent:Activity' :: Activity -> Maybe ResourceMetadata
originalParent} -> Maybe ResourceMetadata
originalParent) (\s :: Activity
s@Activity' {} Maybe ResourceMetadata
a -> Activity
s {$sel:originalParent:Activity' :: Maybe ResourceMetadata
originalParent = Maybe ResourceMetadata
a} :: Activity)
activity_type :: Lens.Lens' Activity (Prelude.Maybe ActivityType)
activity_type :: (Maybe ActivityType -> f (Maybe ActivityType))
-> Activity -> f Activity
activity_type = (Activity -> Maybe ActivityType)
-> (Activity -> Maybe ActivityType -> Activity)
-> Lens Activity Activity (Maybe ActivityType) (Maybe ActivityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe ActivityType
type' :: Maybe ActivityType
$sel:type':Activity' :: Activity -> Maybe ActivityType
type'} -> Maybe ActivityType
type') (\s :: Activity
s@Activity' {} Maybe ActivityType
a -> Activity
s {$sel:type':Activity' :: Maybe ActivityType
type' = Maybe ActivityType
a} :: Activity)
activity_commentMetadata :: Lens.Lens' Activity (Prelude.Maybe CommentMetadata)
= (Activity -> Maybe CommentMetadata)
-> (Activity -> Maybe CommentMetadata -> Activity)
-> Lens
Activity Activity (Maybe CommentMetadata) (Maybe CommentMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe CommentMetadata
commentMetadata :: Maybe CommentMetadata
$sel:commentMetadata:Activity' :: Activity -> Maybe CommentMetadata
commentMetadata} -> Maybe CommentMetadata
commentMetadata) (\s :: Activity
s@Activity' {} Maybe CommentMetadata
a -> Activity
s {$sel:commentMetadata:Activity' :: Maybe CommentMetadata
commentMetadata = Maybe CommentMetadata
a} :: Activity)
activity_timeStamp :: Lens.Lens' Activity (Prelude.Maybe Prelude.UTCTime)
activity_timeStamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Activity -> f Activity
activity_timeStamp = (Activity -> Maybe POSIX)
-> (Activity -> Maybe POSIX -> Activity)
-> Lens Activity Activity (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe POSIX
timeStamp :: Maybe POSIX
$sel:timeStamp:Activity' :: Activity -> Maybe POSIX
timeStamp} -> Maybe POSIX
timeStamp) (\s :: Activity
s@Activity' {} Maybe POSIX
a -> Activity
s {$sel:timeStamp:Activity' :: Maybe POSIX
timeStamp = Maybe POSIX
a} :: Activity) ((Maybe POSIX -> f (Maybe POSIX)) -> Activity -> f Activity)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Activity
-> f Activity
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
activity_organizationId :: Lens.Lens' Activity (Prelude.Maybe Prelude.Text)
activity_organizationId :: (Maybe Text -> f (Maybe Text)) -> Activity -> f Activity
activity_organizationId = (Activity -> Maybe Text)
-> (Activity -> Maybe Text -> Activity)
-> Lens Activity Activity (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Activity' {Maybe Text
organizationId :: Maybe Text
$sel:organizationId:Activity' :: Activity -> Maybe Text
organizationId} -> Maybe Text
organizationId) (\s :: Activity
s@Activity' {} Maybe Text
a -> Activity
s {$sel:organizationId:Activity' :: Maybe Text
organizationId = Maybe Text
a} :: Activity)
instance Core.FromJSON Activity where
parseJSON :: Value -> Parser Activity
parseJSON =
String -> (Object -> Parser Activity) -> Value -> Parser Activity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Activity"
( \Object
x ->
Maybe ResourceMetadata
-> Maybe Bool
-> Maybe UserMetadata
-> Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity
Activity'
(Maybe ResourceMetadata
-> Maybe Bool
-> Maybe UserMetadata
-> Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
-> Parser (Maybe ResourceMetadata)
-> Parser
(Maybe Bool
-> Maybe UserMetadata
-> Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceMetadata")
Parser
(Maybe Bool
-> Maybe UserMetadata
-> Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
-> Parser (Maybe Bool)
-> Parser
(Maybe UserMetadata
-> Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsIndirectActivity")
Parser
(Maybe UserMetadata
-> Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
-> Parser (Maybe UserMetadata)
-> Parser
(Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Initiator")
Parser
(Maybe Participants
-> Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
-> Parser (Maybe Participants)
-> Parser
(Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Participants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Participants")
Parser
(Maybe ResourceMetadata
-> Maybe ActivityType
-> Maybe CommentMetadata
-> Maybe POSIX
-> Maybe Text
-> Activity)
-> Parser (Maybe ResourceMetadata)
-> Parser
(Maybe ActivityType
-> Maybe CommentMetadata -> Maybe POSIX -> Maybe Text -> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OriginalParent")
Parser
(Maybe ActivityType
-> Maybe CommentMetadata -> Maybe POSIX -> Maybe Text -> Activity)
-> Parser (Maybe ActivityType)
-> Parser
(Maybe CommentMetadata -> Maybe POSIX -> Maybe Text -> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActivityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser
(Maybe CommentMetadata -> Maybe POSIX -> Maybe Text -> Activity)
-> Parser (Maybe CommentMetadata)
-> Parser (Maybe POSIX -> Maybe Text -> Activity)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CommentMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CommentMetadata")
Parser (Maybe POSIX -> Maybe Text -> Activity)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> Activity)
forall (f :: * -> *) a b. Applicative f => 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
"TimeStamp")
Parser (Maybe Text -> Activity)
-> Parser (Maybe Text) -> Parser Activity
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
"OrganizationId")
)
instance Prelude.Hashable Activity
instance Prelude.NFData Activity