{-# 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.SecurityHub.Types.AwsIamGroupDetails
-- 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.SecurityHub.Types.AwsIamGroupDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsIamAttachedManagedPolicy
import Amazonka.SecurityHub.Types.AwsIamGroupPolicy

-- | Contains details about an IAM group.
--
-- /See:/ 'newAwsIamGroupDetails' smart constructor.
data AwsIamGroupDetails = AwsIamGroupDetails'
  { -- | The path to the group.
    AwsIamGroupDetails -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | Indicates when the IAM group was created.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsIamGroupDetails -> Maybe Text
createDate :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the IAM group.
    AwsIamGroupDetails -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
    -- | The list of inline policies that are embedded in the group.
    AwsIamGroupDetails -> Maybe [AwsIamGroupPolicy]
groupPolicyList :: Prelude.Maybe [AwsIamGroupPolicy],
    -- | The name of the IAM group.
    AwsIamGroupDetails -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | A list of the managed policies that are attached to the IAM group.
    AwsIamGroupDetails -> Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies :: Prelude.Maybe [AwsIamAttachedManagedPolicy]
  }
  deriving (AwsIamGroupDetails -> AwsIamGroupDetails -> Bool
(AwsIamGroupDetails -> AwsIamGroupDetails -> Bool)
-> (AwsIamGroupDetails -> AwsIamGroupDetails -> Bool)
-> Eq AwsIamGroupDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsIamGroupDetails -> AwsIamGroupDetails -> Bool
$c/= :: AwsIamGroupDetails -> AwsIamGroupDetails -> Bool
== :: AwsIamGroupDetails -> AwsIamGroupDetails -> Bool
$c== :: AwsIamGroupDetails -> AwsIamGroupDetails -> Bool
Prelude.Eq, ReadPrec [AwsIamGroupDetails]
ReadPrec AwsIamGroupDetails
Int -> ReadS AwsIamGroupDetails
ReadS [AwsIamGroupDetails]
(Int -> ReadS AwsIamGroupDetails)
-> ReadS [AwsIamGroupDetails]
-> ReadPrec AwsIamGroupDetails
-> ReadPrec [AwsIamGroupDetails]
-> Read AwsIamGroupDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsIamGroupDetails]
$creadListPrec :: ReadPrec [AwsIamGroupDetails]
readPrec :: ReadPrec AwsIamGroupDetails
$creadPrec :: ReadPrec AwsIamGroupDetails
readList :: ReadS [AwsIamGroupDetails]
$creadList :: ReadS [AwsIamGroupDetails]
readsPrec :: Int -> ReadS AwsIamGroupDetails
$creadsPrec :: Int -> ReadS AwsIamGroupDetails
Prelude.Read, Int -> AwsIamGroupDetails -> ShowS
[AwsIamGroupDetails] -> ShowS
AwsIamGroupDetails -> String
(Int -> AwsIamGroupDetails -> ShowS)
-> (AwsIamGroupDetails -> String)
-> ([AwsIamGroupDetails] -> ShowS)
-> Show AwsIamGroupDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsIamGroupDetails] -> ShowS
$cshowList :: [AwsIamGroupDetails] -> ShowS
show :: AwsIamGroupDetails -> String
$cshow :: AwsIamGroupDetails -> String
showsPrec :: Int -> AwsIamGroupDetails -> ShowS
$cshowsPrec :: Int -> AwsIamGroupDetails -> ShowS
Prelude.Show, (forall x. AwsIamGroupDetails -> Rep AwsIamGroupDetails x)
-> (forall x. Rep AwsIamGroupDetails x -> AwsIamGroupDetails)
-> Generic AwsIamGroupDetails
forall x. Rep AwsIamGroupDetails x -> AwsIamGroupDetails
forall x. AwsIamGroupDetails -> Rep AwsIamGroupDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsIamGroupDetails x -> AwsIamGroupDetails
$cfrom :: forall x. AwsIamGroupDetails -> Rep AwsIamGroupDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsIamGroupDetails' 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:
--
-- 'path', 'awsIamGroupDetails_path' - The path to the group.
--
-- 'createDate', 'awsIamGroupDetails_createDate' - Indicates when the IAM group was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'groupId', 'awsIamGroupDetails_groupId' - The identifier of the IAM group.
--
-- 'groupPolicyList', 'awsIamGroupDetails_groupPolicyList' - The list of inline policies that are embedded in the group.
--
-- 'groupName', 'awsIamGroupDetails_groupName' - The name of the IAM group.
--
-- 'attachedManagedPolicies', 'awsIamGroupDetails_attachedManagedPolicies' - A list of the managed policies that are attached to the IAM group.
newAwsIamGroupDetails ::
  AwsIamGroupDetails
