{-# 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.GetOrganizationsAccessReport
-- 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 the service last accessed data report for Organizations that
-- was previously generated using the @ GenerateOrganizationsAccessReport @
-- operation. This operation retrieves the status of your report job and
-- the report contents.
--
-- Depending on the parameters that you passed when you generated the
-- report, the data returned could include different information. For
-- details, see GenerateOrganizationsAccessReport.
--
-- To call this operation, you must be signed in to the management account
-- in your organization. SCPs must be enabled for your organization root.
-- You must have permissions to perform this operation. For more
-- information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html Refining permissions using service last accessed data>
-- in the /IAM User Guide/.
--
-- For each service that principals in an account (root users, IAM users,
-- or IAM roles) could access using SCPs, the operation returns details
-- about the most recent access attempt. If there was no attempt, the
-- service is listed without details about the most recent attempt to
-- access the service. If the operation fails, it returns the reason that
-- it failed.
--
-- By default, the list is sorted by service namespace.
module Amazonka.IAM.GetOrganizationsAccessReport
  ( -- * Creating a Request
    GetOrganizationsAccessReport (..),
    newGetOrganizationsAccessReport,

    -- * Request Lenses
    getOrganizationsAccessReport_sortKey,
    getOrganizationsAccessReport_marker,
    getOrganizationsAccessReport_maxItems,
    getOrganizationsAccessReport_jobId,

    -- * Destructuring the Response
    GetOrganizationsAccessReportResponse (..),
    newGetOrganizationsAccessReportResponse,

    -- * Response Lenses
    getOrganizationsAccessReportResponse_numberOfServicesNotAccessed,
    getOrganizationsAccessReportResponse_jobCompletionDate,
    getOrganizationsAccessReportResponse_accessDetails,
    getOrganizationsAccessReportResponse_numberOfServicesAccessible,
    getOrganizationsAccessReportResponse_marker,
    getOrganizationsAccessReportResponse_errorDetails,
    getOrganizationsAccessReportResponse_isTruncated,
    getOrganizationsAccessReportResponse_httpStatus,
    getOrganizationsAccessReportResponse_jobStatus,
    getOrganizationsAccessReportResponse_jobCreationDate,
  )
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:/ 'newGetOrganizationsAccessReport' smart constructor.
data GetOrganizationsAccessReport = GetOrganizationsAccessReport'
  { -- | The key that is used to sort the results. If you choose the namespace
    -- key, the results are returned in alphabetical order. If you choose the
    -- time key, the results are sorted numerically by the date and time.
    GetOrganizationsAccessReport -> Maybe SortKeyType
sortKey :: Prelude.Maybe SortKeyType,
    -- | 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.
    GetOrganizationsAccessReport -> 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.
    GetOrganizationsAccessReport -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the request generated by the
    -- GenerateOrganizationsAccessReport operation.
    GetOrganizationsAccessReport -> Text
jobId :: Prelude.Text
  }
  deriving (GetOrganizationsAccessReport
-> GetOrganizationsAccessReport -> Bool
(GetOrganizationsAccessReport
 -> GetOrganizationsAccessReport -> Bool)
-> (GetOrganizationsAccessReport
    -> GetOrganizationsAccessReport -> Bool)
-> Eq GetOrganizationsAccessReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOrganizationsAccessReport
-> GetOrganizationsAccessReport -> Bool
$c/= :: GetOrganizationsAccessReport
-> GetOrganizationsAccessReport -> Bool
== :: GetOrganizationsAccessReport
-> GetOrganizationsAccessReport -> Bool
$c== :: GetOrganizationsAccessReport
-> GetOrganizationsAccessReport -> Bool
Prelude.Eq, ReadPrec [GetOrganizationsAccessReport]
ReadPrec GetOrganizationsAccessReport
Int -> ReadS GetOrganizationsAccessReport
ReadS [GetOrganizationsAccessReport]
(Int -> ReadS GetOrganizationsAccessReport)
-> ReadS [GetOrganizationsAccessReport]
-> ReadPrec GetOrganizationsAccessReport
-> ReadPrec [GetOrganizationsAccessReport]
-> Read GetOrganizationsAccessReport
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOrganizationsAccessReport]
$creadListPrec :: ReadPrec [GetOrganizationsAccessReport]
readPrec :: ReadPrec GetOrganizationsAccessReport
$creadPrec :: ReadPrec GetOrganizationsAccessReport
readList :: ReadS [GetOrganizationsAccessReport]
$creadList :: ReadS [GetOrganizationsAccessReport]
readsPrec :: Int -> ReadS GetOrganizationsAccessReport
$creadsPrec :: Int -> ReadS GetOrganizationsAccessReport
Prelude.Read, Int -> GetOrganizationsAccessReport -> ShowS
[GetOrganizationsAccessReport] -> ShowS
GetOrganizationsAccessReport -> String
(Int -> GetOrganizationsAccessReport -> ShowS)
-> (GetOrganizationsAccessReport -> String)
-> ([GetOrganizationsAccessReport] -> ShowS)
-> Show GetOrganizationsAccessReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOrganizationsAccessReport] -> ShowS
$cshowList :: [GetOrganizationsAccessReport] -> ShowS
show :: GetOrganizationsAccessReport -> String
$cshow :: GetOrganizationsAccessReport -> String
showsPrec :: Int -> GetOrganizationsAccessReport -> ShowS
$cshowsPrec :: Int -> GetOrganizationsAccessReport -> ShowS
Prelude.Show, (forall x.
 GetOrganizationsAccessReport -> Rep GetOrganizationsAccessReport x)
