{-# 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.Lens as Lens
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
statusMessage :: Prelude.Maybe Prelude.Text,
EndpointMessageResult -> Maybe Text
updatedToken :: Prelude.Maybe Prelude.Text,
EndpointMessageResult -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
EndpointMessageResult -> DeliveryStatus
deliveryStatus :: DeliveryStatus,
EndpointMessageResult -> Int
statusCode :: Prelude.Int
}
deriving (EndpointMessageResult -> EndpointMessageResult -> Bool
(EndpointMessageResult -> EndpointMessageResult -> Bool)
-> (EndpointMessageResult -> EndpointMessageResult -> Bool)
-> Eq EndpointMessageResult
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]
(Int -> ReadS EndpointMessageResult)
-> ReadS [EndpointMessageResult]
-> ReadPrec EndpointMessageResult
-> ReadPrec [EndpointMessageResult]
-> Read 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
(Int -> EndpointMessageResult -> ShowS)
-> (EndpointMessageResult -> String)
-> ([EndpointMessageResult] -> ShowS)
-> Show EndpointMessageResult
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. EndpointMessageResult -> Rep EndpointMessageResult x)
-> (forall x. Rep EndpointMessageResult x -> EndpointMessageResult)
-> Generic EndpointMessageResult
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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DeliveryStatus
-> Int
-> EndpointMessageResult
EndpointMessageResult'
{ $sel:address:EndpointMessageResult' :: Maybe Text
address = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:EndpointMessageResult' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:updatedToken:EndpointMessageResult' :: Maybe Text
updatedToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageId:EndpointMessageResult' :: Maybe Text
messageId = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> EndpointMessageResult -> f EndpointMessageResult
endpointMessageResult_address = (EndpointMessageResult -> Maybe Text)
-> (EndpointMessageResult -> Maybe Text -> EndpointMessageResult)
-> Lens
EndpointMessageResult
EndpointMessageResult
(Maybe Text)
(Maybe Text)
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_statusMessage :: Lens.Lens' EndpointMessageResult (Prelude.Maybe Prelude.Text)
endpointMessageResult_statusMessage :: (Maybe Text -> f (Maybe Text))
-> EndpointMessageResult -> f EndpointMessageResult
endpointMessageResult_statusMessage = (EndpointMessageResult -> Maybe Text)
-> (EndpointMessageResult -> Maybe Text -> EndpointMessageResult)
-> Lens
EndpointMessageResult
EndpointMessageResult
(Maybe Text)
(Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> EndpointMessageResult -> f EndpointMessageResult
endpointMessageResult_updatedToken = (EndpointMessageResult -> Maybe Text)
-> (EndpointMessageResult -> Maybe Text -> EndpointMessageResult)
-> Lens
EndpointMessageResult
EndpointMessageResult
(Maybe Text)
(Maybe Text)
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_messageId :: Lens.Lens' EndpointMessageResult (Prelude.Maybe Prelude.Text)
endpointMessageResult_messageId :: (Maybe Text -> f (Maybe Text))
-> EndpointMessageResult -> f EndpointMessageResult
endpointMessageResult_messageId = (EndpointMessageResult -> Maybe Text)
-> (EndpointMessageResult -> Maybe Text -> EndpointMessageResult)
-> Lens
EndpointMessageResult
EndpointMessageResult
(Maybe Text)
(Maybe Text)
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_deliveryStatus :: Lens.Lens' EndpointMessageResult DeliveryStatus
endpointMessageResult_deliveryStatus :: (DeliveryStatus -> f DeliveryStatus)
-> EndpointMessageResult -> f EndpointMessageResult
endpointMessageResult_deliveryStatus = (EndpointMessageResult -> DeliveryStatus)
-> (EndpointMessageResult
-> DeliveryStatus -> EndpointMessageResult)
-> Lens
EndpointMessageResult
EndpointMessageResult
DeliveryStatus
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 :: (Int -> f Int) -> EndpointMessageResult -> f EndpointMessageResult
endpointMessageResult_statusCode = (EndpointMessageResult -> Int)
-> (EndpointMessageResult -> Int -> EndpointMessageResult)
-> Lens EndpointMessageResult EndpointMessageResult Int Int
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 Core.FromJSON EndpointMessageResult where
parseJSON :: Value -> Parser EndpointMessageResult
parseJSON =
String
-> (Object -> Parser EndpointMessageResult)
-> Value
-> Parser EndpointMessageResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EndpointMessageResult"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DeliveryStatus
-> Int
-> EndpointMessageResult
EndpointMessageResult'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DeliveryStatus
-> Int
-> EndpointMessageResult)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> DeliveryStatus
-> Int
-> EndpointMessageResult)
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
"Address")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> DeliveryStatus
-> Int
-> EndpointMessageResult)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> DeliveryStatus -> Int -> EndpointMessageResult)
forall (f :: * -> *) a b. Applicative f => 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
"StatusMessage")
Parser
(Maybe Text
-> Maybe Text -> DeliveryStatus -> Int -> EndpointMessageResult)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> DeliveryStatus -> Int -> EndpointMessageResult)
forall (f :: * -> *) a b. Applicative f => 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
"UpdatedToken")
Parser
(Maybe Text -> DeliveryStatus -> Int -> EndpointMessageResult)
-> Parser (Maybe Text)
-> Parser (DeliveryStatus -> Int -> EndpointMessageResult)
forall (f :: * -> *) a b. Applicative f => 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
"MessageId")
Parser (DeliveryStatus -> Int -> EndpointMessageResult)
-> Parser DeliveryStatus -> Parser (Int -> EndpointMessageResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeliveryStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DeliveryStatus")
Parser (Int -> EndpointMessageResult)
-> Parser Int -> Parser EndpointMessageResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StatusCode")
)
instance Prelude.Hashable EndpointMessageResult
instance Prelude.NFData EndpointMessageResult