{-# 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.AccessAnalyzer.ListAnalyzedResources
-- 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 a list of resources of the specified type that have been
-- analyzed by the specified analyzer..
--
-- This operation returns paginated results.
module Amazonka.AccessAnalyzer.ListAnalyzedResources
  ( -- * Creating a Request
    ListAnalyzedResources (..),
    newListAnalyzedResources,

    -- * Request Lenses
    listAnalyzedResources_resourceType,
    listAnalyzedResources_nextToken,
    listAnalyzedResources_maxResults,
    listAnalyzedResources_analyzerArn,

    -- * Destructuring the Response
    ListAnalyzedResourcesResponse (..),
    newListAnalyzedResourcesResponse,

    -- * Response Lenses
    listAnalyzedResourcesResponse_nextToken,
    listAnalyzedResourcesResponse_httpStatus,
    listAnalyzedResourcesResponse_analyzedResources,
  )
where

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

-- | Retrieves a list of resources that have been analyzed.
--
-- /See:/ 'newListAnalyzedResources' smart constructor.
data ListAnalyzedResources = ListAnalyzedResources'
  { -- | The type of resource.
    ListAnalyzedResources -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | A token used for pagination of results returned.
    ListAnalyzedResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the response.
    ListAnalyzedResources -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources ARN of the analyzer>
    -- to retrieve a list of analyzed resources from.
    ListAnalyzedResources -> Text
analyzerArn :: Prelude.Text
  }
  deriving (ListAnalyzedResources -> ListAnalyzedResources -> Bool
(ListAnalyzedResources -> ListAnalyzedResources -> Bool)
-> (ListAnalyzedResources -> ListAnalyzedResources -> Bool)
-> Eq ListAnalyzedResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAnalyzedResources -> ListAnalyzedResources -> Bool
$c/= :: ListAnalyzedResources -> ListAnalyzedResources -> Bool
== :: ListAnalyzedResources -> ListAnalyzedResources -> Bool
$c== :: ListAnalyzedResources -> ListAnalyzedResources -> Bool
Prelude.Eq, ReadPrec [ListAnalyzedResources]
ReadPrec ListAnalyzedResources
Int -> ReadS ListAnalyzedResources
ReadS [ListAnalyzedResources]
(Int -> ReadS ListAnalyzedResources)
-> ReadS [ListAnalyzedResources]
-> ReadPrec ListAnalyzedResources
-> ReadPrec [ListAnalyzedResources]
-> Read ListAnalyzedResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAnalyzedResources]
$creadListPrec :: ReadPrec [ListAnalyzedResources]
readPrec :: ReadPrec ListAnalyzedResources
$creadPrec :: ReadPrec ListAnalyzedResources
readList :: ReadS [ListAnalyzedResources]
$creadList :: ReadS [ListAnalyzedResources]
readsPrec :: Int -> ReadS ListAnalyzedResources
$creadsPrec :: Int -> ReadS ListAnalyzedResources
Prelude.Read, Int -> ListAnalyzedResources -> ShowS
[ListAnalyzedResources] -> ShowS
ListAnalyzedResources -> String
(Int -> ListAnalyzedResources -> ShowS)
-> (ListAnalyzedResources -> String)
-> ([ListAnalyzedResources] -> ShowS)
-> Show ListAnalyzedResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAnalyzedResources] -> ShowS
$cshowList :: [ListAnalyzedResources] -> ShowS
show :: ListAnalyzedResources -> String
$cshow :: ListAnalyzedResources -> String
showsPrec :: Int -> ListAnalyzedResources -> ShowS
$cshowsPrec :: Int -> ListAnalyzedResources -> ShowS
Prelude.Show, (forall x. ListAnalyzedResources -> Rep ListAnalyzedResources x)
-> (forall x. Rep ListAnalyzedResources x -> ListAnalyzedResources)
-> Generic ListAnalyzedResources
forall x. Rep ListAnalyzedResources x -> ListAnalyzedResources
forall x. ListAnalyzedResources -> Rep ListAnalyzedResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAnalyzedResources x -> ListAnalyzedResources
$cfrom :: forall x. ListAnalyzedResources -> Rep ListAnalyzedResources x
Prelude.Generic)

