{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetAccountAuthorizationDetails
-- 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)
--
-- Retrieves information about all IAM users, groups, roles, and policies
-- in your Amazon Web Services account, including their relationships to
-- one another. Use this operation to obtain a snapshot of the
-- configuration of IAM permissions (users, groups, roles, and policies) in
-- your account.
--
-- Policies returned by this operation are URL-encoded compliant with
-- <https://tools.ietf.org/html/rfc3986 RFC 3986>. You can use a URL
-- decoding method to convert the policy back to plain JSON text. For
-- example, if you use Java, you can use the @decode@ method of the
-- @java.net.URLDecoder@ utility class in the Java SDK. Other languages and
-- SDKs provide similar functionality.
--
-- You can optionally filter the results using the @Filter@ parameter. You
-- can paginate the results using the @MaxItems@ and @Marker@ parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.GetAccountAuthorizationDetails
  ( -- * Creating a Request
    GetAccountAuthorizationDetails (..),
    newGetAccountAuthorizationDetails,

    -- * Request Lenses
    getAccountAuthorizationDetails_marker,
    getAccountAuthorizationDetails_maxItems,
    getAccountAuthorizationDetails_filter,

    -- * Destructuring the Response
    GetAccountAuthorizationDetailsResponse (..),
    newGetAccountAuthorizationDetailsResponse,

    -- * Response Lenses
    getAccountAuthorizationDetailsResponse_roleDetailList,
    getAccountAuthorizationDetailsResponse_groupDetailList,
    getAccountAuthorizationDetailsResponse_userDetailList,
    getAccountAuthorizationDetailsResponse_marker,
    getAccountAuthorizationDetailsResponse_isTruncated,
    getAccountAuthorizationDetailsResponse_policies,
    getAccountAuthorizationDetailsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetAccountAuthorizationDetails' smart constructor.
data GetAccountAuthorizationDetails = GetAccountAuthorizationDetails'
  { -- | Use this parameter only when paginating results and only after you
    -- receive a response indicating that the results are truncated. Set it to
    -- the value of the @Marker@ element in the response that you received to
    -- indicate where the next call should start.
    GetAccountAuthorizationDetails -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this only when paginating results to indicate the maximum number of
    -- items you want in the response. If additional items exist beyond the
    -- maximum you specify, the @IsTruncated@ response element is @true@.
    --
    -- If you do not include this parameter, the number of items defaults to
    -- 100. Note that IAM might return fewer results, even when there are more
    -- results available. In that case, the @IsTruncated@ response element
    -- returns @true@, and @Marker@ contains a value to include in the
    -- subsequent call that tells the service where to continue from.
    GetAccountAuthorizationDetails -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | A list of entity types used to filter the results. Only the entities
    -- that match the types you specify are included in the output. Use the
    -- value @LocalManagedPolicy@ to include customer managed policies.
    --
    -- The format for this parameter is a comma-separated (if more than one)
    -- list of strings. Each string value in the list must be one of the valid
    -- values listed below.
    GetAccountAuthorizationDetails -> Maybe [EntityType]
filter' :: Prelude.Maybe [EntityType]
  }
  deriving (GetAccountAuthorizationDetails
-> GetAccountAuthorizationDetails -> Bool
(GetAccountAuthorizationDetails
 -> GetAccountAuthorizationDetails -> Bool)
-> (GetAccountAuthorizationDetails
    -> GetAccountAuthorizationDetails -> Bool)
-> Eq GetAccountAuthorizationDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccountAuthorizationDetails
-> GetAccountAuthorizationDetails -> Bool
$c/= :: GetAccountAuthorizationDetails
-> GetAccountAuthorizationDetails -> Bool
== :: GetAccountAuthorizationDetails
-> GetAccountAuthorizationDetails -> Bool
$c== :: GetAccountAuthorizationDetails
-> GetAccountAuthorizationDetails -> Bool
Prelude.Eq, ReadPrec [GetAccountAuthorizationDetails]
ReadPrec GetAccountAuthorizationDetails
Int -> ReadS GetAccountAuthorizationDetails
ReadS [GetAccountAuthorizationDetails]
(Int -> ReadS GetAccountAuthorizationDetails)
-> ReadS [GetAccountAuthorizationDetails]
-> ReadPrec GetAccountAuthorizationDetails
-> ReadPrec [GetAccountAuthorizationDetails]
-> Read GetAccountAuthorizationDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccountAuthorizationDetails]
$creadListPrec :: ReadPrec [GetAccountAuthorizationDetails]
readPrec :: ReadPrec GetAccountAuthorizationDetails
$creadPrec :: ReadPrec GetAccountAuthorizationDetails
readList :: ReadS [GetAccountAuthorizationDetails]
$creadList :: ReadS [GetAccountAuthorizationDetails]
readsPrec :: Int -> ReadS GetAccountAuthorizationDetails
$creadsPrec :: Int -> ReadS GetAccountAuthorizationDetails
Prelude.Read, Int -> GetAccountAuthorizationDetails -> ShowS
[GetAccountAuthorizationDetails] -> ShowS
GetAccountAuthorizationDetails -> String
(Int -> GetAccountAuthorizationDetails -> ShowS)
-> (GetAccountAuthorizationDetails -> String)
-> ([GetAccountAuthorizationDetails] -> ShowS)
-> Show GetAccountAuthorizationDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccountAuthorizationDetails] -> ShowS
$cshowList :: [GetAccountAuthorizationDetails] -> ShowS
show :: GetAccountAuthorizationDetails -> String
$cshow :: GetAccountAuthorizationDetails -> String
showsPrec :: Int -> GetAccountAuthorizationDetails -> ShowS
$cshowsPrec :: Int -> GetAccountAuthorizationDetails -> ShowS
Prelude.Show, (forall x.
 GetAccountAuthorizationDetails
 -> Rep GetAccountAuthorizationDetails x)