-> (forall x.
    Rep GetOrganizationsAccessReport x -> GetOrganizationsAccessReport)
-> Generic GetOrganizationsAccessReport
forall x.
Rep GetOrganizationsAccessReport x -> GetOrganizationsAccessReport
forall x.
GetOrganizationsAccessReport -> Rep GetOrganizationsAccessReport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetOrganizationsAccessReport x -> GetOrganizationsAccessReport
$cfrom :: forall x.
GetOrganizationsAccessReport -> Rep GetOrganizationsAccessReport x
Prelude.Generic)

-- |
-- Create a value of 'GetOrganizationsAccessReport' 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:
--
-- 'sortKey', 'getOrganizationsAccessReport_sortKey' - The key that is used to sort the results. If you choose the namespace
-- key, the results are returned in alphabetical order. If you choose the
-- time key, the results are sorted numerically by the date and time.
--
-- 'marker', 'getOrganizationsAccessReport_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', 'getOrganizationsAccessReport_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.
--
-- 'jobId', 'getOrganizationsAccessReport_jobId' - The identifier of the request generated by the
-- GenerateOrganizationsAccessReport operation.
newGetOrganizationsAccessReport ::
  -- | 'jobId'
  Prelude.Text ->
  GetOrganizationsAccessReport
newGetOrganizationsAccessReport :: Text -> GetOrganizationsAccessReport
newGetOrganizationsAccessReport Text
pJobId_ =
  GetOrganizationsAccessReport' :: Maybe SortKeyType
-> Maybe Text
-> Maybe Natural
-> Text
-> GetOrganizationsAccessReport
GetOrganizationsAccessReport'
    { $sel:sortKey:GetOrganizationsAccessReport' :: Maybe SortKeyType
sortKey =
        Maybe SortKeyType
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:GetOrganizationsAccessReport' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:GetOrganizationsAccessReport' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:GetOrganizationsAccessReport' :: Text
jobId = Text
pJobId_
    }

-- | The key that is used to sort the results. If you choose the namespace
-- key, the results are returned in alphabetical order. If you choose the
-- time key, the results are sorted numerically by the date and time.
getOrganizationsAccessReport_sortKey :: Lens.Lens' GetOrganizationsAccessReport (Prelude.Maybe SortKeyType)
getOrganizationsAccessReport_sortKey :: (Maybe SortKeyType -> f (Maybe SortKeyType))
-> GetOrganizationsAccessReport -> f GetOrganizationsAccessReport
getOrganizationsAccessReport_sortKey = (GetOrganizationsAccessReport -> Maybe SortKeyType)
-> (GetOrganizationsAccessReport
    -> Maybe SortKeyType -> GetOrganizationsAccessReport)
-> Lens
     GetOrganizationsAccessReport
     GetOrganizationsAccessReport
     (Maybe SortKeyType)
     (Maybe SortKeyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReport' {Maybe SortKeyType
sortKey :: Maybe SortKeyType
$sel:sortKey:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Maybe SortKeyType
sortKey} -> Maybe SortKeyType
sortKey) (\s :: GetOrganizationsAccessReport
s@GetOrganizationsAccessReport' {} Maybe SortKeyType
a -> GetOrganizationsAccessReport
s {$sel:sortKey:GetOrganizationsAccessReport' :: Maybe SortKeyType
sortKey = Maybe SortKeyType
a} :: GetOrganizationsAccessReport)

