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