{-# 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.AwsIamUserDetails
-- 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.AwsIamUserDetails 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.AwsIamPermissionsBoundary
import Amazonka.SecurityHub.Types.AwsIamUserPolicy

-- | Information about an IAM user.
--
-- /See:/ 'newAwsIamUserDetails' smart constructor.
data AwsIamUserDetails = AwsIamUserDetails'
  { -- | A list of IAM groups that the user belongs to.
    AwsIamUserDetails -> Maybe [Text]
groupList :: Prelude.Maybe [Prelude.Text],
    -- | The path to the user.
    AwsIamUserDetails -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | Indicates when the user 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@.
    AwsIamUserDetails -> Maybe Text
createDate :: Prelude.Maybe Prelude.Text,
    -- | The name of the user.
    AwsIamUserDetails -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the user.
    AwsIamUserDetails -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
    -- | The permissions boundary for the user.
    AwsIamUserDetails -> Maybe AwsIamPermissionsBoundary
permissionsBoundary :: Prelude.Maybe AwsIamPermissionsBoundary,
    -- | The list of inline policies that are embedded in the user.
    AwsIamUserDetails -> Maybe [AwsIamUserPolicy]
userPolicyList :: Prelude.Maybe [AwsIamUserPolicy],
    -- | A list of the managed policies that are attached to the user.
    AwsIamUserDetails -> Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies :: Prelude.Maybe [AwsIamAttachedManagedPolicy]
  }
  deriving (AwsIamUserDetails -> AwsIamUserDetails -> Bool
(AwsIamUserDetails -> AwsIamUserDetails -> Bool)
-> (AwsIamUserDetails -> AwsIamUserDetails -> Bool)
-> Eq AwsIamUserDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsIamUserDetails -> AwsIamUserDetails -> Bool
$c/= :: AwsIamUserDetails -> AwsIamUserDetails -> Bool
== :: AwsIamUserDetails -> AwsIamUserDetails -> Bool
$c== :: AwsIamUserDetails -> AwsIamUserDetails -> Bool
Prelude.Eq, ReadPrec [AwsIamUserDetails]
ReadPrec AwsIamUserDetails
Int -> ReadS AwsIamUserDetails
ReadS [AwsIamUserDetails]
(Int -> ReadS AwsIamUserDetails)
-> ReadS [AwsIamUserDetails]
-> ReadPrec AwsIamUserDetails
-> ReadPrec [AwsIamUserDetails]
-> Read AwsIamUserDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsIamUserDetails]
$creadListPrec :: ReadPrec [AwsIamUserDetails]
readPrec :: ReadPrec AwsIamUserDetails
$creadPrec :: ReadPrec AwsIamUserDetails
readList :: ReadS [AwsIamUserDetails]
$creadList :: ReadS [AwsIamUserDetails]
readsPrec :: Int -> ReadS AwsIamUserDetails
$creadsPrec :: Int -> ReadS AwsIamUserDetails
Prelude.Read, Int -> AwsIamUserDetails -> ShowS
[AwsIamUserDetails] -> ShowS
AwsIamUserDetails -> String
(Int -> AwsIamUserDetails -> ShowS)
-> (AwsIamUserDetails -> String)
-> ([AwsIamUserDetails] -> ShowS)
-> Show AwsIamUserDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsIamUserDetails] -> ShowS
$cshowList :: [AwsIamUserDetails] -> ShowS
show :: AwsIamUserDetails -> String
$cshow :: AwsIamUserDetails -> String
showsPrec :: Int -> AwsIamUserDetails -> ShowS
$cshowsPrec :: Int -> AwsIamUserDetails -> ShowS
Prelude.Show, (forall x. AwsIamUserDetails -> Rep AwsIamUserDetails x)
-> (forall x. Rep AwsIamUserDetails x -> AwsIamUserDetails)
-> Generic AwsIamUserDetails
forall x. Rep AwsIamUserDetails x -> AwsIamUserDetails
forall x. AwsIamUserDetails -> Rep AwsIamUserDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsIamUserDetails x -> AwsIamUserDetails
$cfrom :: forall x. AwsIamUserDetails -> Rep AwsIamUserDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsIamUserDetails' 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:
--
-- 'groupList', 'awsIamUserDetails_groupList' - A list of IAM groups that the user belongs to.
--
-- 'path', 'awsIamUserDetails_path' - The path to the user.
--
-- 'createDate', 'awsIamUserDetails_createDate' - Indicates when the user 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@.
--
-- 'userName', 'awsIamUserDetails_userName' - The name of the user.
--
-- 'userId', 'awsIamUserDetails_userId' - The unique identifier for the user.
--
-- 'permissionsBoundary', 'awsIamUserDetails_permissionsBoundary' - The permissions boundary for the user.
--
-- 'userPolicyList', 'awsIamUserDetails_userPolicyList' - The list of inline policies that are embedded in the user.
--
-- 'attachedManagedPolicies', 'awsIamUserDetails_attachedManagedPolicies' - A list of the managed policies that are attached to the user.
newAwsIamUserDetails ::
  AwsIamUserDetails
