{-# 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.PinpointEmail.Types.PinpointDestination 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
data PinpointDestination = PinpointDestination'
{
PinpointDestination -> Maybe Text
applicationArn :: Prelude.Maybe Prelude.Text
}
deriving (PinpointDestination -> PinpointDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PinpointDestination -> PinpointDestination -> Bool
$c/= :: PinpointDestination -> PinpointDestination -> Bool
== :: PinpointDestination -> PinpointDestination -> Bool
$c== :: PinpointDestination -> PinpointDestination -> Bool
Prelude.Eq, ReadPrec [PinpointDestination]
ReadPrec PinpointDestination
Int -> ReadS PinpointDestination
ReadS [PinpointDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PinpointDestination]
$creadListPrec :: ReadPrec [PinpointDestination]
readPrec :: ReadPrec PinpointDestination
$creadPrec :: ReadPrec PinpointDestination
readList :: ReadS [PinpointDestination]
$creadList :: ReadS [PinpointDestination]
readsPrec :: Int -> ReadS PinpointDestination
$creadsPrec :: Int -> ReadS PinpointDestination
Prelude.Read, Int -> PinpointDestination -> ShowS
[PinpointDestination] -> ShowS
PinpointDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PinpointDestination] -> ShowS
$cshowList :: [PinpointDestination] -> ShowS
show :: PinpointDestination -> String
$cshow :: PinpointDestination -> String
showsPrec :: Int -> PinpointDestination -> ShowS
$cshowsPrec :: Int -> PinpointDestination -> ShowS
Prelude.Show, forall x. Rep PinpointDestination x -> PinpointDestination
forall x. PinpointDestination -> Rep PinpointDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PinpointDestination x -> PinpointDestination
$cfrom :: forall x. PinpointDestination -> Rep PinpointDestination x
Prelude.Generic)
newPinpointDestination ::
PinpointDestination
newPinpointDestination :: PinpointDestination
newPinpointDestination =
PinpointDestination'
{ $sel:applicationArn:PinpointDestination' :: Maybe Text
applicationArn =
forall a. Maybe a
Prelude.Nothing
}
pinpointDestination_applicationArn :: Lens.Lens' PinpointDestination (Prelude.Maybe Prelude.Text)
pinpointDestination_applicationArn :: Lens' PinpointDestination (Maybe Text)
pinpointDestination_applicationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PinpointDestination' {Maybe Text
applicationArn :: Maybe Text
$sel:applicationArn:PinpointDestination' :: PinpointDestination -> Maybe Text
applicationArn} -> Maybe Text
applicationArn) (\s :: PinpointDestination
s@PinpointDestination' {} Maybe Text
a -> PinpointDestination
s {$sel:applicationArn:PinpointDestination' :: Maybe Text
applicationArn = Maybe Text
a} :: PinpointDestination)
instance Data.FromJSON PinpointDestination where
parseJSON :: Value -> Parser PinpointDestination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PinpointDestination"
( \Object
x ->
Maybe Text -> PinpointDestination
PinpointDestination'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ApplicationArn")
)
instance Prelude.Hashable PinpointDestination where
hashWithSalt :: Int -> PinpointDestination -> Int
hashWithSalt Int
_salt PinpointDestination' {Maybe Text
applicationArn :: Maybe Text
$sel:applicationArn:PinpointDestination' :: PinpointDestination -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
applicationArn
instance Prelude.NFData PinpointDestination where
rnf :: PinpointDestination -> ()
rnf PinpointDestination' {Maybe Text
applicationArn :: Maybe Text
$sel:applicationArn:PinpointDestination' :: PinpointDestination -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
applicationArn
instance Data.ToJSON PinpointDestination where
toJSON :: PinpointDestination -> Value
toJSON PinpointDestination' {Maybe Text
applicationArn :: Maybe Text
$sel:applicationArn:PinpointDestination' :: PinpointDestination -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ApplicationArn" 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
applicationArn
]
)