{-# 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.IoTData.Types.RetainedMessageSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RetainedMessageSummary = RetainedMessageSummary'
{
RetainedMessageSummary -> Maybe Integer
lastModifiedTime :: Prelude.Maybe Prelude.Integer,
RetainedMessageSummary -> Maybe Text
topic :: Prelude.Maybe Prelude.Text,
RetainedMessageSummary -> Maybe Natural
qos :: Prelude.Maybe Prelude.Natural,
RetainedMessageSummary -> Maybe Integer
payloadSize :: Prelude.Maybe Prelude.Integer
}
deriving (RetainedMessageSummary -> RetainedMessageSummary -> Bool
(RetainedMessageSummary -> RetainedMessageSummary -> Bool)
-> (RetainedMessageSummary -> RetainedMessageSummary -> Bool)
-> Eq RetainedMessageSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RetainedMessageSummary -> RetainedMessageSummary -> Bool
$c/= :: RetainedMessageSummary -> RetainedMessageSummary -> Bool
== :: RetainedMessageSummary -> RetainedMessageSummary -> Bool
$c== :: RetainedMessageSummary -> RetainedMessageSummary -> Bool
Prelude.Eq, ReadPrec [RetainedMessageSummary]
ReadPrec RetainedMessageSummary
Int -> ReadS RetainedMessageSummary
ReadS [RetainedMessageSummary]
(Int -> ReadS RetainedMessageSummary)
-> ReadS [RetainedMessageSummary]
-> ReadPrec RetainedMessageSummary
-> ReadPrec [RetainedMessageSummary]
-> Read RetainedMessageSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RetainedMessageSummary]
$creadListPrec :: ReadPrec [RetainedMessageSummary]
readPrec :: ReadPrec RetainedMessageSummary
$creadPrec :: ReadPrec RetainedMessageSummary
readList :: ReadS [RetainedMessageSummary]
$creadList :: ReadS [RetainedMessageSummary]
readsPrec :: Int -> ReadS RetainedMessageSummary
$creadsPrec :: Int -> ReadS RetainedMessageSummary
Prelude.Read, Int -> RetainedMessageSummary -> ShowS
[RetainedMessageSummary] -> ShowS
RetainedMessageSummary -> String
(Int -> RetainedMessageSummary -> ShowS)
-> (RetainedMessageSummary -> String)
-> ([RetainedMessageSummary] -> ShowS)
-> Show RetainedMessageSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RetainedMessageSummary] -> ShowS
$cshowList :: [RetainedMessageSummary] -> ShowS
show :: RetainedMessageSummary -> String
$cshow :: RetainedMessageSummary -> String
showsPrec :: Int -> RetainedMessageSummary -> ShowS
$cshowsPrec :: Int -> RetainedMessageSummary -> ShowS
Prelude.Show, (forall x. RetainedMessageSummary -> Rep RetainedMessageSummary x)
-> (forall x.
Rep RetainedMessageSummary x -> RetainedMessageSummary)
-> Generic RetainedMessageSummary
forall x. Rep RetainedMessageSummary x -> RetainedMessageSummary
forall x. RetainedMessageSummary -> Rep RetainedMessageSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RetainedMessageSummary x -> RetainedMessageSummary
$cfrom :: forall x. RetainedMessageSummary -> Rep RetainedMessageSummary x
Prelude.Generic)
newRetainedMessageSummary ::
RetainedMessageSummary
newRetainedMessageSummary :: RetainedMessageSummary
newRetainedMessageSummary =
RetainedMessageSummary' :: Maybe Integer
-> Maybe Text
-> Maybe Natural
-> Maybe Integer
-> RetainedMessageSummary
RetainedMessageSummary'
{ $sel:lastModifiedTime:RetainedMessageSummary' :: Maybe Integer
lastModifiedTime =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:topic:RetainedMessageSummary' :: Maybe Text
topic = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:qos:RetainedMessageSummary' :: Maybe Natural
qos = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:payloadSize:RetainedMessageSummary' :: Maybe Integer
payloadSize = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
retainedMessageSummary_lastModifiedTime :: Lens.Lens' RetainedMessageSummary (Prelude.Maybe Prelude.Integer)
retainedMessageSummary_lastModifiedTime :: (Maybe Integer -> f (Maybe Integer))
-> RetainedMessageSummary -> f RetainedMessageSummary
retainedMessageSummary_lastModifiedTime = (RetainedMessageSummary -> Maybe Integer)
-> (RetainedMessageSummary
-> Maybe Integer -> RetainedMessageSummary)
-> Lens
RetainedMessageSummary
RetainedMessageSummary
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetainedMessageSummary' {Maybe Integer
lastModifiedTime :: Maybe Integer
$sel:lastModifiedTime:RetainedMessageSummary' :: RetainedMessageSummary -> Maybe Integer
lastModifiedTime} -> Maybe Integer
lastModifiedTime) (\s :: RetainedMessageSummary
s@RetainedMessageSummary' {} Maybe Integer
a -> RetainedMessageSummary
s {$sel:lastModifiedTime:RetainedMessageSummary' :: Maybe Integer
lastModifiedTime = Maybe Integer
a} :: RetainedMessageSummary)
retainedMessageSummary_topic :: Lens.Lens' RetainedMessageSummary (Prelude.Maybe Prelude.Text)
retainedMessageSummary_topic :: (Maybe Text -> f (Maybe Text))
-> RetainedMessageSummary -> f RetainedMessageSummary
retainedMessageSummary_topic = (RetainedMessageSummary -> Maybe Text)
-> (RetainedMessageSummary -> Maybe Text -> RetainedMessageSummary)
-> Lens
RetainedMessageSummary
RetainedMessageSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetainedMessageSummary' {Maybe Text
topic :: Maybe Text
$sel:topic:RetainedMessageSummary' :: RetainedMessageSummary -> Maybe Text
topic} -> Maybe Text
topic) (\s :: RetainedMessageSummary
s@RetainedMessageSummary' {} Maybe Text
a -> RetainedMessageSummary
s {$sel:topic:RetainedMessageSummary' :: Maybe Text
topic = Maybe Text
a} :: RetainedMessageSummary)
retainedMessageSummary_qos :: Lens.Lens' RetainedMessageSummary (Prelude.Maybe Prelude.Natural)
retainedMessageSummary_qos :: (Maybe Natural -> f (Maybe Natural))
-> RetainedMessageSummary -> f RetainedMessageSummary
retainedMessageSummary_qos = (RetainedMessageSummary -> Maybe Natural)
-> (RetainedMessageSummary
-> Maybe Natural -> RetainedMessageSummary)
-> Lens
RetainedMessageSummary
RetainedMessageSummary
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetainedMessageSummary' {Maybe Natural
qos :: Maybe Natural
$sel:qos:RetainedMessageSummary' :: RetainedMessageSummary -> Maybe Natural
qos} -> Maybe Natural
qos) (\s :: RetainedMessageSummary
s@RetainedMessageSummary' {} Maybe Natural
a -> RetainedMessageSummary
s {$sel:qos:RetainedMessageSummary' :: Maybe Natural
qos = Maybe Natural
a} :: RetainedMessageSummary)
retainedMessageSummary_payloadSize :: Lens.Lens' RetainedMessageSummary (Prelude.Maybe Prelude.Integer)
retainedMessageSummary_payloadSize :: (Maybe Integer -> f (Maybe Integer))
-> RetainedMessageSummary -> f RetainedMessageSummary
retainedMessageSummary_payloadSize = (RetainedMessageSummary -> Maybe Integer)
-> (RetainedMessageSummary
-> Maybe Integer -> RetainedMessageSummary)
-> Lens
RetainedMessageSummary
RetainedMessageSummary
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetainedMessageSummary' {Maybe Integer
payloadSize :: Maybe Integer
$sel:payloadSize:RetainedMessageSummary' :: RetainedMessageSummary -> Maybe Integer
payloadSize} -> Maybe Integer
payloadSize) (\s :: RetainedMessageSummary
s@RetainedMessageSummary' {} Maybe Integer
a -> RetainedMessageSummary
s {$sel:payloadSize:RetainedMessageSummary' :: Maybe Integer
payloadSize = Maybe Integer
a} :: RetainedMessageSummary)
instance Core.FromJSON RetainedMessageSummary where
parseJSON :: Value -> Parser RetainedMessageSummary
parseJSON =
String
-> (Object -> Parser RetainedMessageSummary)
-> Value
-> Parser RetainedMessageSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RetainedMessageSummary"
( \Object
x ->
Maybe Integer
-> Maybe Text
-> Maybe Natural
-> Maybe Integer
-> RetainedMessageSummary
RetainedMessageSummary'
(Maybe Integer
-> Maybe Text
-> Maybe Natural
-> Maybe Integer
-> RetainedMessageSummary)
-> Parser (Maybe Integer)
-> Parser
(Maybe Text
-> Maybe Natural -> Maybe Integer -> RetainedMessageSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastModifiedTime")
Parser
(Maybe Text
-> Maybe Natural -> Maybe Integer -> RetainedMessageSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural -> Maybe Integer -> RetainedMessageSummary)
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
"topic")
Parser (Maybe Natural -> Maybe Integer -> RetainedMessageSummary)
-> Parser (Maybe Natural)
-> Parser (Maybe Integer -> RetainedMessageSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"qos")
Parser (Maybe Integer -> RetainedMessageSummary)
-> Parser (Maybe Integer) -> Parser RetainedMessageSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"payloadSize")
)
instance Prelude.Hashable RetainedMessageSummary
instance Prelude.NFData RetainedMessageSummary