{-# 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.Pinpoint.Types.CampaignState where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.CampaignStatus
import qualified Amazonka.Prelude as Prelude
data CampaignState = CampaignState'
{
CampaignState -> Maybe CampaignStatus
campaignStatus :: Prelude.Maybe CampaignStatus
}
deriving (CampaignState -> CampaignState -> Bool
(CampaignState -> CampaignState -> Bool)
-> (CampaignState -> CampaignState -> Bool) -> Eq CampaignState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CampaignState -> CampaignState -> Bool
$c/= :: CampaignState -> CampaignState -> Bool
== :: CampaignState -> CampaignState -> Bool
$c== :: CampaignState -> CampaignState -> Bool
Prelude.Eq, ReadPrec [CampaignState]
ReadPrec CampaignState
Int -> ReadS CampaignState
ReadS [CampaignState]
(Int -> ReadS CampaignState)
-> ReadS [CampaignState]
-> ReadPrec CampaignState
-> ReadPrec [CampaignState]
-> Read CampaignState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CampaignState]
$creadListPrec :: ReadPrec [CampaignState]
readPrec :: ReadPrec CampaignState
$creadPrec :: ReadPrec CampaignState
readList :: ReadS [CampaignState]
$creadList :: ReadS [CampaignState]
readsPrec :: Int -> ReadS CampaignState
$creadsPrec :: Int -> ReadS CampaignState
Prelude.Read, Int -> CampaignState -> ShowS
[CampaignState] -> ShowS
CampaignState -> String
(Int -> CampaignState -> ShowS)
-> (CampaignState -> String)
-> ([CampaignState] -> ShowS)
-> Show CampaignState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CampaignState] -> ShowS
$cshowList :: [CampaignState] -> ShowS
show :: CampaignState -> String
$cshow :: CampaignState -> String
showsPrec :: Int -> CampaignState -> ShowS
$cshowsPrec :: Int -> CampaignState -> ShowS
Prelude.Show, (forall x. CampaignState -> Rep CampaignState x)
-> (forall x. Rep CampaignState x -> CampaignState)
-> Generic CampaignState
forall x. Rep CampaignState x -> CampaignState
forall x. CampaignState -> Rep CampaignState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CampaignState x -> CampaignState
$cfrom :: forall x. CampaignState -> Rep CampaignState x
Prelude.Generic)
newCampaignState ::
CampaignState
newCampaignState :: CampaignState
newCampaignState =
CampaignState' :: Maybe CampaignStatus -> CampaignState
CampaignState' {$sel:campaignStatus:CampaignState' :: Maybe CampaignStatus
campaignStatus = Maybe CampaignStatus
forall a. Maybe a
Prelude.Nothing}
campaignState_campaignStatus :: Lens.Lens' CampaignState (Prelude.Maybe CampaignStatus)
campaignState_campaignStatus :: (Maybe CampaignStatus -> f (Maybe CampaignStatus))
-> CampaignState -> f CampaignState
campaignState_campaignStatus = (CampaignState -> Maybe CampaignStatus)
-> (CampaignState -> Maybe CampaignStatus -> CampaignState)
-> Lens
CampaignState
CampaignState
(Maybe CampaignStatus)
(Maybe CampaignStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignState' {Maybe CampaignStatus
campaignStatus :: Maybe CampaignStatus
$sel:campaignStatus:CampaignState' :: CampaignState -> Maybe CampaignStatus
campaignStatus} -> Maybe CampaignStatus
campaignStatus) (\s :: CampaignState
s@CampaignState' {} Maybe CampaignStatus
a -> CampaignState
s {$sel:campaignStatus:CampaignState' :: Maybe CampaignStatus
campaignStatus = Maybe CampaignStatus
a} :: CampaignState)
instance Core.FromJSON CampaignState where
parseJSON :: Value -> Parser CampaignState
parseJSON =
String
-> (Object -> Parser CampaignState)
-> Value
-> Parser CampaignState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CampaignState"
( \Object
x ->
Maybe CampaignStatus -> CampaignState
CampaignState'
(Maybe CampaignStatus -> CampaignState)
-> Parser (Maybe CampaignStatus) -> Parser CampaignState
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CampaignStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CampaignStatus")
)
instance Prelude.Hashable CampaignState
instance Prelude.NFData CampaignState