{-# 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.Campaign where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types.CampaignConfig
import Amazonka.Personalize.Types.CampaignUpdateSummary
import qualified Amazonka.Prelude as Prelude
data Campaign = Campaign'
{
Campaign -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
Campaign -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Campaign -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
Campaign -> Maybe CampaignConfig
campaignConfig :: Prelude.Maybe CampaignConfig,
Campaign -> Maybe CampaignUpdateSummary
latestCampaignUpdate :: Prelude.Maybe CampaignUpdateSummary,
Campaign -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Campaign -> Maybe Natural
minProvisionedTPS :: Prelude.Maybe Prelude.Natural,
Campaign -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
Campaign -> Maybe Text
campaignArn :: Prelude.Maybe Prelude.Text,
Campaign -> Maybe Text
solutionVersionArn :: Prelude.Maybe Prelude.Text
}
deriving (Campaign -> Campaign -> Bool
(Campaign -> Campaign -> Bool)
-> (Campaign -> Campaign -> Bool) -> Eq Campaign
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Campaign -> Campaign -> Bool
$c/= :: Campaign -> Campaign -> Bool
== :: Campaign -> Campaign -> Bool
$c== :: Campaign -> Campaign -> Bool
Prelude.Eq, ReadPrec [Campaign]
ReadPrec Campaign
Int -> ReadS Campaign
ReadS [Campaign]
(Int -> ReadS Campaign)
-> ReadS [Campaign]
-> ReadPrec Campaign
-> ReadPrec [Campaign]
-> Read Campaign
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Campaign]
$creadListPrec :: ReadPrec [Campaign]
readPrec :: ReadPrec Campaign
$creadPrec :: ReadPrec Campaign
readList :: ReadS [Campaign]
$creadList :: ReadS [Campaign]
readsPrec :: Int -> ReadS Campaign
$creadsPrec :: Int -> ReadS Campaign
Prelude.Read, Int -> Campaign -> ShowS
[Campaign] -> ShowS
Campaign -> String
(Int -> Campaign -> ShowS)
-> (Campaign -> String) -> ([Campaign] -> ShowS) -> Show Campaign
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Campaign] -> ShowS
$cshowList :: [Campaign] -> ShowS
show :: Campaign -> String
$cshow :: Campaign -> String
showsPrec :: Int -> Campaign -> ShowS
$cshowsPrec :: Int -> Campaign -> ShowS
Prelude.Show, (forall x. Campaign -> Rep Campaign x)
-> (forall x. Rep Campaign x -> Campaign) -> Generic Campaign
forall x. Rep Campaign x -> Campaign
forall x. Campaign -> Rep Campaign x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Campaign x -> Campaign
$cfrom :: forall x. Campaign -> Rep Campaign x
Prelude.Generic)
newCampaign ::
Campaign
newCampaign :: Campaign
newCampaign =
Campaign' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign
Campaign'
{ $sel:failureReason:Campaign' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:Campaign' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedDateTime:Campaign' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:campaignConfig:Campaign' :: Maybe CampaignConfig
campaignConfig = Maybe CampaignConfig
forall a. Maybe a
Prelude.Nothing,
$sel:latestCampaignUpdate:Campaign' :: Maybe CampaignUpdateSummary
latestCampaignUpdate = Maybe CampaignUpdateSummary
forall a. Maybe a
Prelude.Nothing,
$sel:name:Campaign' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:minProvisionedTPS:Campaign' :: Maybe Natural
minProvisionedTPS = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:creationDateTime:Campaign' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:campaignArn:Campaign' :: Maybe Text
campaignArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:solutionVersionArn:Campaign' :: Maybe Text
solutionVersionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
campaign_failureReason :: Lens.Lens' Campaign (Prelude.Maybe Prelude.Text)
campaign_failureReason :: (Maybe Text -> f (Maybe Text)) -> Campaign -> f Campaign
campaign_failureReason = (Campaign -> Maybe Text)
-> (Campaign -> Maybe Text -> Campaign)
-> Lens Campaign Campaign (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:Campaign' :: Campaign -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: Campaign
s@Campaign' {} Maybe Text
a -> Campaign
s {$sel:failureReason:Campaign' :: Maybe Text
failureReason = Maybe Text
a} :: Campaign)
campaign_status :: Lens.Lens' Campaign (Prelude.Maybe Prelude.Text)
campaign_status :: (Maybe Text -> f (Maybe Text)) -> Campaign -> f Campaign
campaign_status = (Campaign -> Maybe Text)
-> (Campaign -> Maybe Text -> Campaign)
-> Lens Campaign Campaign (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe Text
status :: Maybe Text
$sel:status:Campaign' :: Campaign -> Maybe Text
status} -> Maybe Text
status) (\s :: Campaign
s@Campaign' {} Maybe Text
a -> Campaign
s {$sel:status:Campaign' :: Maybe Text
status = Maybe Text
a} :: Campaign)
campaign_lastUpdatedDateTime :: Lens.Lens' Campaign (Prelude.Maybe Prelude.UTCTime)
campaign_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Campaign -> f Campaign
campaign_lastUpdatedDateTime = (Campaign -> Maybe POSIX)
-> (Campaign -> Maybe POSIX -> Campaign)
-> Lens Campaign Campaign (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:Campaign' :: Campaign -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: Campaign
s@Campaign' {} Maybe POSIX
a -> Campaign
s {$sel:lastUpdatedDateTime:Campaign' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: Campaign) ((Maybe POSIX -> f (Maybe POSIX)) -> Campaign -> f Campaign)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Campaign
-> f Campaign
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
campaign_campaignConfig :: Lens.Lens' Campaign (Prelude.Maybe CampaignConfig)
campaign_campaignConfig :: (Maybe CampaignConfig -> f (Maybe CampaignConfig))
-> Campaign -> f Campaign
campaign_campaignConfig = (Campaign -> Maybe CampaignConfig)
-> (Campaign -> Maybe CampaignConfig -> Campaign)
-> Lens
Campaign Campaign (Maybe CampaignConfig) (Maybe CampaignConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe CampaignConfig
campaignConfig :: Maybe CampaignConfig
$sel:campaignConfig:Campaign' :: Campaign -> Maybe CampaignConfig
campaignConfig} -> Maybe CampaignConfig
campaignConfig) (\s :: Campaign
s@Campaign' {} Maybe CampaignConfig
a -> Campaign
s {$sel:campaignConfig:Campaign' :: Maybe CampaignConfig
campaignConfig = Maybe CampaignConfig
a} :: Campaign)
campaign_latestCampaignUpdate :: Lens.Lens' Campaign (Prelude.Maybe CampaignUpdateSummary)
campaign_latestCampaignUpdate :: (Maybe CampaignUpdateSummary -> f (Maybe CampaignUpdateSummary))
-> Campaign -> f Campaign
campaign_latestCampaignUpdate = (Campaign -> Maybe CampaignUpdateSummary)
-> (Campaign -> Maybe CampaignUpdateSummary -> Campaign)
-> Lens
Campaign
Campaign
(Maybe CampaignUpdateSummary)
(Maybe CampaignUpdateSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe CampaignUpdateSummary
latestCampaignUpdate :: Maybe CampaignUpdateSummary
$sel:latestCampaignUpdate:Campaign' :: Campaign -> Maybe CampaignUpdateSummary
latestCampaignUpdate} -> Maybe CampaignUpdateSummary
latestCampaignUpdate) (\s :: Campaign
s@Campaign' {} Maybe CampaignUpdateSummary
a -> Campaign
s {$sel:latestCampaignUpdate:Campaign' :: Maybe CampaignUpdateSummary
latestCampaignUpdate = Maybe CampaignUpdateSummary
a} :: Campaign)
campaign_name :: Lens.Lens' Campaign (Prelude.Maybe Prelude.Text)
campaign_name :: (Maybe Text -> f (Maybe Text)) -> Campaign -> f Campaign
campaign_name = (Campaign -> Maybe Text)
-> (Campaign -> Maybe Text -> Campaign)
-> Lens Campaign Campaign (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe Text
name :: Maybe Text
$sel:name:Campaign' :: Campaign -> Maybe Text
name} -> Maybe Text
name) (\s :: Campaign
s@Campaign' {} Maybe Text
a -> Campaign
s {$sel:name:Campaign' :: Maybe Text
name = Maybe Text
a} :: Campaign)
campaign_minProvisionedTPS :: Lens.Lens' Campaign (Prelude.Maybe Prelude.Natural)
campaign_minProvisionedTPS :: (Maybe Natural -> f (Maybe Natural)) -> Campaign -> f Campaign
campaign_minProvisionedTPS = (Campaign -> Maybe Natural)
-> (Campaign -> Maybe Natural -> Campaign)
-> Lens Campaign Campaign (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe Natural
minProvisionedTPS :: Maybe Natural
$sel:minProvisionedTPS:Campaign' :: Campaign -> Maybe Natural
minProvisionedTPS} -> Maybe Natural
minProvisionedTPS) (\s :: Campaign
s@Campaign' {} Maybe Natural
a -> Campaign
s {$sel:minProvisionedTPS:Campaign' :: Maybe Natural
minProvisionedTPS = Maybe Natural
a} :: Campaign)
campaign_creationDateTime :: Lens.Lens' Campaign (Prelude.Maybe Prelude.UTCTime)
campaign_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Campaign -> f Campaign
campaign_creationDateTime = (Campaign -> Maybe POSIX)
-> (Campaign -> Maybe POSIX -> Campaign)
-> Lens Campaign Campaign (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:Campaign' :: Campaign -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: Campaign
s@Campaign' {} Maybe POSIX
a -> Campaign
s {$sel:creationDateTime:Campaign' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: Campaign) ((Maybe POSIX -> f (Maybe POSIX)) -> Campaign -> f Campaign)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Campaign
-> f Campaign
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
campaign_campaignArn :: Lens.Lens' Campaign (Prelude.Maybe Prelude.Text)
campaign_campaignArn :: (Maybe Text -> f (Maybe Text)) -> Campaign -> f Campaign
campaign_campaignArn = (Campaign -> Maybe Text)
-> (Campaign -> Maybe Text -> Campaign)
-> Lens Campaign Campaign (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe Text
campaignArn :: Maybe Text
$sel:campaignArn:Campaign' :: Campaign -> Maybe Text
campaignArn} -> Maybe Text
campaignArn) (\s :: Campaign
s@Campaign' {} Maybe Text
a -> Campaign
s {$sel:campaignArn:Campaign' :: Maybe Text
campaignArn = Maybe Text
a} :: Campaign)
campaign_solutionVersionArn :: Lens.Lens' Campaign (Prelude.Maybe Prelude.Text)
campaign_solutionVersionArn :: (Maybe Text -> f (Maybe Text)) -> Campaign -> f Campaign
campaign_solutionVersionArn = (Campaign -> Maybe Text)
-> (Campaign -> Maybe Text -> Campaign)
-> Lens Campaign Campaign (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Campaign' {Maybe Text
solutionVersionArn :: Maybe Text
$sel:solutionVersionArn:Campaign' :: Campaign -> Maybe Text
solutionVersionArn} -> Maybe Text
solutionVersionArn) (\s :: Campaign
s@Campaign' {} Maybe Text
a -> Campaign
s {$sel:solutionVersionArn:Campaign' :: Maybe Text
solutionVersionArn = Maybe Text
a} :: Campaign)
instance Core.FromJSON Campaign where
parseJSON :: Value -> Parser Campaign
parseJSON =
String -> (Object -> Parser Campaign) -> Value -> Parser Campaign
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Campaign"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign
Campaign'
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
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 CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
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 CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
-> Parser (Maybe POSIX)
-> Parser
(Maybe CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
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 CampaignConfig
-> Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
-> Parser (Maybe CampaignConfig)
-> Parser
(Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CampaignConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"campaignConfig")
Parser
(Maybe CampaignUpdateSummary
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
-> Parser (Maybe CampaignUpdateSummary)
-> Parser
(Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CampaignUpdateSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"latestCampaignUpdate")
Parser
(Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Campaign)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Campaign)
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 Natural
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Campaign)
-> Parser (Maybe Natural)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Campaign)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"minProvisionedTPS")
Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> Campaign)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Campaign)
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 -> Campaign)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Campaign)
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")
Parser (Maybe Text -> Campaign)
-> Parser (Maybe Text) -> Parser Campaign
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
"solutionVersionArn")
)
instance Prelude.Hashable Campaign
instance Prelude.NFData Campaign