newAwsIamUserDetails :: AwsIamUserDetails
newAwsIamUserDetails =
  AwsIamUserDetails' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsIamPermissionsBoundary
-> Maybe [AwsIamUserPolicy]
-> Maybe [AwsIamAttachedManagedPolicy]
-> AwsIamUserDetails
AwsIamUserDetails'
    { $sel:groupList:AwsIamUserDetails' :: Maybe [Text]
groupList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:path:AwsIamUserDetails' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:AwsIamUserDetails' :: Maybe Text
createDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userName:AwsIamUserDetails' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userId:AwsIamUserDetails' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionsBoundary:AwsIamUserDetails' :: Maybe AwsIamPermissionsBoundary
permissionsBoundary = Maybe AwsIamPermissionsBoundary
forall a. Maybe a
Prelude.Nothing,
      $sel:userPolicyList:AwsIamUserDetails' :: Maybe [AwsIamUserPolicy]
userPolicyList = Maybe [AwsIamUserPolicy]
forall a. Maybe a
Prelude.Nothing,
      $sel:attachedManagedPolicies:AwsIamUserDetails' :: Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies = Maybe [AwsIamAttachedManagedPolicy]
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of IAM groups that the user belongs to.
awsIamUserDetails_groupList :: Lens.Lens' AwsIamUserDetails (Prelude.Maybe [Prelude.Text])
awsIamUserDetails_groupList :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsIamUserDetails -> f AwsIamUserDetails
awsIamUserDetails_groupList = (AwsIamUserDetails -> Maybe [Text])
-> (AwsIamUserDetails -> Maybe [Text] -> AwsIamUserDetails)
-> Lens
     AwsIamUserDetails AwsIamUserDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamUserDetails' {Maybe [Text]
groupList :: Maybe [Text]
$sel:groupList:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe [Text]
groupList} -> Maybe [Text]
groupList) (\s :: AwsIamUserDetails
s@AwsIamUserDetails' {} Maybe [Text]
a -> AwsIamUserDetails
s {$sel:groupList:AwsIamUserDetails' :: Maybe [Text]
groupList = Maybe [Text]
a} :: AwsIamUserDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsIamUserDetails -> f AwsIamUserDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsIamUserDetails
-> f AwsIamUserDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | Indicates when the user 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@.
awsIamUserDetails_createDate :: Lens.Lens' AwsIamUserDetails (Prelude.Maybe Prelude.Text)
awsIamUserDetails_createDate :: (Maybe Text -> f (Maybe Text))
-> AwsIamUserDetails -> f AwsIamUserDetails
awsIamUserDetails_createDate = (AwsIamUserDetails -> Maybe Text)
-> (AwsIamUserDetails -> Maybe Text -> AwsIamUserDetails)
-> Lens
     AwsIamUserDetails AwsIamUserDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamUserDetails' {Maybe Text
createDate :: Maybe Text
$sel:createDate:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe Text
createDate} -> Maybe Text
createDate) (\s :: AwsIamUserDetails
s@AwsIamUserDetails' {} Maybe Text
a -> AwsIamUserDetails
s {$sel:createDate:AwsIamUserDetails' :: Maybe Text
createDate = Maybe Text
a} :: AwsIamUserDetails)

-- | The name of the user.
awsIamUserDetails_userName :: Lens.Lens' AwsIamUserDetails (Prelude.Maybe Prelude.Text)
awsIamUserDetails_userName :: (Maybe Text -> f (Maybe Text))
-> AwsIamUserDetails -> f AwsIamUserDetails
awsIamUserDetails_userName = (AwsIamUserDetails -> Maybe Text)
-> (AwsIamUserDetails -> Maybe Text -> AwsIamUserDetails)
-> Lens
     AwsIamUserDetails AwsIamUserDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamUserDetails' {Maybe Text
userName :: Maybe Text
$sel:userName:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe Text
userName} -> Maybe Text
userName) (\s :: AwsIamUserDetails
s@AwsIamUserDetails' {} Maybe Text
a -> AwsIamUserDetails
s {$sel:userName:AwsIamUserDetails' :: Maybe Text
userName = Maybe Text
a} :: AwsIamUserDetails)

