{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_filter,
    getAccountAuthorizationDetails_marker,
    getAccountAuthorizationDetails_maxItems,

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

    -- * Response Lenses
    getAccountAuthorizationDetailsResponse_groupDetailList,
    getAccountAuthorizationDetailsResponse_isTruncated,
    getAccountAuthorizationDetailsResponse_marker,
    getAccountAuthorizationDetailsResponse_policies,
    getAccountAuthorizationDetailsResponse_roleDetailList,
    getAccountAuthorizationDetailsResponse_userDetailList,
    getAccountAuthorizationDetailsResponse_httpStatus,
  )
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
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'
  { -- | 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],
    -- | 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
  }
  deriving (GetAccountAuthorizationDetails
-> GetAccountAuthorizationDetails -> Bool
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]
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
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.
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:
--
-- '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.
--
-- '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.
newGetAccountAuthorizationDetails ::
  GetAccountAuthorizationDetails
newGetAccountAuthorizationDetails :: GetAccountAuthorizationDetails
newGetAccountAuthorizationDetails =
  GetAccountAuthorizationDetails'
    { $sel:filter':GetAccountAuthorizationDetails' :: Maybe [EntityType]
filter' =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:GetAccountAuthorizationDetails' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:GetAccountAuthorizationDetails' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' GetAccountAuthorizationDetails (Maybe [EntityType])
getAccountAuthorizationDetails_filter = 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) 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

-- | 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 :: Lens' GetAccountAuthorizationDetails (Maybe Text)
getAccountAuthorizationDetails_marker = 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 :: Lens' GetAccountAuthorizationDetails (Maybe Natural)
getAccountAuthorizationDetails_maxItems = 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)

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

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

instance
  Prelude.Hashable
    GetAccountAuthorizationDetails
  where
  hashWithSalt :: Int -> GetAccountAuthorizationDetails -> Int
hashWithSalt
    Int
_salt
    GetAccountAuthorizationDetails' {Maybe Natural
Maybe [EntityType]
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
filter' :: Maybe [EntityType]
$sel:maxItems:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Natural
$sel:marker:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Text
$sel:filter':GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe [EntityType]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EntityType]
filter'
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems

instance
  Prelude.NFData
    GetAccountAuthorizationDetails
  where
  rnf :: GetAccountAuthorizationDetails -> ()
rnf GetAccountAuthorizationDetails' {Maybe Natural
Maybe [EntityType]
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
filter' :: Maybe [EntityType]
$sel:maxItems:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Natural
$sel:marker:GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe Text
$sel:filter':GetAccountAuthorizationDetails' :: GetAccountAuthorizationDetails -> Maybe [EntityType]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [EntityType]
filter'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems

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

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

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

-- | Contains the response to a successful GetAccountAuthorizationDetails
-- request.
--
-- /See:/ 'newGetAccountAuthorizationDetailsResponse' smart constructor.
data GetAccountAuthorizationDetailsResponse = GetAccountAuthorizationDetailsResponse'
  { -- | A list containing information about IAM groups.
    GetAccountAuthorizationDetailsResponse -> Maybe [GroupDetail]
groupDetailList :: Prelude.Maybe [GroupDetail],
    -- | 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,
    -- | 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 list containing information about managed policies.
    GetAccountAuthorizationDetailsResponse
-> Maybe [ManagedPolicyDetail]
policies :: Prelude.Maybe [ManagedPolicyDetail],
    -- | A list containing information about IAM roles.
    GetAccountAuthorizationDetailsResponse -> Maybe [RoleDetail]
roleDetailList :: Prelude.Maybe [RoleDetail],
    -- | A list containing information about IAM users.
    GetAccountAuthorizationDetailsResponse -> Maybe [UserDetail]
userDetailList :: Prelude.Maybe [UserDetail],
    -- | The response's http status code.
    GetAccountAuthorizationDetailsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAccountAuthorizationDetailsResponse
-> GetAccountAuthorizationDetailsResponse -> Bool
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]
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
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.
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:
--
-- 'groupDetailList', 'getAccountAuthorizationDetailsResponse_groupDetailList' - A list containing information about IAM groups.
--
-- '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.
--
-- '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.
--
-- 'policies', 'getAccountAuthorizationDetailsResponse_policies' - A list containing information about managed policies.
--
-- 'roleDetailList', 'getAccountAuthorizationDetailsResponse_roleDetailList' - A list containing information about IAM roles.
--
-- 'userDetailList', 'getAccountAuthorizationDetailsResponse_userDetailList' - A list containing information about IAM users.
--
-- 'httpStatus', 'getAccountAuthorizationDetailsResponse_httpStatus' - The response's http status code.
newGetAccountAuthorizationDetailsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAccountAuthorizationDetailsResponse
newGetAccountAuthorizationDetailsResponse :: Int -> GetAccountAuthorizationDetailsResponse
newGetAccountAuthorizationDetailsResponse
  Int