-- |
-- Create a value of 'ListAnalyzedResources' 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:
--
-- 'resourceType', 'listAnalyzedResources_resourceType' - The type of resource.
--
-- 'nextToken', 'listAnalyzedResources_nextToken' - A token used for pagination of results returned.
--
-- 'maxResults', 'listAnalyzedResources_maxResults' - The maximum number of results to return in the response.
--
-- 'analyzerArn', 'listAnalyzedResources_analyzerArn' - The
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources ARN of the analyzer>
-- to retrieve a list of analyzed resources from.
newListAnalyzedResources ::
  -- | 'analyzerArn'
  Prelude.Text ->
  ListAnalyzedResources
newListAnalyzedResources :: Text -> ListAnalyzedResources
newListAnalyzedResources Text
pAnalyzerArn_ =
  ListAnalyzedResources' :: Maybe ResourceType
-> Maybe Text -> Maybe Int -> Text -> ListAnalyzedResources
ListAnalyzedResources'
    { $sel:resourceType:ListAnalyzedResources' :: Maybe ResourceType
resourceType =
        Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAnalyzedResources' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAnalyzedResources' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:analyzerArn:ListAnalyzedResources' :: Text
analyzerArn = Text
pAnalyzerArn_
    }

-- | The type of resource.
listAnalyzedResources_resourceType :: Lens.Lens' ListAnalyzedResources (Prelude.Maybe ResourceType)
listAnalyzedResources_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> ListAnalyzedResources -> f ListAnalyzedResources
listAnalyzedResources_resourceType = (ListAnalyzedResources -> Maybe ResourceType)
-> (ListAnalyzedResources
    -> Maybe ResourceType -> ListAnalyzedResources)
-> Lens
     ListAnalyzedResources
     ListAnalyzedResources
     (Maybe ResourceType)
     (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyzedResources' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:ListAnalyzedResources' :: ListAnalyzedResources -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: ListAnalyzedResources
s@ListAnalyzedResources' {} Maybe ResourceType
a -> ListAnalyzedResources
s {$sel:resourceType:ListAnalyzedResources' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: ListAnalyzedResources)

-- | A token used for pagination of results returned.
listAnalyzedResources_nextToken :: Lens.Lens' ListAnalyzedResources (Prelude.Maybe Prelude.Text)
listAnalyzedResources_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAnalyzedResources -> f ListAnalyzedResources
listAnalyzedResources_nextToken = (ListAnalyzedResources -> Maybe Text)
-> (ListAnalyzedResources -> Maybe Text -> ListAnalyzedResources)
-> Lens
     ListAnalyzedResources
     ListAnalyzedResources
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyzedResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAnalyzedResources' :: ListAnalyzedResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAnalyzedResources
s@ListAnalyzedResources' {} Maybe Text
a -> ListAnalyzedResources
s {$sel:nextToken:ListAnalyzedResources' :: Maybe Text
nextToken = Maybe Text
a} :: ListAnalyzedResources)

-- | The maximum number of results to return in the response.
listAnalyzedResources_maxResults :: Lens.Lens' ListAnalyzedResources (Prelude.Maybe Prelude.Int)
listAnalyzedResources_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListAnalyzedResources -> f ListAnalyzedResources
listAnalyzedResources_maxResults = (ListAnalyzedResources -> Maybe Int)
-> (ListAnalyzedResources -> Maybe Int -> ListAnalyzedResources)
-> Lens
     ListAnalyzedResources ListAnalyzedResources (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyzedResources' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListAnalyzedResources' :: ListAnalyzedResources -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListAnalyzedResources
s@ListAnalyzedResources' {} Maybe Int
a -> ListAnalyzedResources
s {$sel:maxResults:ListAnalyzedResources' :: Maybe Int
maxResults = Maybe Int
a} :: ListAnalyzedResources)

-- | The
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources ARN of the analyzer>
-- to retrieve a list of analyzed resources from.
listAnalyzedResources_analyzerArn :: Lens.Lens' ListAnalyzedResources Prelude.Text
listAnalyzedResources_analyzerArn :: (Text -> f Text)
-> ListAnalyzedResources -> f ListAnalyzedResources
listAnalyzedResources_analyzerArn = (ListAnalyzedResources -> Text)
-> (ListAnalyzedResources -> Text -> ListAnalyzedResources)
-> Lens ListAnalyzedResources ListAnalyzedResources Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyzedResources' {Text
analyzerArn :: Text
$sel:analyzerArn:ListAnalyzedResources' :: ListAnalyzedResources -> Text
analyzerArn} -> Text
analyzerArn) (\s :: ListAnalyzedResources
s@ListAnalyzedResources' {} Text
a -> ListAnalyzedResources
s {$sel:analyzerArn:ListAnalyzedResources' :: Text
analyzerArn = Text
a} :: ListAnalyzedResources)

