{-# 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-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.ManagedPolicyDetail 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.PolicyVersion
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'
  { ManagedPolicyDetail -> Maybe Text
arn :: 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,
    -- | 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 Data.ISO8601,
    -- | 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,
    -- | A friendly description of the policy.
    ManagedPolicyDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the policy can be attached to an IAM user, group, or
    -- role.
    ManagedPolicyDetail -> Maybe Bool
isAttachable :: Prelude.Maybe Prelude.Bool,
    -- | 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,
    -- | 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 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 friendly name (not ARN) identifying the policy.
    ManagedPolicyDetail -> Maybe Text
policyName :: 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 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 Data.ISO8601
  }
  deriving (ManagedPolicyDetail -> ManagedPolicyDetail -> Bool
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]
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
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. 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:
--
-- 'arn', 'managedPolicyDetail_arn' - Undocumented member.
--
-- 'attachmentCount', 'managedPolicyDetail_attachmentCount' - The number of principal entities (users, groups, and roles) that the
-- policy is attached to.
--
-- 'createDate', 'managedPolicyDetail_createDate' - The date and time, in
-- <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- policy was created.
--
-- '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/.
--
-- 'description', 'managedPolicyDetail_description' - A friendly description of the policy.
--
-- 'isAttachable', 'managedPolicyDetail_isAttachable' - Specifies whether the policy can be attached to an IAM user, group, or
-- role.
--
-- '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/.
--
-- '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/.
--
-- '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/.
--
-- 'policyName', 'managedPolicyDetail_policyName' - The friendly name (not ARN) identifying the policy.
--
-- 'policyVersionList', 'managedPolicyDetail_policyVersionList' - A list containing information about the versions of the policy.
--
-- '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.
newManagedPolicyDetail ::
  ManagedPolicyDetail
newManagedPolicyDetail :: ManagedPolicyDetail
newManagedPolicyDetail =
  ManagedPolicyDetail'
    { $sel:arn:ManagedPolicyDetail' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentCount:ManagedPolicyDetail' :: Maybe Int
attachmentCount = forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:ManagedPolicyDetail' :: Maybe ISO8601
createDate = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultVersionId:ManagedPolicyDetail' :: Maybe Text
defaultVersionId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:ManagedPolicyDetail' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:isAttachable:ManagedPolicyDetail' :: Maybe Bool
isAttachable = forall a. Maybe a
Prelude.Nothing,
      $sel:path:ManagedPolicyDetail' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing,
      $sel:permissionsBoundaryUsageCount:ManagedPolicyDetail' :: Maybe Int
permissionsBoundaryUsageCount = forall a. Maybe a
Prelude.Nothing,
      $sel:policyId:ManagedPolicyDetail' :: Maybe Text
policyId = forall a. Maybe a
Prelude.Nothing,
      $sel:policyName:ManagedPolicyDetail' :: Maybe Text
policyName = forall a. Maybe a
Prelude.Nothing,
      $sel:policyVersionList:ManagedPolicyDetail' :: Maybe [PolicyVersion]
policyVersionList = forall a. Maybe a
Prelude.Nothing,
      $sel:updateDate:ManagedPolicyDetail' :: Maybe ISO8601
updateDate = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
managedPolicyDetail_arn :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Text)
managedPolicyDetail_arn :: Lens' ManagedPolicyDetail (Maybe Text)
managedPolicyDetail_arn = 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 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 :: Lens' ManagedPolicyDetail (Maybe Int)
managedPolicyDetail_attachmentCount = 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)

-- | 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 :: Lens' ManagedPolicyDetail (Maybe UTCTime)
managedPolicyDetail_createDate = 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) 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

-- | 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 :: Lens' ManagedPolicyDetail (Maybe Text)
managedPolicyDetail_defaultVersionId = 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)

-- | A friendly description of the policy.
managedPolicyDetail_description :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Text)
managedPolicyDetail_description :: Lens' ManagedPolicyDetail (Maybe Text)
managedPolicyDetail_description = 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)

-- | 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 :: Lens' ManagedPolicyDetail (Maybe Bool)
managedPolicyDetail_isAttachable = 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 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 :: Lens' ManagedPolicyDetail (Maybe Text)
managedPolicyDetail_path = 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)

-- | 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 :: Lens' ManagedPolicyDetail (Maybe Int)
managedPolicyDetail_permissionsBoundaryUsageCount = 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 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 :: Lens' ManagedPolicyDetail (Maybe Text)
managedPolicyDetail_policyId = 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 friendly name (not ARN) identifying the policy.
managedPolicyDetail_policyName :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe Prelude.Text)
managedPolicyDetail_policyName :: Lens' ManagedPolicyDetail (Maybe Text)
managedPolicyDetail_policyName = 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)

-- | A list containing information about the versions of the policy.
managedPolicyDetail_policyVersionList :: Lens.Lens' ManagedPolicyDetail (Prelude.Maybe [PolicyVersion])
managedPolicyDetail_policyVersionList :: Lens' ManagedPolicyDetail (Maybe [PolicyVersion])
managedPolicyDetail_policyVersionList = 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) 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
-- 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 :: Lens' ManagedPolicyDetail (Maybe UTCTime)
managedPolicyDetail_updateDate = 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) 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

instance Data.FromXML ManagedPolicyDetail where
  parseXML :: [Node] -> Either String ManagedPolicyDetail
parseXML [Node]
x =
    Maybe Text
-> Maybe Int
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe [PolicyVersion]
-> Maybe ISO8601
-> ManagedPolicyDetail
ManagedPolicyDetail'
      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
"AttachmentCount")
      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
"DefaultVersionId")
      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
"Description")
      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
"IsAttachable")
      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
"PermissionsBoundaryUsageCount")
      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
"PolicyId")
      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
"PolicyName")
      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
"PolicyVersionList"
                      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
"UpdateDate")

instance Prelude.Hashable ManagedPolicyDetail where
  hashWithSalt :: Int -> ManagedPolicyDetail -> Int
hashWithSalt Int
_salt ManagedPolicyDetail' {Maybe Bool
Maybe Int
Maybe [PolicyVersion]
Maybe Text
Maybe ISO8601
updateDate :: Maybe ISO8601
policyVersionList :: Maybe [PolicyVersion]
policyName :: Maybe Text
policyId :: Maybe Text
permissionsBoundaryUsageCount :: Maybe Int
path :: Maybe Text
isAttachable :: Maybe Bool
description :: Maybe Text
defaultVersionId :: Maybe Text
createDate :: Maybe ISO8601
attachmentCount :: Maybe Int
arn :: Maybe Text
$sel:updateDate:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe ISO8601
$sel:policyVersionList:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe [PolicyVersion]
$sel:policyName:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:policyId:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:permissionsBoundaryUsageCount:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Int
$sel:path:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:isAttachable:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Bool
$sel:description:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:defaultVersionId:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:createDate:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe ISO8601
$sel:attachmentCount:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Int
$sel:arn:ManagedPolicyDetail' :: ManagedPolicyDetail -> 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 Int
attachmentCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultVersionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isAttachable
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
permissionsBoundaryUsageCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PolicyVersion]
policyVersionList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
updateDate

instance Prelude.NFData ManagedPolicyDetail where
  rnf :: ManagedPolicyDetail -> ()
rnf ManagedPolicyDetail' {Maybe Bool
Maybe Int
Maybe [PolicyVersion]
Maybe Text
Maybe ISO8601
updateDate :: Maybe ISO8601
policyVersionList :: Maybe [PolicyVersion]
policyName :: Maybe Text
policyId :: Maybe Text
permissionsBoundaryUsageCount :: Maybe Int
path :: Maybe Text
isAttachable :: Maybe Bool
description :: Maybe Text
defaultVersionId :: Maybe Text
createDate :: Maybe ISO8601
attachmentCount :: Maybe Int
arn :: Maybe Text
$sel:updateDate:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe ISO8601
$sel:policyVersionList:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe [PolicyVersion]
$sel:policyName:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:policyId:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:permissionsBoundaryUsageCount:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Int
$sel:path:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:isAttachable:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Bool
$sel:description:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:defaultVersionId:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Text
$sel:createDate:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe ISO8601
$sel:attachmentCount:ManagedPolicyDetail' :: ManagedPolicyDetail -> Maybe Int
$sel:arn:ManagedPolicyDetail' :: ManagedPolicyDetail -> 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 Int
attachmentCount
      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 Text
defaultVersionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isAttachable
      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 Int
permissionsBoundaryUsageCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PolicyVersion]
policyVersionList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
updateDate