{-# 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.CampaignSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CampaignSummary = CampaignSummary'
{
CampaignSummary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
CampaignSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
CampaignSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
CampaignSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CampaignSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
CampaignSummary -> Maybe Text
campaignArn :: Prelude.Maybe Prelude.Text
}
deriving (CampaignSummary -> CampaignSummary -> Bool
(CampaignSummary -> CampaignSummary -> Bool)
-> (CampaignSummary -> CampaignSummary -> Bool)
-> Eq CampaignSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CampaignSummary -> CampaignSummary -> Bool
$c/= :: CampaignSummary -> CampaignSummary -> Bool
== :: CampaignSummary -> CampaignSummary -> Bool
$c== :: CampaignSummary -> CampaignSummary -> Bool
Prelude.Eq, ReadPrec [CampaignSummary]
ReadPrec CampaignSummary
Int -> ReadS CampaignSummary
ReadS [CampaignSummary]
(Int -> ReadS CampaignSummary)
-> ReadS [CampaignSummary]
-> ReadPrec CampaignSummary
-> ReadPrec [CampaignSummary]
-> Read CampaignSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CampaignSummary]
$creadListPrec :: ReadPrec [CampaignSummary]
readPrec :: ReadPrec CampaignSummary
$creadPrec :: ReadPrec CampaignSummary
readList :: ReadS [CampaignSummary]
$creadList :: ReadS [CampaignSummary]
readsPrec :: Int -> ReadS CampaignSummary
$creadsPrec :: Int -> ReadS CampaignSummary
Prelude.Read, Int -> CampaignSummary -> ShowS
[CampaignSummary] -> ShowS
CampaignSummary -> String
(Int -> CampaignSummary -> ShowS)
-> (CampaignSummary -> String)
-> ([CampaignSummary] -> ShowS)
-> Show CampaignSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CampaignSummary] -> ShowS
$cshowList :: [CampaignSummary] -> ShowS
show :: CampaignSummary -> String
$cshow :: CampaignSummary -> String
showsPrec :: Int -> CampaignSummary -> ShowS
$cshowsPrec :: Int -> CampaignSummary -> ShowS
Prelude.Show, (forall x. CampaignSummary -> Rep CampaignSummary x)
-> (forall x. Rep CampaignSummary x -> CampaignSummary)
-> Generic CampaignSummary
forall x. Rep CampaignSummary x -> CampaignSummary
forall x. CampaignSummary -> Rep CampaignSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CampaignSummary x -> CampaignSummary
$cfrom :: forall x. CampaignSummary -> Rep CampaignSummary x
Prelude.Generic)
newCampaignSummary ::
CampaignSummary
newCampaignSummary :: CampaignSummary
newCampaignSummary =
CampaignSummary' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CampaignSummary
CampaignSummary'
{ $sel:failureReason:CampaignSummary' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:CampaignSummary' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedDateTime:CampaignSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:CampaignSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDateTime:CampaignSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:campaignArn:CampaignSummary' :: Maybe Text
campaignArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
campaignSummary_failureReason :: Lens.Lens' CampaignSummary (Prelude.Maybe Prelude.Text)
campaignSummary_failureReason :: (Maybe Text -> f (Maybe Text))
-> CampaignSummary -> f CampaignSummary
campaignSummary_failureReason = (CampaignSummary -> Maybe Text)
-> (CampaignSummary -> Maybe Text -> CampaignSummary)
-> Lens CampaignSummary CampaignSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignSummary' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:CampaignSummary' :: CampaignSummary -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: CampaignSummary
s@CampaignSummary' {} Maybe Text
a -> CampaignSummary
s {$sel:failureReason:CampaignSummary' :: Maybe Text
failureReason = Maybe Text
a} :: CampaignSummary)
campaignSummary_status :: Lens.Lens' CampaignSummary (Prelude.Maybe Prelude.Text)
campaignSummary_status :: (Maybe Text -> f (Maybe Text))
-> CampaignSummary -> f CampaignSummary
campaignSummary_status = (CampaignSummary -> Maybe Text)
-> (CampaignSummary -> Maybe Text -> CampaignSummary)
-> Lens CampaignSummary CampaignSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignSummary' {Maybe Text
status :: Maybe Text
$sel:status:CampaignSummary' :: CampaignSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: CampaignSummary
s@CampaignSummary' {} Maybe Text
a -> CampaignSummary
s {$sel:status:CampaignSummary' :: Maybe Text
status = Maybe Text
a} :: CampaignSummary)
campaignSummary_lastUpdatedDateTime :: Lens.Lens' CampaignSummary (Prelude.Maybe Prelude.UTCTime)
campaignSummary_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CampaignSummary -> f CampaignSummary
campaignSummary_lastUpdatedDateTime = (CampaignSummary -> Maybe POSIX)
-> (CampaignSummary -> Maybe POSIX -> CampaignSummary)
-> Lens CampaignSummary CampaignSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:CampaignSummary' :: CampaignSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: CampaignSummary
s@CampaignSummary' {} Maybe POSIX
a -> CampaignSummary
s {$sel:lastUpdatedDateTime:CampaignSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: CampaignSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> CampaignSummary -> f CampaignSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CampaignSummary
-> f CampaignSummary
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
campaignSummary_name :: Lens.Lens' CampaignSummary (Prelude.Maybe Prelude.Text)
campaignSummary_name :: (Maybe Text -> f (Maybe Text))
-> CampaignSummary -> f CampaignSummary
campaignSummary_name = (CampaignSummary -> Maybe Text)
-> (CampaignSummary -> Maybe Text -> CampaignSummary)
-> Lens CampaignSummary CampaignSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignSummary' {Maybe Text
name :: Maybe Text
$sel:name:CampaignSummary' :: CampaignSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: CampaignSummary
s@CampaignSummary' {} Maybe Text
a -> CampaignSummary
s {$sel:name:CampaignSummary' :: Maybe Text
name = Maybe Text
a} :: CampaignSummary)
campaignSummary_creationDateTime :: Lens.Lens' CampaignSummary (Prelude.Maybe Prelude.UTCTime)
campaignSummary_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CampaignSummary -> f CampaignSummary
campaignSummary_creationDateTime = (CampaignSummary -> Maybe POSIX)
-> (CampaignSummary -> Maybe POSIX -> CampaignSummary)
-> Lens CampaignSummary CampaignSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:CampaignSummary' :: CampaignSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: CampaignSummary
s@CampaignSummary' {} Maybe POSIX
a -> CampaignSummary
s {$sel:creationDateTime:CampaignSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: CampaignSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> CampaignSummary -> f CampaignSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CampaignSummary
-> f CampaignSummary
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
campaignSummary_campaignArn :: Lens.Lens' CampaignSummary (Prelude.Maybe Prelude.Text)
campaignSummary_campaignArn :: (Maybe Text -> f (Maybe Text))
-> CampaignSummary -> f CampaignSummary
campaignSummary_campaignArn = (CampaignSummary -> Maybe Text)
-> (CampaignSummary -> Maybe Text -> CampaignSummary)
-> Lens CampaignSummary CampaignSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignSummary' {Maybe Text
campaignArn :: Maybe Text
$sel:campaignArn:CampaignSummary' :: CampaignSummary -> Maybe Text
campaignArn} -> Maybe Text
campaignArn) (\s :: CampaignSummary
s@CampaignSummary' {} Maybe Text
a -> CampaignSummary
s {$sel:campaignArn:CampaignSummary' :: Maybe Text
campaignArn = Maybe Text
a} :: CampaignSummary)
instance Core.FromJSON CampaignSummary where
parseJSON :: Value -> Parser CampaignSummary
parseJSON =
String
-> (Object -> Parser CampaignSummary)
-> Value
-> Parser CampaignSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CampaignSummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CampaignSummary
CampaignSummary'
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CampaignSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CampaignSummary)
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
"failureReason")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CampaignSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe POSIX -> Maybe Text -> CampaignSummary)
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
"status")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe POSIX -> Maybe Text -> CampaignSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe POSIX -> Maybe Text -> CampaignSummary)
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 -> CampaignSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> CampaignSummary)
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 -> CampaignSummary)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> CampaignSummary)
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 -> CampaignSummary)
-> Parser (Maybe Text) -> Parser CampaignSummary
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
"campaignArn")
)
instance Prelude.Hashable CampaignSummary
instance Prelude.NFData CampaignSummary