{-# 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.Pinpoint.Types.EndpointMessageResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types.DeliveryStatus
import qualified Amazonka.Prelude as Prelude
data EndpointMessageResult = EndpointMessageResult'
{
EndpointMessageResult -> Maybe Text
address :: Prelude.Maybe Prelude.Text,
EndpointMessageResult -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
EndpointMessageResult -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
EndpointMessageResult -> Maybe Text
updatedToken :: Prelude.Maybe Prelude.Text,
EndpointMessageResult -> DeliveryStatus
deliveryStatus :: DeliveryStatus,
EndpointMessageResult -> Int
statusCode :: Prelude.Int
}
deriving (EndpointMessageResult -> EndpointMessageResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointMessageResult -> EndpointMessageResult -> Bool
$c/= :: EndpointMessageResult -> EndpointMessageResult -> Bool
== :: EndpointMessageResult -> EndpointMessageResult -> Bool
$c== :: EndpointMessageResult -> EndpointMessageResult -> Bool
Prelude.Eq, ReadPrec [EndpointMessageResult]
ReadPrec EndpointMessageResult
Int -> ReadS EndpointMessageResult
ReadS [EndpointMessageResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointMessageResult]
$creadListPrec :: ReadPrec [EndpointMessageResult]
readPrec :: ReadPrec EndpointMessageResult
$creadPrec :: ReadPrec EndpointMessageResult
readList :: ReadS [EndpointMessageResult]
$creadList :: ReadS [EndpointMessageResult]
readsPrec :: Int -> ReadS EndpointMessageResult
$creadsPrec :: Int -> ReadS EndpointMessageResult
Prelude.Read, Int -> EndpointMessageResult -> ShowS
[EndpointMessageResult] -> ShowS
EndpointMessageResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointMessageResult] -> ShowS
$cshowList :: [EndpointMessageResult] -> ShowS
show :: EndpointMessageResult -> String
$cshow :: EndpointMessageResult -> String
showsPrec :: Int -> EndpointMessageResult -> ShowS
$cshowsPrec :: Int -> EndpointMessageResult -> ShowS
Prelude.Show, forall x. Rep EndpointMessageResult x -> EndpointMessageResult
forall x. EndpointMessageResult -> Rep EndpointMessageResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointMessageResult x -> EndpointMessageResult
$cfrom :: forall x. EndpointMessageResult -> Rep EndpointMessageResult x
Prelude.Generic)
newEndpointMessageResult ::
DeliveryStatus ->
Prelude.Int ->
EndpointMessageResult
newEndpointMessageResult :: DeliveryStatus -> Int -> EndpointMessageResult
newEndpointMessageResult
DeliveryStatus
pDeliveryStatus_
Int
pStatusCode_ =
EndpointMessageResult'
{ $sel:address:EndpointMessageResult' :: Maybe Text
address = forall a. Maybe a
Prelude.Nothing,
$sel:messageId:EndpointMessageResult' :: Maybe Text
messageId = forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:EndpointMessageResult' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
$sel:updatedToken:EndpointMessageResult' :: Maybe Text
updatedToken = forall a. Maybe a
Prelude.Nothing,
$sel:deliveryStatus:EndpointMessageResult' :: DeliveryStatus
deliveryStatus = DeliveryStatus
pDeliveryStatus_,
$sel:statusCode:EndpointMessageResult' :: Int
statusCode = Int
pStatusCode_
}
endpointMessageResult_address :: Lens.Lens' EndpointMessageResult (Prelude.Maybe Prelude.Text)
endpointMessageResult_address :: Lens' EndpointMessageResult (Maybe Text)
endpointMessageResult_address = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointMessageResult' {Maybe Text
address :: Maybe Text
$sel:address:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
address} -> Maybe Text
address) (\s :: EndpointMessageResult
s@EndpointMessageResult' {} Maybe Text
a -> EndpointMessageResult
s {$sel:address:EndpointMessageResult' :: Maybe Text
address = Maybe Text
a} :: EndpointMessageResult)
endpointMessageResult_messageId :: Lens.Lens' EndpointMessageResult (Prelude.Maybe Prelude.Text)
endpointMessageResult_messageId :: Lens' EndpointMessageResult (Maybe Text)
endpointMessageResult_messageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointMessageResult' {Maybe Text
messageId :: Maybe Text
$sel:messageId:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: EndpointMessageResult
s@EndpointMessageResult' {} Maybe Text
a -> EndpointMessageResult
s {$sel:messageId:EndpointMessageResult' :: Maybe Text
messageId = Maybe Text
a} :: EndpointMessageResult)
endpointMessageResult_statusMessage :: Lens.Lens' EndpointMessageResult (Prelude.Maybe Prelude.Text)
endpointMessageResult_statusMessage :: Lens' EndpointMessageResult (Maybe Text)
endpointMessageResult_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointMessageResult' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: EndpointMessageResult
s@EndpointMessageResult' {} Maybe Text
a -> EndpointMessageResult
s {$sel:statusMessage:EndpointMessageResult' :: Maybe Text
statusMessage = Maybe Text
a} :: EndpointMessageResult)
endpointMessageResult_updatedToken :: Lens.Lens' EndpointMessageResult (Prelude.Maybe Prelude.Text)
endpointMessageResult_updatedToken :: Lens' EndpointMessageResult (Maybe Text)
endpointMessageResult_updatedToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointMessageResult' {Maybe Text
updatedToken :: Maybe Text
$sel:updatedToken:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
updatedToken} -> Maybe Text
updatedToken) (\s :: EndpointMessageResult
s@EndpointMessageResult' {} Maybe Text
a -> EndpointMessageResult
s {$sel:updatedToken:EndpointMessageResult' :: Maybe Text
updatedToken = Maybe Text
a} :: EndpointMessageResult)
endpointMessageResult_deliveryStatus :: Lens.Lens' EndpointMessageResult DeliveryStatus
endpointMessageResult_deliveryStatus :: Lens' EndpointMessageResult DeliveryStatus
endpointMessageResult_deliveryStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointMessageResult' {DeliveryStatus
deliveryStatus :: DeliveryStatus
$sel:deliveryStatus:EndpointMessageResult' :: EndpointMessageResult -> DeliveryStatus
deliveryStatus} -> DeliveryStatus
deliveryStatus) (\s :: EndpointMessageResult
s@EndpointMessageResult' {} DeliveryStatus
a -> EndpointMessageResult
s {$sel:deliveryStatus:EndpointMessageResult' :: DeliveryStatus
deliveryStatus = DeliveryStatus
a} :: EndpointMessageResult)
endpointMessageResult_statusCode :: Lens.Lens' EndpointMessageResult Prelude.Int
endpointMessageResult_statusCode :: Lens' EndpointMessageResult Int
endpointMessageResult_statusCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointMessageResult' {Int
statusCode :: Int
$sel:statusCode:EndpointMessageResult' :: EndpointMessageResult -> Int
statusCode} -> Int
statusCode) (\s :: EndpointMessageResult
s@EndpointMessageResult' {} Int
a -> EndpointMessageResult
s {$sel:statusCode:EndpointMessageResult' :: Int
statusCode = Int
a} :: EndpointMessageResult)
instance Data.FromJSON EndpointMessageResult where
parseJSON :: Value -> Parser EndpointMessageResult
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EndpointMessageResult"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DeliveryStatus
-> Int
-> EndpointMessageResult
EndpointMessageResult'
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
"Address")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MessageId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UpdatedToken")
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
"DeliveryStatus")
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
"StatusCode")
)
instance Prelude.Hashable EndpointMessageResult where
hashWithSalt :: Int -> EndpointMessageResult -> Int
hashWithSalt Int
_salt EndpointMessageResult' {Int
Maybe Text
DeliveryStatus
statusCode :: Int
deliveryStatus :: DeliveryStatus
updatedToken :: Maybe Text
statusMessage :: Maybe Text
messageId :: Maybe Text
address :: Maybe Text
$sel:statusCode:EndpointMessageResult' :: EndpointMessageResult -> Int
$sel:deliveryStatus:EndpointMessageResult' :: EndpointMessageResult -> DeliveryStatus
$sel:updatedToken:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
$sel:statusMessage:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
$sel:messageId:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
$sel:address:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
address
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
messageId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
updatedToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DeliveryStatus
deliveryStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
statusCode
instance Prelude.NFData EndpointMessageResult where
rnf :: EndpointMessageResult -> ()
rnf EndpointMessageResult' {Int
Maybe Text
DeliveryStatus
statusCode :: Int
deliveryStatus :: DeliveryStatus
updatedToken :: Maybe Text
statusMessage :: Maybe Text
messageId :: Maybe Text
address :: Maybe Text
$sel:statusCode:EndpointMessageResult' :: EndpointMessageResult -> Int
$sel:deliveryStatus:EndpointMessageResult' :: EndpointMessageResult -> DeliveryStatus
$sel:updatedToken:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
$sel:statusMessage:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
$sel:messageId:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
$sel:address:EndpointMessageResult' :: EndpointMessageResult -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
address
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
messageId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
updatedToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DeliveryStatus
deliveryStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
statusCode