instance Core.AWSPager ListAnalyzedResources where
  page :: ListAnalyzedResources
-> AWSResponse ListAnalyzedResources -> Maybe ListAnalyzedResources
page ListAnalyzedResources
rq AWSResponse ListAnalyzedResources
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAnalyzedResources
ListAnalyzedResourcesResponse
rs
            ListAnalyzedResourcesResponse
-> Getting (First Text) ListAnalyzedResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAnalyzedResourcesResponse
-> Const (First Text) ListAnalyzedResourcesResponse
Lens' ListAnalyzedResourcesResponse (Maybe Text)
listAnalyzedResourcesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAnalyzedResourcesResponse
 -> Const (First Text) ListAnalyzedResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAnalyzedResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAnalyzedResources
forall a. Maybe a
Prelude.Nothing
    | [AnalyzedResourceSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAnalyzedResources
ListAnalyzedResourcesResponse
rs
            ListAnalyzedResourcesResponse
-> Getting
     [AnalyzedResourceSummary]
     ListAnalyzedResourcesResponse
     [AnalyzedResourceSummary]
-> [AnalyzedResourceSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [AnalyzedResourceSummary]
  ListAnalyzedResourcesResponse
  [AnalyzedResourceSummary]
Lens' ListAnalyzedResourcesResponse [AnalyzedResourceSummary]
listAnalyzedResourcesResponse_analyzedResources
        ) =
      Maybe ListAnalyzedResources
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAnalyzedResources -> Maybe ListAnalyzedResources
forall a. a -> Maybe a
Prelude.Just (ListAnalyzedResources -> Maybe ListAnalyzedResources)
-> ListAnalyzedResources -> Maybe ListAnalyzedResources
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAnalyzedResources
rq
          ListAnalyzedResources
-> (ListAnalyzedResources -> ListAnalyzedResources)
-> ListAnalyzedResources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAnalyzedResources -> Identity ListAnalyzedResources
Lens
  ListAnalyzedResources
  ListAnalyzedResources
  (Maybe Text)
  (Maybe Text)
listAnalyzedResources_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAnalyzedResources -> Identity ListAnalyzedResources)
-> Maybe Text -> ListAnalyzedResources -> ListAnalyzedResources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAnalyzedResources
ListAnalyzedResourcesResponse
rs
          ListAnalyzedResourcesResponse
-> Getting (First Text) ListAnalyzedResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAnalyzedResourcesResponse
-> Const (First Text) ListAnalyzedResourcesResponse
Lens' ListAnalyzedResourcesResponse (Maybe Text)
listAnalyzedResourcesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAnalyzedResourcesResponse
 -> Const (First Text) ListAnalyzedResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAnalyzedResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListAnalyzedResources where
  type
    AWSResponse ListAnalyzedResources =
      ListAnalyzedResourcesResponse
  request :: ListAnalyzedResources -> Request ListAnalyzedResources
request = Service -> ListAnalyzedResources -> Request ListAnalyzedResources
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAnalyzedResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAnalyzedResources)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAnalyzedResources))
-> Logger
-> Service
-> Proxy ListAnalyzedResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAnalyzedResources)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int
-> [AnalyzedResourceSummary]
-> ListAnalyzedResourcesResponse
ListAnalyzedResourcesResponse'
            (Maybe Text
 -> Int
 -> [AnalyzedResourceSummary]
 -> ListAnalyzedResourcesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [AnalyzedResourceSummary] -> ListAnalyzedResourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String
  (Int -> [AnalyzedResourceSummary] -> ListAnalyzedResourcesResponse)
-> Either String Int
-> Either
     String ([AnalyzedResourceSummary] -> ListAnalyzedResourcesResponse)
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 ([AnalyzedResourceSummary] -> ListAnalyzedResourcesResponse)
-> Either String [AnalyzedResourceSummary]
-> Either String ListAnalyzedResourcesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AnalyzedResourceSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"analyzedResources"
                            Either String (Maybe [AnalyzedResourceSummary])
-> [AnalyzedResourceSummary]
-> Either String [AnalyzedResourceSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AnalyzedResourceSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListAnalyzedResources

instance Prelude.NFData ListAnalyzedResources

instance Core.ToHeaders ListAnalyzedResources where
  toHeaders :: ListAnalyzedResources -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAnalyzedResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListAnalyzedResources where
  toJSON :: ListAnalyzedResources -> Value
toJSON ListAnalyzedResources' {Maybe Int
Maybe Text
Maybe ResourceType
Text
analyzerArn :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
resourceType :: Maybe ResourceType
$sel:analyzerArn:ListAnalyzedResources' :: ListAnalyzedResources -> Text
$sel:maxResults:ListAnalyzedResources' :: ListAnalyzedResources -> Maybe Int
$sel:nextToken:ListAnalyzedResources' :: ListAnalyzedResources -> Maybe Text
$sel:resourceType:ListAnalyzedResources' :: ListAnalyzedResources -> Maybe ResourceType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"resourceType" Text -> ResourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ResourceType -> Pair) -> Maybe ResourceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceType
resourceType,
            (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"analyzerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
analyzerArn)
          ]
      )

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

