{-# 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.ManagedPolicyDetail
-- 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.ManagedPolicyDetail where

import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.PolicyVersion
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a managed policy, including the policy\'s
-- ARN, versions, and the number of principal entities (users, groups, and
-- roles) that the policy is attached to.
--
-- This data type is used as a response element in the
-- GetAccountAuthorizationDetails operation.
--
-- For more information about managed policies, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html Managed policies and inline policies>
-- in the /IAM User Guide/.
--
-- /See:/ 'newManagedPolicyDetail' smart constructor.
data ManagedPolicyDetail = ManagedPolicyDetail'
  { -- | The friendly name (not ARN) identifying the policy.
    ManagedPolicyDetail -> Maybe Text
policyName :: Prelude.Maybe Prelude.Text,
    ManagedPolicyDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time, in
    -- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
    -- policy was last updated.
    --
    -- When a policy has only one version, this field contains the date and
    -- time when the policy was created. When a policy has more than one
    -- version, this field contains the date and time when the most recent
    -- policy version was created.
    ManagedPolicyDetail -> Maybe ISO8601
updateDate :: Prelude.Maybe Core.ISO8601,
    -- | The stable and unique string identifying the policy.
    --
    -- For more information about IDs, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
    -- in the /IAM User Guide/.
    ManagedPolicyDetail -> Maybe Text
policyId :: Prelude.Maybe Prelude.Text,
    -- | The path to the policy.
    --
    -- For more information about paths, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
    -- in the /IAM User Guide/.
    ManagedPolicyDetail -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | A list containing information about the versions of the policy.
    ManagedPolicyDetail -> Maybe [PolicyVersion]
policyVersionList :: Prelude.Maybe [PolicyVersion],
    -- | The date and time, in
    -- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
    -- policy was created.
    ManagedPolicyDetail -> Maybe ISO8601
createDate :: Prelude.Maybe Core.ISO8601,
    -- | Specifies whether the policy can be attached to an IAM user, group, or
    -- role.
    ManagedPolicyDetail -> Maybe Bool
isAttachable :: Prelude.Maybe Prelude.Bool,
    -- | The number of entities (users and roles) for which the policy is used as
    -- the permissions boundary.
    --
    -- 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/.
    ManagedPolicyDetail -> Maybe Int
permissionsBoundaryUsageCount :: Prelude.Maybe Prelude.Int,
    -- | The identifier for the version of the policy that is set as the default
    -- (operative) version.
    --
    -- For more information about policy versions, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html Versioning for managed policies>
    -- in the /IAM User Guide/.
    ManagedPolicyDetail -> Maybe Text
defaultVersionId :: Prelude.Maybe Prelude.Text,
    -- | The number of principal entities (users, groups, and roles) that the
    -- policy is attached to.
    ManagedPolicyDetail -> Maybe Int
attachmentCount :: Prelude.Maybe Prelude.Int,
    -- | A friendly description of the policy.
    ManagedPolicyDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ManagedPolicyDetail -> ManagedPolicyDetail -> Bool
(ManagedPolicyDetail -> ManagedPolicyDetail -> Bool)
-> (ManagedPolicyDetail -> ManagedPolicyDetail -> Bool)
-> Eq ManagedPolicyDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedPolicyDetail -> ManagedPolicyDetail -> Bool
$c/= :: ManagedPolicyDetail -> ManagedPolicyDetail -> Bool
== :: ManagedPolicyDetail -> ManagedPolicyDetail -> Bool
$c== :: ManagedPolicyDetail -> ManagedPolicyDetail -> Bool
Prelude.Eq, ReadPrec [ManagedPolicyDetail]
ReadPrec ManagedPolicyDetail
Int -> ReadS ManagedPolicyDetail
ReadS [ManagedPolicyDetail]
(Int -> ReadS ManagedPolicyDetail)
-> ReadS [ManagedPolicyDetail]
-> ReadPrec ManagedPolicyDetail
-> ReadPrec [ManagedPolicyDetail]
-> Read ManagedPolicyDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedPolicyDetail]
$creadListPrec :: ReadPrec [ManagedPolicyDetail]
readPrec :: ReadPrec ManagedPolicyDetail
$creadPrec :: ReadPrec ManagedPolicyDetail
readList :: ReadS [ManagedPolicyDetail]
$creadList :: ReadS [ManagedPolicyDetail]
readsPrec :: Int -> ReadS ManagedPolicyDetail
$creadsPrec :: Int -> ReadS ManagedPolicyDetail
Prelude.Read, Int -> ManagedPolicyDetail -> ShowS
[ManagedPolicyDetail] -> ShowS
ManagedPolicyDetail -> String
(Int -> ManagedPolicyDetail -> ShowS)
-> (ManagedPolicyDetail -> String)
-> ([ManagedPolicyDetail] -> ShowS)
-> Show ManagedPolicyDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedPolicyDetail] -> ShowS
$cshowList :: [ManagedPolicyDetail] -> ShowS
show :: ManagedPolicyDetail -> String
$cshow :: ManagedPolicyDetail -> String
showsPrec :: Int -> ManagedPolicyDetail -> ShowS
$cshowsPrec :: Int -> ManagedPolicyDetail -> ShowS
Prelude.Show, (forall x. ManagedPolicyDetail -> Rep ManagedPolicyDetail x)
-> (forall x. Rep ManagedPolicyDetail x -> ManagedPolicyDetail)
-> Generic ManagedPolicyDetail
forall x. Rep ManagedPolicyDetail x -> ManagedPolicyDetail
forall x. ManagedPolicyDetail -> Rep ManagedPolicyDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedPolicyDetail x -> ManagedPolicyDetail
$cfrom :: forall x. ManagedPolicyDetail -> Rep ManagedPolicyDetail x
Prelude.Generic)

