{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IAM.Types.GroupDetail
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IAM.Types.GroupDetail where

import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.AttachedPolicy
import Amazonka.IAM.Types.PolicyDetail
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about an IAM group, including all of the group\'s
-- policies.
--
-- This data type is used as a response element in the
-- GetAccountAuthorizationDetails operation.
--
-- /See:/ 'newGroupDetail' smart constructor.
data GroupDetail = GroupDetail'
  { GroupDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The path to the group. For more information about paths, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
    -- in the /IAM User Guide/.
    GroupDetail -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | The date and time, in
    -- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
    -- group was created.
    GroupDetail -> Maybe ISO8601
createDate :: Prelude.Maybe Core.ISO8601,
    -- | The stable and unique string identifying the group. For more information
    -- about IDs, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
    -- in the /IAM User Guide/.
    GroupDetail -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
    -- | A list of the inline policies embedded in the group.
    GroupDetail -> Maybe [PolicyDetail]
groupPolicyList :: Prelude.Maybe [PolicyDetail],
    -- | The friendly name that identifies the group.
    GroupDetail -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | A list of the managed policies attached to the group.
    GroupDetail -> Maybe [AttachedPolicy]
attachedManagedPolicies :: Prelude.Maybe [AttachedPolicy]
  }
  deriving (GroupDetail -> GroupDetail -> Bool
(GroupDetail -> GroupDetail -> Bool)
-> (GroupDetail -> GroupDetail -> Bool) -> Eq GroupDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupDetail -> GroupDetail -> Bool
$c/= :: GroupDetail -> GroupDetail -> Bool
== :: GroupDetail -> GroupDetail -> Bool
$c== :: GroupDetail -> GroupDetail -> Bool
Prelude.Eq, ReadPrec [GroupDetail]
ReadPrec GroupDetail
Int -> ReadS GroupDetail
ReadS [GroupDetail]
(Int -> ReadS GroupDetail)
-> ReadS [GroupDetail]
-> ReadPrec GroupDetail
-> ReadPrec [GroupDetail]
-> Read GroupDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupDetail]
$creadListPrec :: ReadPrec [GroupDetail]
readPrec :: ReadPrec GroupDetail
$creadPrec :: ReadPrec GroupDetail
readList :: ReadS [GroupDetail]
$creadList :: ReadS [GroupDetail]
readsPrec :: Int -> ReadS GroupDetail
$creadsPrec :: Int -> ReadS GroupDetail
Prelude.Read, Int -> GroupDetail -> ShowS
[GroupDetail] -> ShowS
GroupDetail -> String
(Int -> GroupDetail -> ShowS)
-> (GroupDetail -> String)
-> ([GroupDetail] -> ShowS)
-> Show GroupDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupDetail] -> ShowS
$cshowList :: [GroupDetail] -> ShowS
show :: GroupDetail -> String
$cshow :: GroupDetail -> String
showsPrec :: Int -> GroupDetail -> ShowS
$cshowsPrec :: Int -> GroupDetail -> ShowS
Prelude.Show, (forall x. GroupDetail -> Rep GroupDetail x)
-> (forall x. Rep GroupDetail x -> GroupDetail)
-> Generic GroupDetail
forall x. Rep GroupDetail x -> GroupDetail
forall x. GroupDetail -> Rep GroupDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupDetail x -> GroupDetail
$cfrom :: forall x. GroupDetail -> Rep GroupDetail x
Prelude.Generic)

-- |
-- Create a value of 'GroupDetail' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'arn', 'groupDetail_arn' - Undocumented member.
--
-- 'path', 'groupDetail_path' - The path to the group. For more information about paths, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
--
-- 'createDate', 'groupDetail_createDate' - The date and time, in
-- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- group was created.
--
-- 'groupId', 'groupDetail_groupId' - The stable and unique string identifying the group. For more information
-- about IDs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
--
-- 'groupPolicyList', 'groupDetail_groupPolicyList' - A list of the inline policies embedded in the group.
--
-- 'groupName', 'groupDetail_groupName' - The friendly name that identifies the group.
--
-- 'attachedManagedPolicies', 'groupDetail_attachedManagedPolicies' - A list of the managed policies attached to the group.
newGroupDetail ::
  GroupDetail