instance Core.ToQuery ListAnalyzedResources where
  toQuery :: ListAnalyzedResources -> QueryString
toQuery = QueryString -> ListAnalyzedResources -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The response to the request.
--
-- /See:/ 'newListAnalyzedResourcesResponse' smart constructor.
data ListAnalyzedResourcesResponse = ListAnalyzedResourcesResponse'
  { -- | A token used for pagination of results returned.
    ListAnalyzedResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAnalyzedResourcesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of resources that were analyzed.
    ListAnalyzedResourcesResponse -> [AnalyzedResourceSummary]
analyzedResources :: [AnalyzedResourceSummary]
  }
  deriving (ListAnalyzedResourcesResponse
-> ListAnalyzedResourcesResponse -> Bool
(ListAnalyzedResourcesResponse
 -> ListAnalyzedResourcesResponse -> Bool)
-> (ListAnalyzedResourcesResponse
    -> ListAnalyzedResourcesResponse -> Bool)
-> Eq ListAnalyzedResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAnalyzedResourcesResponse
-> ListAnalyzedResourcesResponse -> Bool
$c/= :: ListAnalyzedResourcesResponse
-> ListAnalyzedResourcesResponse -> Bool
== :: ListAnalyzedResourcesResponse
-> ListAnalyzedResourcesResponse -> Bool
$c== :: ListAnalyzedResourcesResponse
-> ListAnalyzedResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListAnalyzedResourcesResponse]
ReadPrec ListAnalyzedResourcesResponse
Int -> ReadS ListAnalyzedResourcesResponse
ReadS [ListAnalyzedResourcesResponse]
(Int -> ReadS ListAnalyzedResourcesResponse)
-> ReadS [ListAnalyzedResourcesResponse]
-> ReadPrec ListAnalyzedResourcesResponse
-> ReadPrec [ListAnalyzedResourcesResponse]
-> Read ListAnalyzedResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAnalyzedResourcesResponse]
$creadListPrec :: ReadPrec [ListAnalyzedResourcesResponse]
readPrec :: ReadPrec ListAnalyzedResourcesResponse
$creadPrec :: ReadPrec ListAnalyzedResourcesResponse
readList :: ReadS [ListAnalyzedResourcesResponse]
$creadList :: ReadS [ListAnalyzedResourcesResponse]
readsPrec :: Int -> ReadS ListAnalyzedResourcesResponse
$creadsPrec :: Int -> ReadS ListAnalyzedResourcesResponse
Prelude.Read, Int -> ListAnalyzedResourcesResponse -> ShowS
[ListAnalyzedResourcesResponse] -> ShowS
ListAnalyzedResourcesResponse -> String
(Int -> ListAnalyzedResourcesResponse -> ShowS)
-> (ListAnalyzedResourcesResponse -> String)
-> ([ListAnalyzedResourcesResponse] -> ShowS)
-> Show ListAnalyzedResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAnalyzedResourcesResponse] -> ShowS
$cshowList :: [ListAnalyzedResourcesResponse] -> ShowS
show :: ListAnalyzedResourcesResponse -> String
$cshow :: ListAnalyzedResourcesResponse -> String
showsPrec :: Int -> ListAnalyzedResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListAnalyzedResourcesResponse -> ShowS
Prelude.Show, (forall x.
 ListAnalyzedResourcesResponse
 -> Rep ListAnalyzedResourcesResponse x)
-> (forall x.
    Rep ListAnalyzedResourcesResponse x
    -> ListAnalyzedResourcesResponse)
