{-# 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.Personalize.Types.EventTrackerSummary
-- 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.Personalize.Types.EventTrackerSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of the properties of an event tracker. For a complete
-- listing, call the DescribeEventTracker API.
--
-- /See:/ 'newEventTrackerSummary' smart constructor.
data EventTrackerSummary = EventTrackerSummary'
  { -- | The status of the event tracker.
    --
    -- An event tracker can be in one of the following states:
    --
    -- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
    --
    -- -   DELETE PENDING > DELETE IN_PROGRESS
    EventTrackerSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the event tracker was last
    -- updated.
    EventTrackerSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the event tracker.
    EventTrackerSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the event tracker was created.
    EventTrackerSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the event tracker.
    EventTrackerSummary -> Maybe Text
eventTrackerArn :: Prelude.Maybe Prelude.Text
  }
  deriving (EventTrackerSummary -> EventTrackerSummary -> Bool
(EventTrackerSummary -> EventTrackerSummary -> Bool)
-> (EventTrackerSummary -> EventTrackerSummary -> Bool)
-> Eq EventTrackerSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventTrackerSummary -> EventTrackerSummary -> Bool
$c/= :: EventTrackerSummary -> EventTrackerSummary -> Bool
== :: EventTrackerSummary -> EventTrackerSummary -> Bool
$c== :: EventTrackerSummary -> EventTrackerSummary -> Bool
Prelude.Eq, ReadPrec [EventTrackerSummary]
ReadPrec EventTrackerSummary
Int -> ReadS EventTrackerSummary
ReadS [EventTrackerSummary]
(Int -> ReadS EventTrackerSummary)
-> ReadS [EventTrackerSummary]
-> ReadPrec EventTrackerSummary
-> ReadPrec [EventTrackerSummary]
-> Read EventTrackerSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventTrackerSummary]
$creadListPrec :: ReadPrec [EventTrackerSummary]
readPrec :: ReadPrec EventTrackerSummary
$creadPrec :: ReadPrec EventTrackerSummary
readList :: ReadS [EventTrackerSummary]
$creadList :: ReadS [EventTrackerSummary]
readsPrec :: Int -> ReadS EventTrackerSummary
$creadsPrec :: Int -> ReadS EventTrackerSummary
Prelude.Read, Int -> EventTrackerSummary -> ShowS
[EventTrackerSummary] -> ShowS
EventTrackerSummary -> String
(Int -> EventTrackerSummary -> ShowS)
-> (EventTrackerSummary -> String)
-> ([EventTrackerSummary] -> ShowS)
-> Show EventTrackerSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventTrackerSummary] -> ShowS
$cshowList :: [EventTrackerSummary] -> ShowS
show :: EventTrackerSummary -> String
$cshow :: EventTrackerSummary -> String
showsPrec :: Int -> EventTrackerSummary -> ShowS
$cshowsPrec :: Int -> EventTrackerSummary -> ShowS
Prelude.Show, (forall x. EventTrackerSummary -> Rep EventTrackerSummary x)
-> (forall x. Rep EventTrackerSummary x -> EventTrackerSummary)
-> Generic EventTrackerSummary
forall x. Rep EventTrackerSummary x -> EventTrackerSummary
forall x. EventTrackerSummary -> Rep EventTrackerSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventTrackerSummary x -> EventTrackerSummary
$cfrom :: forall x. EventTrackerSummary -> Rep EventTrackerSummary x
Prelude.Generic)

-- |
-- Create a value of 'EventTrackerSummary' 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:
--
-- 'status', 'eventTrackerSummary_status' - The status of the event tracker.
--
-- An event tracker can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
--
-- -   DELETE PENDING > DELETE IN_PROGRESS
--
-- 'lastUpdatedDateTime', 'eventTrackerSummary_lastUpdatedDateTime' - The date and time (in Unix time) that the event tracker was last
-- updated.
--
-- 'name', 'eventTrackerSummary_name' - The name of the event tracker.
--
-- 'creationDateTime', 'eventTrackerSummary_creationDateTime' - The date and time (in Unix time) that the event tracker was created.
--
-- 'eventTrackerArn', 'eventTrackerSummary_eventTrackerArn' - The Amazon Resource Name (ARN) of the event tracker.
newEventTrackerSummary ::
  EventTrackerSummary
newEventTrackerSummary :: EventTrackerSummary
newEventTrackerSummary =
  EventTrackerSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> EventTrackerSummary
EventTrackerSummary'
    { $sel:status:EventTrackerSummary' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:EventTrackerSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:EventTrackerSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:EventTrackerSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:eventTrackerArn:EventTrackerSummary' :: Maybe Text
eventTrackerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the event tracker.
--
-- An event tracker can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
--
-- -   DELETE PENDING > DELETE IN_PROGRESS
eventTrackerSummary_status :: Lens.Lens' EventTrackerSummary (Prelude.Maybe Prelude.Text)
eventTrackerSummary_status :: (Maybe Text -> f (Maybe Text))
-> EventTrackerSummary -> f EventTrackerSummary
eventTrackerSummary_status = (EventTrackerSummary -> Maybe Text)
-> (EventTrackerSummary -> Maybe Text -> EventTrackerSummary)
-> Lens
     EventTrackerSummary EventTrackerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTrackerSummary' {Maybe Text
status :: Maybe Text
$sel:status:EventTrackerSummary' :: EventTrackerSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: EventTrackerSummary
s@EventTrackerSummary' {} Maybe Text
a -> EventTrackerSummary
s {$sel:status:EventTrackerSummary' :: Maybe Text
status = Maybe Text
a} :: EventTrackerSummary)

