{-# 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.AddressConfiguration 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.ChannelType
import qualified Amazonka.Prelude as Prelude
data AddressConfiguration = AddressConfiguration'
{
AddressConfiguration -> Maybe Text
bodyOverride :: Prelude.Maybe Prelude.Text,
AddressConfiguration -> Maybe ChannelType
channelType :: Prelude.Maybe ChannelType,
AddressConfiguration -> Maybe (HashMap Text Text)
context :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
AddressConfiguration -> Maybe Text
rawContent :: Prelude.Maybe Prelude.Text,
AddressConfiguration -> Maybe (HashMap Text [Text])
substitutions :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
AddressConfiguration -> Maybe Text
titleOverride :: Prelude.Maybe Prelude.Text
}
deriving (AddressConfiguration -> AddressConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddressConfiguration -> AddressConfiguration -> Bool
$c/= :: AddressConfiguration -> AddressConfiguration -> Bool
== :: AddressConfiguration -> AddressConfiguration -> Bool
$c== :: AddressConfiguration -> AddressConfiguration -> Bool
Prelude.Eq, ReadPrec [AddressConfiguration]
ReadPrec AddressConfiguration
Int -> ReadS AddressConfiguration
ReadS [AddressConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddressConfiguration]
$creadListPrec :: ReadPrec [AddressConfiguration]
readPrec :: ReadPrec AddressConfiguration
$creadPrec :: ReadPrec AddressConfiguration
readList :: ReadS [AddressConfiguration]
$creadList :: ReadS [AddressConfiguration]
readsPrec :: Int -> ReadS AddressConfiguration
$creadsPrec :: Int -> ReadS AddressConfiguration
Prelude.Read, Int -> AddressConfiguration -> ShowS
[AddressConfiguration] -> ShowS
AddressConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddressConfiguration] -> ShowS
$cshowList :: [AddressConfiguration] -> ShowS
show :: AddressConfiguration -> String
$cshow :: AddressConfiguration -> String
showsPrec :: Int -> AddressConfiguration -> ShowS
$cshowsPrec :: Int -> AddressConfiguration -> ShowS
Prelude.Show, forall x. Rep AddressConfiguration x -> AddressConfiguration
forall x. AddressConfiguration -> Rep AddressConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddressConfiguration x -> AddressConfiguration
$cfrom :: forall x. AddressConfiguration -> Rep AddressConfiguration x
Prelude.Generic)
newAddressConfiguration ::
AddressConfiguration
newAddressConfiguration :: AddressConfiguration
newAddressConfiguration =
AddressConfiguration'
{ $sel:bodyOverride:AddressConfiguration' :: Maybe Text
bodyOverride =
forall a. Maybe a
Prelude.Nothing,
$sel:channelType:AddressConfiguration' :: Maybe ChannelType
channelType = forall a. Maybe a
Prelude.Nothing,
$sel:context:AddressConfiguration' :: Maybe (HashMap Text Text)
context = forall a. Maybe a
Prelude.Nothing,
$sel:rawContent:AddressConfiguration' :: Maybe Text
rawContent = forall a. Maybe a
Prelude.Nothing,
$sel:substitutions:AddressConfiguration' :: Maybe (HashMap Text [Text])
substitutions = forall a. Maybe a
Prelude.Nothing,
$sel:titleOverride:AddressConfiguration' :: Maybe Text
titleOverride = forall a. Maybe a
Prelude.Nothing
}
addressConfiguration_bodyOverride :: Lens.Lens' AddressConfiguration (Prelude.Maybe Prelude.Text)
addressConfiguration_bodyOverride :: Lens' AddressConfiguration (Maybe Text)
addressConfiguration_bodyOverride = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressConfiguration' {Maybe Text
bodyOverride :: Maybe Text
$sel:bodyOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
bodyOverride} -> Maybe Text
bodyOverride) (\s :: AddressConfiguration
s@AddressConfiguration' {} Maybe Text
a -> AddressConfiguration
s {$sel:bodyOverride:AddressConfiguration' :: Maybe Text
bodyOverride = Maybe Text
a} :: AddressConfiguration)
addressConfiguration_channelType :: Lens.Lens' AddressConfiguration (Prelude.Maybe ChannelType)
addressConfiguration_channelType :: Lens' AddressConfiguration (Maybe ChannelType)
addressConfiguration_channelType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressConfiguration' {Maybe ChannelType
channelType :: Maybe ChannelType
$sel:channelType:AddressConfiguration' :: AddressConfiguration -> Maybe ChannelType
channelType} -> Maybe ChannelType
channelType) (\s :: AddressConfiguration
s@AddressConfiguration' {} Maybe ChannelType
a -> AddressConfiguration
s {$sel:channelType:AddressConfiguration' :: Maybe ChannelType
channelType = Maybe ChannelType
a} :: AddressConfiguration)
addressConfiguration_context :: Lens.Lens' AddressConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
addressConfiguration_context :: Lens' AddressConfiguration (Maybe (HashMap Text Text))
addressConfiguration_context = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressConfiguration' {Maybe (HashMap Text Text)
context :: Maybe (HashMap Text Text)
$sel:context:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text Text)
context} -> Maybe (HashMap Text Text)
context) (\s :: AddressConfiguration
s@AddressConfiguration' {} Maybe (HashMap Text Text)
a -> AddressConfiguration
s {$sel:context:AddressConfiguration' :: Maybe (HashMap Text Text)
context = Maybe (HashMap Text Text)
a} :: AddressConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
addressConfiguration_rawContent :: Lens.Lens' AddressConfiguration (Prelude.Maybe Prelude.Text)
addressConfiguration_rawContent :: Lens' AddressConfiguration (Maybe Text)
addressConfiguration_rawContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressConfiguration' {Maybe Text
rawContent :: Maybe Text
$sel:rawContent:AddressConfiguration' :: AddressConfiguration -> Maybe Text
rawContent} -> Maybe Text
rawContent) (\s :: AddressConfiguration
s@AddressConfiguration' {} Maybe Text
a -> AddressConfiguration
s {$sel:rawContent:AddressConfiguration' :: Maybe Text
rawContent = Maybe Text
a} :: AddressConfiguration)
addressConfiguration_substitutions :: Lens.Lens' AddressConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
addressConfiguration_substitutions :: Lens' AddressConfiguration (Maybe (HashMap Text [Text]))
addressConfiguration_substitutions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressConfiguration' {Maybe (HashMap Text [Text])
substitutions :: Maybe (HashMap Text [Text])
$sel:substitutions:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text [Text])
substitutions} -> Maybe (HashMap Text [Text])
substitutions) (\s :: AddressConfiguration
s@AddressConfiguration' {} Maybe (HashMap Text [Text])
a -> AddressConfiguration
s {$sel:substitutions:AddressConfiguration' :: Maybe (HashMap Text [Text])
substitutions = Maybe (HashMap Text [Text])
a} :: AddressConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
addressConfiguration_titleOverride :: Lens.Lens' AddressConfiguration (Prelude.Maybe Prelude.Text)
addressConfiguration_titleOverride :: Lens' AddressConfiguration (Maybe Text)
addressConfiguration_titleOverride = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddressConfiguration' {Maybe Text
titleOverride :: Maybe Text
$sel:titleOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
titleOverride} -> Maybe Text
titleOverride) (\s :: AddressConfiguration
s@AddressConfiguration' {} Maybe Text
a -> AddressConfiguration
s {$sel:titleOverride:AddressConfiguration' :: Maybe Text
titleOverride = Maybe Text
a} :: AddressConfiguration)
instance Prelude.Hashable AddressConfiguration where
hashWithSalt :: Int -> AddressConfiguration -> Int
hashWithSalt Int
_salt AddressConfiguration' {Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe ChannelType
titleOverride :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
rawContent :: Maybe Text
context :: Maybe (HashMap Text Text)
channelType :: Maybe ChannelType
bodyOverride :: Maybe Text
$sel:titleOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
$sel:substitutions:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text [Text])
$sel:rawContent:AddressConfiguration' :: AddressConfiguration -> Maybe Text
$sel:context:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text Text)
$sel:channelType:AddressConfiguration' :: AddressConfiguration -> Maybe ChannelType
$sel:bodyOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bodyOverride
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChannelType
channelType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
context
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rawContent
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text [Text])
substitutions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
titleOverride
instance Prelude.NFData AddressConfiguration where
rnf :: AddressConfiguration -> ()
rnf AddressConfiguration' {Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe ChannelType
titleOverride :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
rawContent :: Maybe Text
context :: Maybe (HashMap Text Text)
channelType :: Maybe ChannelType
bodyOverride :: Maybe Text
$sel:titleOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
$sel:substitutions:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text [Text])
$sel:rawContent:AddressConfiguration' :: AddressConfiguration -> Maybe Text
$sel:context:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text Text)
$sel:channelType:AddressConfiguration' :: AddressConfiguration -> Maybe ChannelType
$sel:bodyOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bodyOverride
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChannelType
channelType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
context
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rawContent
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [Text])
substitutions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
titleOverride
instance Data.ToJSON AddressConfiguration where
toJSON :: AddressConfiguration -> Value
toJSON AddressConfiguration' {Maybe Text
Maybe (HashMap Text [Text])
Maybe (HashMap Text Text)
Maybe ChannelType
titleOverride :: Maybe Text
substitutions :: Maybe (HashMap Text [Text])
rawContent :: Maybe Text
context :: Maybe (HashMap Text Text)
channelType :: Maybe ChannelType
bodyOverride :: Maybe Text
$sel:titleOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
$sel:substitutions:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text [Text])
$sel:rawContent:AddressConfiguration' :: AddressConfiguration -> Maybe Text
$sel:context:AddressConfiguration' :: AddressConfiguration -> Maybe (HashMap Text Text)
$sel:channelType:AddressConfiguration' :: AddressConfiguration -> Maybe ChannelType
$sel:bodyOverride:AddressConfiguration' :: AddressConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BodyOverride" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bodyOverride,
(Key
"ChannelType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelType
channelType,
(Key
"Context" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
context,
(Key
"RawContent" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
rawContent,
(Key
"Substitutions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
substitutions,
(Key
"TitleOverride" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
titleOverride
]
)