{-# 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.IAM.Types.PolicyDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PolicyDetail = PolicyDetail'
{
PolicyDetail -> Maybe Text
policyDocument :: Prelude.Maybe Prelude.Text,
PolicyDetail -> Maybe Text
policyName :: Prelude.Maybe Prelude.Text
}
deriving (PolicyDetail -> PolicyDetail -> Bool
(PolicyDetail -> PolicyDetail -> Bool)
-> (PolicyDetail -> PolicyDetail -> Bool) -> Eq PolicyDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyDetail -> PolicyDetail -> Bool
$c/= :: PolicyDetail -> PolicyDetail -> Bool
== :: PolicyDetail -> PolicyDetail -> Bool
$c== :: PolicyDetail -> PolicyDetail -> Bool
Prelude.Eq, ReadPrec [PolicyDetail]
ReadPrec PolicyDetail
Int -> ReadS PolicyDetail
ReadS [PolicyDetail]
(Int -> ReadS PolicyDetail)
-> ReadS [PolicyDetail]
-> ReadPrec PolicyDetail
-> ReadPrec [PolicyDetail]
-> Read PolicyDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyDetail]
$creadListPrec :: ReadPrec [PolicyDetail]
readPrec :: ReadPrec PolicyDetail
$creadPrec :: ReadPrec PolicyDetail
readList :: ReadS [PolicyDetail]
$creadList :: ReadS [PolicyDetail]
readsPrec :: Int -> ReadS PolicyDetail
$creadsPrec :: Int -> ReadS PolicyDetail
Prelude.Read, Int -> PolicyDetail -> ShowS
[PolicyDetail] -> ShowS
PolicyDetail -> String
(Int -> PolicyDetail -> ShowS)
-> (PolicyDetail -> String)
-> ([PolicyDetail] -> ShowS)
-> Show PolicyDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyDetail] -> ShowS
$cshowList :: [PolicyDetail] -> ShowS
show :: PolicyDetail -> String
$cshow :: PolicyDetail -> String
showsPrec :: Int -> PolicyDetail -> ShowS
$cshowsPrec :: Int -> PolicyDetail -> ShowS
Prelude.Show, (forall x. PolicyDetail -> Rep PolicyDetail x)
-> (forall x. Rep PolicyDetail x -> PolicyDetail)
-> Generic PolicyDetail
forall x. Rep PolicyDetail x -> PolicyDetail
forall x. PolicyDetail -> Rep PolicyDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyDetail x -> PolicyDetail
$cfrom :: forall x. PolicyDetail -> Rep PolicyDetail x
Prelude.Generic)
newPolicyDetail ::
PolicyDetail
newPolicyDetail :: PolicyDetail
newPolicyDetail =
PolicyDetail' :: Maybe Text -> Maybe Text -> PolicyDetail
PolicyDetail'
{ $sel:policyDocument:PolicyDetail' :: Maybe Text
policyDocument = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policyName:PolicyDetail' :: Maybe Text
policyName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
policyDetail_policyDocument :: Lens.Lens' PolicyDetail (Prelude.Maybe Prelude.Text)
policyDetail_policyDocument :: (Maybe Text -> f (Maybe Text)) -> PolicyDetail -> f PolicyDetail
policyDetail_policyDocument = (PolicyDetail -> Maybe Text)
-> (PolicyDetail -> Maybe Text -> PolicyDetail)
-> Lens PolicyDetail PolicyDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetail' {Maybe Text
policyDocument :: Maybe Text
$sel:policyDocument:PolicyDetail' :: PolicyDetail -> Maybe Text
policyDocument} -> Maybe Text
policyDocument) (\s :: PolicyDetail
s@PolicyDetail' {} Maybe Text
a -> PolicyDetail
s {$sel:policyDocument:PolicyDetail' :: Maybe Text
policyDocument = Maybe Text
a} :: PolicyDetail)
policyDetail_policyName :: Lens.Lens' PolicyDetail (Prelude.Maybe Prelude.Text)
policyDetail_policyName :: (Maybe Text -> f (Maybe Text)) -> PolicyDetail -> f PolicyDetail
policyDetail_policyName = (PolicyDetail -> Maybe Text)
-> (PolicyDetail -> Maybe Text -> PolicyDetail)
-> Lens PolicyDetail PolicyDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyDetail' {Maybe Text
policyName :: Maybe Text
$sel:policyName:PolicyDetail' :: PolicyDetail -> Maybe Text
policyName} -> Maybe Text
policyName) (\s :: PolicyDetail
s@PolicyDetail' {} Maybe Text
a -> PolicyDetail
s {$sel:policyName:PolicyDetail' :: Maybe Text
policyName = Maybe Text
a} :: PolicyDetail)
instance Core.FromXML PolicyDetail where
parseXML :: [Node] -> Either String PolicyDetail
parseXML [Node]
x =
Maybe Text -> Maybe Text -> PolicyDetail
PolicyDetail'
(Maybe Text -> Maybe Text -> PolicyDetail)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> PolicyDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PolicyDocument")
Either String (Maybe Text -> PolicyDetail)
-> Either String (Maybe Text) -> Either String PolicyDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PolicyName")
instance Prelude.Hashable PolicyDetail
instance Prelude.NFData PolicyDetail