-> Generic ListAnalyzedResourcesResponse
forall x.
Rep ListAnalyzedResourcesResponse x
-> ListAnalyzedResourcesResponse
forall x.
ListAnalyzedResourcesResponse
-> Rep ListAnalyzedResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAnalyzedResourcesResponse x
-> ListAnalyzedResourcesResponse
$cfrom :: forall x.
ListAnalyzedResourcesResponse
-> Rep ListAnalyzedResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAnalyzedResourcesResponse' 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:
--
-- 'nextToken', 'listAnalyzedResourcesResponse_nextToken' - A token used for pagination of results returned.
--
-- 'httpStatus', 'listAnalyzedResourcesResponse_httpStatus' - The response's http status code.
--
-- 'analyzedResources', 'listAnalyzedResourcesResponse_analyzedResources' - A list of resources that were analyzed.
newListAnalyzedResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAnalyzedResourcesResponse
newListAnalyzedResourcesResponse :: Int -> ListAnalyzedResourcesResponse
newListAnalyzedResourcesResponse Int
pHttpStatus_ =
  ListAnalyzedResourcesResponse' :: Maybe Text
-> Int
-> [AnalyzedResourceSummary]
-> ListAnalyzedResourcesResponse
ListAnalyzedResourcesResponse'
    { $sel:nextToken:ListAnalyzedResourcesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAnalyzedResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:analyzedResources:ListAnalyzedResourcesResponse' :: [AnalyzedResourceSummary]
analyzedResources = [AnalyzedResourceSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token used for pagination of results returned.
listAnalyzedResourcesResponse_nextToken :: Lens.Lens' ListAnalyzedResourcesResponse (Prelude.Maybe Prelude.Text)
listAnalyzedResourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAnalyzedResourcesResponse -> f ListAnalyzedResourcesResponse
listAnalyzedResourcesResponse_nextToken = (ListAnalyzedResourcesResponse -> Maybe Text)
-> (ListAnalyzedResourcesResponse
    -> Maybe Text -> ListAnalyzedResourcesResponse)
-> Lens' ListAnalyzedResourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyzedResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAnalyzedResourcesResponse' :: ListAnalyzedResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAnalyzedResourcesResponse
s@ListAnalyzedResourcesResponse' {} Maybe Text
a -> ListAnalyzedResourcesResponse
s {$sel:nextToken:ListAnalyzedResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAnalyzedResourcesResponse)

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

-- | A list of resources that were analyzed.
listAnalyzedResourcesResponse_analyzedResources :: Lens.Lens' ListAnalyzedResourcesResponse [AnalyzedResourceSummary]
listAnalyzedResourcesResponse_analyzedResources :: ([AnalyzedResourceSummary] -> f [AnalyzedResourceSummary])
-> ListAnalyzedResourcesResponse -> f ListAnalyzedResourcesResponse
listAnalyzedResourcesResponse_analyzedResources = (ListAnalyzedResourcesResponse -> [AnalyzedResourceSummary])
-> (ListAnalyzedResourcesResponse
    -> [AnalyzedResourceSummary] -> ListAnalyzedResourcesResponse)
-> Lens' ListAnalyzedResourcesResponse [AnalyzedResourceSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyzedResourcesResponse' {[AnalyzedResourceSummary]
analyzedResources :: [AnalyzedResourceSummary]
$sel:analyzedResources:ListAnalyzedResourcesResponse' :: ListAnalyzedResourcesResponse -> [AnalyzedResourceSummary]
analyzedResources} -> [AnalyzedResourceSummary]
analyzedResources) (\s :: ListAnalyzedResourcesResponse
s@ListAnalyzedResourcesResponse' {} [AnalyzedResourceSummary]
a -> ListAnalyzedResourcesResponse
s {$sel:analyzedResources:ListAnalyzedResourcesResponse' :: [AnalyzedResourceSummary]
analyzedResources = [AnalyzedResourceSummary]
a} :: ListAnalyzedResourcesResponse) (([AnalyzedResourceSummary] -> f [AnalyzedResourceSummary])
 -> ListAnalyzedResourcesResponse
 -> f ListAnalyzedResourcesResponse)
-> (([AnalyzedResourceSummary] -> f [AnalyzedResourceSummary])
    -> [AnalyzedResourceSummary] -> f [AnalyzedResourceSummary])
-> ([AnalyzedResourceSummary] -> f [AnalyzedResourceSummary])
-> ListAnalyzedResourcesResponse
-> f ListAnalyzedResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AnalyzedResourceSummary] -> f [AnalyzedResourceSummary])
-> [AnalyzedResourceSummary] -> f [AnalyzedResourceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListAnalyzedResourcesResponse