{-# 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.RoleDetail
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IAM.Types.RoleDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types.AttachedPermissionsBoundary
import Amazonka.IAM.Types.AttachedPolicy
import Amazonka.IAM.Types.InstanceProfile
import Amazonka.IAM.Types.PolicyDetail
import Amazonka.IAM.Types.RoleLastUsed
import Amazonka.IAM.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Contains information about an IAM role, including all of the role\'s
-- policies.
--
-- This data type is used as a response element in the
-- GetAccountAuthorizationDetails operation.
--
-- /See:/ 'newRoleDetail' smart constructor.
data RoleDetail = RoleDetail'
  { RoleDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The trust policy that grants permission to assume the role.
    RoleDetail -> Maybe Text
assumeRolePolicyDocument :: Prelude.Maybe Prelude.Text,
    -- | A list of managed policies attached to the role. These policies are the
    -- role\'s access (permissions) policies.
    RoleDetail -> Maybe [AttachedPolicy]
attachedManagedPolicies :: Prelude.Maybe [AttachedPolicy],
    -- | The date and time, in
    -- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
    -- role was created.
    RoleDetail -> Maybe ISO8601
createDate :: Prelude.Maybe Data.ISO8601,
    -- | A list of instance profiles that contain this role.
    RoleDetail -> Maybe [InstanceProfile]
instanceProfileList :: Prelude.Maybe [InstanceProfile],
    -- | The path to the role. For more information about paths, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
    -- in the /IAM User Guide/.
    RoleDetail -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the policy used to set the permissions boundary for the role.
    --
    -- For more information about permissions boundaries, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html Permissions boundaries for IAM identities>
    -- in the /IAM User Guide/.
    RoleDetail -> Maybe AttachedPermissionsBoundary
permissionsBoundary :: Prelude.Maybe AttachedPermissionsBoundary,
    -- | The stable and unique string identifying the role. For more information
    -- about IDs, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
    -- in the /IAM User Guide/.
    RoleDetail -> Maybe Text
roleId :: Prelude.Maybe Prelude.Text,
    -- | Contains information about the last time that an IAM role was used. This
    -- includes the date and time and the Region in which the role was last
    -- used. Activity is only reported for the trailing 400 days. This period
    -- can be shorter if your Region began supporting these features within the
    -- last year. The role might have been used more than 400 days ago. For
    -- more information, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period Regions where data is tracked>
    -- in the /IAM User Guide/.
    RoleDetail -> Maybe RoleLastUsed
roleLastUsed :: Prelude.Maybe RoleLastUsed,
    -- | The friendly name that identifies the role.
    RoleDetail -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
    -- | A list of inline policies embedded in the role. These policies are the
    -- role\'s access (permissions) policies.
    RoleDetail -> Maybe [PolicyDetail]
rolePolicyList :: Prelude.Maybe [PolicyDetail],
    -- | A list of tags that are attached to the role. For more information about
    -- tagging, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
    -- in the /IAM User Guide/.
    RoleDetail -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (RoleDetail -> RoleDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoleDetail -> RoleDetail -> Bool
$c/= :: RoleDetail -> RoleDetail -> Bool
== :: RoleDetail -> RoleDetail -> Bool
$c== :: RoleDetail -> RoleDetail -> Bool
Prelude.Eq, ReadPrec [RoleDetail]
ReadPrec RoleDetail
Int -> ReadS RoleDetail
ReadS [RoleDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoleDetail]
$creadListPrec :: ReadPrec [RoleDetail]
readPrec :: ReadPrec RoleDetail
$creadPrec :: ReadPrec RoleDetail
readList :: ReadS [RoleDetail]
$creadList :: ReadS [RoleDetail]
readsPrec :: Int -> ReadS RoleDetail
$creadsPrec :: Int -> ReadS RoleDetail
Prelude.Read, Int -> RoleDetail -> ShowS
[RoleDetail] -> ShowS
RoleDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoleDetail] -> ShowS
$cshowList :: [RoleDetail] -> ShowS
show :: RoleDetail -> String
$cshow :: RoleDetail -> String
showsPrec :: Int -> RoleDetail -> ShowS
$cshowsPrec :: Int -> RoleDetail -> ShowS
Prelude.Show, forall x. Rep RoleDetail x -> RoleDetail
forall x. RoleDetail -> Rep RoleDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoleDetail x -> RoleDetail
$cfrom :: forall x. RoleDetail -> Rep RoleDetail x
Prelude.Generic)

-- |
-- Create a value of 'RoleDetail' 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', 'roleDetail_arn' - Undocumented member.
--
-- 'assumeRolePolicyDocument', 'roleDetail_assumeRolePolicyDocument' - The trust policy that grants permission to assume the role.
--
-- 'attachedManagedPolicies', 'roleDetail_attachedManagedPolicies' - A list of managed policies attached to the role. These policies are the
-- role\'s access (permissions) policies.
--
-- 'createDate', 'roleDetail_createDate' - The date and time, in
-- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- role was created.
--
-- 'instanceProfileList', 'roleDetail_instanceProfileList' - A list of instance profiles that contain this role.
--
-- 'path', 'roleDetail_path' - The path to the role. For more information about paths, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
--
-- 'permissionsBoundary', 'roleDetail_permissionsBoundary' - The ARN of the policy used to set the permissions boundary for the role.
--
-- For more information about permissions boundaries, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html Permissions boundaries for IAM identities>
-- in the /IAM User Guide/.
--
-- 'roleId', 'roleDetail_roleId' - The stable and unique string identifying the role. For more information
-- about IDs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
--
-- 'roleLastUsed', 'roleDetail_roleLastUsed' - Contains information about the last time that an IAM role was used. This
-- includes the date and time and the Region in which the role was last
-- used. Activity is only reported for the trailing 400 days. This period
-- can be shorter if your Region began supporting these features within the
-- last year. The role might have been used more than 400 days ago. For
-- more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period Regions where data is tracked>
-- in the /IAM User Guide/.
--
-- 'roleName', 'roleDetail_roleName' - The friendly name that identifies the role.
--
-- 'rolePolicyList', 'roleDetail_rolePolicyList' - A list of inline policies embedded in the role. These policies are the
-- role\'s access (permissions) policies.
--
-- 'tags', 'roleDetail_tags' - A list of tags that are attached to the role. For more information about
-- tagging, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
newRoleDetail ::
  RoleDetail
newRoleDetail :: RoleDetail
newRoleDetail =
  RoleDetail'
    { $sel:arn:RoleDetail' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:assumeRolePolicyDocument:RoleDetail' :: Maybe Text
assumeRolePolicyDocument = forall a. Maybe a
Prelude.Nothing,
      $sel:attachedManagedPolicies:RoleDetail' :: Maybe [AttachedPolicy]
attachedManagedPolicies = forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:RoleDetail' :: Maybe ISO8601
createDate = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceProfileList:RoleDetail' :: Maybe [InstanceProfile]
instanceProfileList = forall a. Maybe a
Prelude.Nothing,
      $sel:path:RoleDetail' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing,
      $sel:permissionsBoundary:RoleDetail' :: Maybe AttachedPermissionsBoundary
permissionsBoundary = forall a. Maybe a
Prelude.Nothing,
      $sel:roleId:RoleDetail' :: Maybe Text
roleId = forall a. Maybe a
Prelude.Nothing,
      $sel:roleLastUsed:RoleDetail' :: Maybe RoleLastUsed
roleLastUsed = forall a. Maybe a
Prelude.Nothing,
      $sel:roleName:RoleDetail' :: Maybe Text
roleName = forall a. Maybe a
Prelude.Nothing,
      $sel:rolePolicyList:RoleDetail' :: Maybe [PolicyDetail]
rolePolicyList = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:RoleDetail' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The trust policy that grants permission to assume the role.
roleDetail_assumeRolePolicyDocument :: Lens.Lens' RoleDetail (Prelude.Maybe Prelude.Text)
roleDetail_assumeRolePolicyDocument :: Lens' RoleDetail (Maybe Text)
roleDetail_assumeRolePolicyDocument = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe Text
assumeRolePolicyDocument :: Maybe Text
$sel:assumeRolePolicyDocument:RoleDetail' :: RoleDetail -> Maybe Text
assumeRolePolicyDocument} -> Maybe Text
assumeRolePolicyDocument) (\s :: RoleDetail
s@RoleDetail' {} Maybe Text
a -> RoleDetail
s {$sel:assumeRolePolicyDocument:RoleDetail' :: Maybe Text
assumeRolePolicyDocument = Maybe Text
a} :: RoleDetail)