-> (forall x.
    Rep GetAccountAuthorizationDetails x
    -> GetAccountAuthorizationDetails)
-> Generic GetAccountAuthorizationDetails
forall x.
Rep GetAccountAuthorizationDetails x
-> GetAccountAuthorizationDetails
forall x.
GetAccountAuthorizationDetails
-> Rep GetAccountAuthorizationDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAccountAuthorizationDetails x
-> GetAccountAuthorizationDetails
$cfrom :: forall x.
GetAccountAuthorizationDetails
-> Rep GetAccountAuthorizationDetails x
Prelude.Generic)

-- |
-- Create a value of 'GetAccountAuthorizationDetails' 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:
--
-- 'marker', 'getAccountAuthorizationDetails_marker' - Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
--
-- 'maxItems', 'getAccountAuthorizationDetails_maxItems' - Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
--
-- 'filter'', 'getAccountAuthorizationDetails_filter' - A list of entity types used to filter the results. Only the entities
-- that match the types you specify are included in the output. Use the
-- value @LocalManagedPolicy@ to include customer managed policies.
--
-- The format for this parameter is a comma-separated (if more than one)
-- list of strings. Each string value in the list must be one of the valid
-- values listed below.
newGetAccountAuthorizationDetails ::
  GetAccountAuthorizationDetails
newGetAccountAuthorizationDetails :: GetAccountAuthorizationDetails
newGetAccountAuthorizationDetails =
  GetAccountAuthorizationDetails' :: Maybe Text
-> Maybe Natural
-> Maybe [EntityType]
-> GetAccountAuthorizationDetails
GetAccountAuthorizationDetails'
    { $sel:marker:GetAccountAuthorizationDetails' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:GetAccountAuthorizationDetails' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':GetAccountAuthorizationDetails' :: Maybe [EntityType]
filter' = Maybe [EntityType]
forall a. Maybe a
Prelude.Nothing
    }

-- | Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
getAccountAuthorizationDetails_marker :: Lens.Lens' GetAccountAuthorizationDetails (Prelude.Maybe Prelude.Text)
getAccountAuthorizationDetails_marker :: (Maybe Text -> f (Maybe Text))
-> GetAccountAuthorizationDetails
-> f GetAccountAuthorizationDetails
getAccountAuthorizationDetails_marker = (GetAccountAuthorizationDetails -> Maybe Text)
-> (GetAccountAuthorizationDetails
    -> Maybe Text -> GetAccountAuthorizationDetails)
-> Lens
     GetAccountAuthorizationDetails
     GetAccountAuthorizationDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetails' {Maybe Text
marker :: Maybe Text
$sel:marker:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Text
marker} -> Maybe Text
marker) (\s :: GetAccountAuthorizationDetails
s@GetAccountAuthorizationDetails' {} Maybe Text
a -> GetAccountAuthorizationDetails
s {$sel:marker:GetAccountAuthorizationDetails' :: Maybe Text
marker = Maybe Text
a} :: GetAccountAuthorizationDetails)

-- | Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
getAccountAuthorizationDetails_maxItems :: Lens.Lens' GetAccountAuthorizationDetails (Prelude.Maybe Prelude.Natural)
getAccountAuthorizationDetails_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> GetAccountAuthorizationDetails
-> f GetAccountAuthorizationDetails
getAccountAuthorizationDetails_maxItems = (GetAccountAuthorizationDetails -> Maybe Natural)
-> (GetAccountAuthorizationDetails
    -> Maybe Natural -> GetAccountAuthorizationDetails)
-> Lens
     GetAccountAuthorizationDetails
     GetAccountAuthorizationDetails
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetails' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: GetAccountAuthorizationDetails
s@GetAccountAuthorizationDetails' {} Maybe Natural
a -> GetAccountAuthorizationDetails
s {$sel:maxItems:GetAccountAuthorizationDetails' :: Maybe Natural
maxItems = Maybe Natural
a} :: GetAccountAuthorizationDetails)

-- | A list of entity types used to filter the results. Only the entities
-- that match the types you specify are included in the output. Use the
-- value @LocalManagedPolicy@ to include customer managed policies.
--
-- The format for this parameter is a comma-separated (if more than one)
-- list of strings. Each string value in the list must be one of the valid
-- values listed below.
getAccountAuthorizationDetails_filter :: Lens.Lens' GetAccountAuthorizationDetails (Prelude.Maybe [EntityType])
getAccountAuthorizationDetails_filter :: (Maybe [EntityType] -> f (Maybe [EntityType]))
-> GetAccountAuthorizationDetails
-> f GetAccountAuthorizationDetails
getAccountAuthorizationDetails_filter = (GetAccountAuthorizationDetails -> Maybe [EntityType])
-> (GetAccountAuthorizationDetails
    -> Maybe [EntityType] -> GetAccountAuthorizationDetails)
-> Lens
     GetAccountAuthorizationDetails
     GetAccountAuthorizationDetails
     (Maybe [EntityType])
     (Maybe [EntityType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetails' {Maybe [EntityType]
filter' :: Maybe [EntityType]
$sel:filter':GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe [EntityType]
filter'} -> Maybe [EntityType]
filter') (\s :: GetAccountAuthorizationDetails
s@GetAccountAuthorizationDetails' {} Maybe [EntityType]
a -> GetAccountAuthorizationDetails
s {$sel:filter':GetAccountAuthorizationDetails' :: Maybe [EntityType]
filter' = Maybe [EntityType]
a} :: GetAccountAuthorizationDetails) ((Maybe [EntityType] -> f (Maybe [EntityType]))
 -> GetAccountAuthorizationDetails
 -> f GetAccountAuthorizationDetails)
-> ((Maybe [EntityType] -> f (Maybe [EntityType]))
    -> Maybe [EntityType] -> f (Maybe [EntityType]))
-> (Maybe [EntityType] -> f (Maybe [EntityType]))
-> GetAccountAuthorizationDetails
-> f GetAccountAuthorizationDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [EntityType] [EntityType] [EntityType] [EntityType]
-> Iso
     (Maybe [EntityType])
     (Maybe [EntityType])
     (Maybe [EntityType])
     (Maybe [EntityType])
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 [EntityType] [EntityType] [EntityType] [EntityType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager GetAccountAuthorizationDetails where
  page :: GetAccountAuthorizationDetails
-> AWSResponse GetAccountAuthorizationDetails
-> Maybe GetAccountAuthorizationDetails
page GetAccountAuthorizationDetails
rq AWSResponse GetAccountAuthorizationDetails
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAccountAuthorizationDetails
GetAccountAuthorizationDetailsResponse
rs
            GetAccountAuthorizationDetailsResponse
-> Getting (First Bool) GetAccountAuthorizationDetailsResponse Bool
-> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> GetAccountAuthorizationDetailsResponse
-> Const (First Bool) GetAccountAuthorizationDetailsResponse
Lens' GetAccountAuthorizationDetailsResponse (Maybe Bool)
getAccountAuthorizationDetailsResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> GetAccountAuthorizationDetailsResponse
 -> Const (First Bool) GetAccountAuthorizationDetailsResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) GetAccountAuthorizationDetailsResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const (First Bool) Bool)
-> Maybe Bool -> Const (First Bool) (Maybe Bool)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetAccountAuthorizationDetails
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse GetAccountAuthorizationDetails
GetAccountAuthorizationDetailsResponse
rs
            GetAccountAuthorizationDetailsResponse
-> Getting (First Text) GetAccountAuthorizationDetailsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAccountAuthorizationDetailsResponse
-> Const (First Text) GetAccountAuthorizationDetailsResponse
Lens' GetAccountAuthorizationDetailsResponse (Maybe Text)
getAccountAuthorizationDetailsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAccountAuthorizationDetailsResponse
 -> Const (First Text) GetAccountAuthorizationDetailsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAccountAuthorizationDetailsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetAccountAuthorizationDetails
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetAccountAuthorizationDetails
-> Maybe GetAccountAuthorizationDetails
forall a. a -> Maybe a
Prelude.Just (GetAccountAuthorizationDetails
 -> Maybe GetAccountAuthorizationDetails)
-> GetAccountAuthorizationDetails
-> Maybe GetAccountAuthorizationDetails
forall a b. (a -> b) -> a -> b
Prelude.$
        GetAccountAuthorizationDetails
rq
          GetAccountAuthorizationDetails
-> (GetAccountAuthorizationDetails
    -> GetAccountAuthorizationDetails)
-> GetAccountAuthorizationDetails
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetAccountAuthorizationDetails
-> Identity GetAccountAuthorizationDetails
Lens
  GetAccountAuthorizationDetails
  GetAccountAuthorizationDetails
  (Maybe Text)
  (Maybe Text)
getAccountAuthorizationDetails_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> GetAccountAuthorizationDetails
 -> Identity GetAccountAuthorizationDetails)
-> Maybe Text
-> GetAccountAuthorizationDetails
-> GetAccountAuthorizationDetails
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetAccountAuthorizationDetails
GetAccountAuthorizationDetailsResponse
rs
          GetAccountAuthorizationDetailsResponse
