{-# 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.PolicyGrantingServiceAccess where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.PolicyOwnerEntityType
import Amazonka.IAM.Types.PolicyType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PolicyGrantingServiceAccess = PolicyGrantingServiceAccess'
{
PolicyGrantingServiceAccess -> Maybe Text
entityName :: Prelude.Maybe Prelude.Text,
PolicyGrantingServiceAccess -> Maybe PolicyOwnerEntityType
entityType :: Prelude.Maybe PolicyOwnerEntityType,
PolicyGrantingServiceAccess -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
PolicyGrantingServiceAccess -> Text
policyName :: Prelude.Text,
PolicyGrantingServiceAccess -> PolicyType
policyType :: PolicyType
}
deriving (PolicyGrantingServiceAccess -> PolicyGrantingServiceAccess -> Bool
(PolicyGrantingServiceAccess
-> PolicyGrantingServiceAccess -> Bool)
-> (PolicyGrantingServiceAccess
-> PolicyGrantingServiceAccess -> Bool)
-> Eq PolicyGrantingServiceAccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyGrantingServiceAccess -> PolicyGrantingServiceAccess -> Bool
$c/= :: PolicyGrantingServiceAccess -> PolicyGrantingServiceAccess -> Bool
== :: PolicyGrantingServiceAccess -> PolicyGrantingServiceAccess -> Bool
$c== :: PolicyGrantingServiceAccess -> PolicyGrantingServiceAccess -> Bool
Prelude.Eq, ReadPrec [PolicyGrantingServiceAccess]
ReadPrec PolicyGrantingServiceAccess
Int -> ReadS PolicyGrantingServiceAccess
ReadS [PolicyGrantingServiceAccess]
(Int -> ReadS PolicyGrantingServiceAccess)
-> ReadS [PolicyGrantingServiceAccess]
-> ReadPrec PolicyGrantingServiceAccess
-> ReadPrec [PolicyGrantingServiceAccess]
-> Read PolicyGrantingServiceAccess
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyGrantingServiceAccess]
$creadListPrec :: ReadPrec [PolicyGrantingServiceAccess]
readPrec :: ReadPrec PolicyGrantingServiceAccess
$creadPrec :: ReadPrec PolicyGrantingServiceAccess
readList :: ReadS [PolicyGrantingServiceAccess]
$creadList :: ReadS [PolicyGrantingServiceAccess]
readsPrec :: Int -> ReadS PolicyGrantingServiceAccess
$creadsPrec :: Int -> ReadS PolicyGrantingServiceAccess
Prelude.Read, Int -> PolicyGrantingServiceAccess -> ShowS
[PolicyGrantingServiceAccess] -> ShowS
PolicyGrantingServiceAccess -> String
(Int -> PolicyGrantingServiceAccess -> ShowS)
-> (PolicyGrantingServiceAccess -> String)
-> ([PolicyGrantingServiceAccess] -> ShowS)
-> Show PolicyGrantingServiceAccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyGrantingServiceAccess] -> ShowS
$cshowList :: [PolicyGrantingServiceAccess] -> ShowS
show :: PolicyGrantingServiceAccess -> String
$cshow :: PolicyGrantingServiceAccess -> String
showsPrec :: Int -> PolicyGrantingServiceAccess -> ShowS
$cshowsPrec :: Int -> PolicyGrantingServiceAccess -> ShowS
Prelude.Show, (forall x.
PolicyGrantingServiceAccess -> Rep PolicyGrantingServiceAccess x)
-> (forall x.
Rep PolicyGrantingServiceAccess x -> PolicyGrantingServiceAccess)
-> Generic PolicyGrantingServiceAccess
forall x.
Rep PolicyGrantingServiceAccess x -> PolicyGrantingServiceAccess
forall x.
PolicyGrantingServiceAccess -> Rep PolicyGrantingServiceAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PolicyGrantingServiceAccess x -> PolicyGrantingServiceAccess
$cfrom :: forall x.
PolicyGrantingServiceAccess -> Rep PolicyGrantingServiceAccess x
Prelude.Generic)
newPolicyGrantingServiceAccess ::
Prelude.Text ->
PolicyType ->
PolicyGrantingServiceAccess
newPolicyGrantingServiceAccess :: Text -> PolicyType -> PolicyGrantingServiceAccess
newPolicyGrantingServiceAccess
Text
pPolicyName_
PolicyType
pPolicyType_ =
PolicyGrantingServiceAccess' :: Maybe Text
-> Maybe PolicyOwnerEntityType
-> Maybe Text
-> Text
-> PolicyType
-> PolicyGrantingServiceAccess
PolicyGrantingServiceAccess'
{ $sel:entityName:PolicyGrantingServiceAccess' :: Maybe Text
entityName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entityType:PolicyGrantingServiceAccess' :: Maybe PolicyOwnerEntityType
entityType = Maybe PolicyOwnerEntityType
forall a. Maybe a
Prelude.Nothing,
$sel:policyArn:PolicyGrantingServiceAccess' :: Maybe Text
policyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policyName:PolicyGrantingServiceAccess' :: Text
policyName = Text
pPolicyName_,
$sel:policyType:PolicyGrantingServiceAccess' :: PolicyType
policyType = PolicyType
pPolicyType_
}
policyGrantingServiceAccess_entityName :: Lens.Lens' PolicyGrantingServiceAccess (Prelude.Maybe Prelude.Text)
policyGrantingServiceAccess_entityName :: (Maybe Text -> f (Maybe Text))
-> PolicyGrantingServiceAccess -> f PolicyGrantingServiceAccess
policyGrantingServiceAccess_entityName = (PolicyGrantingServiceAccess -> Maybe Text)
-> (PolicyGrantingServiceAccess
-> Maybe Text -> PolicyGrantingServiceAccess)
-> Lens
PolicyGrantingServiceAccess
PolicyGrantingServiceAccess
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGrantingServiceAccess' {Maybe Text
entityName :: Maybe Text
$sel:entityName:PolicyGrantingServiceAccess' :: PolicyGrantingServiceAccess -> Maybe Text
entityName} -> Maybe Text
entityName) (\s :: PolicyGrantingServiceAccess
s@PolicyGrantingServiceAccess' {} Maybe Text
a -> PolicyGrantingServiceAccess
s {$sel:entityName:PolicyGrantingServiceAccess' :: Maybe Text
entityName = Maybe Text
a} :: PolicyGrantingServiceAccess)
policyGrantingServiceAccess_entityType :: Lens.Lens' PolicyGrantingServiceAccess (Prelude.Maybe PolicyOwnerEntityType)
policyGrantingServiceAccess_entityType :: (Maybe PolicyOwnerEntityType -> f (Maybe PolicyOwnerEntityType))
-> PolicyGrantingServiceAccess -> f PolicyGrantingServiceAccess
policyGrantingServiceAccess_entityType = (PolicyGrantingServiceAccess -> Maybe PolicyOwnerEntityType)
-> (PolicyGrantingServiceAccess
-> Maybe PolicyOwnerEntityType -> PolicyGrantingServiceAccess)
-> Lens
PolicyGrantingServiceAccess
PolicyGrantingServiceAccess
(Maybe PolicyOwnerEntityType)
(Maybe PolicyOwnerEntityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGrantingServiceAccess' {Maybe PolicyOwnerEntityType
entityType :: Maybe PolicyOwnerEntityType
$sel:entityType:PolicyGrantingServiceAccess' :: PolicyGrantingServiceAccess -> Maybe PolicyOwnerEntityType
entityType} -> Maybe PolicyOwnerEntityType
entityType) (\s :: PolicyGrantingServiceAccess
s@PolicyGrantingServiceAccess' {} Maybe PolicyOwnerEntityType
a -> PolicyGrantingServiceAccess
s {$sel:entityType:PolicyGrantingServiceAccess' :: Maybe PolicyOwnerEntityType
entityType = Maybe PolicyOwnerEntityType
a} :: PolicyGrantingServiceAccess)
policyGrantingServiceAccess_policyArn :: Lens.Lens' PolicyGrantingServiceAccess (Prelude.Maybe Prelude.Text)
policyGrantingServiceAccess_policyArn :: (Maybe Text -> f (Maybe Text))
-> PolicyGrantingServiceAccess -> f PolicyGrantingServiceAccess
policyGrantingServiceAccess_policyArn = (PolicyGrantingServiceAccess -> Maybe Text)
-> (PolicyGrantingServiceAccess
-> Maybe Text -> PolicyGrantingServiceAccess)
-> Lens
PolicyGrantingServiceAccess
PolicyGrantingServiceAccess
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGrantingServiceAccess' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:PolicyGrantingServiceAccess' :: PolicyGrantingServiceAccess -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: PolicyGrantingServiceAccess
s@PolicyGrantingServiceAccess' {} Maybe Text
a -> PolicyGrantingServiceAccess
s {$sel:policyArn:PolicyGrantingServiceAccess' :: Maybe Text
policyArn = Maybe Text
a} :: PolicyGrantingServiceAccess)
policyGrantingServiceAccess_policyName :: Lens.Lens' PolicyGrantingServiceAccess Prelude.Text
policyGrantingServiceAccess_policyName :: (Text -> f Text)
-> PolicyGrantingServiceAccess -> f PolicyGrantingServiceAccess
policyGrantingServiceAccess_policyName = (PolicyGrantingServiceAccess -> Text)
-> (PolicyGrantingServiceAccess
-> Text -> PolicyGrantingServiceAccess)
-> Lens
PolicyGrantingServiceAccess PolicyGrantingServiceAccess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGrantingServiceAccess' {Text
policyName :: Text
$sel:policyName:PolicyGrantingServiceAccess' :: PolicyGrantingServiceAccess -> Text
policyName} -> Text
policyName) (\s :: PolicyGrantingServiceAccess
s@PolicyGrantingServiceAccess' {} Text
a -> PolicyGrantingServiceAccess
s {$sel:policyName:PolicyGrantingServiceAccess' :: Text
policyName = Text
a} :: PolicyGrantingServiceAccess)
policyGrantingServiceAccess_policyType :: Lens.Lens' PolicyGrantingServiceAccess PolicyType
policyGrantingServiceAccess_policyType :: (PolicyType -> f PolicyType)
-> PolicyGrantingServiceAccess -> f PolicyGrantingServiceAccess
policyGrantingServiceAccess_policyType = (PolicyGrantingServiceAccess -> PolicyType)
-> (PolicyGrantingServiceAccess
-> PolicyType -> PolicyGrantingServiceAccess)
-> Lens
PolicyGrantingServiceAccess
PolicyGrantingServiceAccess
PolicyType
PolicyType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGrantingServiceAccess' {PolicyType
policyType :: PolicyType
$sel:policyType:PolicyGrantingServiceAccess' :: PolicyGrantingServiceAccess -> PolicyType
policyType} -> PolicyType
policyType) (\s :: PolicyGrantingServiceAccess
s@PolicyGrantingServiceAccess' {} PolicyType
a -> PolicyGrantingServiceAccess
s {$sel:policyType:PolicyGrantingServiceAccess' :: PolicyType
policyType = PolicyType
a} :: PolicyGrantingServiceAccess)
instance Core.FromXML PolicyGrantingServiceAccess where
parseXML :: [Node] -> Either String PolicyGrantingServiceAccess
parseXML [Node]
x =
Maybe Text
-> Maybe PolicyOwnerEntityType
-> Maybe Text
-> Text
-> PolicyType
-> PolicyGrantingServiceAccess
PolicyGrantingServiceAccess'
(Maybe Text
-> Maybe PolicyOwnerEntityType
-> Maybe Text
-> Text
-> PolicyType
-> PolicyGrantingServiceAccess)
-> Either String (Maybe Text)
-> Either
String
(Maybe PolicyOwnerEntityType
-> Maybe Text -> Text -> PolicyType -> PolicyGrantingServiceAccess)
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
"EntityName")
Either
String
(Maybe PolicyOwnerEntityType
-> Maybe Text -> Text -> PolicyType -> PolicyGrantingServiceAccess)
-> Either String (Maybe PolicyOwnerEntityType)
-> Either
String
(Maybe Text -> Text -> PolicyType -> PolicyGrantingServiceAccess)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe PolicyOwnerEntityType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EntityType")
Either
String
(Maybe Text -> Text -> PolicyType -> PolicyGrantingServiceAccess)
-> Either String (Maybe Text)
-> Either
String (Text -> PolicyType -> PolicyGrantingServiceAccess)
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
"PolicyArn")
Either String (Text -> PolicyType -> PolicyGrantingServiceAccess)
-> Either String Text
-> Either String (PolicyType -> PolicyGrantingServiceAccess)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"PolicyName")
Either String (PolicyType -> PolicyGrantingServiceAccess)
-> Either String PolicyType
-> Either String PolicyGrantingServiceAccess
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String PolicyType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"PolicyType")
instance Prelude.Hashable PolicyGrantingServiceAccess
instance Prelude.NFData PolicyGrantingServiceAccess