-- | The date and time (in Unix time) that the event tracker was last
-- updated.
eventTrackerSummary_lastUpdatedDateTime :: Lens.Lens' EventTrackerSummary (Prelude.Maybe Prelude.UTCTime)
eventTrackerSummary_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTrackerSummary -> f EventTrackerSummary
eventTrackerSummary_lastUpdatedDateTime = (EventTrackerSummary -> Maybe POSIX)
-> (EventTrackerSummary -> Maybe POSIX -> EventTrackerSummary)
-> Lens
     EventTrackerSummary EventTrackerSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTrackerSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:EventTrackerSummary' :: EventTrackerSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: EventTrackerSummary
s@EventTrackerSummary' {} Maybe POSIX
a -> EventTrackerSummary
s {$sel:lastUpdatedDateTime:EventTrackerSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: EventTrackerSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> EventTrackerSummary -> f EventTrackerSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTrackerSummary
-> f EventTrackerSummary
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

-- | The name of the event tracker.
eventTrackerSummary_name :: Lens.Lens' EventTrackerSummary (Prelude.Maybe Prelude.Text)
eventTrackerSummary_name :: (Maybe Text -> f (Maybe Text))
-> EventTrackerSummary -> f EventTrackerSummary
eventTrackerSummary_name = (EventTrackerSummary -> Maybe Text)
-> (EventTrackerSummary -> Maybe Text -> EventTrackerSummary)
-> Lens
     EventTrackerSummary EventTrackerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTrackerSummary' {Maybe Text
name :: Maybe Text
$sel:name:EventTrackerSummary' :: EventTrackerSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: EventTrackerSummary
s@EventTrackerSummary' {} Maybe Text
a -> EventTrackerSummary
s {$sel:name:EventTrackerSummary' :: Maybe Text
name = Maybe Text
a} :: EventTrackerSummary)

-- | The date and time (in Unix time) that the event tracker was created.
eventTrackerSummary_creationDateTime :: Lens.Lens' EventTrackerSummary (Prelude.Maybe Prelude.UTCTime)
eventTrackerSummary_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTrackerSummary -> f EventTrackerSummary
eventTrackerSummary_creationDateTime = (EventTrackerSummary -> Maybe POSIX)
-> (EventTrackerSummary -> Maybe POSIX -> EventTrackerSummary)
-> Lens
     EventTrackerSummary EventTrackerSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTrackerSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:EventTrackerSummary' :: EventTrackerSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: EventTrackerSummary
s@EventTrackerSummary' {} Maybe POSIX
a -> EventTrackerSummary
s {$sel:creationDateTime:EventTrackerSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: EventTrackerSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> EventTrackerSummary -> f EventTrackerSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EventTrackerSummary
-> f EventTrackerSummary
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

-- | The Amazon Resource Name (ARN) of the event tracker.
eventTrackerSummary_eventTrackerArn :: Lens.Lens' EventTrackerSummary (Prelude.Maybe Prelude.Text)
eventTrackerSummary_eventTrackerArn :: (Maybe Text -> f (Maybe Text))
-> EventTrackerSummary -> f EventTrackerSummary
eventTrackerSummary_eventTrackerArn = (EventTrackerSummary -> Maybe Text)
-> (EventTrackerSummary -> Maybe Text -> EventTrackerSummary)
-> Lens
     EventTrackerSummary EventTrackerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTrackerSummary' {Maybe Text
eventTrackerArn :: Maybe Text
$sel:eventTrackerArn:EventTrackerSummary' :: EventTrackerSummary -> Maybe Text
eventTrackerArn} -> Maybe Text
eventTrackerArn) (\s :: EventTrackerSummary
s@EventTrackerSummary' {} Maybe Text
a -> EventTrackerSummary
s {$sel:eventTrackerArn:EventTrackerSummary' :: Maybe Text
eventTrackerArn = Maybe Text
a} :: EventTrackerSummary)

instance Core.FromJSON EventTrackerSummary where
  parseJSON :: Value -> Parser EventTrackerSummary
parseJSON =
    String
-> (Object -> Parser EventTrackerSummary)
-> Value
-> Parser EventTrackerSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EventTrackerSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> EventTrackerSummary
EventTrackerSummary'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> EventTrackerSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> EventTrackerSummary)
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 POSIX
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> EventTrackerSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> EventTrackerSummary)
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 POSIX -> Maybe Text -> EventTrackerSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> EventTrackerSummary)
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 -> EventTrackerSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> EventTrackerSummary)
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 -> EventTrackerSummary)
-> Parser (Maybe Text) -> Parser EventTrackerSummary
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 EventTrackerSummary

instance Prelude.NFData EventTrackerSummary