{-# 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.ListPoliciesGrantingServiceAccessEntry where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.PolicyGrantingServiceAccess
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ListPoliciesGrantingServiceAccessEntry = ListPoliciesGrantingServiceAccessEntry'
{
ListPoliciesGrantingServiceAccessEntry -> Maybe Text
serviceNamespace :: Prelude.Maybe Prelude.Text,
ListPoliciesGrantingServiceAccessEntry
-> Maybe [PolicyGrantingServiceAccess]
policies :: Prelude.Maybe [PolicyGrantingServiceAccess]
}
deriving (ListPoliciesGrantingServiceAccessEntry
-> ListPoliciesGrantingServiceAccessEntry -> Bool
(ListPoliciesGrantingServiceAccessEntry
-> ListPoliciesGrantingServiceAccessEntry -> Bool)
-> (ListPoliciesGrantingServiceAccessEntry
-> ListPoliciesGrantingServiceAccessEntry -> Bool)
-> Eq ListPoliciesGrantingServiceAccessEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPoliciesGrantingServiceAccessEntry
-> ListPoliciesGrantingServiceAccessEntry -> Bool
$c/= :: ListPoliciesGrantingServiceAccessEntry
-> ListPoliciesGrantingServiceAccessEntry -> Bool
== :: ListPoliciesGrantingServiceAccessEntry
-> ListPoliciesGrantingServiceAccessEntry -> Bool
$c== :: ListPoliciesGrantingServiceAccessEntry
-> ListPoliciesGrantingServiceAccessEntry -> Bool
Prelude.Eq, ReadPrec [ListPoliciesGrantingServiceAccessEntry]
ReadPrec ListPoliciesGrantingServiceAccessEntry
Int -> ReadS ListPoliciesGrantingServiceAccessEntry
ReadS [ListPoliciesGrantingServiceAccessEntry]
(Int -> ReadS ListPoliciesGrantingServiceAccessEntry)
-> ReadS [ListPoliciesGrantingServiceAccessEntry]
-> ReadPrec ListPoliciesGrantingServiceAccessEntry
-> ReadPrec [ListPoliciesGrantingServiceAccessEntry]
-> Read ListPoliciesGrantingServiceAccessEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPoliciesGrantingServiceAccessEntry]
$creadListPrec :: ReadPrec [ListPoliciesGrantingServiceAccessEntry]
readPrec :: ReadPrec ListPoliciesGrantingServiceAccessEntry
$creadPrec :: ReadPrec ListPoliciesGrantingServiceAccessEntry
readList :: ReadS [ListPoliciesGrantingServiceAccessEntry]
$creadList :: ReadS [ListPoliciesGrantingServiceAccessEntry]
readsPrec :: Int -> ReadS ListPoliciesGrantingServiceAccessEntry
$creadsPrec :: Int -> ReadS ListPoliciesGrantingServiceAccessEntry
Prelude.Read, Int -> ListPoliciesGrantingServiceAccessEntry -> ShowS
[ListPoliciesGrantingServiceAccessEntry] -> ShowS
ListPoliciesGrantingServiceAccessEntry -> String
(Int -> ListPoliciesGrantingServiceAccessEntry -> ShowS)
-> (ListPoliciesGrantingServiceAccessEntry -> String)
-> ([ListPoliciesGrantingServiceAccessEntry] -> ShowS)
-> Show ListPoliciesGrantingServiceAccessEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPoliciesGrantingServiceAccessEntry] -> ShowS
$cshowList :: [ListPoliciesGrantingServiceAccessEntry] -> ShowS
show :: ListPoliciesGrantingServiceAccessEntry -> String
$cshow :: ListPoliciesGrantingServiceAccessEntry -> String
showsPrec :: Int -> ListPoliciesGrantingServiceAccessEntry -> ShowS
$cshowsPrec :: Int -> ListPoliciesGrantingServiceAccessEntry -> ShowS
Prelude.Show, (forall x.
ListPoliciesGrantingServiceAccessEntry
-> Rep ListPoliciesGrantingServiceAccessEntry x)
-> (forall x.
Rep ListPoliciesGrantingServiceAccessEntry x
-> ListPoliciesGrantingServiceAccessEntry)
-> Generic ListPoliciesGrantingServiceAccessEntry
forall x.
Rep ListPoliciesGrantingServiceAccessEntry x
-> ListPoliciesGrantingServiceAccessEntry
forall x.
ListPoliciesGrantingServiceAccessEntry
-> Rep ListPoliciesGrantingServiceAccessEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPoliciesGrantingServiceAccessEntry x
-> ListPoliciesGrantingServiceAccessEntry
$cfrom :: forall x.
ListPoliciesGrantingServiceAccessEntry
-> Rep ListPoliciesGrantingServiceAccessEntry x
Prelude.Generic)
newListPoliciesGrantingServiceAccessEntry ::
ListPoliciesGrantingServiceAccessEntry
newListPoliciesGrantingServiceAccessEntry :: ListPoliciesGrantingServiceAccessEntry
newListPoliciesGrantingServiceAccessEntry =
ListPoliciesGrantingServiceAccessEntry' :: Maybe Text
-> Maybe [PolicyGrantingServiceAccess]
-> ListPoliciesGrantingServiceAccessEntry
ListPoliciesGrantingServiceAccessEntry'
{ $sel:serviceNamespace:ListPoliciesGrantingServiceAccessEntry' :: Maybe Text
serviceNamespace =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policies:ListPoliciesGrantingServiceAccessEntry' :: Maybe [PolicyGrantingServiceAccess]
policies = Maybe [PolicyGrantingServiceAccess]
forall a. Maybe a
Prelude.Nothing
}
listPoliciesGrantingServiceAccessEntry_serviceNamespace :: Lens.Lens' ListPoliciesGrantingServiceAccessEntry (Prelude.Maybe Prelude.Text)
listPoliciesGrantingServiceAccessEntry_serviceNamespace :: (Maybe Text -> f (Maybe Text))
-> ListPoliciesGrantingServiceAccessEntry
-> f ListPoliciesGrantingServiceAccessEntry
listPoliciesGrantingServiceAccessEntry_serviceNamespace = (ListPoliciesGrantingServiceAccessEntry -> Maybe Text)
-> (ListPoliciesGrantingServiceAccessEntry
-> Maybe Text -> ListPoliciesGrantingServiceAccessEntry)
-> Lens
ListPoliciesGrantingServiceAccessEntry
ListPoliciesGrantingServiceAccessEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesGrantingServiceAccessEntry' {Maybe Text
serviceNamespace :: Maybe Text
$sel:serviceNamespace:ListPoliciesGrantingServiceAccessEntry' :: ListPoliciesGrantingServiceAccessEntry -> Maybe Text
serviceNamespace} -> Maybe Text
serviceNamespace) (\s :: ListPoliciesGrantingServiceAccessEntry
s@ListPoliciesGrantingServiceAccessEntry' {} Maybe Text
a -> ListPoliciesGrantingServiceAccessEntry
s {$sel:serviceNamespace:ListPoliciesGrantingServiceAccessEntry' :: Maybe Text
serviceNamespace = Maybe Text
a} :: ListPoliciesGrantingServiceAccessEntry)
listPoliciesGrantingServiceAccessEntry_policies :: Lens.Lens' ListPoliciesGrantingServiceAccessEntry (Prelude.Maybe [PolicyGrantingServiceAccess])
listPoliciesGrantingServiceAccessEntry_policies :: (Maybe [PolicyGrantingServiceAccess]
-> f (Maybe [PolicyGrantingServiceAccess]))
-> ListPoliciesGrantingServiceAccessEntry
-> f ListPoliciesGrantingServiceAccessEntry
listPoliciesGrantingServiceAccessEntry_policies = (ListPoliciesGrantingServiceAccessEntry
-> Maybe [PolicyGrantingServiceAccess])
-> (ListPoliciesGrantingServiceAccessEntry
-> Maybe [PolicyGrantingServiceAccess]
-> ListPoliciesGrantingServiceAccessEntry)
-> Lens
ListPoliciesGrantingServiceAccessEntry
ListPoliciesGrantingServiceAccessEntry
(Maybe [PolicyGrantingServiceAccess])
(Maybe [PolicyGrantingServiceAccess])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPoliciesGrantingServiceAccessEntry' {Maybe [PolicyGrantingServiceAccess]
policies :: Maybe [PolicyGrantingServiceAccess]
$sel:policies:ListPoliciesGrantingServiceAccessEntry' :: ListPoliciesGrantingServiceAccessEntry
-> Maybe [PolicyGrantingServiceAccess]
policies} -> Maybe [PolicyGrantingServiceAccess]
policies) (\s :: ListPoliciesGrantingServiceAccessEntry
s@ListPoliciesGrantingServiceAccessEntry' {} Maybe [PolicyGrantingServiceAccess]
a -> ListPoliciesGrantingServiceAccessEntry
s {$sel:policies:ListPoliciesGrantingServiceAccessEntry' :: Maybe [PolicyGrantingServiceAccess]
policies = Maybe [PolicyGrantingServiceAccess]
a} :: ListPoliciesGrantingServiceAccessEntry) ((Maybe [PolicyGrantingServiceAccess]
-> f (Maybe [PolicyGrantingServiceAccess]))
-> ListPoliciesGrantingServiceAccessEntry
-> f ListPoliciesGrantingServiceAccessEntry)
-> ((Maybe [PolicyGrantingServiceAccess]
-> f (Maybe [PolicyGrantingServiceAccess]))
-> Maybe [PolicyGrantingServiceAccess]
-> f (Maybe [PolicyGrantingServiceAccess]))
-> (Maybe [PolicyGrantingServiceAccess]
-> f (Maybe [PolicyGrantingServiceAccess]))
-> ListPoliciesGrantingServiceAccessEntry
-> f ListPoliciesGrantingServiceAccessEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PolicyGrantingServiceAccess]
[PolicyGrantingServiceAccess]
[PolicyGrantingServiceAccess]
[PolicyGrantingServiceAccess]
-> Iso
(Maybe [PolicyGrantingServiceAccess])
(Maybe [PolicyGrantingServiceAccess])
(Maybe [PolicyGrantingServiceAccess])
(Maybe [PolicyGrantingServiceAccess])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[PolicyGrantingServiceAccess]
[PolicyGrantingServiceAccess]
[PolicyGrantingServiceAccess]
[PolicyGrantingServiceAccess]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Core.FromXML
ListPoliciesGrantingServiceAccessEntry
where
parseXML :: [Node] -> Either String ListPoliciesGrantingServiceAccessEntry
parseXML [Node]
x =
Maybe Text
-> Maybe [PolicyGrantingServiceAccess]
-> ListPoliciesGrantingServiceAccessEntry
ListPoliciesGrantingServiceAccessEntry'
(Maybe Text
-> Maybe [PolicyGrantingServiceAccess]
-> ListPoliciesGrantingServiceAccessEntry)
-> Either String (Maybe Text)
-> Either
String
(Maybe [PolicyGrantingServiceAccess]
-> ListPoliciesGrantingServiceAccessEntry)
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
"ServiceNamespace")
Either
String
(Maybe [PolicyGrantingServiceAccess]
-> ListPoliciesGrantingServiceAccessEntry)
-> Either String (Maybe [PolicyGrantingServiceAccess])
-> Either String ListPoliciesGrantingServiceAccessEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Policies" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [PolicyGrantingServiceAccess]))
-> Either String (Maybe [PolicyGrantingServiceAccess])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PolicyGrantingServiceAccess])
-> [Node] -> Either String (Maybe [PolicyGrantingServiceAccess])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [PolicyGrantingServiceAccess]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
instance
Prelude.Hashable
ListPoliciesGrantingServiceAccessEntry
instance
Prelude.NFData
ListPoliciesGrantingServiceAccessEntry