-- | A list of managed policies attached to the role. These policies are the
-- role\'s access (permissions) policies.
roleDetail_attachedManagedPolicies :: Lens.Lens' RoleDetail (Prelude.Maybe [AttachedPolicy])
roleDetail_attachedManagedPolicies :: Lens' RoleDetail (Maybe [AttachedPolicy])
roleDetail_attachedManagedPolicies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe [AttachedPolicy]
attachedManagedPolicies :: Maybe [AttachedPolicy]
$sel:attachedManagedPolicies:RoleDetail' :: RoleDetail -> Maybe [AttachedPolicy]
attachedManagedPolicies} -> Maybe [AttachedPolicy]
attachedManagedPolicies) (\s :: RoleDetail
s@RoleDetail' {} Maybe [AttachedPolicy]
a -> RoleDetail
s {$sel:attachedManagedPolicies:RoleDetail' :: Maybe [AttachedPolicy]
attachedManagedPolicies = Maybe [AttachedPolicy]
a} :: RoleDetail) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | A list of instance profiles that contain this role.
roleDetail_instanceProfileList :: Lens.Lens' RoleDetail (Prelude.Maybe [InstanceProfile])
roleDetail_instanceProfileList :: Lens' RoleDetail (Maybe [InstanceProfile])
roleDetail_instanceProfileList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe [InstanceProfile]
instanceProfileList :: Maybe [InstanceProfile]
$sel:instanceProfileList:RoleDetail' :: RoleDetail -> Maybe [InstanceProfile]
instanceProfileList} -> Maybe [InstanceProfile]
instanceProfileList) (\s :: RoleDetail
s@RoleDetail' {} Maybe [InstanceProfile]
a -> RoleDetail
s {$sel:instanceProfileList:RoleDetail' :: Maybe [InstanceProfile]
instanceProfileList = Maybe [InstanceProfile]
a} :: RoleDetail) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The ARN of the policy used to set the permissions boundary for the role.
--
-- For more information about permissions boundaries, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html Permissions boundaries for IAM identities>
-- in the /IAM User Guide/.
roleDetail_permissionsBoundary :: Lens.Lens' RoleDetail (Prelude.Maybe AttachedPermissionsBoundary)
roleDetail_permissionsBoundary :: Lens' RoleDetail (Maybe AttachedPermissionsBoundary)
roleDetail_permissionsBoundary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe AttachedPermissionsBoundary
permissionsBoundary :: Maybe AttachedPermissionsBoundary
$sel:permissionsBoundary:RoleDetail' :: RoleDetail -> Maybe AttachedPermissionsBoundary
permissionsBoundary} -> Maybe AttachedPermissionsBoundary
permissionsBoundary) (\s :: RoleDetail
s@RoleDetail' {} Maybe AttachedPermissionsBoundary
a -> RoleDetail
s {$sel:permissionsBoundary:RoleDetail' :: Maybe AttachedPermissionsBoundary
permissionsBoundary = Maybe AttachedPermissionsBoundary
a} :: RoleDetail)

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

