{-# 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.AttachedPolicy 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 AttachedPolicy = AttachedPolicy'
{ AttachedPolicy -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
AttachedPolicy -> Maybe Text
policyName :: Prelude.Maybe Prelude.Text
}
deriving (AttachedPolicy -> AttachedPolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachedPolicy -> AttachedPolicy -> Bool
$c/= :: AttachedPolicy -> AttachedPolicy -> Bool
== :: AttachedPolicy -> AttachedPolicy -> Bool
$c== :: AttachedPolicy -> AttachedPolicy -> Bool
Prelude.Eq, ReadPrec [AttachedPolicy]
ReadPrec AttachedPolicy
Int -> ReadS AttachedPolicy
ReadS [AttachedPolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachedPolicy]
$creadListPrec :: ReadPrec [AttachedPolicy]
readPrec :: ReadPrec AttachedPolicy
$creadPrec :: ReadPrec AttachedPolicy
readList :: ReadS [AttachedPolicy]
$creadList :: ReadS [AttachedPolicy]
readsPrec :: Int -> ReadS AttachedPolicy
$creadsPrec :: Int -> ReadS AttachedPolicy
Prelude.Read, Int -> AttachedPolicy -> ShowS
[AttachedPolicy] -> ShowS
AttachedPolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachedPolicy] -> ShowS
$cshowList :: [AttachedPolicy] -> ShowS
show :: AttachedPolicy -> String
$cshow :: AttachedPolicy -> String
showsPrec :: Int -> AttachedPolicy -> ShowS
$cshowsPrec :: Int -> AttachedPolicy -> ShowS
Prelude.Show, forall x. Rep AttachedPolicy x -> AttachedPolicy
forall x. AttachedPolicy -> Rep AttachedPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttachedPolicy x -> AttachedPolicy
$cfrom :: forall x. AttachedPolicy -> Rep AttachedPolicy x
Prelude.Generic)
newAttachedPolicy ::
AttachedPolicy
newAttachedPolicy :: AttachedPolicy
newAttachedPolicy =
AttachedPolicy'
{ $sel:policyArn:AttachedPolicy' :: Maybe Text
policyArn = forall a. Maybe a
Prelude.Nothing,
$sel:policyName:AttachedPolicy' :: Maybe Text
policyName = forall a. Maybe a
Prelude.Nothing
}
attachedPolicy_policyArn :: Lens.Lens' AttachedPolicy (Prelude.Maybe Prelude.Text)
attachedPolicy_policyArn :: Lens' AttachedPolicy (Maybe Text)
attachedPolicy_policyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachedPolicy' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:AttachedPolicy' :: AttachedPolicy -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: AttachedPolicy
s@AttachedPolicy' {} Maybe Text
a -> AttachedPolicy
s {$sel:policyArn:AttachedPolicy' :: Maybe Text
policyArn = Maybe Text
a} :: AttachedPolicy)
attachedPolicy_policyName :: Lens.Lens' AttachedPolicy (Prelude.Maybe Prelude.Text)
attachedPolicy_policyName :: Lens' AttachedPolicy (Maybe Text)
attachedPolicy_policyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachedPolicy' {Maybe Text
policyName :: Maybe Text
$sel:policyName:AttachedPolicy' :: AttachedPolicy -> Maybe Text
policyName} -> Maybe Text
policyName) (\s :: AttachedPolicy
s@AttachedPolicy' {} Maybe Text
a -> AttachedPolicy
s {$sel:policyName:AttachedPolicy' :: Maybe Text
policyName = Maybe Text
a} :: AttachedPolicy)
instance Data.FromXML AttachedPolicy where
parseXML :: [Node] -> Either String AttachedPolicy
parseXML [Node]
x =
Maybe Text -> Maybe Text -> AttachedPolicy
AttachedPolicy'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PolicyArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PolicyName")
instance Prelude.Hashable AttachedPolicy where
hashWithSalt :: Int -> AttachedPolicy -> Int
hashWithSalt Int
_salt AttachedPolicy' {Maybe Text
policyName :: Maybe Text
policyArn :: Maybe Text
$sel:policyName:AttachedPolicy' :: AttachedPolicy -> Maybe Text
$sel:policyArn:AttachedPolicy' :: AttachedPolicy -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyName
instance Prelude.NFData AttachedPolicy where
rnf :: AttachedPolicy -> ()
rnf AttachedPolicy' {Maybe Text
policyName :: Maybe Text
policyArn :: Maybe Text
$sel:policyName:AttachedPolicy' :: AttachedPolicy -> Maybe Text
$sel:policyArn:AttachedPolicy' :: AttachedPolicy -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyName