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