{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PinpointDestination = PinpointDestination'
{
PinpointDestination -> Maybe Text
applicationArn :: Prelude.Maybe Prelude.Text
}
deriving (PinpointDestination -> PinpointDestination -> Bool
(PinpointDestination -> PinpointDestination -> Bool)
-> (PinpointDestination -> PinpointDestination -> Bool)
-> Eq PinpointDestination
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]
(Int -> ReadS PinpointDestination)
-> ReadS [PinpointDestination]
-> ReadPrec PinpointDestination
-> ReadPrec [PinpointDestination]
-> Read 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
(Int -> PinpointDestination -> ShowS)
-> (PinpointDestination -> String)
-> ([PinpointDestination] -> ShowS)
-> Show PinpointDestination
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. PinpointDestination -> Rep PinpointDestination x)
-> (forall x. Rep PinpointDestination x -> PinpointDestination)
-> Generic PinpointDestination
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' :: Maybe Text -> PinpointDestination
PinpointDestination'
{ $sel:applicationArn:PinpointDestination' :: Maybe Text
applicationArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
pinpointDestination_applicationArn :: Lens.Lens' PinpointDestination (Prelude.Maybe Prelude.Text)
pinpointDestination_applicationArn :: (Maybe Text -> f (Maybe Text))
-> PinpointDestination -> f PinpointDestination
pinpointDestination_applicationArn = (PinpointDestination -> Maybe Text)
-> (PinpointDestination -> Maybe Text -> PinpointDestination)
-> Lens
PinpointDestination PinpointDestination (Maybe Text) (Maybe Text)
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 Core.FromJSON PinpointDestination where
parseJSON :: Value -> Parser PinpointDestination
parseJSON =
String
-> (Object -> Parser PinpointDestination)
-> Value
-> Parser PinpointDestination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PinpointDestination"
( \Object
x ->
Maybe Text -> PinpointDestination
PinpointDestination'
(Maybe Text -> PinpointDestination)
-> Parser (Maybe Text) -> Parser PinpointDestination
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApplicationArn")
)
instance Prelude.Hashable PinpointDestination
instance Prelude.NFData PinpointDestination
instance Core.ToJSON PinpointDestination where
toJSON :: PinpointDestination -> Value
toJSON PinpointDestination' {Maybe Text
applicationArn :: Maybe Text
$sel:applicationArn:PinpointDestination' :: PinpointDestination -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ApplicationArn" 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
applicationArn
]
)