{-# 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.ValidatePolicyFinding where
import Amazonka.AccessAnalyzer.Types.Location
import Amazonka.AccessAnalyzer.Types.ValidatePolicyFindingType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ValidatePolicyFinding = ValidatePolicyFinding'
{
ValidatePolicyFinding -> Text
findingDetails :: Prelude.Text,
ValidatePolicyFinding -> ValidatePolicyFindingType
findingType :: ValidatePolicyFindingType,
ValidatePolicyFinding -> Text
issueCode :: Prelude.Text,
ValidatePolicyFinding -> Text
learnMoreLink :: Prelude.Text,
ValidatePolicyFinding -> [Location]
locations :: [Location]
}
deriving (ValidatePolicyFinding -> ValidatePolicyFinding -> Bool
(ValidatePolicyFinding -> ValidatePolicyFinding -> Bool)
-> (ValidatePolicyFinding -> ValidatePolicyFinding -> Bool)
-> Eq ValidatePolicyFinding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidatePolicyFinding -> ValidatePolicyFinding -> Bool
$c/= :: ValidatePolicyFinding -> ValidatePolicyFinding -> Bool
== :: ValidatePolicyFinding -> ValidatePolicyFinding -> Bool
$c== :: ValidatePolicyFinding -> ValidatePolicyFinding -> Bool
Prelude.Eq, ReadPrec [ValidatePolicyFinding]
ReadPrec ValidatePolicyFinding
Int -> ReadS ValidatePolicyFinding
ReadS [ValidatePolicyFinding]
(Int -> ReadS ValidatePolicyFinding)
-> ReadS [ValidatePolicyFinding]
-> ReadPrec ValidatePolicyFinding
-> ReadPrec [ValidatePolicyFinding]
-> Read ValidatePolicyFinding
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ValidatePolicyFinding]
$creadListPrec :: ReadPrec [ValidatePolicyFinding]
readPrec :: ReadPrec ValidatePolicyFinding
$creadPrec :: ReadPrec ValidatePolicyFinding
readList :: ReadS [ValidatePolicyFinding]
$creadList :: ReadS [ValidatePolicyFinding]
readsPrec :: Int -> ReadS ValidatePolicyFinding
$creadsPrec :: Int -> ReadS ValidatePolicyFinding
Prelude.Read, Int -> ValidatePolicyFinding -> ShowS
[ValidatePolicyFinding] -> ShowS
ValidatePolicyFinding -> String
(Int -> ValidatePolicyFinding -> ShowS)
-> (ValidatePolicyFinding -> String)
-> ([ValidatePolicyFinding] -> ShowS)
-> Show ValidatePolicyFinding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ValidatePolicyFinding] -> ShowS
$cshowList :: [ValidatePolicyFinding] -> ShowS
show :: ValidatePolicyFinding -> String
$cshow :: ValidatePolicyFinding -> String
showsPrec :: Int -> ValidatePolicyFinding -> ShowS
$cshowsPrec :: Int -> ValidatePolicyFinding -> ShowS
Prelude.Show, (forall x. ValidatePolicyFinding -> Rep ValidatePolicyFinding x)
-> (forall x. Rep ValidatePolicyFinding x -> ValidatePolicyFinding)
-> Generic ValidatePolicyFinding
forall x. Rep ValidatePolicyFinding x -> ValidatePolicyFinding
forall x. ValidatePolicyFinding -> Rep ValidatePolicyFinding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ValidatePolicyFinding x -> ValidatePolicyFinding
$cfrom :: forall x. ValidatePolicyFinding -> Rep ValidatePolicyFinding x
Prelude.Generic)
newValidatePolicyFinding ::
Prelude.Text ->
ValidatePolicyFindingType ->
Prelude.Text ->
Prelude.Text ->
ValidatePolicyFinding
newValidatePolicyFinding :: Text
-> ValidatePolicyFindingType
-> Text
-> Text
-> ValidatePolicyFinding
newValidatePolicyFinding
Text
pFindingDetails_
ValidatePolicyFindingType
pFindingType_
Text
pIssueCode_
Text
pLearnMoreLink_ =
ValidatePolicyFinding' :: Text
-> ValidatePolicyFindingType
-> Text
-> Text
-> [Location]
-> ValidatePolicyFinding
ValidatePolicyFinding'
{ $sel:findingDetails:ValidatePolicyFinding' :: Text
findingDetails =
Text
pFindingDetails_,
$sel:findingType:ValidatePolicyFinding' :: ValidatePolicyFindingType
findingType = ValidatePolicyFindingType
pFindingType_,
$sel:issueCode:ValidatePolicyFinding' :: Text
issueCode = Text
pIssueCode_,
$sel:learnMoreLink:ValidatePolicyFinding' :: Text
learnMoreLink = Text
pLearnMoreLink_,
$sel:locations:ValidatePolicyFinding' :: [Location]
locations = [Location]
forall a. Monoid a => a
Prelude.mempty
}
validatePolicyFinding_findingDetails :: Lens.Lens' ValidatePolicyFinding Prelude.Text
validatePolicyFinding_findingDetails :: (Text -> f Text)
-> ValidatePolicyFinding -> f ValidatePolicyFinding
validatePolicyFinding_findingDetails = (ValidatePolicyFinding -> Text)
-> (ValidatePolicyFinding -> Text -> ValidatePolicyFinding)
-> Lens ValidatePolicyFinding ValidatePolicyFinding Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePolicyFinding' {Text
findingDetails :: Text
$sel:findingDetails:ValidatePolicyFinding' :: ValidatePolicyFinding -> Text
findingDetails} -> Text
findingDetails) (\s :: ValidatePolicyFinding
s@ValidatePolicyFinding' {} Text
a -> ValidatePolicyFinding
s {$sel:findingDetails:ValidatePolicyFinding' :: Text
findingDetails = Text
a} :: ValidatePolicyFinding)
validatePolicyFinding_findingType :: Lens.Lens' ValidatePolicyFinding ValidatePolicyFindingType
validatePolicyFinding_findingType :: (ValidatePolicyFindingType -> f ValidatePolicyFindingType)
-> ValidatePolicyFinding -> f ValidatePolicyFinding
validatePolicyFinding_findingType = (ValidatePolicyFinding -> ValidatePolicyFindingType)
-> (ValidatePolicyFinding
-> ValidatePolicyFindingType -> ValidatePolicyFinding)
-> Lens
ValidatePolicyFinding
ValidatePolicyFinding
ValidatePolicyFindingType
ValidatePolicyFindingType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePolicyFinding' {ValidatePolicyFindingType
findingType :: ValidatePolicyFindingType
$sel:findingType:ValidatePolicyFinding' :: ValidatePolicyFinding -> ValidatePolicyFindingType
findingType} -> ValidatePolicyFindingType
findingType) (\s :: ValidatePolicyFinding
s@ValidatePolicyFinding' {} ValidatePolicyFindingType
a -> ValidatePolicyFinding
s {$sel:findingType:ValidatePolicyFinding' :: ValidatePolicyFindingType
findingType = ValidatePolicyFindingType
a} :: ValidatePolicyFinding)
validatePolicyFinding_issueCode :: Lens.Lens' ValidatePolicyFinding Prelude.Text
validatePolicyFinding_issueCode :: (Text -> f Text)
-> ValidatePolicyFinding -> f ValidatePolicyFinding
validatePolicyFinding_issueCode = (ValidatePolicyFinding -> Text)
-> (ValidatePolicyFinding -> Text -> ValidatePolicyFinding)
-> Lens ValidatePolicyFinding ValidatePolicyFinding Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePolicyFinding' {Text
issueCode :: Text
$sel:issueCode:ValidatePolicyFinding' :: ValidatePolicyFinding -> Text
issueCode} -> Text
issueCode) (\s :: ValidatePolicyFinding
s@ValidatePolicyFinding' {} Text
a -> ValidatePolicyFinding
s {$sel:issueCode:ValidatePolicyFinding' :: Text
issueCode = Text
a} :: ValidatePolicyFinding)
validatePolicyFinding_learnMoreLink :: Lens.Lens' ValidatePolicyFinding Prelude.Text
validatePolicyFinding_learnMoreLink :: (Text -> f Text)
-> ValidatePolicyFinding -> f ValidatePolicyFinding
validatePolicyFinding_learnMoreLink = (ValidatePolicyFinding -> Text)
-> (ValidatePolicyFinding -> Text -> ValidatePolicyFinding)
-> Lens ValidatePolicyFinding ValidatePolicyFinding Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePolicyFinding' {Text
learnMoreLink :: Text
$sel:learnMoreLink:ValidatePolicyFinding' :: ValidatePolicyFinding -> Text
learnMoreLink} -> Text
learnMoreLink) (\s :: ValidatePolicyFinding
s@ValidatePolicyFinding' {} Text
a -> ValidatePolicyFinding
s {$sel:learnMoreLink:ValidatePolicyFinding' :: Text
learnMoreLink = Text
a} :: ValidatePolicyFinding)
validatePolicyFinding_locations :: Lens.Lens' ValidatePolicyFinding [Location]
validatePolicyFinding_locations :: ([Location] -> f [Location])
-> ValidatePolicyFinding -> f ValidatePolicyFinding
validatePolicyFinding_locations = (ValidatePolicyFinding -> [Location])
-> (ValidatePolicyFinding -> [Location] -> ValidatePolicyFinding)
-> Lens
ValidatePolicyFinding ValidatePolicyFinding [Location] [Location]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidatePolicyFinding' {[Location]
locations :: [Location]
$sel:locations:ValidatePolicyFinding' :: ValidatePolicyFinding -> [Location]
locations} -> [Location]
locations) (\s :: ValidatePolicyFinding
s@ValidatePolicyFinding' {} [Location]
a -> ValidatePolicyFinding
s {$sel:locations:ValidatePolicyFinding' :: [Location]
locations = [Location]
a} :: ValidatePolicyFinding) (([Location] -> f [Location])
-> ValidatePolicyFinding -> f ValidatePolicyFinding)
-> (([Location] -> f [Location]) -> [Location] -> f [Location])
-> ([Location] -> f [Location])
-> ValidatePolicyFinding
-> f ValidatePolicyFinding
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Location] -> f [Location]) -> [Location] -> f [Location]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ValidatePolicyFinding where
parseJSON :: Value -> Parser ValidatePolicyFinding
parseJSON =
String
-> (Object -> Parser ValidatePolicyFinding)
-> Value
-> Parser ValidatePolicyFinding
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ValidatePolicyFinding"
( \Object
x ->
Text
-> ValidatePolicyFindingType
-> Text
-> Text
-> [Location]
-> ValidatePolicyFinding
ValidatePolicyFinding'
(Text
-> ValidatePolicyFindingType
-> Text
-> Text
-> [Location]
-> ValidatePolicyFinding)
-> Parser Text
-> Parser
(ValidatePolicyFindingType
-> Text -> Text -> [Location] -> ValidatePolicyFinding)
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
"findingDetails")
Parser
(ValidatePolicyFindingType
-> Text -> Text -> [Location] -> ValidatePolicyFinding)
-> Parser ValidatePolicyFindingType
-> Parser (Text -> Text -> [Location] -> ValidatePolicyFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ValidatePolicyFindingType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"findingType")
Parser (Text -> Text -> [Location] -> ValidatePolicyFinding)
-> Parser Text
-> Parser (Text -> [Location] -> ValidatePolicyFinding)
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
"issueCode")
Parser (Text -> [Location] -> ValidatePolicyFinding)
-> Parser Text -> Parser ([Location] -> ValidatePolicyFinding)
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
"learnMoreLink")
Parser ([Location] -> ValidatePolicyFinding)
-> Parser [Location] -> Parser ValidatePolicyFinding
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [Location])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"locations" Parser (Maybe [Location]) -> [Location] -> Parser [Location]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Location]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ValidatePolicyFinding
instance Prelude.NFData ValidatePolicyFinding