-> Getting (First Text) GetAccountAuthorizationDetailsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAccountAuthorizationDetailsResponse
-> Const (First Text) GetAccountAuthorizationDetailsResponse
Lens' GetAccountAuthorizationDetailsResponse (Maybe Text)
getAccountAuthorizationDetailsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAccountAuthorizationDetailsResponse
 -> Const (First Text) GetAccountAuthorizationDetailsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAccountAuthorizationDetailsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    GetAccountAuthorizationDetails
  where
  type
    AWSResponse GetAccountAuthorizationDetails =
      GetAccountAuthorizationDetailsResponse
  request :: GetAccountAuthorizationDetails
-> Request GetAccountAuthorizationDetails
request = Service
-> GetAccountAuthorizationDetails
-> Request GetAccountAuthorizationDetails
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAccountAuthorizationDetails
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetAccountAuthorizationDetails)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse GetAccountAuthorizationDetails))
-> Logger
-> Service
-> Proxy GetAccountAuthorizationDetails
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetAccountAuthorizationDetails)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"GetAccountAuthorizationDetailsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [RoleDetail]
-> Maybe [GroupDetail]
-> Maybe [UserDetail]
-> Maybe Text
-> Maybe Bool
-> Maybe [ManagedPolicyDetail]
-> Int
-> GetAccountAuthorizationDetailsResponse
GetAccountAuthorizationDetailsResponse'
            (Maybe [RoleDetail]
 -> Maybe [GroupDetail]
 -> Maybe [UserDetail]
 -> Maybe Text
 -> Maybe Bool
 -> Maybe [ManagedPolicyDetail]
 -> Int
 -> GetAccountAuthorizationDetailsResponse)
-> Either String (Maybe [RoleDetail])
-> Either
     String
     (Maybe [GroupDetail]
      -> Maybe [UserDetail]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [ManagedPolicyDetail]
      -> Int
      -> GetAccountAuthorizationDetailsResponse)
forall (f :: * -> *) a b. Functor 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
"RoleDetailList" 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 [RoleDetail]))
-> Either String (Maybe [RoleDetail])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [RoleDetail])
-> [Node] -> Either String (Maybe [RoleDetail])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [RoleDetail]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either
  String
  (Maybe [GroupDetail]
   -> Maybe [UserDetail]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [ManagedPolicyDetail]
   -> Int
   -> GetAccountAuthorizationDetailsResponse)
-> Either String (Maybe [GroupDetail])
-> Either
     String
     (Maybe [UserDetail]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe [ManagedPolicyDetail]
      -> Int
      -> GetAccountAuthorizationDetailsResponse)
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
"GroupDetailList" 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 [GroupDetail]))
-> Either String (Maybe [GroupDetail])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [GroupDetail])
-> [Node] -> Either String (Maybe [GroupDetail])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [GroupDetail]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either
  String
  (Maybe [UserDetail]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe [ManagedPolicyDetail]
   -> Int
   -> GetAccountAuthorizationDetailsResponse)
-> Either String (Maybe [UserDetail])
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe [ManagedPolicyDetail]
      -> Int
      -> GetAccountAuthorizationDetailsResponse)
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
"UserDetailList" 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 [UserDetail]))
-> Either String (Maybe [UserDetail])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [UserDetail])
-> [Node] -> Either String (Maybe [UserDetail])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [UserDetail]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe [ManagedPolicyDetail]
   -> Int
   -> GetAccountAuthorizationDetailsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe [ManagedPolicyDetail]
      -> Int
      -> GetAccountAuthorizationDetailsResponse)
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
"Marker")
            Either
  String
  (Maybe Bool
   -> Maybe [ManagedPolicyDetail]
   -> Int
   -> GetAccountAuthorizationDetailsResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [ManagedPolicyDetail]
      -> Int -> GetAccountAuthorizationDetailsResponse)
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
"IsTruncated")
            Either
  String
  (Maybe [ManagedPolicyDetail]
   -> Int -> GetAccountAuthorizationDetailsResponse)
-> Either String (Maybe [ManagedPolicyDetail])
-> Either String (Int -> GetAccountAuthorizationDetailsResponse)
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
"Policies" 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 [ManagedPolicyDetail]))
-> Either String (Maybe [ManagedPolicyDetail])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ManagedPolicyDetail])
-> [Node] -> Either String (Maybe [ManagedPolicyDetail])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ManagedPolicyDetail]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> GetAccountAuthorizationDetailsResponse)
-> Either String Int
-> Either String GetAccountAuthorizationDetailsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetAccountAuthorizationDetails

instance
  Prelude.NFData
    GetAccountAuthorizationDetails

instance
  Core.ToHeaders
    GetAccountAuthorizationDetails
  where
  toHeaders :: GetAccountAuthorizationDetails -> ResponseHeaders
toHeaders = ResponseHeaders
-> GetAccountAuthorizationDetails -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath GetAccountAuthorizationDetails where
  toPath :: GetAccountAuthorizationDetails -> ByteString
