{-# 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.Inspector.Types.TelemetryMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TelemetryMetadata = TelemetryMetadata'
{
TelemetryMetadata -> Maybe Integer
dataSize :: Prelude.Maybe Prelude.Integer,
TelemetryMetadata -> Text
messageType :: Prelude.Text,
TelemetryMetadata -> Integer
count :: Prelude.Integer
}
deriving (TelemetryMetadata -> TelemetryMetadata -> Bool
(TelemetryMetadata -> TelemetryMetadata -> Bool)
-> (TelemetryMetadata -> TelemetryMetadata -> Bool)
-> Eq TelemetryMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TelemetryMetadata -> TelemetryMetadata -> Bool
$c/= :: TelemetryMetadata -> TelemetryMetadata -> Bool
== :: TelemetryMetadata -> TelemetryMetadata -> Bool
$c== :: TelemetryMetadata -> TelemetryMetadata -> Bool
Prelude.Eq, ReadPrec [TelemetryMetadata]
ReadPrec TelemetryMetadata
Int -> ReadS TelemetryMetadata
ReadS [TelemetryMetadata]
(Int -> ReadS TelemetryMetadata)
-> ReadS [TelemetryMetadata]
-> ReadPrec TelemetryMetadata
-> ReadPrec [TelemetryMetadata]
-> Read TelemetryMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TelemetryMetadata]
$creadListPrec :: ReadPrec [TelemetryMetadata]
readPrec :: ReadPrec TelemetryMetadata
$creadPrec :: ReadPrec TelemetryMetadata
readList :: ReadS [TelemetryMetadata]
$creadList :: ReadS [TelemetryMetadata]
readsPrec :: Int -> ReadS TelemetryMetadata
$creadsPrec :: Int -> ReadS TelemetryMetadata
Prelude.Read, Int -> TelemetryMetadata -> ShowS
[TelemetryMetadata] -> ShowS
TelemetryMetadata -> String
(Int -> TelemetryMetadata -> ShowS)
-> (TelemetryMetadata -> String)
-> ([TelemetryMetadata] -> ShowS)
-> Show TelemetryMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TelemetryMetadata] -> ShowS
$cshowList :: [TelemetryMetadata] -> ShowS
show :: TelemetryMetadata -> String
$cshow :: TelemetryMetadata -> String
showsPrec :: Int -> TelemetryMetadata -> ShowS
$cshowsPrec :: Int -> TelemetryMetadata -> ShowS
Prelude.Show, (forall x. TelemetryMetadata -> Rep TelemetryMetadata x)
-> (forall x. Rep TelemetryMetadata x -> TelemetryMetadata)
-> Generic TelemetryMetadata
forall x. Rep TelemetryMetadata x -> TelemetryMetadata
forall x. TelemetryMetadata -> Rep TelemetryMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TelemetryMetadata x -> TelemetryMetadata
$cfrom :: forall x. TelemetryMetadata -> Rep TelemetryMetadata x
Prelude.Generic)
newTelemetryMetadata ::
Prelude.Text ->
Prelude.Integer ->
TelemetryMetadata
newTelemetryMetadata :: Text -> Integer -> TelemetryMetadata
newTelemetryMetadata Text
pMessageType_ Integer
pCount_ =
TelemetryMetadata' :: Maybe Integer -> Text -> Integer -> TelemetryMetadata
TelemetryMetadata'
{ $sel:dataSize:TelemetryMetadata' :: Maybe Integer
dataSize = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:messageType:TelemetryMetadata' :: Text
messageType = Text
pMessageType_,
$sel:count:TelemetryMetadata' :: Integer
count = Integer
pCount_
}
telemetryMetadata_dataSize :: Lens.Lens' TelemetryMetadata (Prelude.Maybe Prelude.Integer)
telemetryMetadata_dataSize :: (Maybe Integer -> f (Maybe Integer))
-> TelemetryMetadata -> f TelemetryMetadata
telemetryMetadata_dataSize = (TelemetryMetadata -> Maybe Integer)
-> (TelemetryMetadata -> Maybe Integer -> TelemetryMetadata)
-> Lens
TelemetryMetadata TelemetryMetadata (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TelemetryMetadata' {Maybe Integer
dataSize :: Maybe Integer
$sel:dataSize:TelemetryMetadata' :: TelemetryMetadata -> Maybe Integer
dataSize} -> Maybe Integer
dataSize) (\s :: TelemetryMetadata
s@TelemetryMetadata' {} Maybe Integer
a -> TelemetryMetadata
s {$sel:dataSize:TelemetryMetadata' :: Maybe Integer
dataSize = Maybe Integer
a} :: TelemetryMetadata)
telemetryMetadata_messageType :: Lens.Lens' TelemetryMetadata Prelude.Text
telemetryMetadata_messageType :: (Text -> f Text) -> TelemetryMetadata -> f TelemetryMetadata
telemetryMetadata_messageType = (TelemetryMetadata -> Text)
-> (TelemetryMetadata -> Text -> TelemetryMetadata)
-> Lens TelemetryMetadata TelemetryMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TelemetryMetadata' {Text
messageType :: Text
$sel:messageType:TelemetryMetadata' :: TelemetryMetadata -> Text
messageType} -> Text
messageType) (\s :: TelemetryMetadata
s@TelemetryMetadata' {} Text
a -> TelemetryMetadata
s {$sel:messageType:TelemetryMetadata' :: Text
messageType = Text
a} :: TelemetryMetadata)
telemetryMetadata_count :: Lens.Lens' TelemetryMetadata Prelude.Integer
telemetryMetadata_count :: (Integer -> f Integer) -> TelemetryMetadata -> f TelemetryMetadata
telemetryMetadata_count = (TelemetryMetadata -> Integer)
-> (TelemetryMetadata -> Integer -> TelemetryMetadata)
-> Lens TelemetryMetadata TelemetryMetadata Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TelemetryMetadata' {Integer
count :: Integer
$sel:count:TelemetryMetadata' :: TelemetryMetadata -> Integer
count} -> Integer
count) (\s :: TelemetryMetadata
s@TelemetryMetadata' {} Integer
a -> TelemetryMetadata
s {$sel:count:TelemetryMetadata' :: Integer
count = Integer
a} :: TelemetryMetadata)
instance Core.FromJSON TelemetryMetadata where
parseJSON :: Value -> Parser TelemetryMetadata
parseJSON =
String
-> (Object -> Parser TelemetryMetadata)
-> Value
-> Parser TelemetryMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TelemetryMetadata"
( \Object
x ->
Maybe Integer -> Text -> Integer -> TelemetryMetadata
TelemetryMetadata'
(Maybe Integer -> Text -> Integer -> TelemetryMetadata)
-> Parser (Maybe Integer)
-> Parser (Text -> Integer -> TelemetryMetadata)
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
"dataSize")
Parser (Text -> Integer -> TelemetryMetadata)
-> Parser Text -> Parser (Integer -> TelemetryMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"messageType")
Parser (Integer -> TelemetryMetadata)
-> Parser Integer -> Parser TelemetryMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"count")
)
instance Prelude.Hashable TelemetryMetadata
instance Prelude.NFData TelemetryMetadata