-- |
-- Create a value of 'ManagedPolicyDetail' 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:
--
-- 'policyName', 'managedPolicyDetail_policyName' - The friendly name (not ARN) identifying the policy.
--
-- 'arn', 'managedPolicyDetail_arn' - Undocumented member.
--
-- 'updateDate', 'managedPolicyDetail_updateDate' - The date and time, in
-- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- policy was last updated.
--
-- When a policy has only one version, this field contains the date and
-- time when the policy was created. When a policy has more than one
-- version, this field contains the date and time when the most recent
-- policy version was created.
--
-- 'policyId', 'managedPolicyDetail_policyId' - The stable and unique string identifying the policy.
--
-- For more information about IDs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
--
-- 'path', 'managedPolicyDetail_path' - The path to the policy.
--
-- For more information about paths, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
--
-- 'policyVersionList', 'managedPolicyDetail_policyVersionList' - A list containing information about the versions of the policy.
--
-- 'createDate', 'managedPolicyDetail_createDate' - The date and time, in
-- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- policy was created.
--
-- 'isAttachable', 'managedPolicyDetail_isAttachable' - Specifies whether the policy can be attached to an IAM user, group, or
-- role.
--
-- 'permissionsBoundaryUsageCount', 'managedPolicyDetail_permissionsBoundaryUsageCount' - The number of entities (users and roles) for which the policy is used as
-- the permissions boundary.
--
-- 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/.
--
-- 'defaultVersionId', 'managedPolicyDetail_defaultVersionId' - The identifier for the version of the policy that is set as the default
-- (operative) version.
--
-- For more information about policy versions, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html Versioning for managed policies>
-- in the /IAM User Guide/.
--
-- 'attachmentCount', 'managedPolicyDetail_attachmentCount' - The number of principal entities (users, groups, and roles) that the
-- policy is attached to.
--
-- 'description', 'managedPolicyDetail_description' - A friendly description of the policy.
newManagedPolicyDetail ::
  ManagedPolicyDetail
newManagedPolicyDetail :: ManagedPolicyDetail
newManagedPolicyDetail =
  ManagedPolicyDetail' :: Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe [PolicyVersion]
