{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:contactListName:ContactListDestination' :: Text
contactListName =
Text
pContactListName_,
$sel:contactListImportAction:ContactListDestination' :: ContactListImportAction
contactListImportAction = ContactListImportAction
pContactListImportAction_
}
contactListDestination_contactListName :: Lens.Lens' ContactListDestination Prelude.Text
contactListDestination_contactListName :: Lens' ContactListDestination Text
contactListDestination_contactListName = 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 :: Lens' ContactListDestination ContactListImportAction
contactListDestination_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 Data.FromJSON ContactListDestination where
parseJSON :: Value -> Parser ContactListDestination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ContactListDestination"
( \Object
x ->
Text -> ContactListImportAction -> ContactListDestination
ContactListDestination'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ContactListName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ContactListImportAction")
)
instance Prelude.Hashable ContactListDestination where
hashWithSalt :: Int -> ContactListDestination -> Int
hashWithSalt Int
_salt ContactListDestination' {Text
ContactListImportAction
contactListImportAction :: ContactListImportAction
contactListName :: Text
$sel:contactListImportAction:ContactListDestination' :: ContactListDestination -> ContactListImportAction
$sel:contactListName:ContactListDestination' :: ContactListDestination -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactListName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ContactListImportAction
contactListImportAction
instance Prelude.NFData ContactListDestination where
rnf :: ContactListDestination -> ()
rnf ContactListDestination' {Text
ContactListImportAction
contactListImportAction :: ContactListImportAction
contactListName :: Text
$sel:contactListImportAction:ContactListDestination' :: ContactListDestination -> ContactListImportAction
$sel:contactListName:ContactListDestination' :: ContactListDestination -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
contactListName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ContactListImportAction
contactListImportAction
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ContactListName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
contactListName),
forall a. a -> Maybe a
Prelude.Just
( Key
"ContactListImportAction"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ContactListImportAction
contactListImportAction
)
]
)