newGroupDetail :: GroupDetail
newGroupDetail =
  GroupDetail' :: Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe [PolicyDetail]
-> Maybe Text
-> Maybe [AttachedPolicy]
-> GroupDetail
GroupDetail'
    { $sel:arn:GroupDetail' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:path:GroupDetail' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:GroupDetail' :: Maybe ISO8601
createDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:groupId:GroupDetail' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupPolicyList:GroupDetail' :: Maybe [PolicyDetail]
groupPolicyList = Maybe [PolicyDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:GroupDetail' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachedManagedPolicies:GroupDetail' :: Maybe [AttachedPolicy]
attachedManagedPolicies = Maybe [AttachedPolicy]
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
groupDetail_arn :: Lens.Lens' GroupDetail (Prelude.Maybe Prelude.Text)
groupDetail_arn :: (Maybe Text -> f (Maybe Text)) -> GroupDetail -> f GroupDetail
groupDetail_arn = (GroupDetail -> Maybe Text)
-> (GroupDetail -> Maybe Text -> GroupDetail)
-> Lens GroupDetail GroupDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupDetail' {Maybe Text
arn :: Maybe Text
$sel:arn:GroupDetail' :: GroupDetail -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GroupDetail
s@GroupDetail' {} Maybe Text
a -> GroupDetail
s {$sel:arn:GroupDetail' :: Maybe Text
arn = Maybe Text
a} :: GroupDetail)

-- | The path to the group. For more information about paths, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
groupDetail_path :: Lens.Lens' GroupDetail (Prelude.Maybe Prelude.Text)
groupDetail_path :: (Maybe Text -> f (Maybe Text)) -> GroupDetail -> f GroupDetail
groupDetail_path = (GroupDetail -> Maybe Text)
-> (GroupDetail -> Maybe Text -> GroupDetail)
-> Lens GroupDetail GroupDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupDetail' {Maybe Text
path :: Maybe Text
$sel:path:GroupDetail' :: GroupDetail -> Maybe Text
path} -> Maybe Text
path) (\s :: GroupDetail
s@GroupDetail' {} Maybe Text
a -> GroupDetail
s {$sel:path:GroupDetail' :: Maybe Text
path = Maybe Text
a} :: GroupDetail)

-- | The date and time, in
-- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- group was created.
groupDetail_createDate :: Lens.Lens' GroupDetail (Prelude.Maybe Prelude.UTCTime)
groupDetail_createDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GroupDetail -> f GroupDetail
groupDetail_createDate = (GroupDetail -> Maybe ISO8601)
-> (GroupDetail -> Maybe ISO8601 -> GroupDetail)
-> Lens GroupDetail GroupDetail (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupDetail' {Maybe ISO8601
createDate :: Maybe ISO8601
$sel:createDate:GroupDetail' :: GroupDetail -> Maybe ISO8601
createDate} -> Maybe ISO8601
createDate) (\s :: GroupDetail
s@GroupDetail' {} Maybe ISO8601
a -> GroupDetail
s {$sel:createDate:GroupDetail' :: Maybe ISO8601
createDate = Maybe ISO8601
a} :: GroupDetail) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> GroupDetail -> f GroupDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GroupDetail
-> f GroupDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The stable and unique string identifying the group. For more information
-- about IDs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
groupDetail_groupId :: Lens.Lens' GroupDetail (Prelude.Maybe Prelude.Text)
groupDetail_groupId :: (Maybe Text -> f (Maybe Text)) -> GroupDetail -> f GroupDetail
groupDetail_groupId = (GroupDetail -> Maybe Text)
-> (GroupDetail -> Maybe Text -> GroupDetail)
-> Lens GroupDetail GroupDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupDetail' {Maybe Text
groupId :: Maybe Text
$sel:groupId:GroupDetail' :: GroupDetail -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: GroupDetail
s@GroupDetail' {} Maybe Text
a -> GroupDetail
s {$sel:groupId:GroupDetail' :: Maybe Text
groupId = Maybe Text
a} :: GroupDetail)

