{-# 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.IamRoleConfiguration where
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 IamRoleConfiguration = IamRoleConfiguration'
{
IamRoleConfiguration -> Maybe Text
trustPolicy :: Prelude.Maybe Prelude.Text
}
deriving (IamRoleConfiguration -> IamRoleConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IamRoleConfiguration -> IamRoleConfiguration -> Bool
$c/= :: IamRoleConfiguration -> IamRoleConfiguration -> Bool
== :: IamRoleConfiguration -> IamRoleConfiguration -> Bool
$c== :: IamRoleConfiguration -> IamRoleConfiguration -> Bool
Prelude.Eq, ReadPrec [IamRoleConfiguration]
ReadPrec IamRoleConfiguration
Int -> ReadS IamRoleConfiguration
ReadS [IamRoleConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IamRoleConfiguration]
$creadListPrec :: ReadPrec [IamRoleConfiguration]
readPrec :: ReadPrec IamRoleConfiguration
$creadPrec :: ReadPrec IamRoleConfiguration
readList :: ReadS [IamRoleConfiguration]
$creadList :: ReadS [IamRoleConfiguration]
readsPrec :: Int -> ReadS IamRoleConfiguration
$creadsPrec :: Int -> ReadS IamRoleConfiguration
Prelude.Read, Int -> IamRoleConfiguration -> ShowS
[IamRoleConfiguration] -> ShowS
IamRoleConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IamRoleConfiguration] -> ShowS
$cshowList :: [IamRoleConfiguration] -> ShowS
show :: IamRoleConfiguration -> String
$cshow :: IamRoleConfiguration -> String
showsPrec :: Int -> IamRoleConfiguration -> ShowS
$cshowsPrec :: Int -> IamRoleConfiguration -> ShowS
Prelude.Show, forall x. Rep IamRoleConfiguration x -> IamRoleConfiguration
forall x. IamRoleConfiguration -> Rep IamRoleConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IamRoleConfiguration x -> IamRoleConfiguration
$cfrom :: forall x. IamRoleConfiguration -> Rep IamRoleConfiguration x
Prelude.Generic)
newIamRoleConfiguration ::
IamRoleConfiguration
newIamRoleConfiguration :: IamRoleConfiguration
newIamRoleConfiguration =
IamRoleConfiguration'
{ $sel:trustPolicy:IamRoleConfiguration' :: Maybe Text
trustPolicy =
forall a. Maybe a
Prelude.Nothing
}
iamRoleConfiguration_trustPolicy :: Lens.Lens' IamRoleConfiguration (Prelude.Maybe Prelude.Text)
iamRoleConfiguration_trustPolicy :: Lens' IamRoleConfiguration (Maybe Text)
iamRoleConfiguration_trustPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IamRoleConfiguration' {Maybe Text
trustPolicy :: Maybe Text
$sel:trustPolicy:IamRoleConfiguration' :: IamRoleConfiguration -> Maybe Text
trustPolicy} -> Maybe Text
trustPolicy) (\s :: IamRoleConfiguration
s@IamRoleConfiguration' {} Maybe Text
a -> IamRoleConfiguration
s {$sel:trustPolicy:IamRoleConfiguration' :: Maybe Text
trustPolicy = Maybe Text
a} :: IamRoleConfiguration)
instance Data.FromJSON IamRoleConfiguration where
parseJSON :: Value -> Parser IamRoleConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IamRoleConfiguration"
( \Object
x ->
Maybe Text -> IamRoleConfiguration
IamRoleConfiguration'
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
"trustPolicy")
)
instance Prelude.Hashable IamRoleConfiguration where
hashWithSalt :: Int -> IamRoleConfiguration -> Int
hashWithSalt Int
_salt IamRoleConfiguration' {Maybe Text
trustPolicy :: Maybe Text
$sel:trustPolicy:IamRoleConfiguration' :: IamRoleConfiguration -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trustPolicy
instance Prelude.NFData IamRoleConfiguration where
rnf :: IamRoleConfiguration -> ()
rnf IamRoleConfiguration' {Maybe Text
trustPolicy :: Maybe Text
$sel:trustPolicy:IamRoleConfiguration' :: IamRoleConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trustPolicy
instance Data.ToJSON IamRoleConfiguration where
toJSON :: IamRoleConfiguration -> Value
toJSON IamRoleConfiguration' {Maybe Text
trustPolicy :: Maybe Text
$sel:trustPolicy:IamRoleConfiguration' :: IamRoleConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"trustPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
trustPolicy]
)