{-# 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.JourneyStateRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.State
import qualified Amazonka.Prelude as Prelude
data JourneyStateRequest = JourneyStateRequest'
{
JourneyStateRequest -> Maybe State
state :: Prelude.Maybe State
}
deriving (JourneyStateRequest -> JourneyStateRequest -> Bool
(JourneyStateRequest -> JourneyStateRequest -> Bool)
-> (JourneyStateRequest -> JourneyStateRequest -> Bool)
-> Eq JourneyStateRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JourneyStateRequest -> JourneyStateRequest -> Bool
$c/= :: JourneyStateRequest -> JourneyStateRequest -> Bool
== :: JourneyStateRequest -> JourneyStateRequest -> Bool
$c== :: JourneyStateRequest -> JourneyStateRequest -> Bool
Prelude.Eq, ReadPrec [JourneyStateRequest]
ReadPrec JourneyStateRequest
Int -> ReadS JourneyStateRequest
ReadS [JourneyStateRequest]
(Int -> ReadS JourneyStateRequest)
-> ReadS [JourneyStateRequest]
-> ReadPrec JourneyStateRequest
-> ReadPrec [JourneyStateRequest]
-> Read JourneyStateRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JourneyStateRequest]
$creadListPrec :: ReadPrec [JourneyStateRequest]
readPrec :: ReadPrec JourneyStateRequest
$creadPrec :: ReadPrec JourneyStateRequest
readList :: ReadS [JourneyStateRequest]
$creadList :: ReadS [JourneyStateRequest]
readsPrec :: Int -> ReadS JourneyStateRequest
$creadsPrec :: Int -> ReadS JourneyStateRequest
Prelude.Read, Int -> JourneyStateRequest -> ShowS
[JourneyStateRequest] -> ShowS
JourneyStateRequest -> String
(Int -> JourneyStateRequest -> ShowS)
-> (JourneyStateRequest -> String)
-> ([JourneyStateRequest] -> ShowS)
-> Show JourneyStateRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JourneyStateRequest] -> ShowS
$cshowList :: [JourneyStateRequest] -> ShowS
show :: JourneyStateRequest -> String
$cshow :: JourneyStateRequest -> String
showsPrec :: Int -> JourneyStateRequest -> ShowS
$cshowsPrec :: Int -> JourneyStateRequest -> ShowS
Prelude.Show, (forall x. JourneyStateRequest -> Rep JourneyStateRequest x)
-> (forall x. Rep JourneyStateRequest x -> JourneyStateRequest)
-> Generic JourneyStateRequest
forall x. Rep JourneyStateRequest x -> JourneyStateRequest
forall x. JourneyStateRequest -> Rep JourneyStateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JourneyStateRequest x -> JourneyStateRequest
$cfrom :: forall x. JourneyStateRequest -> Rep JourneyStateRequest x
Prelude.Generic)
newJourneyStateRequest ::
JourneyStateRequest
newJourneyStateRequest :: JourneyStateRequest
newJourneyStateRequest =
JourneyStateRequest' :: Maybe State -> JourneyStateRequest
JourneyStateRequest' {$sel:state:JourneyStateRequest' :: Maybe State
state = Maybe State
forall a. Maybe a
Prelude.Nothing}
journeyStateRequest_state :: Lens.Lens' JourneyStateRequest (Prelude.Maybe State)
journeyStateRequest_state :: (Maybe State -> f (Maybe State))
-> JourneyStateRequest -> f JourneyStateRequest
journeyStateRequest_state = (JourneyStateRequest -> Maybe State)
-> (JourneyStateRequest -> Maybe State -> JourneyStateRequest)
-> Lens
JourneyStateRequest JourneyStateRequest (Maybe State) (Maybe State)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JourneyStateRequest' {Maybe State
state :: Maybe State
$sel:state:JourneyStateRequest' :: JourneyStateRequest -> Maybe State
state} -> Maybe State
state) (\s :: JourneyStateRequest
s@JourneyStateRequest' {} Maybe State
a -> JourneyStateRequest
s {$sel:state:JourneyStateRequest' :: Maybe State
state = Maybe State
a} :: JourneyStateRequest)
instance Prelude.Hashable JourneyStateRequest
instance Prelude.NFData JourneyStateRequest
instance Core.ToJSON JourneyStateRequest where
toJSON :: JourneyStateRequest -> Value
toJSON JourneyStateRequest' {Maybe State
state :: Maybe State
$sel:state:JourneyStateRequest' :: JourneyStateRequest -> Maybe State
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"State" Text -> State -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (State -> Pair) -> Maybe State -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe State
state]
)