{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data GeneratedPolicyProperties = GeneratedPolicyProperties'
{
GeneratedPolicyProperties -> Maybe CloudTrailProperties
cloudTrailProperties :: Prelude.Maybe CloudTrailProperties,
GeneratedPolicyProperties -> Maybe Bool
isComplete :: Prelude.Maybe Prelude.Bool,
GeneratedPolicyProperties -> Text
principalArn :: Prelude.Text
}
deriving (GeneratedPolicyProperties -> GeneratedPolicyProperties -> Bool
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]
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
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.
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'
{ $sel:cloudTrailProperties:GeneratedPolicyProperties' :: Maybe CloudTrailProperties
cloudTrailProperties =
forall a. Maybe a
Prelude.Nothing,
$sel:isComplete:GeneratedPolicyProperties' :: Maybe Bool
isComplete = forall a. Maybe a
Prelude.Nothing,
$sel:principalArn:GeneratedPolicyProperties' :: Text
principalArn = Text
pPrincipalArn_
}
generatedPolicyProperties_cloudTrailProperties :: Lens.Lens' GeneratedPolicyProperties (Prelude.Maybe CloudTrailProperties)
generatedPolicyProperties_cloudTrailProperties :: Lens' GeneratedPolicyProperties (Maybe CloudTrailProperties)
generatedPolicyProperties_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_isComplete :: Lens.Lens' GeneratedPolicyProperties (Prelude.Maybe Prelude.Bool)
generatedPolicyProperties_isComplete :: Lens' GeneratedPolicyProperties (Maybe Bool)
generatedPolicyProperties_isComplete = 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_principalArn :: Lens.Lens' GeneratedPolicyProperties Prelude.Text
generatedPolicyProperties_principalArn :: Lens' GeneratedPolicyProperties Text
generatedPolicyProperties_principalArn = 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 Data.FromJSON GeneratedPolicyProperties where
parseJSON :: Value -> Parser GeneratedPolicyProperties
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GeneratedPolicyProperties"
( \Object
x ->
Maybe CloudTrailProperties
-> Maybe Bool -> Text -> GeneratedPolicyProperties
GeneratedPolicyProperties'
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
"cloudTrailProperties")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"isComplete")
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
"principalArn")
)
instance Prelude.Hashable GeneratedPolicyProperties where
hashWithSalt :: Int -> GeneratedPolicyProperties -> Int
hashWithSalt Int
_salt GeneratedPolicyProperties' {Maybe Bool
Maybe CloudTrailProperties
Text
principalArn :: Text
isComplete :: Maybe Bool
cloudTrailProperties :: Maybe CloudTrailProperties
$sel:principalArn:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Text
$sel:isComplete:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Maybe Bool
$sel:cloudTrailProperties:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Maybe CloudTrailProperties
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudTrailProperties
cloudTrailProperties
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isComplete
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
principalArn
instance Prelude.NFData GeneratedPolicyProperties where
rnf :: GeneratedPolicyProperties -> ()
rnf GeneratedPolicyProperties' {Maybe Bool
Maybe CloudTrailProperties
Text
principalArn :: Text
isComplete :: Maybe Bool
cloudTrailProperties :: Maybe CloudTrailProperties
$sel:principalArn:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Text
$sel:isComplete:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Maybe Bool
$sel:cloudTrailProperties:GeneratedPolicyProperties' :: GeneratedPolicyProperties -> Maybe CloudTrailProperties
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudTrailProperties
cloudTrailProperties
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isComplete
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
principalArn