{-# 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.Personalize.Types.EventTracker where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventTracker = EventTracker'
{
EventTracker -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
EventTracker -> Maybe Text
trackingId :: Prelude.Maybe Prelude.Text,
EventTracker -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
EventTracker -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
EventTracker -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
EventTracker -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
EventTracker -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
EventTracker -> Maybe Text
eventTrackerArn :: Prelude.Maybe Prelude.Text
}
deriving (EventTracker -> EventTracker -> Bool
(EventTracker -> EventTracker -> Bool)
-> (EventTracker -> EventTracker -> Bool) -> Eq EventTracker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventTracker -> EventTracker -> Bool
$c/= :: EventTracker -> EventTracker -> Bool
== :: EventTracker -> EventTracker -> Bool
$c== :: EventTracker -> EventTracker -> Bool
Prelude.Eq, ReadPrec [EventTracker]
ReadPrec EventTracker
Int -> ReadS EventTracker
ReadS [EventTracker]
(Int -> ReadS EventTracker)
-> ReadS [EventTracker]
-> ReadPrec EventTracker
-> ReadPrec [EventTracker]
-> Read EventTracker
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventTracker]
$creadListPrec :: ReadPrec [EventTracker]
readPrec :: ReadPrec EventTracker
$creadPrec :: ReadPrec EventTracker
readList :: ReadS [EventTracker]
$creadList :: ReadS [EventTracker]
readsPrec :: Int -> ReadS EventTracker
$creadsPrec :: Int -> ReadS EventTracker
Prelude.Read, Int -> EventTracker -> ShowS
[EventTracker] -> ShowS
EventTracker -> String
(Int -> EventTracker -> ShowS)
-> (EventTracker -> String)
-> ([EventTracker] -> ShowS)
-> Show EventTracker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventTracker] -> ShowS
$cshowList :: [EventTracker] -> ShowS
show :: EventTracker -> String
$cshow :: EventTracker -> String
showsPrec :: Int -> EventTracker -> ShowS
$cshowsPrec :: Int -> EventTracker -> ShowS
Prelude.Show, (forall x. EventTracker -> Rep EventTracker x)
-> (forall x. Rep EventTracker x -> EventTracker)
-> Generic EventTracker
forall x. Rep EventTracker x -> EventTracker
forall x. EventTracker -> Rep EventTracker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventTracker x -> EventTracker
$cfrom :: forall x. EventTracker -> Rep EventTracker x
Prelude.Generic)
newEventTracker ::
EventTracker
newEventTracker :: EventTracker
newEventTracker =
EventTracker' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker
EventTracker'
{ $sel:status:EventTracker' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:trackingId:EventTracker' :: Maybe Text
trackingId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedDateTime:EventTracker' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:EventTracker' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:EventTracker' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDateTime:EventTracker' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:datasetGroupArn:EventTracker' :: Maybe Text
datasetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventTrackerArn:EventTracker' :: Maybe Text
eventTrackerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
eventTracker_status :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.Text)
eventTracker_status :: (Maybe Text -> f (Maybe Text)) -> EventTracker -> f EventTracker
eventTracker_status = (EventTracker -> Maybe Text)
-> (EventTracker -> Maybe Text -> EventTracker)
-> Lens EventTracker EventTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe Text
status :: Maybe Text
$sel:status:EventTracker' :: EventTracker -> Maybe Text
status} -> Maybe Text
status) (\s :: EventTracker
s@EventTracker' {} Maybe Text
a -> EventTracker
s {$sel:status:EventTracker' :: Maybe Text
status = Maybe Text
a} :: EventTracker)
eventTracker_trackingId :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.Text)
eventTracker_trackingId :: (Maybe Text -> f (Maybe Text)) -> EventTracker -> f EventTracker
eventTracker_trackingId = (EventTracker -> Maybe Text)
-> (EventTracker -> Maybe Text -> EventTracker)
-> Lens EventTracker EventTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe Text
trackingId :: Maybe Text
$sel:trackingId:EventTracker' :: EventTracker -> Maybe Text
trackingId} -> Maybe Text
trackingId) (\s :: EventTracker
s@EventTracker' {} Maybe Text
a -> EventTracker
s {$sel:trackingId:EventTracker' :: Maybe Text
trackingId = Maybe Text
a} :: EventTracker)
eventTracker_lastUpdatedDateTime :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.UTCTime)
eventTracker_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTracker -> f EventTracker
eventTracker_lastUpdatedDateTime = (EventTracker -> Maybe POSIX)
-> (EventTracker -> Maybe POSIX -> EventTracker)
-> Lens EventTracker EventTracker (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:EventTracker' :: EventTracker -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: EventTracker
s@EventTracker' {} Maybe POSIX
a -> EventTracker
s {$sel:lastUpdatedDateTime:EventTracker' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: EventTracker) ((Maybe POSIX -> f (Maybe POSIX))
-> EventTracker -> f EventTracker)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTracker
-> f EventTracker
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
eventTracker_accountId :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.Text)
eventTracker_accountId :: (Maybe Text -> f (Maybe Text)) -> EventTracker -> f EventTracker
eventTracker_accountId = (EventTracker -> Maybe Text)
-> (EventTracker -> Maybe Text -> EventTracker)
-> Lens EventTracker EventTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe Text
accountId :: Maybe Text
$sel:accountId:EventTracker' :: EventTracker -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: EventTracker
s@EventTracker' {} Maybe Text
a -> EventTracker
s {$sel:accountId:EventTracker' :: Maybe Text
accountId = Maybe Text
a} :: EventTracker)
eventTracker_name :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.Text)
eventTracker_name :: (Maybe Text -> f (Maybe Text)) -> EventTracker -> f EventTracker
eventTracker_name = (EventTracker -> Maybe Text)
-> (EventTracker -> Maybe Text -> EventTracker)
-> Lens EventTracker EventTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe Text
name :: Maybe Text
$sel:name:EventTracker' :: EventTracker -> Maybe Text
name} -> Maybe Text
name) (\s :: EventTracker
s@EventTracker' {} Maybe Text
a -> EventTracker
s {$sel:name:EventTracker' :: Maybe Text
name = Maybe Text
a} :: EventTracker)
eventTracker_creationDateTime :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.UTCTime)
eventTracker_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTracker -> f EventTracker
eventTracker_creationDateTime = (EventTracker -> Maybe POSIX)
-> (EventTracker -> Maybe POSIX -> EventTracker)
-> Lens EventTracker EventTracker (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:EventTracker' :: EventTracker -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: EventTracker
s@EventTracker' {} Maybe POSIX
a -> EventTracker
s {$sel:creationDateTime:EventTracker' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: EventTracker) ((Maybe POSIX -> f (Maybe POSIX))
-> EventTracker -> f EventTracker)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTracker
-> f EventTracker
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
eventTracker_datasetGroupArn :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.Text)
eventTracker_datasetGroupArn :: (Maybe Text -> f (Maybe Text)) -> EventTracker -> f EventTracker
eventTracker_datasetGroupArn = (EventTracker -> Maybe Text)
-> (EventTracker -> Maybe Text -> EventTracker)
-> Lens EventTracker EventTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe Text
datasetGroupArn :: Maybe Text
$sel:datasetGroupArn:EventTracker' :: EventTracker -> Maybe Text
datasetGroupArn} -> Maybe Text
datasetGroupArn) (\s :: EventTracker
s@EventTracker' {} Maybe Text
a -> EventTracker
s {$sel:datasetGroupArn:EventTracker' :: Maybe Text
datasetGroupArn = Maybe Text
a} :: EventTracker)
eventTracker_eventTrackerArn :: Lens.Lens' EventTracker (Prelude.Maybe Prelude.Text)
eventTracker_eventTrackerArn :: (Maybe Text -> f (Maybe Text)) -> EventTracker -> f EventTracker
eventTracker_eventTrackerArn = (EventTracker -> Maybe Text)
-> (EventTracker -> Maybe Text -> EventTracker)
-> Lens EventTracker EventTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTracker' {Maybe Text
eventTrackerArn :: Maybe Text
$sel:eventTrackerArn:EventTracker' :: EventTracker -> Maybe Text
eventTrackerArn} -> Maybe Text
eventTrackerArn) (\s :: EventTracker
s@EventTracker' {} Maybe Text
a -> EventTracker
s {$sel:eventTrackerArn:EventTracker' :: Maybe Text
eventTrackerArn = Maybe Text
a} :: EventTracker)
instance Core.FromJSON EventTracker where
parseJSON :: Value -> Parser EventTracker
parseJSON =
String
-> (Object -> Parser EventTracker) -> Value -> Parser EventTracker
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventTracker"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker
EventTracker'
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker)
forall (f :: * -> *) a b. Functor 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
"status")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker)
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
"trackingId")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker)
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
"lastUpdatedDateTime")
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> EventTracker)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe Text -> EventTracker)
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
"accountId")
Parser
(Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe Text -> EventTracker)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> EventTracker)
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
"name")
Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> EventTracker)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> EventTracker)
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
"creationDateTime")
Parser (Maybe Text -> Maybe Text -> EventTracker)
-> Parser (Maybe Text) -> Parser (Maybe Text -> EventTracker)
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
"datasetGroupArn")
Parser (Maybe Text -> EventTracker)
-> Parser (Maybe Text) -> Parser EventTracker
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
"eventTrackerArn")
)
instance Prelude.Hashable EventTracker
instance Prelude.NFData EventTracker