-- | A list of the inline policies embedded in the group.
groupDetail_groupPolicyList :: Lens.Lens' GroupDetail (Prelude.Maybe [PolicyDetail])
groupDetail_groupPolicyList :: (Maybe [PolicyDetail] -> f (Maybe [PolicyDetail]))
-> GroupDetail -> f GroupDetail
groupDetail_groupPolicyList = (GroupDetail -> Maybe [PolicyDetail])
-> (GroupDetail -> Maybe [PolicyDetail] -> GroupDetail)
-> Lens
     GroupDetail
     GroupDetail
     (Maybe [PolicyDetail])
     (Maybe [PolicyDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupDetail' {Maybe [PolicyDetail]
groupPolicyList :: Maybe [PolicyDetail]
$sel:groupPolicyList:GroupDetail' :: GroupDetail -> Maybe [PolicyDetail]
groupPolicyList} -> Maybe [PolicyDetail]
groupPolicyList) (\s :: GroupDetail
s@GroupDetail' {} Maybe [PolicyDetail]
a -> GroupDetail
s {$sel:groupPolicyList:GroupDetail' :: Maybe [PolicyDetail]
groupPolicyList = Maybe [PolicyDetail]
a} :: GroupDetail) ((Maybe [PolicyDetail] -> f (Maybe [PolicyDetail]))
 -> GroupDetail -> f GroupDetail)
-> ((Maybe [PolicyDetail] -> f (Maybe [PolicyDetail]))
    -> Maybe [PolicyDetail] -> f (Maybe [PolicyDetail]))
-> (Maybe [PolicyDetail] -> f (Maybe [PolicyDetail]))
-> GroupDetail
-> f GroupDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [PolicyDetail] [PolicyDetail] [PolicyDetail] [PolicyDetail]
-> Iso
     (Maybe [PolicyDetail])
     (Maybe [PolicyDetail])
     (Maybe [PolicyDetail])
     (Maybe [PolicyDetail])
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 [PolicyDetail] [PolicyDetail] [PolicyDetail] [PolicyDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The friendly name that identifies the group.
groupDetail_groupName :: Lens.Lens' GroupDetail (Prelude.Maybe Prelude.Text)
groupDetail_groupName :: (Maybe Text -> f (Maybe Text)) -> GroupDetail -> f GroupDetail
groupDetail_groupName = (GroupDetail -> Maybe Text)
-> (GroupDetail -> Maybe Text -> GroupDetail)
-> Lens GroupDetail GroupDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupDetail' {Maybe Text
groupName :: Maybe Text
$sel:groupName:GroupDetail' :: GroupDetail -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: GroupDetail
s@GroupDetail' {} Maybe Text
a -> GroupDetail
s {$sel:groupName:GroupDetail' :: Maybe Text
groupName = Maybe Text
a} :: GroupDetail)

-- | A list of the managed policies attached to the group.
groupDetail_attachedManagedPolicies :: Lens.Lens' GroupDetail (Prelude.Maybe [AttachedPolicy])
groupDetail_attachedManagedPolicies :: (Maybe [AttachedPolicy] -> f (Maybe [AttachedPolicy]))
-> GroupDetail -> f GroupDetail
groupDetail_attachedManagedPolicies = (GroupDetail -> Maybe [AttachedPolicy])
-> (GroupDetail -> Maybe [AttachedPolicy] -> GroupDetail)
-> Lens
     GroupDetail
     GroupDetail
     (Maybe [AttachedPolicy])
     (Maybe [AttachedPolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupDetail' {Maybe [AttachedPolicy]
attachedManagedPolicies :: Maybe [AttachedPolicy]
$sel:attachedManagedPolicies:GroupDetail' :: GroupDetail -> Maybe [AttachedPolicy]
attachedManagedPolicies} -> Maybe [AttachedPolicy]
attachedManagedPolicies) (\s :: GroupDetail
s@GroupDetail' {} Maybe [AttachedPolicy]
a -> GroupDetail
s {$sel:attachedManagedPolicies:GroupDetail' :: Maybe [AttachedPolicy]
attachedManagedPolicies = Maybe [AttachedPolicy]
a} :: GroupDetail) ((Maybe [AttachedPolicy] -> f (Maybe [AttachedPolicy]))
 -> GroupDetail -> f GroupDetail)
