{-# 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.AccessAnalyzer.Types.FindingSource where
import Amazonka.AccessAnalyzer.Types.FindingSourceDetail
import Amazonka.AccessAnalyzer.Types.FindingSourceType
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data FindingSource = FindingSource'
{
FindingSource -> Maybe FindingSourceDetail
detail :: Prelude.Maybe FindingSourceDetail,
FindingSource -> FindingSourceType
type' :: FindingSourceType
}
deriving (FindingSource -> FindingSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FindingSource -> FindingSource -> Bool
$c/= :: FindingSource -> FindingSource -> Bool
== :: FindingSource -> FindingSource -> Bool
$c== :: FindingSource -> FindingSource -> Bool
Prelude.Eq, ReadPrec [FindingSource]
ReadPrec FindingSource
Int -> ReadS FindingSource
ReadS [FindingSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FindingSource]
$creadListPrec :: ReadPrec [FindingSource]
readPrec :: ReadPrec FindingSource
$creadPrec :: ReadPrec FindingSource
readList :: ReadS [FindingSource]
$creadList :: ReadS [FindingSource]
readsPrec :: Int -> ReadS FindingSource
$creadsPrec :: Int -> ReadS FindingSource
Prelude.Read, Int -> FindingSource -> ShowS
[FindingSource] -> ShowS
FindingSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FindingSource] -> ShowS
$cshowList :: [FindingSource] -> ShowS
show :: FindingSource -> String
$cshow :: FindingSource -> String
showsPrec :: Int -> FindingSource -> ShowS
$cshowsPrec :: Int -> FindingSource -> ShowS
Prelude.Show, forall x. Rep FindingSource x -> FindingSource
forall x. FindingSource -> Rep FindingSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FindingSource x -> FindingSource
$cfrom :: forall x. FindingSource -> Rep FindingSource x
Prelude.Generic)
newFindingSource ::
FindingSourceType ->
FindingSource
newFindingSource :: FindingSourceType -> FindingSource
newFindingSource FindingSourceType
pType_ =
FindingSource'
{ $sel:detail:FindingSource' :: Maybe FindingSourceDetail
detail = forall a. Maybe a
Prelude.Nothing,
$sel:type':FindingSource' :: FindingSourceType
type' = FindingSourceType
pType_
}
findingSource_detail :: Lens.Lens' FindingSource (Prelude.Maybe FindingSourceDetail)
findingSource_detail :: Lens' FindingSource (Maybe FindingSourceDetail)
findingSource_detail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingSource' {Maybe FindingSourceDetail
detail :: Maybe FindingSourceDetail
$sel:detail:FindingSource' :: FindingSource -> Maybe FindingSourceDetail
detail} -> Maybe FindingSourceDetail
detail) (\s :: FindingSource
s@FindingSource' {} Maybe FindingSourceDetail
a -> FindingSource
s {$sel:detail:FindingSource' :: Maybe FindingSourceDetail
detail = Maybe FindingSourceDetail
a} :: FindingSource)
findingSource_type :: Lens.Lens' FindingSource FindingSourceType
findingSource_type :: Lens' FindingSource FindingSourceType
findingSource_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingSource' {FindingSourceType
type' :: FindingSourceType
$sel:type':FindingSource' :: FindingSource -> FindingSourceType
type'} -> FindingSourceType
type') (\s :: FindingSource
s@FindingSource' {} FindingSourceType
a -> FindingSource
s {$sel:type':FindingSource' :: FindingSourceType
type' = FindingSourceType
a} :: FindingSource)
instance Data.FromJSON FindingSource where
parseJSON :: Value -> Parser FindingSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FindingSource"
( \Object
x ->
Maybe FindingSourceDetail -> FindingSourceType -> FindingSource
FindingSource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"detail")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"type")
)
instance Prelude.Hashable FindingSource where
hashWithSalt :: Int -> FindingSource -> Int
hashWithSalt Int
_salt FindingSource' {Maybe FindingSourceDetail
FindingSourceType
type' :: FindingSourceType
detail :: Maybe FindingSourceDetail
$sel:type':FindingSource' :: FindingSource -> FindingSourceType
$sel:detail:FindingSource' :: FindingSource -> Maybe FindingSourceDetail
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FindingSourceDetail
detail
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FindingSourceType
type'
instance Prelude.NFData FindingSource where
rnf :: FindingSource -> ()
rnf FindingSource' {Maybe FindingSourceDetail
FindingSourceType
type' :: FindingSourceType
detail :: Maybe FindingSourceDetail
$sel:type':FindingSource' :: FindingSource -> FindingSourceType
$sel:detail:FindingSource' :: FindingSource -> Maybe FindingSourceDetail
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FindingSourceDetail
detail seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FindingSourceType
type'