-- | 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.
getOrganizationsAccessReport_marker :: Lens.Lens' GetOrganizationsAccessReport (Prelude.Maybe Prelude.Text)
getOrganizationsAccessReport_marker :: (Maybe Text -> f (Maybe Text))
-> GetOrganizationsAccessReport -> f GetOrganizationsAccessReport
getOrganizationsAccessReport_marker = (GetOrganizationsAccessReport -> Maybe Text)
-> (GetOrganizationsAccessReport
    -> Maybe Text -> GetOrganizationsAccessReport)
-> Lens
     GetOrganizationsAccessReport
     GetOrganizationsAccessReport
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReport' {Maybe Text
marker :: Maybe Text
$sel:marker:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Maybe Text
marker} -> Maybe Text
marker) (\s :: GetOrganizationsAccessReport
s@GetOrganizationsAccessReport' {} Maybe Text
a -> GetOrganizationsAccessReport
s {$sel:marker:GetOrganizationsAccessReport' :: Maybe Text
marker = Maybe Text
a} :: GetOrganizationsAccessReport)

-- | 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.
getOrganizationsAccessReport_maxItems :: Lens.Lens' GetOrganizationsAccessReport (Prelude.Maybe Prelude.Natural)
getOrganizationsAccessReport_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> GetOrganizationsAccessReport -> f GetOrganizationsAccessReport
getOrganizationsAccessReport_maxItems = (GetOrganizationsAccessReport -> Maybe Natural)
-> (GetOrganizationsAccessReport
    -> Maybe Natural -> GetOrganizationsAccessReport)
-> Lens
     GetOrganizationsAccessReport
     GetOrganizationsAccessReport
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReport' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: GetOrganizationsAccessReport
s@GetOrganizationsAccessReport' {} Maybe Natural
a -> GetOrganizationsAccessReport
s {$sel:maxItems:GetOrganizationsAccessReport' :: Maybe Natural
maxItems = Maybe Natural
a} :: GetOrganizationsAccessReport)

-- | The identifier of the request generated by the
-- GenerateOrganizationsAccessReport operation.
getOrganizationsAccessReport_jobId :: Lens.Lens' GetOrganizationsAccessReport Prelude.Text
getOrganizationsAccessReport_jobId :: (Text -> f Text)
-> GetOrganizationsAccessReport -> f GetOrganizationsAccessReport
getOrganizationsAccessReport_jobId = (GetOrganizationsAccessReport -> Text)
-> (GetOrganizationsAccessReport
    -> Text -> GetOrganizationsAccessReport)
-> Lens
     GetOrganizationsAccessReport GetOrganizationsAccessReport Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReport' {Text
jobId :: Text
$sel:jobId:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Text
jobId} -> Text
jobId) (\s :: GetOrganizationsAccessReport
s@GetOrganizationsAccessReport' {} Text
a -> GetOrganizationsAccessReport
s {$sel:jobId:GetOrganizationsAccessReport' :: Text
jobId = Text
a} :: GetOrganizationsAccessReport)

instance Core.AWSRequest GetOrganizationsAccessReport where
  type
    AWSResponse GetOrganizationsAccessReport =
      GetOrganizationsAccessReportResponse
  request :: GetOrganizationsAccessReport
-> Request GetOrganizationsAccessReport
request = Service
-> GetOrganizationsAccessReport
-> Request GetOrganizationsAccessReport
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy GetOrganizationsAccessReport
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetOrganizationsAccessReport)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse GetOrganizationsAccessReport))
-> Logger
-> Service
-> Proxy GetOrganizationsAccessReport
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetOrganizationsAccessReport)))
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
"GetOrganizationsAccessReportResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Int
-> Maybe ISO8601
-> Maybe [AccessDetail]
-> Maybe Int
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Bool
-> Int
-> JobStatusType
-> ISO8601
-> GetOrganizationsAccessReportResponse
GetOrganizationsAccessReportResponse'
            (Maybe Int
 -> Maybe ISO8601
 -> Maybe [AccessDetail]
 -> Maybe Int
 -> Maybe Text
 -> Maybe ErrorDetails
 -> Maybe Bool
 -> Int
 -> JobStatusType
 -> ISO8601
 -> GetOrganizationsAccessReportResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe ISO8601
      -> Maybe [AccessDetail]
      -> Maybe Int
      -> Maybe Text
      -> Maybe ErrorDetails
      -> Maybe Bool
      -> Int
      -> JobStatusType
      -> ISO8601
      -> GetOrganizationsAccessReportResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NumberOfServicesNotAccessed")
            Either
  String
  (Maybe ISO8601
   -> Maybe [AccessDetail]
   -> Maybe Int
   -> Maybe Text
   -> Maybe ErrorDetails
   -> Maybe Bool
   -> Int
   -> JobStatusType
   -> ISO8601
   -> GetOrganizationsAccessReportResponse)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe [AccessDetail]
      -> Maybe Int
      -> Maybe Text
      -> Maybe ErrorDetails
      -> Maybe Bool
      -> Int
      -> JobStatusType
      -> ISO8601
      -> GetOrganizationsAccessReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"JobCompletionDate")
            Either
  String
  (Maybe [AccessDetail]
   -> Maybe Int
   -> Maybe Text
   -> Maybe ErrorDetails
   -> Maybe Bool
   -> Int
   -> JobStatusType
   -> ISO8601
   -> GetOrganizationsAccessReportResponse)