-- | The unique identifier for the user.
awsIamUserDetails_userId :: Lens.Lens' AwsIamUserDetails (Prelude.Maybe Prelude.Text)
awsIamUserDetails_userId :: (Maybe Text -> f (Maybe Text))
-> AwsIamUserDetails -> f AwsIamUserDetails
awsIamUserDetails_userId = (AwsIamUserDetails -> Maybe Text)
-> (AwsIamUserDetails -> Maybe Text -> AwsIamUserDetails)
-> Lens
     AwsIamUserDetails AwsIamUserDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamUserDetails' {Maybe Text
userId :: Maybe Text
$sel:userId:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe Text
userId} -> Maybe Text
userId) (\s :: AwsIamUserDetails
s@AwsIamUserDetails' {} Maybe Text
a -> AwsIamUserDetails
s {$sel:userId:AwsIamUserDetails' :: Maybe Text
userId = Maybe Text
a} :: AwsIamUserDetails)

-- | The permissions boundary for the user.
awsIamUserDetails_permissionsBoundary :: Lens.Lens' AwsIamUserDetails (Prelude.Maybe AwsIamPermissionsBoundary)
awsIamUserDetails_permissionsBoundary :: (Maybe AwsIamPermissionsBoundary
 -> f (Maybe AwsIamPermissionsBoundary))
-> AwsIamUserDetails -> f AwsIamUserDetails
awsIamUserDetails_permissionsBoundary = (AwsIamUserDetails -> Maybe AwsIamPermissionsBoundary)
-> (AwsIamUserDetails
    -> Maybe AwsIamPermissionsBoundary -> AwsIamUserDetails)
-> Lens
     AwsIamUserDetails
     AwsIamUserDetails
     (Maybe AwsIamPermissionsBoundary)
     (Maybe AwsIamPermissionsBoundary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamUserDetails' {Maybe AwsIamPermissionsBoundary
permissionsBoundary :: Maybe AwsIamPermissionsBoundary
$sel:permissionsBoundary:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe AwsIamPermissionsBoundary
permissionsBoundary} -> Maybe AwsIamPermissionsBoundary
permissionsBoundary) (\s :: AwsIamUserDetails
s@AwsIamUserDetails' {} Maybe AwsIamPermissionsBoundary
a -> AwsIamUserDetails
s {$sel:permissionsBoundary:AwsIamUserDetails' :: Maybe AwsIamPermissionsBoundary
permissionsBoundary = Maybe AwsIamPermissionsBoundary
a} :: AwsIamUserDetails)

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

-- | A list of the managed policies that are attached to the user.
awsIamUserDetails_attachedManagedPolicies :: Lens.Lens' AwsIamUserDetails (Prelude.Maybe [AwsIamAttachedManagedPolicy])
awsIamUserDetails_attachedManagedPolicies :: (Maybe [AwsIamAttachedManagedPolicy]
 -> f (Maybe [AwsIamAttachedManagedPolicy]))
-> AwsIamUserDetails -> f AwsIamUserDetails
awsIamUserDetails_attachedManagedPolicies = (AwsIamUserDetails -> Maybe [AwsIamAttachedManagedPolicy])
-> (AwsIamUserDetails
    -> Maybe [AwsIamAttachedManagedPolicy] -> AwsIamUserDetails)
-> Lens
     AwsIamUserDetails
     AwsIamUserDetails
     (Maybe [AwsIamAttachedManagedPolicy])
     (Maybe [AwsIamAttachedManagedPolicy])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamUserDetails' {Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies :: Maybe [AwsIamAttachedManagedPolicy]
$sel:attachedManagedPolicies:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies} -> Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies) (\s :: AwsIamUserDetails
s@AwsIamUserDetails' {} Maybe [AwsIamAttachedManagedPolicy]
a -> AwsIamUserDetails
s {$sel:attachedManagedPolicies:AwsIamUserDetails' :: Maybe [AwsIamAttachedManagedPolicy]
attachedManagedPolicies = Maybe [AwsIamAttachedManagedPolicy]
a} :: AwsIamUserDetails) ((Maybe [AwsIamAttachedManagedPolicy]
  -> f (Maybe [AwsIamAttachedManagedPolicy]))
 -> AwsIamUserDetails -> f AwsIamUserDetails)
-> ((Maybe [AwsIamAttachedManagedPolicy]
     -> f (Maybe [AwsIamAttachedManagedPolicy]))
    -> Maybe [AwsIamAttachedManagedPolicy]
    -> f (Maybe [AwsIamAttachedManagedPolicy]))
-> (Maybe [AwsIamAttachedManagedPolicy]
    -> f (Maybe [AwsIamAttachedManagedPolicy]))
-> AwsIamUserDetails
-> f AwsIamUserDetails
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 AwsIamUserDetails where
  parseJSON :: Value -> Parser AwsIamUserDetails
parseJSON =
    String