newAwsIamGroupDetails :: AwsIamGroupDetails
newAwsIamGroupDetails =
  AwsIamGroupDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsIamGroupPolicy]
-> Maybe Text
-> Maybe [AwsIamAttachedManagedPolicy]
-> AwsIamGroupDetails
AwsIamGroupDetails'
    { $sel:path:AwsIamGroupDetails' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:AwsIamGroupDetails' :: Maybe Text
createDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupId:AwsIamGroupDetails' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupPolicyList:AwsIamGroupDetails' :: Maybe [AwsIamGroupPolicy]
groupPolicyList = Maybe [AwsIamGroupPolicy]
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:AwsIamGroupDetails' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachedManagedPolicies:AwsIamGroupDetails' :: Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies = Maybe [AwsIamAttachedManagedPolicy]
forall a. Maybe a
Prelude.Nothing
    }

-- | The path to the group.
awsIamGroupDetails_path :: Lens.Lens' AwsIamGroupDetails (Prelude.Maybe Prelude.Text)
awsIamGroupDetails_path :: (Maybe Text -> f (Maybe Text))
-> AwsIamGroupDetails -> f AwsIamGroupDetails
awsIamGroupDetails_path = (AwsIamGroupDetails -> Maybe Text)
-> (AwsIamGroupDetails -> Maybe Text -> AwsIamGroupDetails)
-> Lens
     AwsIamGroupDetails AwsIamGroupDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamGroupDetails' {Maybe Text
path :: Maybe Text
$sel:path:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
path} -> Maybe Text
path) (\s :: AwsIamGroupDetails
s@AwsIamGroupDetails' {} Maybe Text
a -> AwsIamGroupDetails
s {$sel:path:AwsIamGroupDetails' :: Maybe Text
path = Maybe Text
a} :: AwsIamGroupDetails)

-- | Indicates when the IAM group was created.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsIamGroupDetails_createDate :: Lens.Lens' AwsIamGroupDetails (Prelude.Maybe Prelude.Text)
awsIamGroupDetails_createDate :: (Maybe Text -> f (Maybe Text))
-> AwsIamGroupDetails -> f AwsIamGroupDetails
awsIamGroupDetails_createDate = (AwsIamGroupDetails -> Maybe Text)
-> (AwsIamGroupDetails -> Maybe Text -> AwsIamGroupDetails)
-> Lens
     AwsIamGroupDetails AwsIamGroupDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamGroupDetails' {Maybe Text
createDate :: Maybe Text
$sel:createDate:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
createDate} -> Maybe Text
createDate) (\s :: AwsIamGroupDetails
s@AwsIamGroupDetails' {} Maybe Text
a -> AwsIamGroupDetails
s {$sel:createDate:AwsIamGroupDetails' :: Maybe Text
createDate = Maybe Text
a} :: AwsIamGroupDetails)

-- | The identifier of the IAM group.
awsIamGroupDetails_groupId :: Lens.Lens' AwsIamGroupDetails (Prelude.Maybe Prelude.Text)
awsIamGroupDetails_groupId :: (Maybe Text -> f (Maybe Text))
-> AwsIamGroupDetails -> f AwsIamGroupDetails
awsIamGroupDetails_groupId = (AwsIamGroupDetails -> Maybe Text)
-> (AwsIamGroupDetails -> Maybe Text -> AwsIamGroupDetails)
-> Lens
     AwsIamGroupDetails AwsIamGroupDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamGroupDetails' {Maybe Text
groupId :: Maybe Text
$sel:groupId:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: AwsIamGroupDetails
s@AwsIamGroupDetails' {} Maybe Text
a -> AwsIamGroupDetails
s {$sel:groupId:AwsIamGroupDetails' :: Maybe Text
groupId = Maybe Text
a} :: AwsIamGroupDetails)

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

-- | The name of the IAM group.
awsIamGroupDetails_groupName :: Lens.Lens' AwsIamGroupDetails (Prelude.Maybe Prelude.Text)
awsIamGroupDetails_groupName :: (Maybe Text -> f (Maybe Text))
-> AwsIamGroupDetails -> f AwsIamGroupDetails
awsIamGroupDetails_groupName = (AwsIamGroupDetails -> Maybe Text)
-> (AwsIamGroupDetails -> Maybe Text -> AwsIamGroupDetails)
-> Lens
     AwsIamGroupDetails AwsIamGroupDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamGroupDetails' {Maybe Text