-> Maybe ISO8601
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ManagedPolicyDetail
ManagedPolicyDetail'
    { $sel:policyName:ManagedPolicyDetail' :: Maybe Text
policyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ManagedPolicyDetail' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updateDate:ManagedPolicyDetail' :: Maybe ISO8601
updateDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:policyId:ManagedPolicyDetail' :: Maybe Text
policyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:path:ManagedPolicyDetail' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:policyVersionList:ManagedPolicyDetail' :: Maybe [PolicyVersion]
policyVersionList = Maybe [PolicyVersion]
forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:ManagedPolicyDetail' :: Maybe ISO8601
createDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:isAttachable:ManagedPolicyDetail' :: Maybe Bool
isAttachable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionsBoundaryUsageCount:ManagedPolicyDetail' :: Maybe Int
permissionsBoundaryUsageCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultVersionId:ManagedPolicyDetail' :: Maybe Text
defaultVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentCount:ManagedPolicyDetail' :: Maybe Int
attachmentCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ManagedPolicyDetail' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The friendly name (not ARN) identifying the policy.
managedPolicyDetail_policyName :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Text)
managedPolicyDetail_policyName :: (Maybe Text -> f (Maybe Text))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_policyName = (ManagedPolicyDetail -> Maybe Text)
-> (ManagedPolicyDetail -> Maybe Text -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail ManagedPolicyDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe Text
policyName :: Maybe Text
$sel:policyName:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
policyName} -> Maybe Text
policyName) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe Text
a -> ManagedPolicyDetail
s {$sel:policyName:ManagedPolicyDetail' :: Maybe Text
policyName = Maybe Text
a} :: ManagedPolicyDetail)

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

-- | The date and time, in
-- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- policy was last updated.
--
-- When a policy has only one version, this field contains the date and
-- time when the policy was created. When a policy has more than one
-- version, this field contains the date and time when the most recent
-- policy version was created.
managedPolicyDetail_updateDate :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.UTCTime)
managedPolicyDetail_updateDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_updateDate = (ManagedPolicyDetail -> Maybe ISO8601)
-> (ManagedPolicyDetail -> Maybe ISO8601 -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail
     ManagedPolicyDetail
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe ISO8601
updateDate :: Maybe ISO8601
$sel:updateDate:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe ISO8601
updateDate} -> Maybe ISO8601
updateDate) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe ISO8601
a -> ManagedPolicyDetail
s {$sel:updateDate:ManagedPolicyDetail' :: Maybe ISO8601
updateDate = Maybe ISO8601
a} :: ManagedPolicyDetail) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> ManagedPolicyDetail -> f ManagedPolicyDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ManagedPolicyDetail
-> f ManagedPolicyDetail
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 policy.
--
-- For more information about IDs, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM identifiers>
-- in the /IAM User Guide/.
managedPolicyDetail_policyId :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Text)
managedPolicyDetail_policyId :: (Maybe Text -> f (Maybe Text))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_policyId = (ManagedPolicyDetail -> Maybe Text)
-> (ManagedPolicyDetail -> Maybe Text -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail ManagedPolicyDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe Text
policyId :: Maybe Text
$sel:policyId:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
policyId} -> Maybe Text
policyId) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe Text
a -> ManagedPolicyDetail
s {$sel:policyId:ManagedPolicyDetail' :: Maybe Text
policyId = Maybe Text
a} :: ManagedPolicyDetail)

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

-- | A list containing information about the versions of the policy.
managedPolicyDetail_policyVersionList :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe [PolicyVersion])
managedPolicyDetail_policyVersionList :: (Maybe [PolicyVersion] -> f (Maybe [PolicyVersion]))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_policyVersionList = (ManagedPolicyDetail -> Maybe [PolicyVersion])
-> (ManagedPolicyDetail
    -> Maybe [PolicyVersion] -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail
     ManagedPolicyDetail
     (Maybe [PolicyVersion])
     (Maybe [PolicyVersion])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe [PolicyVersion]
policyVersionList :: Maybe [PolicyVersion]
$sel:policyVersionList:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe [PolicyVersion]
policyVersionList} -> Maybe [PolicyVersion]
policyVersionList) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe [PolicyVersion]
a -> ManagedPolicyDetail
s {$sel:policyVersionList:ManagedPolicyDetail' :: Maybe [PolicyVersion]
policyVersionList = Maybe [PolicyVersion]
a} :: ManagedPolicyDetail) ((Maybe [PolicyVersion] -> f (Maybe [PolicyVersion]))
 -> ManagedPolicyDetail -> f ManagedPolicyDetail)
-> ((Maybe [PolicyVersion] -> f (Maybe [PolicyVersion]))
    -> Maybe [PolicyVersion] -> f (Maybe [PolicyVersion]))
