{-# 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.Insight where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsSecurityFindingFilters
data Insight = Insight'
{
Insight -> Text
insightArn :: Prelude.Text,
Insight -> Text
name :: Prelude.Text,
Insight -> AwsSecurityFindingFilters
filters :: AwsSecurityFindingFilters,
Insight -> Text
groupByAttribute :: Prelude.Text
}
deriving (Insight -> Insight -> Bool
(Insight -> Insight -> Bool)
-> (Insight -> Insight -> Bool) -> Eq Insight
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Insight -> Insight -> Bool
$c/= :: Insight -> Insight -> Bool
== :: Insight -> Insight -> Bool
$c== :: Insight -> Insight -> Bool
Prelude.Eq, ReadPrec [Insight]
ReadPrec Insight
Int -> ReadS Insight
ReadS [Insight]
(Int -> ReadS Insight)
-> ReadS [Insight]
-> ReadPrec Insight
-> ReadPrec [Insight]
-> Read Insight
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Insight]
$creadListPrec :: ReadPrec [Insight]
readPrec :: ReadPrec Insight
$creadPrec :: ReadPrec Insight
readList :: ReadS [Insight]
$creadList :: ReadS [Insight]
readsPrec :: Int -> ReadS Insight
$creadsPrec :: Int -> ReadS Insight
Prelude.Read, Int -> Insight -> ShowS
[Insight] -> ShowS
Insight -> String
(Int -> Insight -> ShowS)
-> (Insight -> String) -> ([Insight] -> ShowS) -> Show Insight
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Insight] -> ShowS
$cshowList :: [Insight] -> ShowS
show :: Insight -> String
$cshow :: Insight -> String
showsPrec :: Int -> Insight -> ShowS
$cshowsPrec :: Int -> Insight -> ShowS
Prelude.Show, (forall x. Insight -> Rep Insight x)
-> (forall x. Rep Insight x -> Insight) -> Generic Insight
forall x. Rep Insight x -> Insight
forall x. Insight -> Rep Insight x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Insight x -> Insight
$cfrom :: forall x. Insight -> Rep Insight x
Prelude.Generic)
newInsight ::
Prelude.Text ->
Prelude.Text ->
AwsSecurityFindingFilters ->
Prelude.Text ->
Insight
newInsight :: Text -> Text -> AwsSecurityFindingFilters -> Text -> Insight
newInsight
Text
pInsightArn_
Text
pName_
AwsSecurityFindingFilters
pFilters_
Text
pGroupByAttribute_ =
Insight' :: Text -> Text -> AwsSecurityFindingFilters -> Text -> Insight
Insight'
{ $sel:insightArn:Insight' :: Text
insightArn = Text
pInsightArn_,
$sel:name:Insight' :: Text
name = Text
pName_,
$sel:filters:Insight' :: AwsSecurityFindingFilters
filters = AwsSecurityFindingFilters
pFilters_,
$sel:groupByAttribute:Insight' :: Text
groupByAttribute = Text
pGroupByAttribute_
}
insight_insightArn :: Lens.Lens' Insight Prelude.Text
insight_insightArn :: (Text -> f Text) -> Insight -> f Insight
insight_insightArn = (Insight -> Text)
-> (Insight -> Text -> Insight) -> Lens Insight Insight Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Insight' {Text
insightArn :: Text
$sel:insightArn:Insight' :: Insight -> Text
insightArn} -> Text
insightArn) (\s :: Insight
s@Insight' {} Text
a -> Insight
s {$sel:insightArn:Insight' :: Text
insightArn = Text
a} :: Insight)
insight_name :: Lens.Lens' Insight Prelude.Text
insight_name :: (Text -> f Text) -> Insight -> f Insight
insight_name = (Insight -> Text)
-> (Insight -> Text -> Insight) -> Lens Insight Insight Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Insight' {Text
name :: Text
$sel:name:Insight' :: Insight -> Text
name} -> Text
name) (\s :: Insight
s@Insight' {} Text
a -> Insight
s {$sel:name:Insight' :: Text
name = Text
a} :: Insight)
insight_filters :: Lens.Lens' Insight AwsSecurityFindingFilters
insight_filters :: (AwsSecurityFindingFilters -> f AwsSecurityFindingFilters)
-> Insight -> f Insight
insight_filters = (Insight -> AwsSecurityFindingFilters)
-> (Insight -> AwsSecurityFindingFilters -> Insight)
-> Lens
Insight Insight AwsSecurityFindingFilters AwsSecurityFindingFilters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Insight' {AwsSecurityFindingFilters
filters :: AwsSecurityFindingFilters
$sel:filters:Insight' :: Insight -> AwsSecurityFindingFilters
filters} -> AwsSecurityFindingFilters
filters) (\s :: Insight
s@Insight' {} AwsSecurityFindingFilters
a -> Insight
s {$sel:filters:Insight' :: AwsSecurityFindingFilters
filters = AwsSecurityFindingFilters
a} :: Insight)
insight_groupByAttribute :: Lens.Lens' Insight Prelude.Text
insight_groupByAttribute :: (Text -> f Text) -> Insight -> f Insight
insight_groupByAttribute = (Insight -> Text)
-> (Insight -> Text -> Insight) -> Lens Insight Insight Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Insight' {Text
groupByAttribute :: Text
$sel:groupByAttribute:Insight' :: Insight -> Text
groupByAttribute} -> Text
groupByAttribute) (\s :: Insight
s@Insight' {} Text
a -> Insight
s {$sel:groupByAttribute:Insight' :: Text
groupByAttribute = Text
a} :: Insight)
instance Core.FromJSON Insight where
parseJSON :: Value -> Parser Insight
parseJSON =
String -> (Object -> Parser Insight) -> Value -> Parser Insight
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Insight"
( \Object
x ->
Text -> Text -> AwsSecurityFindingFilters -> Text -> Insight
Insight'
(Text -> Text -> AwsSecurityFindingFilters -> Text -> Insight)
-> Parser Text
-> Parser (Text -> AwsSecurityFindingFilters -> Text -> Insight)
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
"InsightArn")
Parser (Text -> AwsSecurityFindingFilters -> Text -> Insight)
-> Parser Text
-> Parser (AwsSecurityFindingFilters -> Text -> Insight)
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
"Name")
Parser (AwsSecurityFindingFilters -> Text -> Insight)
-> Parser AwsSecurityFindingFilters -> Parser (Text -> Insight)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AwsSecurityFindingFilters
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Filters")
Parser (Text -> Insight) -> Parser Text -> Parser Insight
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
"GroupByAttribute")
)
instance Prelude.Hashable Insight
instance Prelude.NFData Insight