-- | Contains information about the last time that an IAM role was used. This
-- includes the date and time and the Region in which the role was last
-- used. Activity is only reported for the trailing 400 days. This period
-- can be shorter if your Region began supporting these features within the
-- last year. The role might have been used more than 400 days ago. For
-- more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period Regions where data is tracked>
-- in the /IAM User Guide/.
roleDetail_roleLastUsed :: Lens.Lens' RoleDetail (Prelude.Maybe RoleLastUsed)
roleDetail_roleLastUsed :: Lens' RoleDetail (Maybe RoleLastUsed)
roleDetail_roleLastUsed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe RoleLastUsed
roleLastUsed :: Maybe RoleLastUsed
$sel:roleLastUsed:RoleDetail' :: RoleDetail -> Maybe RoleLastUsed
roleLastUsed} -> Maybe RoleLastUsed
roleLastUsed) (\s :: RoleDetail
s@RoleDetail' {} Maybe RoleLastUsed
a -> RoleDetail
s {$sel:roleLastUsed:RoleDetail' :: Maybe RoleLastUsed
roleLastUsed = Maybe RoleLastUsed
a} :: RoleDetail)

-- | The friendly name that identifies the role.
roleDetail_roleName :: Lens.Lens' RoleDetail (Prelude.Maybe Prelude.Text)
roleDetail_roleName :: Lens' RoleDetail (Maybe Text)
roleDetail_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe Text
roleName :: Maybe Text
$sel:roleName:RoleDetail' :: RoleDetail -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: RoleDetail
s@RoleDetail' {} Maybe Text
a -> RoleDetail
s {$sel:roleName:RoleDetail' :: Maybe Text
roleName = Maybe Text
a} :: RoleDetail)