-> (Maybe [PolicyVersion] -> f (Maybe [PolicyVersion]))
-> ManagedPolicyDetail
-> f ManagedPolicyDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PolicyVersion] [PolicyVersion] [PolicyVersion] [PolicyVersion]
-> Iso
     (Maybe [PolicyVersion])
     (Maybe [PolicyVersion])
     (Maybe [PolicyVersion])
     (Maybe [PolicyVersion])
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
  [PolicyVersion] [PolicyVersion] [PolicyVersion] [PolicyVersion]
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
-- policy was created.
managedPolicyDetail_createDate :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.UTCTime)
managedPolicyDetail_createDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_createDate = (ManagedPolicyDetail -> Maybe ISO8601)
-> (ManagedPolicyDetail -> Maybe ISO8601 -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail
     ManagedPolicyDetail
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe ISO8601
createDate :: Maybe ISO8601
$sel:createDate:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe ISO8601
createDate} -> Maybe ISO8601
createDate) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe ISO8601
a -> ManagedPolicyDetail
s {$sel:createDate:ManagedPolicyDetail' :: Maybe ISO8601
createDate = Maybe ISO8601
a} :: ManagedPolicyDetail) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> ManagedPolicyDetail -> f ManagedPolicyDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ManagedPolicyDetail
-> f ManagedPolicyDetail
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

-- | Specifies whether the policy can be attached to an IAM user, group, or
-- role.
managedPolicyDetail_isAttachable :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Bool)
managedPolicyDetail_isAttachable :: (Maybe Bool -> f (Maybe Bool))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_isAttachable = (ManagedPolicyDetail -> Maybe Bool)
-> (ManagedPolicyDetail -> Maybe Bool -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail ManagedPolicyDetail (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe Bool
isAttachable :: Maybe Bool
$sel:isAttachable:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Bool
isAttachable} -> Maybe Bool
isAttachable) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe Bool
a -> ManagedPolicyDetail
s {$sel:isAttachable:ManagedPolicyDetail' :: Maybe Bool
isAttachable = Maybe Bool
a} :: ManagedPolicyDetail)

-- | The number of entities (users and roles) for which the policy is used as
-- the permissions boundary.
--
-- 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/.
managedPolicyDetail_permissionsBoundaryUsageCount :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Int)
managedPolicyDetail_permissionsBoundaryUsageCount :: (Maybe Int -> f (Maybe Int))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_permissionsBoundaryUsageCount = (ManagedPolicyDetail -> Maybe Int)
-> (ManagedPolicyDetail -> Maybe Int -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail ManagedPolicyDetail (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe Int
permissionsBoundaryUsageCount :: Maybe Int
$sel:permissionsBoundaryUsageCount:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Int
permissionsBoundaryUsageCount} -> Maybe Int
permissionsBoundaryUsageCount) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe Int
a -> ManagedPolicyDetail
s {$sel:permissionsBoundaryUsageCount:ManagedPolicyDetail' :: Maybe Int
permissionsBoundaryUsageCount = Maybe Int
a} :: ManagedPolicyDetail)

-- | The identifier for the version of the policy that is set as the default
-- (operative) version.
--
-- For more information about policy versions, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html Versioning for managed policies>
-- in the /IAM User Guide/.
managedPolicyDetail_defaultVersionId :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Text)
managedPolicyDetail_defaultVersionId :: (Maybe Text -> f (Maybe Text))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_defaultVersionId = (ManagedPolicyDetail -> Maybe Text)
-> (ManagedPolicyDetail -> Maybe Text -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail ManagedPolicyDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe Text
defaultVersionId :: Maybe Text
$sel:defaultVersionId:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
defaultVersionId} -> Maybe Text
defaultVersionId) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe Text
a -> ManagedPolicyDetail
s {$sel:defaultVersionId:ManagedPolicyDetail' :: Maybe Text
defaultVersionId = Maybe Text
a} :: ManagedPolicyDetail)

