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