{-# 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.AwsSecurityFindingIdentifier where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsSecurityFindingIdentifier = AwsSecurityFindingIdentifier'
{
AwsSecurityFindingIdentifier -> Text
id :: Prelude.Text,
AwsSecurityFindingIdentifier -> Text
productArn :: Prelude.Text
}
deriving (AwsSecurityFindingIdentifier
-> AwsSecurityFindingIdentifier -> Bool
(AwsSecurityFindingIdentifier
-> AwsSecurityFindingIdentifier -> Bool)
-> (AwsSecurityFindingIdentifier
-> AwsSecurityFindingIdentifier -> Bool)
-> Eq AwsSecurityFindingIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsSecurityFindingIdentifier
-> AwsSecurityFindingIdentifier -> Bool
$c/= :: AwsSecurityFindingIdentifier
-> AwsSecurityFindingIdentifier -> Bool
== :: AwsSecurityFindingIdentifier
-> AwsSecurityFindingIdentifier -> Bool
$c== :: AwsSecurityFindingIdentifier
-> AwsSecurityFindingIdentifier -> Bool
Prelude.Eq, ReadPrec [AwsSecurityFindingIdentifier]
ReadPrec AwsSecurityFindingIdentifier
Int -> ReadS AwsSecurityFindingIdentifier
ReadS [AwsSecurityFindingIdentifier]
(Int -> ReadS AwsSecurityFindingIdentifier)
-> ReadS [AwsSecurityFindingIdentifier]
-> ReadPrec AwsSecurityFindingIdentifier
-> ReadPrec [AwsSecurityFindingIdentifier]
-> Read AwsSecurityFindingIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsSecurityFindingIdentifier]
$creadListPrec :: ReadPrec [AwsSecurityFindingIdentifier]
readPrec :: ReadPrec AwsSecurityFindingIdentifier
$creadPrec :: ReadPrec AwsSecurityFindingIdentifier
readList :: ReadS [AwsSecurityFindingIdentifier]
$creadList :: ReadS [AwsSecurityFindingIdentifier]
readsPrec :: Int -> ReadS AwsSecurityFindingIdentifier
$creadsPrec :: Int -> ReadS AwsSecurityFindingIdentifier
Prelude.Read, Int -> AwsSecurityFindingIdentifier -> ShowS
[AwsSecurityFindingIdentifier] -> ShowS
AwsSecurityFindingIdentifier -> String
(Int -> AwsSecurityFindingIdentifier -> ShowS)
-> (AwsSecurityFindingIdentifier -> String)
-> ([AwsSecurityFindingIdentifier] -> ShowS)
-> Show AwsSecurityFindingIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsSecurityFindingIdentifier] -> ShowS
$cshowList :: [AwsSecurityFindingIdentifier] -> ShowS
show :: AwsSecurityFindingIdentifier -> String
$cshow :: AwsSecurityFindingIdentifier -> String
showsPrec :: Int -> AwsSecurityFindingIdentifier -> ShowS
$cshowsPrec :: Int -> AwsSecurityFindingIdentifier -> ShowS
Prelude.Show, (forall x.
AwsSecurityFindingIdentifier -> Rep AwsSecurityFindingIdentifier x)
-> (forall x.
Rep AwsSecurityFindingIdentifier x -> AwsSecurityFindingIdentifier)
-> Generic AwsSecurityFindingIdentifier
forall x.
Rep AwsSecurityFindingIdentifier x -> AwsSecurityFindingIdentifier
forall x.
AwsSecurityFindingIdentifier -> Rep AwsSecurityFindingIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsSecurityFindingIdentifier x -> AwsSecurityFindingIdentifier
$cfrom :: forall x.
AwsSecurityFindingIdentifier -> Rep AwsSecurityFindingIdentifier x
Prelude.Generic)
newAwsSecurityFindingIdentifier ::
Prelude.Text ->
Prelude.Text ->
AwsSecurityFindingIdentifier
newAwsSecurityFindingIdentifier :: Text -> Text -> AwsSecurityFindingIdentifier
newAwsSecurityFindingIdentifier Text
pId_ Text
pProductArn_ =
AwsSecurityFindingIdentifier' :: Text -> Text -> AwsSecurityFindingIdentifier
AwsSecurityFindingIdentifier'
{ $sel:id:AwsSecurityFindingIdentifier' :: Text
id = Text
pId_,
$sel:productArn:AwsSecurityFindingIdentifier' :: Text
productArn = Text
pProductArn_
}
awsSecurityFindingIdentifier_id :: Lens.Lens' AwsSecurityFindingIdentifier Prelude.Text
awsSecurityFindingIdentifier_id :: (Text -> f Text)
-> AwsSecurityFindingIdentifier -> f AwsSecurityFindingIdentifier
awsSecurityFindingIdentifier_id = (AwsSecurityFindingIdentifier -> Text)
-> (AwsSecurityFindingIdentifier
-> Text -> AwsSecurityFindingIdentifier)
-> Lens
AwsSecurityFindingIdentifier AwsSecurityFindingIdentifier Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecurityFindingIdentifier' {Text
id :: Text
$sel:id:AwsSecurityFindingIdentifier' :: AwsSecurityFindingIdentifier -> Text
id} -> Text
id) (\s :: AwsSecurityFindingIdentifier
s@AwsSecurityFindingIdentifier' {} Text
a -> AwsSecurityFindingIdentifier
s {$sel:id:AwsSecurityFindingIdentifier' :: Text
id = Text
a} :: AwsSecurityFindingIdentifier)
awsSecurityFindingIdentifier_productArn :: Lens.Lens' AwsSecurityFindingIdentifier Prelude.Text
awsSecurityFindingIdentifier_productArn :: (Text -> f Text)
-> AwsSecurityFindingIdentifier -> f AwsSecurityFindingIdentifier
awsSecurityFindingIdentifier_productArn = (AwsSecurityFindingIdentifier -> Text)
-> (AwsSecurityFindingIdentifier
-> Text -> AwsSecurityFindingIdentifier)
-> Lens
AwsSecurityFindingIdentifier AwsSecurityFindingIdentifier Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsSecurityFindingIdentifier' {Text
productArn :: Text
$sel:productArn:AwsSecurityFindingIdentifier' :: AwsSecurityFindingIdentifier -> Text
productArn} -> Text
productArn) (\s :: AwsSecurityFindingIdentifier
s@AwsSecurityFindingIdentifier' {} Text
a -> AwsSecurityFindingIdentifier
s {$sel:productArn:AwsSecurityFindingIdentifier' :: Text
productArn = Text
a} :: AwsSecurityFindingIdentifier)
instance Core.FromJSON AwsSecurityFindingIdentifier where
parseJSON :: Value -> Parser AwsSecurityFindingIdentifier
parseJSON =
String
-> (Object -> Parser AwsSecurityFindingIdentifier)
-> Value
-> Parser AwsSecurityFindingIdentifier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsSecurityFindingIdentifier"
( \Object
x ->
Text -> Text -> AwsSecurityFindingIdentifier
AwsSecurityFindingIdentifier'
(Text -> Text -> AwsSecurityFindingIdentifier)
-> Parser Text -> Parser (Text -> AwsSecurityFindingIdentifier)
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
"Id")
Parser (Text -> AwsSecurityFindingIdentifier)
-> Parser Text -> Parser AwsSecurityFindingIdentifier
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
"ProductArn")
)
instance
Prelude.Hashable
AwsSecurityFindingIdentifier
instance Prelude.NFData AwsSecurityFindingIdentifier
instance Core.ToJSON AwsSecurityFindingIdentifier where
toJSON :: AwsSecurityFindingIdentifier -> Value
toJSON AwsSecurityFindingIdentifier' {Text
productArn :: Text
id :: Text
$sel:productArn:AwsSecurityFindingIdentifier' :: AwsSecurityFindingIdentifier -> Text
$sel:id:AwsSecurityFindingIdentifier' :: AwsSecurityFindingIdentifier -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProductArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
productArn)
]
)