pHttpStatus_ =
    GetAccountAuthorizationDetailsResponse'
      { $sel:groupDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [GroupDetail]
groupDetailList =
          forall a. Maybe a
Prelude.Nothing,
        $sel:isTruncated:GetAccountAuthorizationDetailsResponse' :: Maybe Bool
isTruncated = forall a. Maybe a
Prelude.Nothing,
        $sel:marker:GetAccountAuthorizationDetailsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
        $sel:policies:GetAccountAuthorizationDetailsResponse' :: Maybe [ManagedPolicyDetail]
policies = forall a. Maybe a
Prelude.Nothing,
        $sel:roleDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [RoleDetail]
roleDetailList = forall a. Maybe a
Prelude.Nothing,
        $sel:userDetailList:GetAccountAuthorizationDetailsResponse' :: Maybe [UserDetail]
userDetailList = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetAccountAuthorizationDetailsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list containing information about IAM groups.
getAccountAuthorizationDetailsResponse_groupDetailList :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [GroupDetail])
getAccountAuthorizationDetailsResponse_groupDetailList :: Lens' GetAccountAuthorizationDetailsResponse (Maybe [GroupDetail])
getAccountAuthorizationDetailsResponse_groupDetailList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A 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 :: Lens' GetAccountAuthorizationDetailsResponse (Maybe Bool)
getAccountAuthorizationDetailsResponse_isTruncated = 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)

-- | 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 :: Lens' GetAccountAuthorizationDetailsResponse (Maybe Text)
getAccountAuthorizationDetailsResponse_marker = 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 list containing information about managed policies.
getAccountAuthorizationDetailsResponse_policies :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [ManagedPolicyDetail])
getAccountAuthorizationDetailsResponse_policies :: Lens'
  GetAccountAuthorizationDetailsResponse
  (Maybe [ManagedPolicyDetail])
getAccountAuthorizationDetailsResponse_policies = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list containing information about IAM roles.
getAccountAuthorizationDetailsResponse_roleDetailList :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [RoleDetail])
getAccountAuthorizationDetailsResponse_roleDetailList :: Lens' GetAccountAuthorizationDetailsResponse (Maybe [RoleDetail])
getAccountAuthorizationDetailsResponse_roleDetailList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list containing information about IAM users.
getAccountAuthorizationDetailsResponse_userDetailList :: Lens.Lens' GetAccountAuthorizationDetailsResponse (Prelude.Maybe [UserDetail])
getAccountAuthorizationDetailsResponse_userDetailList :: Lens' GetAccountAuthorizationDetailsResponse (Maybe [UserDetail])
getAccountAuthorizationDetailsResponse_userDetailList = 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) 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 response's http status code.
getAccountAuthorizationDetailsResponse_httpStatus :: Lens.Lens' GetAccountAuthorizationDetailsResponse Prelude.Int
getAccountAuthorizationDetailsResponse_httpStatus :: Lens' GetAccountAuthorizationDetailsResponse Int
getAccountAuthorizationDetailsResponse_httpStatus = 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
  where
  rnf :: GetAccountAuthorizationDetailsResponse -> ()
rnf GetAccountAuthorizationDetailsResponse' {Int
Maybe Bool
Maybe [GroupDetail]
Maybe [ManagedPolicyDetail]
Maybe [RoleDetail]
Maybe [UserDetail]
Maybe Text
httpStatus :: Int
userDetailList :: Maybe [UserDetail]
roleDetailList :: Maybe [RoleDetail]
policies :: Maybe [ManagedPolicyDetail]
marker :: Maybe Text
isTruncated :: Maybe Bool
groupDetailList :: Maybe [GroupDetail]
$sel:httpStatus:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Int
$sel:userDetailList:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe [UserDetail]
$sel:roleDetailList:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe [RoleDetail]
$sel:policies:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse
-> Maybe [ManagedPolicyDetail]
$sel:marker:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe Text
$sel:isTruncated:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe Bool
$sel:groupDetailList:GetAccountAuthorizationDetailsResponse' :: GetAccountAuthorizationDetailsResponse -> Maybe [GroupDetail]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [GroupDetail]
groupDetailList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ManagedPolicyDetail]
policies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RoleDetail]
roleDetailList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [UserDetail]
userDetailList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus