{-# 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.SecurityHub.Types.InsightResultValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InsightResultValue = InsightResultValue'
{
InsightResultValue -> Text
groupByAttributeValue :: Prelude.Text,
InsightResultValue -> Int
count :: Prelude.Int
}
deriving (InsightResultValue -> InsightResultValue -> Bool
(InsightResultValue -> InsightResultValue -> Bool)
-> (InsightResultValue -> InsightResultValue -> Bool)
-> Eq InsightResultValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightResultValue -> InsightResultValue -> Bool
$c/= :: InsightResultValue -> InsightResultValue -> Bool
== :: InsightResultValue -> InsightResultValue -> Bool
$c== :: InsightResultValue -> InsightResultValue -> Bool
Prelude.Eq, ReadPrec [InsightResultValue]
ReadPrec InsightResultValue
Int -> ReadS InsightResultValue
ReadS [InsightResultValue]
(Int -> ReadS InsightResultValue)
-> ReadS [InsightResultValue]
-> ReadPrec InsightResultValue
-> ReadPrec [InsightResultValue]
-> Read InsightResultValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightResultValue]
$creadListPrec :: ReadPrec [InsightResultValue]
readPrec :: ReadPrec InsightResultValue
$creadPrec :: ReadPrec InsightResultValue
readList :: ReadS [InsightResultValue]
$creadList :: ReadS [InsightResultValue]
readsPrec :: Int -> ReadS InsightResultValue
$creadsPrec :: Int -> ReadS InsightResultValue
Prelude.Read, Int -> InsightResultValue -> ShowS
[InsightResultValue] -> ShowS
InsightResultValue -> String
(Int -> InsightResultValue -> ShowS)
-> (InsightResultValue -> String)
-> ([InsightResultValue] -> ShowS)
-> Show InsightResultValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightResultValue] -> ShowS
$cshowList :: [InsightResultValue] -> ShowS
show :: InsightResultValue -> String
$cshow :: InsightResultValue -> String
showsPrec :: Int -> InsightResultValue -> ShowS
$cshowsPrec :: Int -> InsightResultValue -> ShowS
Prelude.Show, (forall x. InsightResultValue -> Rep InsightResultValue x)
-> (forall x. Rep InsightResultValue x -> InsightResultValue)
-> Generic InsightResultValue
forall x. Rep InsightResultValue x -> InsightResultValue
forall x. InsightResultValue -> Rep InsightResultValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InsightResultValue x -> InsightResultValue
$cfrom :: forall x. InsightResultValue -> Rep InsightResultValue x
Prelude.Generic)
newInsightResultValue ::
Prelude.Text ->
Prelude.Int ->
InsightResultValue
newInsightResultValue :: Text -> Int -> InsightResultValue
newInsightResultValue Text
pGroupByAttributeValue_ Int
pCount_ =
InsightResultValue' :: Text -> Int -> InsightResultValue
InsightResultValue'
{ $sel:groupByAttributeValue:InsightResultValue' :: Text
groupByAttributeValue =
Text
pGroupByAttributeValue_,
$sel:count:InsightResultValue' :: Int
count = Int
pCount_
}
insightResultValue_groupByAttributeValue :: Lens.Lens' InsightResultValue Prelude.Text
insightResultValue_groupByAttributeValue :: (Text -> f Text) -> InsightResultValue -> f InsightResultValue
insightResultValue_groupByAttributeValue = (InsightResultValue -> Text)
-> (InsightResultValue -> Text -> InsightResultValue)
-> Lens InsightResultValue InsightResultValue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightResultValue' {Text
groupByAttributeValue :: Text
$sel:groupByAttributeValue:InsightResultValue' :: InsightResultValue -> Text
groupByAttributeValue} -> Text
groupByAttributeValue) (\s :: InsightResultValue
s@InsightResultValue' {} Text
a -> InsightResultValue
s {$sel:groupByAttributeValue:InsightResultValue' :: Text
groupByAttributeValue = Text
a} :: InsightResultValue)
insightResultValue_count :: Lens.Lens' InsightResultValue Prelude.Int
insightResultValue_count :: (Int -> f Int) -> InsightResultValue -> f InsightResultValue
insightResultValue_count = (InsightResultValue -> Int)
-> (InsightResultValue -> Int -> InsightResultValue)
-> Lens InsightResultValue InsightResultValue Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightResultValue' {Int
count :: Int
$sel:count:InsightResultValue' :: InsightResultValue -> Int
count} -> Int
count) (\s :: InsightResultValue
s@InsightResultValue' {} Int
a -> InsightResultValue
s {$sel:count:InsightResultValue' :: Int
count = Int
a} :: InsightResultValue)
instance Core.FromJSON InsightResultValue where
parseJSON :: Value -> Parser InsightResultValue
parseJSON =
String
-> (Object -> Parser InsightResultValue)
-> Value
-> Parser InsightResultValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InsightResultValue"
( \Object
x ->
Text -> Int -> InsightResultValue
InsightResultValue'
(Text -> Int -> InsightResultValue)
-> Parser Text -> Parser (Int -> InsightResultValue)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"GroupByAttributeValue")
Parser (Int -> InsightResultValue)
-> Parser Int -> Parser InsightResultValue
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
"Count")
)
instance Prelude.Hashable InsightResultValue
instance Prelude.NFData InsightResultValue