-- | The number of principal entities (users, groups, and roles) that the
-- policy is attached to.
managedPolicyDetail_attachmentCount :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Int)
managedPolicyDetail_attachmentCount :: (Maybe Int -> f (Maybe Int))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_attachmentCount = (ManagedPolicyDetail -> Maybe Int)
-> (ManagedPolicyDetail -> Maybe Int -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail ManagedPolicyDetail (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe Int
attachmentCount :: Maybe Int
$sel:attachmentCount:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Int
attachmentCount} -> Maybe Int
attachmentCount) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe Int
a -> ManagedPolicyDetail
s {$sel:attachmentCount:ManagedPolicyDetail' :: Maybe Int
attachmentCount = Maybe Int
a} :: ManagedPolicyDetail)

-- | A friendly description of the policy.
managedPolicyDetail_description :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Text)
managedPolicyDetail_description :: (Maybe Text -> f (Maybe Text))
-> ManagedPolicyDetail -> f ManagedPolicyDetail
managedPolicyDetail_description = (ManagedPolicyDetail -> Maybe Text)
-> (ManagedPolicyDetail -> Maybe Text -> ManagedPolicyDetail)
-> Lens
     ManagedPolicyDetail ManagedPolicyDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedPolicyDetail' {Maybe Text
description :: Maybe Text
$sel:description:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
description} -> Maybe Text
description) (\s :: ManagedPolicyDetail
s@ManagedPolicyDetail' {} Maybe Text
a -> ManagedPolicyDetail
s {$sel:description:ManagedPolicyDetail' :: Maybe Text
description = Maybe Text
a} :: ManagedPolicyDetail)

instance Core.FromXML ManagedPolicyDetail where
  parseXML :: [Node] -> Either String ManagedPolicyDetail
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe [PolicyVersion]
-> Maybe ISO8601
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ManagedPolicyDetail
ManagedPolicyDetail'
      (Maybe Text
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe Text
 -> Maybe Text
 -> Maybe [PolicyVersion]
 -> Maybe ISO8601
 -> Maybe Bool
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> ManagedPolicyDetail)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PolicyVersion]
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ManagedPolicyDetail)
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
"PolicyName")
      Either
  String
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PolicyVersion]
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ManagedPolicyDetail)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PolicyVersion]
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ManagedPolicyDetail)
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
"Arn")
      Either
  String
  (Maybe ISO8601
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PolicyVersion]
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ManagedPolicyDetail)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [PolicyVersion]
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ManagedPolicyDetail)
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
"UpdateDate")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [PolicyVersion]
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ManagedPolicyDetail)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [PolicyVersion]
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ManagedPolicyDetail)
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
"PolicyId")
      Either
  String
  (Maybe Text
   -> Maybe [PolicyVersion]
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ManagedPolicyDetail)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [PolicyVersion]
      -> Maybe ISO8601
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ManagedPolicyDetail)
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 [PolicyVersion]
   -> Maybe ISO8601
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ManagedPolicyDetail)
-> Either String (Maybe [PolicyVersion])
-> Either
     String
     (Maybe ISO8601
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ManagedPolicyDetail)
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
"PolicyVersionList"
                      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 [PolicyVersion]))
-> Either String (Maybe [PolicyVersion])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PolicyVersion])
-> [Node] -> Either String (Maybe [PolicyVersion])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [PolicyVersion]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe ISO8601
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ManagedPolicyDetail)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ManagedPolicyDetail)
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 Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ManagedPolicyDetail)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Int
      -> Maybe Text -> Maybe Int -> Maybe Text -> ManagedPolicyDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsAttachable")
      Either
  String
  (Maybe Int
   -> Maybe Text -> Maybe Int -> Maybe Text -> ManagedPolicyDetail)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text -> Maybe Int -> Maybe Text -> ManagedPolicyDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PermissionsBoundaryUsageCount")
      Either
  String
  (Maybe Text -> Maybe Int -> Maybe Text -> ManagedPolicyDetail)
-> Either String (Maybe Text)
-> Either String (Maybe Int -> Maybe Text -> ManagedPolicyDetail)
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
"DefaultVersionId")
      Either String (Maybe Int -> Maybe Text -> ManagedPolicyDetail)
-> Either String (Maybe Int)
-> Either String (Maybe Text -> ManagedPolicyDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AttachmentCount")
      Either String (Maybe Text -> ManagedPolicyDetail)
-> Either String (Maybe Text) -> Either String ManagedPolicyDetail
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
"Description")

instance Prelude.Hashable ManagedPolicyDetail

instance Prelude.NFData ManagedPolicyDetail