toPath = ByteString -> GetAccountAuthorizationDetails -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery GetAccountAuthorizationDetails where
  toQuery :: GetAccountAuthorizationDetails -> QueryString
toQuery GetAccountAuthorizationDetails' {Maybe Natural
Maybe [EntityType]
Maybe Text
filter' :: Maybe [EntityType]
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:filter':GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe [EntityType]
$sel:maxItems:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Natural
$sel:marker:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"GetAccountAuthorizationDetails" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems,
        ByteString
"Filter"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [EntityType] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([EntityType] -> QueryString)
-> Maybe [EntityType] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EntityType]
filter')
      ]

-- | Contains the response to a successful GetAccountAuthorizationDetails
-- request.
--
-- /See:/ 'newGetAccountAuthorizationDetailsResponse' smart constructor.
data GetAccountAuthorizationDetailsResponse = GetAccountAuthorizationDetailsResponse'
  { -- | A list containing information about IAM roles.
    GetAccountAuthorizationDetailsResponse -> Maybe [RoleDetail]
roleDetailList :: Prelude.Maybe [RoleDetail],
    -- | A list containing information about IAM groups.
    GetAccountAuthorizationDetailsResponse -> Maybe [GroupDetail]
groupDetailList :: Prelude.Maybe [GroupDetail],
    -- | A list containing information about IAM users.
    GetAccountAuthorizationDetailsResponse -> Maybe [UserDetail]
userDetailList :: Prelude.Maybe [UserDetail],
    -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    GetAccountAuthorizationDetailsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A flag that indicates whether there are more items to return. If your
    -- results were truncated, you can make a subsequent pagination request
    -- using the @Marker@ request parameter to retrieve more items. Note that
    -- IAM might return fewer than the @MaxItems@ number of results even when
    -- there are more results available. We recommend that you check
    -- @IsTruncated@ after every call to ensure that you receive all your
    -- results.
    GetAccountAuthorizationDetailsResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | A list containing information about managed policies.
    GetAccountAuthorizationDetailsResponse
-> Maybe [ManagedPolicyDetail]
policies :: Prelude.Maybe [ManagedPolicyDetail],
    -- | The response's http status code.
    GetAccountAuthorizationDetailsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAccountAuthorizationDetailsResponse
-> GetAccountAuthorizationDetailsResponse -> Bool
(GetAccountAuthorizationDetailsResponse
 -> GetAccountAuthorizationDetailsResponse -> Bool)
-> (GetAccountAuthorizationDetailsResponse
    -> GetAccountAuthorizationDetailsResponse -> Bool)
-> Eq GetAccountAuthorizationDetailsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccountAuthorizationDetailsResponse
-> GetAccountAuthorizationDetailsResponse -> Bool
$c/= :: GetAccountAuthorizationDetailsResponse
-> GetAccountAuthorizationDetailsResponse -> Bool
== :: GetAccountAuthorizationDetailsResponse
-> GetAccountAuthorizationDetailsResponse -> Bool
$c== :: GetAccountAuthorizationDetailsResponse
-> GetAccountAuthorizationDetailsResponse -> Bool
Prelude.Eq, ReadPrec [GetAccountAuthorizationDetailsResponse]
ReadPrec GetAccountAuthorizationDetailsResponse
Int -> ReadS GetAccountAuthorizationDetailsResponse
ReadS [GetAccountAuthorizationDetailsResponse]
(Int -> ReadS GetAccountAuthorizationDetailsResponse)
-> ReadS [GetAccountAuthorizationDetailsResponse]
-> ReadPrec GetAccountAuthorizationDetailsResponse
-> ReadPrec [GetAccountAuthorizationDetailsResponse]
-> Read GetAccountAuthorizationDetailsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccountAuthorizationDetailsResponse]
$creadListPrec :: ReadPrec [GetAccountAuthorizationDetailsResponse]
readPrec :: ReadPrec GetAccountAuthorizationDetailsResponse
$creadPrec :: ReadPrec GetAccountAuthorizationDetailsResponse
readList :: ReadS [GetAccountAuthorizationDetailsResponse]
$creadList :: ReadS [GetAccountAuthorizationDetailsResponse]
readsPrec :: Int -> ReadS GetAccountAuthorizationDetailsResponse
$creadsPrec :: Int -> ReadS GetAccountAuthorizationDetailsResponse
Prelude.Read, Int -> GetAccountAuthorizationDetailsResponse -> ShowS
[GetAccountAuthorizationDetailsResponse] -> ShowS
GetAccountAuthorizationDetailsResponse -> String
(Int -> GetAccountAuthorizationDetailsResponse -> ShowS)
-> (GetAccountAuthorizationDetailsResponse -> String)
-> ([GetAccountAuthorizationDetailsResponse] -> ShowS)
-> Show GetAccountAuthorizationDetailsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccountAuthorizationDetailsResponse] -> ShowS
$cshowList :: [GetAccountAuthorizationDetailsResponse] -> ShowS
show :: GetAccountAuthorizationDetailsResponse -> String
$cshow :: GetAccountAuthorizationDetailsResponse -> String
showsPrec :: Int -> GetAccountAuthorizationDetailsResponse -> ShowS
$cshowsPrec :: Int -> GetAccountAuthorizationDetailsResponse -> ShowS
Prelude.Show, (forall x.
 GetAccountAuthorizationDetailsResponse
 -> Rep GetAccountAuthorizationDetailsResponse x)