-> Either String (Maybe [AccessDetail])
-> Either
     String
     (Maybe Int
      -> Maybe Text
      -> Maybe ErrorDetails
      -> Maybe Bool
      -> Int
      -> JobStatusType
      -> ISO8601
      -> GetOrganizationsAccessReportResponse)
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
"AccessDetails" 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 [AccessDetail]))
-> Either String (Maybe [AccessDetail])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [AccessDetail])
-> [Node] -> Either String (Maybe [AccessDetail])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [AccessDetail]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either
  String
  (Maybe Int
   -> Maybe Text
   -> Maybe ErrorDetails
   -> Maybe Bool
   -> Int
   -> JobStatusType
   -> ISO8601
   -> GetOrganizationsAccessReportResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe ErrorDetails
      -> Maybe Bool
      -> Int
      -> JobStatusType
      -> ISO8601
      -> GetOrganizationsAccessReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NumberOfServicesAccessible")
            Either
  String
  (Maybe Text
   -> Maybe ErrorDetails
   -> Maybe Bool
   -> Int
   -> JobStatusType
   -> ISO8601
   -> GetOrganizationsAccessReportResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ErrorDetails
      -> Maybe Bool
      -> Int
      -> JobStatusType
      -> ISO8601
      -> GetOrganizationsAccessReportResponse)
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 ErrorDetails
   -> Maybe Bool
   -> Int
   -> JobStatusType
   -> ISO8601
   -> GetOrganizationsAccessReportResponse)
-> Either String (Maybe ErrorDetails)
-> Either
     String
     (Maybe Bool
      -> Int
      -> JobStatusType
      -> ISO8601
      -> GetOrganizationsAccessReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ErrorDetails)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ErrorDetails")
            Either
  String
  (Maybe Bool
   -> Int
   -> JobStatusType
   -> ISO8601
   -> GetOrganizationsAccessReportResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Int
      -> JobStatusType
      -> ISO8601
      -> GetOrganizationsAccessReportResponse)
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
  (Int
   -> JobStatusType
   -> ISO8601
   -> GetOrganizationsAccessReportResponse)
-> Either String Int
-> Either
     String
     (JobStatusType -> ISO8601 -> GetOrganizationsAccessReportResponse)
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))
            Either
  String
  (JobStatusType -> ISO8601 -> GetOrganizationsAccessReportResponse)
-> Either String JobStatusType
-> Either String (ISO8601 -> GetOrganizationsAccessReportResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String JobStatusType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"JobStatus")
            Either String (ISO8601 -> GetOrganizationsAccessReportResponse)
-> Either String ISO8601
-> Either String GetOrganizationsAccessReportResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"JobCreationDate")
      )

instance
  Prelude.Hashable
    GetOrganizationsAccessReport

instance Prelude.NFData GetOrganizationsAccessReport

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

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

instance Core.ToQuery GetOrganizationsAccessReport where
  toQuery :: GetOrganizationsAccessReport -> QueryString
toQuery GetOrganizationsAccessReport' {Maybe Natural
Maybe Text
Maybe SortKeyType
Text
jobId :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
sortKey :: Maybe SortKeyType
$sel:jobId:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Text
$sel:maxItems:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Maybe Natural
$sel:marker:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Maybe Text
$sel:sortKey:GetOrganizationsAccessReport' :: GetOrganizationsAccessReport -> Maybe SortKeyType
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"GetOrganizationsAccessReport" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"SortKey" ByteString -> Maybe SortKeyType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe SortKeyType
sortKey,
        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
"JobId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
jobId
      ]

-- | /See:/ 'newGetOrganizationsAccessReportResponse' smart constructor.
data GetOrganizationsAccessReportResponse = GetOrganizationsAccessReportResponse'
  { -- | The number of services that account principals are allowed but did not
    -- attempt to access.
    GetOrganizationsAccessReportResponse -> Maybe Int
numberOfServicesNotAccessed :: Prelude.Maybe Prelude.Int,
    -- | The date and time,
    -- in <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
    -- generated report job was completed or failed.
    --
    -- This field is null if the job is still in progress, as indicated by a
    -- job status value of @IN_PROGRESS@.
    GetOrganizationsAccessReportResponse -> Maybe ISO8601
jobCompletionDate :: Prelude.Maybe Core.ISO8601,
    -- | An object that contains details about the most recent attempt to access
    -- the service.
    GetOrganizationsAccessReportResponse -> Maybe [AccessDetail]
accessDetails :: Prelude.Maybe [AccessDetail],
    -- | The number of services that the applicable SCPs allow account principals
    -- to access.
    GetOrganizationsAccessReportResponse -> Maybe Int
numberOfServicesAccessible :: Prelude.Maybe Prelude.Int,
    -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    GetOrganizationsAccessReportResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    GetOrganizationsAccessReportResponse -> Maybe ErrorDetails
errorDetails :: Prelude.Maybe ErrorDetails,
    -- | 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.
    GetOrganizationsAccessReportResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    GetOrganizationsAccessReportResponse -> Int
httpStatus :: Prelude.Int,
    -- | The status of the job.
    GetOrganizationsAccessReportResponse -> JobStatusType
jobStatus :: JobStatusType,
    -- | The date and time,
    -- in <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
    -- report job was created.
    GetOrganizationsAccessReportResponse -> ISO8601
jobCreationDate :: Core.ISO8601
  }
  deriving (GetOrganizationsAccessReportResponse
-> GetOrganizationsAccessReportResponse -> Bool
(GetOrganizationsAccessReportResponse
 -> GetOrganizationsAccessReportResponse -> Bool)
-> (GetOrganizationsAccessReportResponse
    -> GetOrganizationsAccessReportResponse -> Bool)
-> Eq GetOrganizationsAccessReportResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOrganizationsAccessReportResponse
-> GetOrganizationsAccessReportResponse -> Bool
$c/= :: GetOrganizationsAccessReportResponse
-> GetOrganizationsAccessReportResponse -> Bool
== :: GetOrganizationsAccessReportResponse
-> GetOrganizationsAccessReportResponse -> Bool
$c== :: GetOrganizationsAccessReportResponse
-> GetOrganizationsAccessReportResponse -> Bool
Prelude.Eq, ReadPrec [GetOrganizationsAccessReportResponse]
ReadPrec GetOrganizationsAccessReportResponse
Int -> ReadS GetOrganizationsAccessReportResponse
ReadS [GetOrganizationsAccessReportResponse]
(Int -> ReadS GetOrganizationsAccessReportResponse)
-> ReadS [GetOrganizationsAccessReportResponse]
-> ReadPrec GetOrganizationsAccessReportResponse
-> ReadPrec [GetOrganizationsAccessReportResponse]
-> Read GetOrganizationsAccessReportResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOrganizationsAccessReportResponse]
$creadListPrec :: ReadPrec [GetOrganizationsAccessReportResponse]
readPrec :: ReadPrec GetOrganizationsAccessReportResponse
$creadPrec :: ReadPrec GetOrganizationsAccessReportResponse
readList :: ReadS [GetOrganizationsAccessReportResponse]
$creadList :: ReadS [GetOrganizationsAccessReportResponse]
readsPrec :: Int -> ReadS GetOrganizationsAccessReportResponse
$creadsPrec :: Int -> ReadS GetOrganizationsAccessReportResponse
Prelude.Read, Int -> GetOrganizationsAccessReportResponse -> ShowS
[GetOrganizationsAccessReportResponse] -> ShowS
GetOrganizationsAccessReportResponse -> String
(Int -> GetOrganizationsAccessReportResponse -> ShowS)
-> (GetOrganizationsAccessReportResponse -> String)
-> ([GetOrganizationsAccessReportResponse] -> ShowS)
-> Show GetOrganizationsAccessReportResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOrganizationsAccessReportResponse] -> ShowS
$cshowList :: [GetOrganizationsAccessReportResponse] -> ShowS
show :: GetOrganizationsAccessReportResponse -> String
$cshow :: GetOrganizationsAccessReportResponse -> String
showsPrec :: Int -> GetOrganizationsAccessReportResponse -> ShowS
$cshowsPrec :: Int -> GetOrganizationsAccessReportResponse -> ShowS
Prelude.Show, (forall x.
 GetOrganizationsAccessReportResponse
 -> Rep GetOrganizationsAccessReportResponse x)