-> ((Maybe [AttachedPolicy] -> f (Maybe [AttachedPolicy]))
    -> Maybe [AttachedPolicy] -> f (Maybe [AttachedPolicy]))
-> (Maybe [AttachedPolicy] -> f (Maybe [AttachedPolicy]))
-> GroupDetail
-> f GroupDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttachedPolicy] [AttachedPolicy] [AttachedPolicy] [AttachedPolicy]
-> Iso
     (Maybe [AttachedPolicy])
     (Maybe [AttachedPolicy])
     (Maybe [AttachedPolicy])
     (Maybe [AttachedPolicy])
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
  [AttachedPolicy] [AttachedPolicy] [AttachedPolicy] [AttachedPolicy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromXML GroupDetail where
  parseXML :: [Node] -> Either String GroupDetail
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe [PolicyDetail]
-> Maybe Text
-> Maybe [AttachedPolicy]
-> GroupDetail
GroupDetail'
      (Maybe Text
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe [PolicyDetail]
 -> Maybe Text
 -> Maybe [AttachedPolicy]
 -> GroupDetail)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe [PolicyDetail]
      -> Maybe Text
      -> Maybe [AttachedPolicy]
      -> GroupDetail)
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
"Arn")
      Either
  String
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe [PolicyDetail]
   -> Maybe Text
   -> Maybe [AttachedPolicy]
   -> GroupDetail)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe [PolicyDetail]
      -> Maybe Text
      -> Maybe [AttachedPolicy]
      -> GroupDetail)
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
"Path")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe [PolicyDetail]
   -> Maybe Text
   -> Maybe [AttachedPolicy]
   -> GroupDetail)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe [PolicyDetail]
      -> Maybe Text
      -> Maybe [AttachedPolicy]
      -> GroupDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CreateDate")
      Either
  String
  (Maybe Text
   -> Maybe [PolicyDetail]
   -> Maybe Text
   -> Maybe [AttachedPolicy]
   -> GroupDetail)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [PolicyDetail]
      -> Maybe Text -> Maybe [AttachedPolicy] -> GroupDetail)
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
"GroupId")
      Either
  String
  (Maybe [PolicyDetail]
   -> Maybe Text -> Maybe [AttachedPolicy] -> GroupDetail)
-> Either String (Maybe [PolicyDetail])
-> Either
     String (Maybe Text -> Maybe [AttachedPolicy] -> GroupDetail)
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
"GroupPolicyList" 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 [PolicyDetail]))
-> Either String (Maybe [PolicyDetail])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PolicyDetail])
-> [Node] -> Either String (Maybe [PolicyDetail])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [PolicyDetail]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either String (Maybe Text -> Maybe [AttachedPolicy] -> GroupDetail)
-> Either String (Maybe Text)
-> Either String (Maybe [AttachedPolicy] -> GroupDetail)
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
"GroupName")
      Either String (Maybe [AttachedPolicy] -> GroupDetail)
-> Either String (Maybe [AttachedPolicy])
-> Either String GroupDetail
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
"AttachedManagedPolicies"
                      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 [AttachedPolicy]))
-> Either String (Maybe [AttachedPolicy])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [AttachedPolicy])
-> [Node] -> Either String (Maybe [AttachedPolicy])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [AttachedPolicy]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )

instance Prelude.Hashable GroupDetail

instance Prelude.NFData GroupDetail