{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:campaignStatus:CampaignState' :: Maybe CampaignStatus
campaignStatus = forall a. Maybe a
Prelude.Nothing}
campaignState_campaignStatus :: Lens.Lens' CampaignState (Prelude.Maybe CampaignStatus)
campaignState_campaignStatus :: Lens' CampaignState (Maybe CampaignStatus)
campaignState_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 Data.FromJSON CampaignState where
parseJSON :: Value -> Parser CampaignState
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CampaignState"
( \Object
x ->
Maybe CampaignStatus -> CampaignState
CampaignState'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CampaignStatus")
)
instance Prelude.Hashable CampaignState where
hashWithSalt :: Int -> CampaignState -> Int
hashWithSalt Int
_salt CampaignState' {Maybe CampaignStatus
campaignStatus :: Maybe CampaignStatus
$sel:campaignStatus:CampaignState' :: CampaignState -> Maybe CampaignStatus
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CampaignStatus
campaignStatus
instance Prelude.NFData CampaignState where
rnf :: CampaignState -> ()
rnf CampaignState' {Maybe CampaignStatus
campaignStatus :: Maybe CampaignStatus
$sel:campaignStatus:CampaignState' :: CampaignState -> Maybe CampaignStatus
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe CampaignStatus
campaignStatus