-> (forall x.
    Rep GetOrganizationsAccessReportResponse x
    -> GetOrganizationsAccessReportResponse)
-> Generic GetOrganizationsAccessReportResponse
forall x.
Rep GetOrganizationsAccessReportResponse x
-> GetOrganizationsAccessReportResponse
forall x.
GetOrganizationsAccessReportResponse
-> Rep GetOrganizationsAccessReportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetOrganizationsAccessReportResponse x
-> GetOrganizationsAccessReportResponse
$cfrom :: forall x.
GetOrganizationsAccessReportResponse
-> Rep GetOrganizationsAccessReportResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetOrganizationsAccessReportResponse' 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:
--
-- 'numberOfServicesNotAccessed', 'getOrganizationsAccessReportResponse_numberOfServicesNotAccessed' - The number of services that account principals are allowed but did not
-- attempt to access.
--
-- 'jobCompletionDate', 'getOrganizationsAccessReportResponse_jobCompletionDate' - The date and time,
-- in <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- generated report job was completed or failed.
--
-- This field is null if the job is still in progress, as indicated by a
-- job status value of @IN_PROGRESS@.
--
-- 'accessDetails', 'getOrganizationsAccessReportResponse_accessDetails' - An object that contains details about the most recent attempt to access
-- the service.
--
-- 'numberOfServicesAccessible', 'getOrganizationsAccessReportResponse_numberOfServicesAccessible' - The number of services that the applicable SCPs allow account principals
-- to access.
--
-- 'marker', 'getOrganizationsAccessReportResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'errorDetails', 'getOrganizationsAccessReportResponse_errorDetails' - Undocumented member.
--
-- 'isTruncated', 'getOrganizationsAccessReportResponse_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.
--
-- 'httpStatus', 'getOrganizationsAccessReportResponse_httpStatus' - The response's http status code.
--
-- 'jobStatus', 'getOrganizationsAccessReportResponse_jobStatus' - The status of the job.
--
-- 'jobCreationDate', 'getOrganizationsAccessReportResponse_jobCreationDate' - The date and time,
-- in <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- report job was created.
newGetOrganizationsAccessReportResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'jobStatus'
  JobStatusType ->
  -- | 'jobCreationDate'
  Prelude.UTCTime ->
  GetOrganizationsAccessReportResponse
newGetOrganizationsAccessReportResponse :: Int
-> JobStatusType -> UTCTime -> GetOrganizationsAccessReportResponse
newGetOrganizationsAccessReportResponse
  Int
pHttpStatus_
  JobStatusType
pJobStatus_
  UTCTime
pJobCreationDate_ =
    GetOrganizationsAccessReportResponse' :: Maybe Int
-> Maybe ISO8601
-> Maybe [AccessDetail]
-> Maybe Int
-> Maybe Text
-> Maybe ErrorDetails
-> Maybe Bool
-> Int
-> JobStatusType
-> ISO8601
-> GetOrganizationsAccessReportResponse
GetOrganizationsAccessReportResponse'
      { $sel:numberOfServicesNotAccessed:GetOrganizationsAccessReportResponse' :: Maybe Int
numberOfServicesNotAccessed =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:jobCompletionDate:GetOrganizationsAccessReportResponse' :: Maybe ISO8601
jobCompletionDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
        $sel:accessDetails:GetOrganizationsAccessReportResponse' :: Maybe [AccessDetail]
accessDetails = Maybe [AccessDetail]
forall a. Maybe a
Prelude.Nothing,
        $sel:numberOfServicesAccessible:GetOrganizationsAccessReportResponse' :: Maybe Int
numberOfServicesAccessible =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:marker:GetOrganizationsAccessReportResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:errorDetails:GetOrganizationsAccessReportResponse' :: Maybe ErrorDetails
errorDetails = Maybe ErrorDetails
forall a. Maybe a
Prelude.Nothing,
        $sel:isTruncated:GetOrganizationsAccessReportResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetOrganizationsAccessReportResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:jobStatus:GetOrganizationsAccessReportResponse' :: JobStatusType
jobStatus = JobStatusType
pJobStatus_,
        $sel:jobCreationDate:GetOrganizationsAccessReportResponse' :: ISO8601
jobCreationDate =
          Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pJobCreationDate_
      }

-- | The number of services that account principals are allowed but did not
-- attempt to access.
getOrganizationsAccessReportResponse_numberOfServicesNotAccessed :: Lens.Lens' GetOrganizationsAccessReportResponse (Prelude.Maybe Prelude.Int)
getOrganizationsAccessReportResponse_numberOfServicesNotAccessed :: (Maybe Int -> f (Maybe Int))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_numberOfServicesNotAccessed = (GetOrganizationsAccessReportResponse -> Maybe Int)
-> (GetOrganizationsAccessReportResponse
    -> Maybe Int -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {Maybe Int
numberOfServicesNotAccessed :: Maybe Int
$sel:numberOfServicesNotAccessed:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> Maybe Int
numberOfServicesNotAccessed} -> Maybe Int
numberOfServicesNotAccessed) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} Maybe Int
a -> GetOrganizationsAccessReportResponse
s {$sel:numberOfServicesNotAccessed:GetOrganizationsAccessReportResponse' :: Maybe Int
numberOfServicesNotAccessed = Maybe Int
a} :: GetOrganizationsAccessReportResponse)

-- | The date and time,
-- in <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- generated report job was completed or failed.
--
-- This field is null if the job is still in progress, as indicated by a
-- job status value of @IN_PROGRESS@.
getOrganizationsAccessReportResponse_jobCompletionDate :: Lens.Lens' GetOrganizationsAccessReportResponse (Prelude.Maybe Prelude.UTCTime)
getOrganizationsAccessReportResponse_jobCompletionDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_jobCompletionDate = (GetOrganizationsAccessReportResponse -> Maybe ISO8601)
-> (GetOrganizationsAccessReportResponse
    -> Maybe ISO8601 -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {Maybe ISO8601
jobCompletionDate :: Maybe ISO8601
$sel:jobCompletionDate:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> Maybe ISO8601
jobCompletionDate} -> Maybe ISO8601
jobCompletionDate) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} Maybe ISO8601
a -> GetOrganizationsAccessReportResponse
s {$sel:jobCompletionDate:GetOrganizationsAccessReportResponse' :: Maybe ISO8601
jobCompletionDate = Maybe ISO8601
a} :: GetOrganizationsAccessReportResponse) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> GetOrganizationsAccessReportResponse
 -> f GetOrganizationsAccessReportResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | An object that contains details about the most recent attempt to access
-- the service.
getOrganizationsAccessReportResponse_accessDetails :: Lens.Lens' GetOrganizationsAccessReportResponse (Prelude.Maybe [AccessDetail])
getOrganizationsAccessReportResponse_accessDetails :: (Maybe [AccessDetail] -> f (Maybe [AccessDetail]))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_accessDetails = (GetOrganizationsAccessReportResponse -> Maybe [AccessDetail])
-> (GetOrganizationsAccessReportResponse
    -> Maybe [AccessDetail] -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     (Maybe [AccessDetail])
     (Maybe [AccessDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {Maybe [AccessDetail]
accessDetails :: Maybe [AccessDetail]
$sel:accessDetails:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> Maybe [AccessDetail]
accessDetails} -> Maybe [AccessDetail]
accessDetails) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} Maybe [AccessDetail]
a -> GetOrganizationsAccessReportResponse
s {$sel:accessDetails:GetOrganizationsAccessReportResponse' :: Maybe [AccessDetail]
accessDetails = Maybe [AccessDetail]
a} :: GetOrganizationsAccessReportResponse) ((Maybe [AccessDetail] -> f (Maybe [AccessDetail]))
 -> GetOrganizationsAccessReportResponse
 -> f GetOrganizationsAccessReportResponse)
-> ((Maybe [AccessDetail] -> f (Maybe [AccessDetail]))
    -> Maybe [AccessDetail] -> f (Maybe [AccessDetail]))
-> (Maybe [AccessDetail] -> f (Maybe [AccessDetail]))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AccessDetail] [AccessDetail] [AccessDetail] [AccessDetail]
-> Iso
     (Maybe [AccessDetail])
     (Maybe [AccessDetail])
     (Maybe [AccessDetail])
     (Maybe [AccessDetail])
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 [AccessDetail] [AccessDetail] [AccessDetail] [AccessDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of services that the applicable SCPs allow account principals
-- to access.
getOrganizationsAccessReportResponse_numberOfServicesAccessible :: Lens.Lens' GetOrganizationsAccessReportResponse (Prelude.Maybe Prelude.Int)
getOrganizationsAccessReportResponse_numberOfServicesAccessible :: (Maybe Int -> f (Maybe Int))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_numberOfServicesAccessible = (GetOrganizationsAccessReportResponse -> Maybe Int)
-> (GetOrganizationsAccessReportResponse
    -> Maybe Int -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {Maybe Int
numberOfServicesAccessible :: Maybe Int
$sel:numberOfServicesAccessible:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> Maybe Int
numberOfServicesAccessible} -> Maybe Int
numberOfServicesAccessible) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} Maybe Int
a -> GetOrganizationsAccessReportResponse
s {$sel:numberOfServicesAccessible:GetOrganizationsAccessReportResponse' :: Maybe Int
numberOfServicesAccessible = Maybe Int
a} :: GetOrganizationsAccessReportResponse)

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

-- | Undocumented member.
getOrganizationsAccessReportResponse_errorDetails :: Lens.Lens' GetOrganizationsAccessReportResponse (Prelude.Maybe ErrorDetails)
getOrganizationsAccessReportResponse_errorDetails :: (Maybe ErrorDetails -> f (Maybe ErrorDetails))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_errorDetails = (GetOrganizationsAccessReportResponse -> Maybe ErrorDetails)
-> (GetOrganizationsAccessReportResponse
    -> Maybe ErrorDetails -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     (Maybe ErrorDetails)
     (Maybe ErrorDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {Maybe ErrorDetails
errorDetails :: Maybe ErrorDetails
$sel:errorDetails:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> Maybe ErrorDetails
errorDetails} -> Maybe ErrorDetails
errorDetails) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} Maybe ErrorDetails
a -> GetOrganizationsAccessReportResponse
s {$sel:errorDetails:GetOrganizationsAccessReportResponse' :: Maybe ErrorDetails
errorDetails = Maybe ErrorDetails
a} :: GetOrganizationsAccessReportResponse)

-- | 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.
getOrganizationsAccessReportResponse_isTruncated :: Lens.Lens' GetOrganizationsAccessReportResponse (Prelude.Maybe Prelude.Bool)
getOrganizationsAccessReportResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_isTruncated = (GetOrganizationsAccessReportResponse -> Maybe Bool)
-> (GetOrganizationsAccessReportResponse
    -> Maybe Bool -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} Maybe Bool
a -> GetOrganizationsAccessReportResponse
s {$sel:isTruncated:GetOrganizationsAccessReportResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: GetOrganizationsAccessReportResponse)

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

-- | The status of the job.
getOrganizationsAccessReportResponse_jobStatus :: Lens.Lens' GetOrganizationsAccessReportResponse JobStatusType
getOrganizationsAccessReportResponse_jobStatus :: (JobStatusType -> f JobStatusType)
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_jobStatus = (GetOrganizationsAccessReportResponse -> JobStatusType)
-> (GetOrganizationsAccessReportResponse
    -> JobStatusType -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     JobStatusType
     JobStatusType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {JobStatusType
jobStatus :: JobStatusType
$sel:jobStatus:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> JobStatusType
jobStatus} -> JobStatusType
jobStatus) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} JobStatusType
a -> GetOrganizationsAccessReportResponse
s {$sel:jobStatus:GetOrganizationsAccessReportResponse' :: JobStatusType
jobStatus = JobStatusType
a} :: GetOrganizationsAccessReportResponse)

-- | The date and time,
-- in <http://www.iso.org/iso/iso8601 ISO 8601 date-time format>, when the
-- report job was created.
getOrganizationsAccessReportResponse_jobCreationDate :: Lens.Lens' GetOrganizationsAccessReportResponse Prelude.UTCTime
getOrganizationsAccessReportResponse_jobCreationDate :: (UTCTime -> f UTCTime)
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
getOrganizationsAccessReportResponse_jobCreationDate = (GetOrganizationsAccessReportResponse -> ISO8601)
-> (GetOrganizationsAccessReportResponse
    -> ISO8601 -> GetOrganizationsAccessReportResponse)
-> Lens
     GetOrganizationsAccessReportResponse
     GetOrganizationsAccessReportResponse
     ISO8601
     ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOrganizationsAccessReportResponse' {ISO8601
jobCreationDate :: ISO8601
$sel:jobCreationDate:GetOrganizationsAccessReportResponse' :: GetOrganizationsAccessReportResponse -> ISO8601
jobCreationDate} -> ISO8601
jobCreationDate) (\s :: GetOrganizationsAccessReportResponse
s@GetOrganizationsAccessReportResponse' {} ISO8601
a -> GetOrganizationsAccessReportResponse
s {$sel:jobCreationDate:GetOrganizationsAccessReportResponse' :: ISO8601
jobCreationDate = ISO8601
a} :: GetOrganizationsAccessReportResponse) ((ISO8601 -> f ISO8601)
 -> GetOrganizationsAccessReportResponse
 -> f GetOrganizationsAccessReportResponse)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> GetOrganizationsAccessReportResponse
-> f GetOrganizationsAccessReportResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance
  Prelude.NFData
    GetOrganizationsAccessReportResponse