{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IamRoleConfiguration = IamRoleConfiguration'
{
IamRoleConfiguration -> Maybe Text
trustPolicy :: Prelude.Maybe Prelude.Text
}
deriving (IamRoleConfiguration -> IamRoleConfiguration -> Bool
(IamRoleConfiguration -> IamRoleConfiguration -> Bool)
-> (IamRoleConfiguration -> IamRoleConfiguration -> Bool)
-> Eq IamRoleConfiguration
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]
(Int -> ReadS IamRoleConfiguration)
-> ReadS [IamRoleConfiguration]
-> ReadPrec IamRoleConfiguration
-> ReadPrec [IamRoleConfiguration]
-> Read 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
(Int -> IamRoleConfiguration -> ShowS)
-> (IamRoleConfiguration -> String)
-> ([IamRoleConfiguration] -> ShowS)
-> Show IamRoleConfiguration
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. IamRoleConfiguration -> Rep IamRoleConfiguration x)
-> (forall x. Rep IamRoleConfiguration x -> IamRoleConfiguration)
-> Generic IamRoleConfiguration
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' :: Maybe Text -> IamRoleConfiguration
IamRoleConfiguration'
{ $sel:trustPolicy:IamRoleConfiguration' :: Maybe Text
trustPolicy =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
iamRoleConfiguration_trustPolicy :: Lens.Lens' IamRoleConfiguration (Prelude.Maybe Prelude.Text)
iamRoleConfiguration_trustPolicy :: (Maybe Text -> f (Maybe Text))
-> IamRoleConfiguration -> f IamRoleConfiguration
iamRoleConfiguration_trustPolicy = (IamRoleConfiguration -> Maybe Text)
-> (IamRoleConfiguration -> Maybe Text -> IamRoleConfiguration)
-> Lens
IamRoleConfiguration IamRoleConfiguration (Maybe Text) (Maybe Text)
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 Core.FromJSON IamRoleConfiguration where
parseJSON :: Value -> Parser IamRoleConfiguration
parseJSON =
String
-> (Object -> Parser IamRoleConfiguration)
-> Value
-> Parser IamRoleConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IamRoleConfiguration"
( \Object
x ->
Maybe Text -> IamRoleConfiguration
IamRoleConfiguration'
(Maybe Text -> IamRoleConfiguration)
-> Parser (Maybe Text) -> Parser IamRoleConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"trustPolicy")
)
instance Prelude.Hashable IamRoleConfiguration
instance Prelude.NFData IamRoleConfiguration
instance Core.ToJSON IamRoleConfiguration where
toJSON :: IamRoleConfiguration -> Value
toJSON IamRoleConfiguration' {Maybe Text
trustPolicy :: Maybe Text
$sel:trustPolicy:IamRoleConfiguration' :: IamRoleConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"trustPolicy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
trustPolicy]
)