-> (forall x.
    Rep GetAccountAuthorizationDetailsResponse x
    -> GetAccountAuthorizationDetailsResponse)
-> Generic GetAccountAuthorizationDetailsResponse
forall x.
Rep GetAccountAuthorizationDetailsResponse x
-> GetAccountAuthorizationDetailsResponse
forall x.
GetAccountAuthorizationDetailsResponse
-> Rep GetAccountAuthorizationDetailsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAccountAuthorizationDetailsResponse x
-> GetAccountAuthorizationDetailsResponse
$cfrom :: forall x.
GetAccountAuthorizationDetailsResponse
-> Rep GetAccountAuthorizationDetailsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAccountAuthorizationDetailsResponse' 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:
--
-- 'roleDetailList', 'getAccountAuthorizationDetailsResponse_roleDetailList' - A list containing information about IAM roles.
--
-- 'groupDetailList', 'getAccountAuthorizationDetailsResponse_groupDetailList' - A list containing information about IAM groups.
--
-- 'userDetailList', 'getAccountAuthorizationDetailsResponse_userDetailList' - A list containing information about IAM users.
--
-- 'marker', 'getAccountAuthorizationDetailsResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'isTruncated', 'getAccountAuthorizationDetailsResponse_isTruncated' - A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
--
-- 'policies', 'getAccountAuthorizationDetailsResponse_policies' - A list containing information about managed policies.
--
-- 'httpStatus', 'getAccountAuthorizationDetailsResponse_httpStatus' - The response's http status code.
newGetAccountAuthorizationDetailsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAccountAuthorizationDetailsResponse
newGetAccountAuthorizationDetailsResponse :: Int -> GetAccountAuthorizationDetailsResponse
newGetAccountAuthorizationDetailsResponse
  Int
pHttpStatus_ =
    GetAccountAuthorizationDetailsResponse' :: Maybe [RoleDetail]
