{-# 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.GeneratedPolicyProperties where
import Amazonka.AccessAnalyzer.Types.CloudTrailProperties
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GeneratedPolicyProperties = GeneratedPolicyProperties'
{
GeneratedPolicyProperties -> Maybe Bool
isComplete :: Prelude.Maybe Prelude.Bool,
GeneratedPolicyProperties -> Maybe CloudTrailProperties
cloudTrailProperties :: Prelude.Maybe CloudTrailProperties,
GeneratedPolicyProperties -> Text
principalArn :: Prelude.Text
}
deriving (GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool
(GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool)
-> (GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool)
-> Eq GeneratedPolicyProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool
$c/= :: GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool
== :: GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool
$c== :: GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool
Prelude.Eq, ReadPrec [GeneratedPolicyProperties]
ReadPrec GeneratedPolicyProperties
Int -> ReadS GeneratedPolicyProperties
ReadS [GeneratedPolicyProperties]
(Int -> ReadS GeneratedPolicyProperties)
-> ReadS [GeneratedPolicyProperties]
-> ReadPrec GeneratedPolicyProperties
-> ReadPrec [GeneratedPolicyProperties]
-> Read GeneratedPolicyProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GeneratedPolicyProperties]
$creadListPrec :: ReadPrec [GeneratedPolicyProperties]
readPrec :: ReadPrec GeneratedPolicyProperties
$creadPrec :: ReadPrec GeneratedPolicyProperties
readList :: ReadS [GeneratedPolicyProperties]
$creadList :: ReadS [GeneratedPolicyProperties]
readsPrec :: Int -> ReadS GeneratedPolicyProperties
$creadsPrec :: Int -> ReadS GeneratedPolicyProperties
Prelude.Read, Int -> GeneratedPolicyProperties -> ShowS
[GeneratedPolicyProperties] -> ShowS
GeneratedPolicyProperties -> String
(Int -> GeneratedPolicyProperties -> ShowS)
-> (GeneratedPolicyProperties -> String)
-> ([GeneratedPolicyProperties] -> ShowS)
-> Show GeneratedPolicyProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeneratedPolicyProperties] -> ShowS
$cshowList :: [GeneratedPolicyProperties] -> ShowS
show :: GeneratedPolicyProperties -> String
$cshow :: GeneratedPolicyProperties -> String
showsPrec :: Int -> GeneratedPolicyProperties -> ShowS
$cshowsPrec :: Int -> GeneratedPolicyProperties -> ShowS
Prelude.Show, (forall x.
GeneratedPolicyProperties -> Rep GeneratedPolicyProperties x)
-> (forall x.
Rep GeneratedPolicyProperties x -> GeneratedPolicyProperties)
-> Generic GeneratedPolicyProperties
forall x.
Rep GeneratedPolicyProperties x -> GeneratedPolicyProperties
forall x.
GeneratedPolicyProperties -> Rep GeneratedPolicyProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GeneratedPolicyProperties x -> GeneratedPolicyProperties
$cfrom :: forall x.
GeneratedPolicyProperties -> Rep GeneratedPolicyProperties x
Prelude.Generic)
newGeneratedPolicyProperties ::
Prelude.Text ->
GeneratedPolicyProperties
newGeneratedPolicyProperties :: Text -> GeneratedPolicyProperties
newGeneratedPolicyProperties Text
pPrincipalArn_ =
GeneratedPolicyProperties' :: Maybe Bool
-> Maybe CloudTrailProperties -> Text -> GeneratedPolicyProperties
GeneratedPolicyProperties'
{ $sel:isComplete:GeneratedPolicyProperties' :: Maybe Bool
isComplete =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:cloudTrailProperties:GeneratedPolicyProperties' :: Maybe CloudTrailProperties
cloudTrailProperties = Maybe CloudTrailProperties
forall a. Maybe a
Prelude.Nothing,
$sel:principalArn:GeneratedPolicyProperties' :: Text
principalArn = Text
pPrincipalArn_
}
generatedPolicyProperties_isComplete :: Lens.Lens' GeneratedPolicyProperties (Prelude.Maybe Prelude.Bool)
generatedPolicyProperties_isComplete :: (Maybe Bool -> f (Maybe Bool))
-> GeneratedPolicyProperties -> f GeneratedPolicyProperties
generatedPolicyProperties_isComplete = (GeneratedPolicyProperties -> Maybe Bool)
-> (GeneratedPolicyProperties
-> Maybe Bool -> GeneratedPolicyProperties)
-> Lens
GeneratedPolicyProperties
GeneratedPolicyProperties
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeneratedPolicyProperties' {Maybe Bool
isComplete :: Maybe Bool
$sel:isComplete:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Maybe Bool
isComplete} -> Maybe Bool
isComplete) (\s :: GeneratedPolicyProperties
s@GeneratedPolicyProperties' {} Maybe Bool
a -> GeneratedPolicyProperties
s {$sel:isComplete:GeneratedPolicyProperties' :: Maybe Bool
isComplete = Maybe Bool
a} :: GeneratedPolicyProperties)
generatedPolicyProperties_cloudTrailProperties :: Lens.Lens' GeneratedPolicyProperties (Prelude.Maybe CloudTrailProperties)
generatedPolicyProperties_cloudTrailProperties :: (Maybe CloudTrailProperties -> f (Maybe CloudTrailProperties))
-> GeneratedPolicyProperties -> f GeneratedPolicyProperties
generatedPolicyProperties_cloudTrailProperties = (GeneratedPolicyProperties -> Maybe CloudTrailProperties)
-> (GeneratedPolicyProperties
-> Maybe CloudTrailProperties -> GeneratedPolicyProperties)
-> Lens
GeneratedPolicyProperties
GeneratedPolicyProperties
(Maybe CloudTrailProperties)
(Maybe CloudTrailProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeneratedPolicyProperties' {Maybe CloudTrailProperties
cloudTrailProperties :: Maybe CloudTrailProperties
$sel:cloudTrailProperties:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Maybe CloudTrailProperties
cloudTrailProperties} -> Maybe CloudTrailProperties
cloudTrailProperties) (\s :: GeneratedPolicyProperties
s@GeneratedPolicyProperties' {} Maybe CloudTrailProperties
a -> GeneratedPolicyProperties
s {$sel:cloudTrailProperties:GeneratedPolicyProperties' :: Maybe CloudTrailProperties
cloudTrailProperties = Maybe CloudTrailProperties
a} :: GeneratedPolicyProperties)
generatedPolicyProperties_principalArn :: Lens.Lens' GeneratedPolicyProperties Prelude.Text
generatedPolicyProperties_principalArn :: (Text -> f Text)
-> GeneratedPolicyProperties -> f GeneratedPolicyProperties
generatedPolicyProperties_principalArn = (GeneratedPolicyProperties -> Text)
-> (GeneratedPolicyProperties -> Text -> GeneratedPolicyProperties)
-> Lens
GeneratedPolicyProperties GeneratedPolicyProperties Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeneratedPolicyProperties' {Text
principalArn :: Text
$sel:principalArn:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Text
principalArn} -> Text
principalArn) (\s :: GeneratedPolicyProperties
s@GeneratedPolicyProperties' {} Text
a -> GeneratedPolicyProperties
s {$sel:principalArn:GeneratedPolicyProperties' :: Text
principalArn = Text
a} :: GeneratedPolicyProperties)
instance Core.FromJSON GeneratedPolicyProperties where
parseJSON :: Value -> Parser GeneratedPolicyProperties
parseJSON =
String
-> (Object -> Parser GeneratedPolicyProperties)
-> Value
-> Parser GeneratedPolicyProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GeneratedPolicyProperties"
( \Object
x ->
Maybe Bool
-> Maybe CloudTrailProperties -> Text -> GeneratedPolicyProperties
GeneratedPolicyProperties'
(Maybe Bool
-> Maybe CloudTrailProperties -> Text -> GeneratedPolicyProperties)
-> Parser (Maybe Bool)
-> Parser
(Maybe CloudTrailProperties -> Text -> GeneratedPolicyProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isComplete")
Parser
(Maybe CloudTrailProperties -> Text -> GeneratedPolicyProperties)
-> Parser (Maybe CloudTrailProperties)
-> Parser (Text -> GeneratedPolicyProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CloudTrailProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cloudTrailProperties")
Parser (Text -> GeneratedPolicyProperties)
-> Parser Text -> Parser GeneratedPolicyProperties
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
"principalArn")
)
instance Prelude.Hashable GeneratedPolicyProperties
instance Prelude.NFData GeneratedPolicyProperties