groupName :: Maybe Text
$sel:groupName:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: AwsIamGroupDetails
s@AwsIamGroupDetails' {} Maybe Text
a -> AwsIamGroupDetails
s {$sel:groupName:AwsIamGroupDetails' :: Maybe Text
groupName = Maybe Text
a} :: AwsIamGroupDetails)

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

instance Core.FromJSON AwsIamGroupDetails where
  parseJSON :: Value -> Parser AwsIamGroupDetails
parseJSON =
    String
-> (Object -> Parser AwsIamGroupDetails)
-> Value
-> Parser AwsIamGroupDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsIamGroupDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsIamGroupPolicy]
-> Maybe Text
-> Maybe [AwsIamAttachedManagedPolicy]
-> AwsIamGroupDetails
AwsIamGroupDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [AwsIamGroupPolicy]
 -> Maybe Text
 -> Maybe [AwsIamAttachedManagedPolicy]
 -> AwsIamGroupDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [AwsIamGroupPolicy]
      -> Maybe Text
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamGroupDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Path")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [AwsIamGroupPolicy]
   -> Maybe Text
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamGroupDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [AwsIamGroupPolicy]
      -> Maybe Text
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamGroupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateDate")
            Parser
  (Maybe Text
   -> Maybe [AwsIamGroupPolicy]
   -> Maybe Text
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamGroupDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AwsIamGroupPolicy]
      -> Maybe Text
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamGroupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupId")
            Parser
  (Maybe [AwsIamGroupPolicy]
   -> Maybe Text
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamGroupDetails)
-> Parser (Maybe [AwsIamGroupPolicy])
-> Parser
     (Maybe Text
      -> Maybe [AwsIamAttachedManagedPolicy] -> AwsIamGroupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [AwsIamGroupPolicy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupPolicyList"
                            Parser (Maybe (Maybe [AwsIamGroupPolicy]))
-> Maybe [AwsIamGroupPolicy] -> Parser (Maybe [AwsIamGroupPolicy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsIamGroupPolicy]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe [AwsIamAttachedManagedPolicy] -> AwsIamGroupDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AwsIamAttachedManagedPolicy] -> AwsIamGroupDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupName")
            Parser (Maybe [AwsIamAttachedManagedPolicy] -> AwsIamGroupDetails)
-> Parser (Maybe [AwsIamAttachedManagedPolicy])
-> Parser AwsIamGroupDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [AwsIamAttachedManagedPolicy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AttachedManagedPolicies"
                            Parser (Maybe (Maybe [AwsIamAttachedManagedPolicy]))
-> Maybe [AwsIamAttachedManagedPolicy]
-> Parser (Maybe [AwsIamAttachedManagedPolicy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsIamAttachedManagedPolicy]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable AwsIamGroupDetails

instance Prelude.NFData AwsIamGroupDetails

instance Core.ToJSON AwsIamGroupDetails where
  toJSON :: AwsIamGroupDetails -> Value
toJSON AwsIamGroupDetails' {Maybe [AwsIamAttachedManagedPolicy]
Maybe [AwsIamGroupPolicy]
Maybe Text
attachedManagedPolicies :: Maybe [AwsIamAttachedManagedPolicy]
groupName :: Maybe Text
groupPolicyList :: Maybe [AwsIamGroupPolicy]
groupId :: Maybe Text
createDate :: Maybe Text
path :: Maybe Text
$sel:attachedManagedPolicies:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe [AwsIamAttachedManagedPolicy]
$sel:groupName:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
$sel:groupPolicyList:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe [AwsIamGroupPolicy]
$sel:groupId:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
$sel:createDate:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
$sel:path:AwsIamGroupDetails' :: AwsIamGroupDetails -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Path" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
path,
            (Text
"CreateDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
createDate,
            (Text
"GroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupId,
            (Text
"GroupPolicyList" Text -> [AwsIamGroupPolicy] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsIamGroupPolicy] -> Pair)
-> Maybe [AwsIamGroupPolicy] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsIamGroupPolicy]
groupPolicyList,
            (Text
"GroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupName,
            (Text
"AttachedManagedPolicies" Text -> [AwsIamAttachedManagedPolicy] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsIamAttachedManagedPolicy] -> Pair)
-> Maybe [AwsIamAttachedManagedPolicy] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies
          ]
      )