-> Maybe [GroupDetail]
-> Maybe [UserDetail]
-> Maybe Text
-> Maybe Bool
-> Maybe [ManagedPolicyDetail]
-> Int
-> GetAccountAuthorizationDetailsResponse
GetAccountAuthorizationDetailsResponse'
      { $sel:roleDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [RoleDetail]
roleDetailList =
          Maybe [RoleDetail]
forall a. Maybe a
Prelude.Nothing,
        $sel:groupDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [GroupDetail]
groupDetailList = Maybe [GroupDetail]
forall a. Maybe a
Prelude.Nothing,
        $sel:userDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [UserDetail]
userDetailList = Maybe [UserDetail]
forall a. Maybe a
Prelude.Nothing,
        $sel:marker:GetAccountAuthorizationDetailsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:isTruncated:GetAccountAuthorizationDetailsResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:policies:GetAccountAuthorizationDetailsResponse' :: Maybe [ManagedPolicyDetail]
policies = Maybe [ManagedPolicyDetail]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetAccountAuthorizationDetailsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list containing information about IAM roles.
getAccountAuthorizationDetailsResponse_roleDetailList :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [RoleDetail])
getAccountAuthorizationDetailsResponse_roleDetailList :: (Maybe [RoleDetail] -> f (Maybe [RoleDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
getAccountAuthorizationDetailsResponse_roleDetailList = (GetAccountAuthorizationDetailsResponse -> Maybe [RoleDetail])
-> (GetAccountAuthorizationDetailsResponse
    -> Maybe [RoleDetail] -> GetAccountAuthorizationDetailsResponse)
-> Lens
     GetAccountAuthorizationDetailsResponse
     GetAccountAuthorizationDetailsResponse
     (Maybe [RoleDetail])
     (Maybe [RoleDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetailsResponse' {Maybe [RoleDetail]
roleDetailList :: Maybe [RoleDetail]
$sel:roleDetailList:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe [RoleDetail]
roleDetailList} -> Maybe [RoleDetail]
roleDetailList) (\s :: GetAccountAuthorizationDetailsResponse
s@GetAccountAuthorizationDetailsResponse' {} Maybe [RoleDetail]
a -> GetAccountAuthorizationDetailsResponse
s {$sel:roleDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [RoleDetail]
roleDetailList = Maybe [RoleDetail]
a} :: GetAccountAuthorizationDetailsResponse) ((Maybe [RoleDetail] -> f (Maybe [RoleDetail]))
 -> GetAccountAuthorizationDetailsResponse
 -> f GetAccountAuthorizationDetailsResponse)
-> ((Maybe [RoleDetail] -> f (Maybe [RoleDetail]))
    -> Maybe [RoleDetail] -> f (Maybe [RoleDetail]))
-> (Maybe [RoleDetail] -> f (Maybe [RoleDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [RoleDetail] [RoleDetail] [RoleDetail] [RoleDetail]
-> Iso
     (Maybe [RoleDetail])
     (Maybe [RoleDetail])
     (Maybe [RoleDetail])
     (Maybe [RoleDetail])
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 [RoleDetail] [RoleDetail] [RoleDetail] [RoleDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list containing information about IAM groups.
getAccountAuthorizationDetailsResponse_groupDetailList :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [GroupDetail])
getAccountAuthorizationDetailsResponse_groupDetailList :: (Maybe [GroupDetail] -> f (Maybe [GroupDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
getAccountAuthorizationDetailsResponse_groupDetailList = (GetAccountAuthorizationDetailsResponse -> Maybe [GroupDetail])
-> (GetAccountAuthorizationDetailsResponse
    -> Maybe [GroupDetail] -> GetAccountAuthorizationDetailsResponse)
-> Lens
     GetAccountAuthorizationDetailsResponse
     GetAccountAuthorizationDetailsResponse
     (Maybe [GroupDetail])
     (Maybe [GroupDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetailsResponse' {Maybe [GroupDetail]
groupDetailList :: Maybe [GroupDetail]
$sel:groupDetailList:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe [GroupDetail]
groupDetailList} -> Maybe [GroupDetail]
groupDetailList) (\s :: GetAccountAuthorizationDetailsResponse
s@GetAccountAuthorizationDetailsResponse' {} Maybe [GroupDetail]
a -> GetAccountAuthorizationDetailsResponse
s {$sel:groupDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [GroupDetail]
groupDetailList = Maybe [GroupDetail]
a} :: GetAccountAuthorizationDetailsResponse) ((Maybe [GroupDetail] -> f (Maybe [GroupDetail]))
 -> GetAccountAuthorizationDetailsResponse
 -> f GetAccountAuthorizationDetailsResponse)
-> ((Maybe [GroupDetail] -> f (Maybe [GroupDetail]))
    -> Maybe [GroupDetail] -> f (Maybe [GroupDetail]))
-> (Maybe [GroupDetail] -> f (Maybe [GroupDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GroupDetail] [GroupDetail] [GroupDetail] [GroupDetail]
-> Iso
     (Maybe [GroupDetail])
     (Maybe [GroupDetail])
     (Maybe [GroupDetail])
     (Maybe [GroupDetail])
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 [GroupDetail] [GroupDetail] [GroupDetail] [GroupDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list containing information about IAM users.
getAccountAuthorizationDetailsResponse_userDetailList :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [UserDetail])
getAccountAuthorizationDetailsResponse_userDetailList :: (Maybe [UserDetail] -> f (Maybe [UserDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
getAccountAuthorizationDetailsResponse_userDetailList = (GetAccountAuthorizationDetailsResponse -> Maybe [UserDetail])
-> (GetAccountAuthorizationDetailsResponse
    -> Maybe [UserDetail] -> GetAccountAuthorizationDetailsResponse)
-> Lens
     GetAccountAuthorizationDetailsResponse
     GetAccountAuthorizationDetailsResponse
     (Maybe [UserDetail])
     (Maybe [UserDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetailsResponse' {Maybe [UserDetail]
userDetailList :: Maybe [UserDetail]
$sel:userDetailList:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe [UserDetail]
userDetailList} -> Maybe [UserDetail]
userDetailList) (\s :: GetAccountAuthorizationDetailsResponse
s@GetAccountAuthorizationDetailsResponse' {} Maybe [UserDetail]
a -> GetAccountAuthorizationDetailsResponse
s {$sel:userDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [UserDetail]
userDetailList = Maybe [UserDetail]
a} :: GetAccountAuthorizationDetailsResponse) ((Maybe [UserDetail] -> f (Maybe [UserDetail]))
 -> GetAccountAuthorizationDetailsResponse
 -> f GetAccountAuthorizationDetailsResponse)
-> ((Maybe [UserDetail] -> f (Maybe [UserDetail]))
    -> Maybe [UserDetail] -> f (Maybe [UserDetail]))
-> (Maybe [UserDetail] -> f (Maybe [UserDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [UserDetail] [UserDetail] [UserDetail] [UserDetail]
-> Iso
     (Maybe [UserDetail])
     (Maybe [UserDetail])
     (Maybe [UserDetail])
     (Maybe [UserDetail])
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 [UserDetail] [UserDetail] [UserDetail] [UserDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
getAccountAuthorizationDetailsResponse_marker :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe Prelude.Text)
getAccountAuthorizationDetailsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
getAccountAuthorizationDetailsResponse_marker = (GetAccountAuthorizationDetailsResponse -> Maybe Text)
-> (GetAccountAuthorizationDetailsResponse
    -> Maybe Text -> GetAccountAuthorizationDetailsResponse)
-> Lens' GetAccountAuthorizationDetailsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetailsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: GetAccountAuthorizationDetailsResponse
s@GetAccountAuthorizationDetailsResponse' {} Maybe Text
a -> GetAccountAuthorizationDetailsResponse
s {$sel:marker:GetAccountAuthorizationDetailsResponse' :: Maybe Text
marker = Maybe Text
a} :: GetAccountAuthorizationDetailsResponse)

-- | A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
getAccountAuthorizationDetailsResponse_isTruncated :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe Prelude.Bool)
getAccountAuthorizationDetailsResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
getAccountAuthorizationDetailsResponse_isTruncated = (GetAccountAuthorizationDetailsResponse -> Maybe Bool)
-> (GetAccountAuthorizationDetailsResponse
    -> Maybe Bool -> GetAccountAuthorizationDetailsResponse)
-> Lens' GetAccountAuthorizationDetailsResponse (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetailsResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: GetAccountAuthorizationDetailsResponse
s@GetAccountAuthorizationDetailsResponse' {} Maybe Bool
a -> GetAccountAuthorizationDetailsResponse
s {$sel:isTruncated:GetAccountAuthorizationDetailsResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: GetAccountAuthorizationDetailsResponse)

-- | A list containing information about managed policies.
getAccountAuthorizationDetailsResponse_policies :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [ManagedPolicyDetail])
getAccountAuthorizationDetailsResponse_policies :: (Maybe [ManagedPolicyDetail] -> f (Maybe [ManagedPolicyDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
getAccountAuthorizationDetailsResponse_policies = (GetAccountAuthorizationDetailsResponse
 -> Maybe [ManagedPolicyDetail])
-> (GetAccountAuthorizationDetailsResponse
    -> Maybe [ManagedPolicyDetail]
    -> GetAccountAuthorizationDetailsResponse)
-> Lens
     GetAccountAuthorizationDetailsResponse
     GetAccountAuthorizationDetailsResponse
     (Maybe [ManagedPolicyDetail])
     (Maybe [ManagedPolicyDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetailsResponse' {Maybe [ManagedPolicyDetail]
policies :: Maybe [ManagedPolicyDetail]
$sel:policies:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse
-> Maybe [ManagedPolicyDetail]
policies} -> Maybe [ManagedPolicyDetail]
policies) (\s :: GetAccountAuthorizationDetailsResponse
s@GetAccountAuthorizationDetailsResponse' {} Maybe [ManagedPolicyDetail]
a -> GetAccountAuthorizationDetailsResponse
s {$sel:policies:GetAccountAuthorizationDetailsResponse' :: Maybe [ManagedPolicyDetail]
policies = Maybe [ManagedPolicyDetail]
a} :: GetAccountAuthorizationDetailsResponse) ((Maybe [ManagedPolicyDetail] -> f (Maybe [ManagedPolicyDetail]))
 -> GetAccountAuthorizationDetailsResponse
 -> f GetAccountAuthorizationDetailsResponse)
-> ((Maybe [ManagedPolicyDetail]
     -> f (Maybe [ManagedPolicyDetail]))
    -> Maybe [ManagedPolicyDetail] -> f (Maybe [ManagedPolicyDetail]))
-> (Maybe [ManagedPolicyDetail] -> f (Maybe [ManagedPolicyDetail]))
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ManagedPolicyDetail]
  [ManagedPolicyDetail]
  [ManagedPolicyDetail]
  [ManagedPolicyDetail]
-> Iso
     (Maybe [ManagedPolicyDetail])
     (Maybe [ManagedPolicyDetail])
     (Maybe [ManagedPolicyDetail])
     (Maybe [ManagedPolicyDetail])
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
  [ManagedPolicyDetail]
  [ManagedPolicyDetail]
  [ManagedPolicyDetail]
  [ManagedPolicyDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
getAccountAuthorizationDetailsResponse_httpStatus :: Lens.Lens' GetAccountAuthorizationDetailsResponse Prelude.Int
getAccountAuthorizationDetailsResponse_httpStatus :: (Int -> f Int)
-> GetAccountAuthorizationDetailsResponse
-> f GetAccountAuthorizationDetailsResponse
getAccountAuthorizationDetailsResponse_httpStatus = (GetAccountAuthorizationDetailsResponse -> Int)
-> (GetAccountAuthorizationDetailsResponse
    -> Int -> GetAccountAuthorizationDetailsResponse)
-> Lens
     GetAccountAuthorizationDetailsResponse
     GetAccountAuthorizationDetailsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountAuthorizationDetailsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAccountAuthorizationDetailsResponse
s@GetAccountAuthorizationDetailsResponse' {} Int
a -> GetAccountAuthorizationDetailsResponse
s {$sel:httpStatus:GetAccountAuthorizationDetailsResponse' :: Int
httpStatus = Int
a} :: GetAccountAuthorizationDetailsResponse)

instance
  Prelude.NFData
    GetAccountAuthorizationDetailsResponse