-> (Object -> Parser AwsIamUserDetails)
-> Value
-> Parser AwsIamUserDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsIamUserDetails"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AwsIamPermissionsBoundary
-> Maybe [AwsIamUserPolicy]
-> Maybe [AwsIamAttachedManagedPolicy]
-> AwsIamUserDetails
AwsIamUserDetails'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AwsIamPermissionsBoundary
 -> Maybe [AwsIamUserPolicy]
 -> Maybe [AwsIamAttachedManagedPolicy]
 -> AwsIamUserDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsIamPermissionsBoundary
      -> Maybe [AwsIamUserPolicy]
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamUserDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GroupList" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsIamPermissionsBoundary
   -> Maybe [AwsIamUserPolicy]
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamUserDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AwsIamPermissionsBoundary
      -> Maybe [AwsIamUserPolicy]
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamUserDetails)
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
"Path")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AwsIamPermissionsBoundary
   -> Maybe [AwsIamUserPolicy]
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamUserDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AwsIamPermissionsBoundary
      -> Maybe [AwsIamUserPolicy]
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamUserDetails)
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 Text
   -> Maybe AwsIamPermissionsBoundary
   -> Maybe [AwsIamUserPolicy]
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamUserDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AwsIamPermissionsBoundary
      -> Maybe [AwsIamUserPolicy]
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamUserDetails)
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
"UserName")
            Parser
  (Maybe Text
   -> Maybe AwsIamPermissionsBoundary
   -> Maybe [AwsIamUserPolicy]
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamUserDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe AwsIamPermissionsBoundary
      -> Maybe [AwsIamUserPolicy]
      -> Maybe [AwsIamAttachedManagedPolicy]
      -> AwsIamUserDetails)
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
"UserId")
            Parser
  (Maybe AwsIamPermissionsBoundary
   -> Maybe [AwsIamUserPolicy]
   -> Maybe [AwsIamAttachedManagedPolicy]
   -> AwsIamUserDetails)
-> Parser (Maybe AwsIamPermissionsBoundary)
-> Parser
     (Maybe [AwsIamUserPolicy]
      -> Maybe [AwsIamAttachedManagedPolicy] -> AwsIamUserDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsIamPermissionsBoundary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PermissionsBoundary")
            Parser
  (Maybe [AwsIamUserPolicy]
   -> Maybe [AwsIamAttachedManagedPolicy] -> AwsIamUserDetails)
-> Parser (Maybe [AwsIamUserPolicy])
-> Parser
     (Maybe [AwsIamAttachedManagedPolicy] -> AwsIamUserDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AwsIamUserPolicy]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserPolicyList" Parser (Maybe (Maybe [AwsIamUserPolicy]))
-> Maybe [AwsIamUserPolicy] -> Parser (Maybe [AwsIamUserPolicy])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsIamUserPolicy]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe [AwsIamAttachedManagedPolicy] -> AwsIamUserDetails)
-> Parser (Maybe [AwsIamAttachedManagedPolicy])
-> Parser AwsIamUserDetails
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 AwsIamUserDetails

instance Prelude.NFData AwsIamUserDetails

instance Core.ToJSON AwsIamUserDetails where
  toJSON :: AwsIamUserDetails -> Value
toJSON AwsIamUserDetails' {Maybe [Text]
Maybe [AwsIamAttachedManagedPolicy]
Maybe [AwsIamUserPolicy]
Maybe Text
Maybe AwsIamPermissionsBoundary
attachedManagedPolicies :: Maybe [AwsIamAttachedManagedPolicy]
userPolicyList :: Maybe [AwsIamUserPolicy]
permissionsBoundary :: Maybe AwsIamPermissionsBoundary
userId :: Maybe Text
userName :: Maybe Text
createDate :: Maybe Text
path :: Maybe Text
groupList :: Maybe [Text]
$sel:attachedManagedPolicies:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe [AwsIamAttachedManagedPolicy]
$sel:userPolicyList:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe [AwsIamUserPolicy]
$sel:permissionsBoundary:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe AwsIamPermissionsBoundary
$sel:userId:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe Text
$sel:userName:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe Text
$sel:createDate:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe Text
$sel:path:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe Text
$sel:groupList:AwsIamUserDetails' :: AwsIamUserDetails -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"GroupList" 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]
groupList,
            (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
"UserName" 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
userName,
            (Text
"UserId" 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
userId,
            (Text
"PermissionsBoundary" Text -> AwsIamPermissionsBoundary -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsIamPermissionsBoundary -> Pair)
-> Maybe AwsIamPermissionsBoundary -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsIamPermissionsBoundary
permissionsBoundary,
            (Text
"UserPolicyList" Text -> [AwsIamUserPolicy] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsIamUserPolicy] -> Pair)
-> Maybe [AwsIamUserPolicy] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsIamUserPolicy]
userPolicyList,
            (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
          ]
      )