-- | A list of inline policies embedded in the role. These policies are the
-- role\'s access (permissions) policies.
roleDetail_rolePolicyList :: Lens.Lens' RoleDetail (Prelude.Maybe [PolicyDetail])
roleDetail_rolePolicyList :: Lens' RoleDetail (Maybe [PolicyDetail])
roleDetail_rolePolicyList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe [PolicyDetail]
rolePolicyList :: Maybe [PolicyDetail]
$sel:rolePolicyList:RoleDetail' :: RoleDetail -> Maybe [PolicyDetail]
rolePolicyList} -> Maybe [PolicyDetail]
rolePolicyList) (\s :: RoleDetail
s@RoleDetail' {} Maybe [PolicyDetail]
a -> RoleDetail
s {$sel:rolePolicyList:RoleDetail' :: Maybe [PolicyDetail]
rolePolicyList = Maybe [PolicyDetail]
a} :: RoleDetail) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of tags that are attached to the role. For more information about
-- tagging, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
roleDetail_tags :: Lens.Lens' RoleDetail (Prelude.Maybe [Tag])
roleDetail_tags :: Lens' RoleDetail (Maybe [Tag])
roleDetail_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleDetail' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:RoleDetail' :: RoleDetail -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: RoleDetail
s@RoleDetail' {} Maybe [Tag]
a -> RoleDetail
s {$sel:tags:RoleDetail' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: RoleDetail) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromXML RoleDetail where
  parseXML :: [Node] -> Either String RoleDetail
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe [AttachedPolicy]
-> Maybe ISO8601
-> Maybe [InstanceProfile]
-> Maybe Text
-> Maybe AttachedPermissionsBoundary
-> Maybe Text
-> Maybe RoleLastUsed
-> Maybe Text
-> Maybe [PolicyDetail]
-> Maybe [Tag]
-> RoleDetail
RoleDetail'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Arn")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AssumeRolePolicyDocument")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AttachedManagedPolicies"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CreateDate")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"InstanceProfileList"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Path")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PermissionsBoundary")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RoleId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RoleLastUsed")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RoleName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RolePolicyList"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Tags"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )

instance Prelude.Hashable RoleDetail where
  hashWithSalt :: Int -> RoleDetail -> Int
hashWithSalt Int
_salt RoleDetail' {Maybe [AttachedPolicy]
Maybe [PolicyDetail]
Maybe [Tag]
Maybe [InstanceProfile]
Maybe Text
Maybe ISO8601
Maybe AttachedPermissionsBoundary
Maybe RoleLastUsed
tags :: Maybe [Tag]
rolePolicyList :: Maybe [PolicyDetail]
roleName :: Maybe Text
roleLastUsed :: Maybe RoleLastUsed
roleId :: Maybe Text
permissionsBoundary :: Maybe AttachedPermissionsBoundary
path :: Maybe Text
instanceProfileList :: Maybe [InstanceProfile]
createDate :: Maybe ISO8601
attachedManagedPolicies :: Maybe [AttachedPolicy]
assumeRolePolicyDocument :: Maybe Text
arn :: Maybe Text
$sel:tags:RoleDetail' :: RoleDetail -> Maybe [Tag]
$sel:rolePolicyList:RoleDetail' :: RoleDetail -> Maybe [PolicyDetail]
$sel:roleName:RoleDetail' :: RoleDetail -> Maybe Text
$sel:roleLastUsed:RoleDetail' :: RoleDetail -> Maybe RoleLastUsed
$sel:roleId:RoleDetail' :: RoleDetail -> Maybe Text
$sel:permissionsBoundary:RoleDetail' :: RoleDetail -> Maybe AttachedPermissionsBoundary
$sel:path:RoleDetail' :: RoleDetail -> Maybe Text
$sel:instanceProfileList:RoleDetail' :: RoleDetail -> Maybe [InstanceProfile]
$sel:createDate:RoleDetail' :: RoleDetail -> Maybe ISO8601
$sel:attachedManagedPolicies:RoleDetail' :: RoleDetail -> Maybe [AttachedPolicy]
$sel:assumeRolePolicyDocument:RoleDetail' :: RoleDetail -> Maybe Text
$sel:arn:RoleDetail' :: RoleDetail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
assumeRolePolicyDocument
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AttachedPolicy]
attachedManagedPolicies
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceProfile]
instanceProfileList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttachedPermissionsBoundary
permissionsBoundary
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RoleLastUsed
roleLastUsed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PolicyDetail]
rolePolicyList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags

instance Prelude.NFData RoleDetail where
  rnf :: RoleDetail -> ()
rnf RoleDetail' {Maybe [AttachedPolicy]
Maybe [PolicyDetail]
Maybe [Tag]
Maybe [InstanceProfile]
Maybe Text
Maybe ISO8601
Maybe AttachedPermissionsBoundary
Maybe RoleLastUsed
tags :: Maybe [Tag]
rolePolicyList :: Maybe [PolicyDetail]
roleName :: Maybe Text
roleLastUsed :: Maybe RoleLastUsed
roleId :: Maybe Text
permissionsBoundary :: Maybe AttachedPermissionsBoundary
path :: Maybe Text
instanceProfileList :: Maybe [InstanceProfile]
createDate :: Maybe ISO8601
attachedManagedPolicies :: Maybe [AttachedPolicy]
assumeRolePolicyDocument :: Maybe Text
arn :: Maybe Text
$sel:tags:RoleDetail' :: RoleDetail -> Maybe [Tag]
$sel:rolePolicyList:RoleDetail' :: RoleDetail -> Maybe [PolicyDetail]
$sel:roleName:RoleDetail' :: RoleDetail -> Maybe Text
$sel:roleLastUsed:RoleDetail' :: RoleDetail -> Maybe RoleLastUsed
$sel:roleId:RoleDetail' :: RoleDetail -> Maybe Text
$sel:permissionsBoundary:RoleDetail' :: RoleDetail -> Maybe AttachedPermissionsBoundary
$sel:path:RoleDetail' :: RoleDetail -> Maybe Text
$sel:instanceProfileList:RoleDetail' :: RoleDetail -> Maybe [InstanceProfile]
$sel:createDate:RoleDetail' :: RoleDetail -> Maybe ISO8601
$sel:attachedManagedPolicies:RoleDetail' :: RoleDetail -> Maybe [AttachedPolicy]
$sel:assumeRolePolicyDocument:RoleDetail' :: RoleDetail -> Maybe Text
$sel:arn:RoleDetail' :: RoleDetail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
assumeRolePolicyDocument
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AttachedPolicy]
attachedManagedPolicies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceProfile]
instanceProfileList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
path
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AttachedPermissionsBoundary
permissionsBoundary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RoleLastUsed
roleLastUsed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PolicyDetail]
rolePolicyList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags