{-# 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.QuickSight.ListAnalyses
-- 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)
--
-- Lists Amazon QuickSight analyses that exist in the specified Amazon Web
-- Services account.
--
-- This operation returns paginated results.
module Amazonka.QuickSight.ListAnalyses
  ( -- * Creating a Request
    ListAnalyses (..),
    newListAnalyses,

    -- * Request Lenses
    listAnalyses_nextToken,
    listAnalyses_maxResults,
    listAnalyses_awsAccountId,

    -- * Destructuring the Response
    ListAnalysesResponse (..),
    newListAnalysesResponse,

    -- * Response Lenses
    listAnalysesResponse_requestId,
    listAnalysesResponse_nextToken,
    listAnalysesResponse_analysisSummaryList,
    listAnalysesResponse_status,
  )
where

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

-- | /See:/ 'newListAnalyses' smart constructor.
data ListAnalyses = ListAnalyses'
  { -- | A pagination token that can be used in a subsequent request.
    ListAnalyses -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    ListAnalyses -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the Amazon Web Services account that contains the analyses.
    ListAnalyses -> Text
awsAccountId :: Prelude.Text
  }
  deriving (ListAnalyses -> ListAnalyses -> Bool
(ListAnalyses -> ListAnalyses -> Bool)
-> (ListAnalyses -> ListAnalyses -> Bool) -> Eq ListAnalyses
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAnalyses -> ListAnalyses -> Bool
$c/= :: ListAnalyses -> ListAnalyses -> Bool
== :: ListAnalyses -> ListAnalyses -> Bool
$c== :: ListAnalyses -> ListAnalyses -> Bool
Prelude.Eq, ReadPrec [ListAnalyses]
ReadPrec ListAnalyses
Int -> ReadS ListAnalyses
ReadS [ListAnalyses]
(Int -> ReadS ListAnalyses)
-> ReadS [ListAnalyses]
-> ReadPrec ListAnalyses
-> ReadPrec [ListAnalyses]
-> Read ListAnalyses
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAnalyses]
$creadListPrec :: ReadPrec [ListAnalyses]
readPrec :: ReadPrec ListAnalyses
$creadPrec :: ReadPrec ListAnalyses
readList :: ReadS [ListAnalyses]
$creadList :: ReadS [ListAnalyses]
readsPrec :: Int -> ReadS ListAnalyses
$creadsPrec :: Int -> ReadS ListAnalyses
Prelude.Read, Int -> ListAnalyses -> ShowS
[ListAnalyses] -> ShowS
ListAnalyses -> String
(Int -> ListAnalyses -> ShowS)
-> (ListAnalyses -> String)
-> ([ListAnalyses] -> ShowS)
-> Show ListAnalyses
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAnalyses] -> ShowS
$cshowList :: [ListAnalyses] -> ShowS
show :: ListAnalyses -> String
$cshow :: ListAnalyses -> String
showsPrec :: Int -> ListAnalyses -> ShowS
$cshowsPrec :: Int -> ListAnalyses -> ShowS
Prelude.Show, (forall x. ListAnalyses -> Rep ListAnalyses x)
-> (forall x. Rep ListAnalyses x -> ListAnalyses)
-> Generic ListAnalyses
forall x. Rep ListAnalyses x -> ListAnalyses
forall x. ListAnalyses -> Rep ListAnalyses x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAnalyses x -> ListAnalyses
$cfrom :: forall x. ListAnalyses -> Rep ListAnalyses x
Prelude.Generic)

-- |
-- Create a value of 'ListAnalyses' 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', 'listAnalyses_nextToken' - A pagination token that can be used in a subsequent request.
--
-- 'maxResults', 'listAnalyses_maxResults' - The maximum number of results to return.
--
-- 'awsAccountId', 'listAnalyses_awsAccountId' - The ID of the Amazon Web Services account that contains the analyses.
newListAnalyses ::
  -- | 'awsAccountId'
  Prelude.Text ->
  ListAnalyses
newListAnalyses :: Text -> ListAnalyses
newListAnalyses Text
pAwsAccountId_ =
  ListAnalyses' :: Maybe Text -> Maybe Natural -> Text -> ListAnalyses
ListAnalyses'
    { $sel:nextToken:ListAnalyses' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAnalyses' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:ListAnalyses' :: Text
awsAccountId = Text
pAwsAccountId_
    }

-- | A pagination token that can be used in a subsequent request.
listAnalyses_nextToken :: Lens.Lens' ListAnalyses (Prelude.Maybe Prelude.Text)
listAnalyses_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListAnalyses -> f ListAnalyses
listAnalyses_nextToken = (ListAnalyses -> Maybe Text)
-> (ListAnalyses -> Maybe Text -> ListAnalyses)
-> Lens ListAnalyses ListAnalyses (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyses' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAnalyses' :: ListAnalyses -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAnalyses
s@ListAnalyses' {} Maybe Text
a -> ListAnalyses
s {$sel:nextToken:ListAnalyses' :: Maybe Text
nextToken = Maybe Text
a} :: ListAnalyses)

-- | The maximum number of results to return.
listAnalyses_maxResults :: Lens.Lens' ListAnalyses (Prelude.Maybe Prelude.Natural)
listAnalyses_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAnalyses -> f ListAnalyses
listAnalyses_maxResults = (ListAnalyses -> Maybe Natural)
-> (ListAnalyses -> Maybe Natural -> ListAnalyses)
-> Lens ListAnalyses ListAnalyses (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyses' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAnalyses' :: ListAnalyses -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAnalyses
s@ListAnalyses' {} Maybe Natural
a -> ListAnalyses
s {$sel:maxResults:ListAnalyses' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAnalyses)

-- | The ID of the Amazon Web Services account that contains the analyses.
listAnalyses_awsAccountId :: Lens.Lens' ListAnalyses Prelude.Text
listAnalyses_awsAccountId :: (Text -> f Text) -> ListAnalyses -> f ListAnalyses
listAnalyses_awsAccountId = (ListAnalyses -> Text)
-> (ListAnalyses -> Text -> ListAnalyses)
-> Lens ListAnalyses ListAnalyses Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalyses' {Text
awsAccountId :: Text
$sel:awsAccountId:ListAnalyses' :: ListAnalyses -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListAnalyses
s@ListAnalyses' {} Text
a -> ListAnalyses
s {$sel:awsAccountId:ListAnalyses' :: Text
awsAccountId = Text
a} :: ListAnalyses)

instance Core.AWSPager ListAnalyses where
  page :: ListAnalyses -> AWSResponse ListAnalyses -> Maybe ListAnalyses
page ListAnalyses
rq AWSResponse ListAnalyses
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAnalyses
ListAnalysesResponse
rs
            ListAnalysesResponse
-> Getting (First Text) ListAnalysesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAnalysesResponse -> Const (First Text) ListAnalysesResponse
Lens' ListAnalysesResponse (Maybe Text)
listAnalysesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAnalysesResponse -> Const (First Text) ListAnalysesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAnalysesResponse 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 ListAnalyses
forall a. Maybe a
Prelude.Nothing
    | Maybe [AnalysisSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAnalyses
ListAnalysesResponse
rs
            ListAnalysesResponse
-> Getting
     (First [AnalysisSummary]) ListAnalysesResponse [AnalysisSummary]
-> Maybe [AnalysisSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AnalysisSummary]
 -> Const (First [AnalysisSummary]) (Maybe [AnalysisSummary]))
-> ListAnalysesResponse
-> Const (First [AnalysisSummary]) ListAnalysesResponse
Lens' ListAnalysesResponse (Maybe [AnalysisSummary])
listAnalysesResponse_analysisSummaryList
              ((Maybe [AnalysisSummary]
  -> Const (First [AnalysisSummary]) (Maybe [AnalysisSummary]))
 -> ListAnalysesResponse
 -> Const (First [AnalysisSummary]) ListAnalysesResponse)
-> (([AnalysisSummary]
     -> Const (First [AnalysisSummary]) [AnalysisSummary])
    -> Maybe [AnalysisSummary]
    -> Const (First [AnalysisSummary]) (Maybe [AnalysisSummary]))
-> Getting
     (First [AnalysisSummary]) ListAnalysesResponse [AnalysisSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AnalysisSummary]
 -> Const (First [AnalysisSummary]) [AnalysisSummary])
-> Maybe [AnalysisSummary]
-> Const (First [AnalysisSummary]) (Maybe [AnalysisSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAnalyses
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAnalyses -> Maybe ListAnalyses
forall a. a -> Maybe a
Prelude.Just (ListAnalyses -> Maybe ListAnalyses)
-> ListAnalyses -> Maybe ListAnalyses
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAnalyses
rq
          ListAnalyses -> (ListAnalyses -> ListAnalyses) -> ListAnalyses
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAnalyses -> Identity ListAnalyses
Lens ListAnalyses ListAnalyses (Maybe Text) (Maybe Text)
listAnalyses_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAnalyses -> Identity ListAnalyses)
-> Maybe Text -> ListAnalyses -> ListAnalyses
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAnalyses
ListAnalysesResponse
rs
          ListAnalysesResponse
-> Getting (First Text) ListAnalysesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAnalysesResponse -> Const (First Text) ListAnalysesResponse
Lens' ListAnalysesResponse (Maybe Text)
listAnalysesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAnalysesResponse -> Const (First Text) ListAnalysesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAnalysesResponse 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 ListAnalyses where
  type AWSResponse ListAnalyses = ListAnalysesResponse
  request :: ListAnalyses -> Request ListAnalyses
request = Service -> ListAnalyses -> Request ListAnalyses
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAnalyses
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAnalyses)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAnalyses))
-> Logger
-> Service
-> Proxy ListAnalyses
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAnalyses)))
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
-> Maybe Text
-> Maybe [AnalysisSummary]
-> Int
-> ListAnalysesResponse
ListAnalysesResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [AnalysisSummary]
 -> Int
 -> ListAnalysesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [AnalysisSummary] -> Int -> ListAnalysesResponse)
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
"RequestId")
            Either
  String
  (Maybe Text
   -> Maybe [AnalysisSummary] -> Int -> ListAnalysesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [AnalysisSummary] -> Int -> ListAnalysesResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Maybe [AnalysisSummary] -> Int -> ListAnalysesResponse)
-> Either String (Maybe [AnalysisSummary])
-> Either String (Int -> ListAnalysesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [AnalysisSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AnalysisSummaryList"
                            Either String (Maybe (Maybe [AnalysisSummary]))
-> Maybe [AnalysisSummary]
-> Either String (Maybe [AnalysisSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AnalysisSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListAnalysesResponse)
-> Either String Int -> Either String ListAnalysesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListAnalyses

instance Prelude.NFData ListAnalyses

instance Core.ToHeaders ListAnalyses where
  toHeaders :: ListAnalyses -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAnalyses -> 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.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListAnalyses where
  toPath :: ListAnalyses -> ByteString
toPath ListAnalyses' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListAnalyses' :: ListAnalyses -> Text
$sel:maxResults:ListAnalyses' :: ListAnalyses -> Maybe Natural
$sel:nextToken:ListAnalyses' :: ListAnalyses -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/accounts/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId, ByteString
"/analyses"]

instance Core.ToQuery ListAnalyses where
  toQuery :: ListAnalyses -> QueryString
toQuery ListAnalyses' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListAnalyses' :: ListAnalyses -> Text
$sel:maxResults:ListAnalyses' :: ListAnalyses -> Maybe Natural
$sel:nextToken:ListAnalyses' :: ListAnalyses -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListAnalysesResponse' smart constructor.
data ListAnalysesResponse = ListAnalysesResponse'
  { -- | The Amazon Web Services request ID for this operation.
    ListAnalysesResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | A pagination token that can be used in a subsequent request.
    ListAnalysesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Metadata describing each of the analyses that are listed.
    ListAnalysesResponse -> Maybe [AnalysisSummary]
analysisSummaryList :: Prelude.Maybe [AnalysisSummary],
    -- | The HTTP status of the request.
    ListAnalysesResponse -> Int
status :: Prelude.Int
  }
  deriving (ListAnalysesResponse -> ListAnalysesResponse -> Bool
(ListAnalysesResponse -> ListAnalysesResponse -> Bool)
-> (ListAnalysesResponse -> ListAnalysesResponse -> Bool)
-> Eq ListAnalysesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAnalysesResponse -> ListAnalysesResponse -> Bool
$c/= :: ListAnalysesResponse -> ListAnalysesResponse -> Bool
== :: ListAnalysesResponse -> ListAnalysesResponse -> Bool
$c== :: ListAnalysesResponse -> ListAnalysesResponse -> Bool
Prelude.Eq, ReadPrec [ListAnalysesResponse]
ReadPrec ListAnalysesResponse
Int -> ReadS ListAnalysesResponse
ReadS [ListAnalysesResponse]
(Int -> ReadS ListAnalysesResponse)
-> ReadS [ListAnalysesResponse]
-> ReadPrec ListAnalysesResponse
-> ReadPrec [ListAnalysesResponse]
-> Read ListAnalysesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAnalysesResponse]
$creadListPrec :: ReadPrec [ListAnalysesResponse]
readPrec :: ReadPrec ListAnalysesResponse
$creadPrec :: ReadPrec ListAnalysesResponse
readList :: ReadS [ListAnalysesResponse]
$creadList :: ReadS [ListAnalysesResponse]
readsPrec :: Int -> ReadS ListAnalysesResponse
$creadsPrec :: Int -> ReadS ListAnalysesResponse
Prelude.Read, Int -> ListAnalysesResponse -> ShowS
[ListAnalysesResponse] -> ShowS
ListAnalysesResponse -> String
(Int -> ListAnalysesResponse -> ShowS)
-> (ListAnalysesResponse -> String)
-> ([ListAnalysesResponse] -> ShowS)
-> Show ListAnalysesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAnalysesResponse] -> ShowS
$cshowList :: [ListAnalysesResponse] -> ShowS
show :: ListAnalysesResponse -> String
$cshow :: ListAnalysesResponse -> String
showsPrec :: Int -> ListAnalysesResponse -> ShowS
$cshowsPrec :: Int -> ListAnalysesResponse -> ShowS
Prelude.Show, (forall x. ListAnalysesResponse -> Rep ListAnalysesResponse x)
-> (forall x. Rep ListAnalysesResponse x -> ListAnalysesResponse)
-> Generic ListAnalysesResponse
forall x. Rep ListAnalysesResponse x -> ListAnalysesResponse
forall x. ListAnalysesResponse -> Rep ListAnalysesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAnalysesResponse x -> ListAnalysesResponse
$cfrom :: forall x. ListAnalysesResponse -> Rep ListAnalysesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAnalysesResponse' 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:
--
-- 'requestId', 'listAnalysesResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'nextToken', 'listAnalysesResponse_nextToken' - A pagination token that can be used in a subsequent request.
--
-- 'analysisSummaryList', 'listAnalysesResponse_analysisSummaryList' - Metadata describing each of the analyses that are listed.
--
-- 'status', 'listAnalysesResponse_status' - The HTTP status of the request.
newListAnalysesResponse ::
  -- | 'status'
  Prelude.Int ->
  ListAnalysesResponse
newListAnalysesResponse :: Int -> ListAnalysesResponse
newListAnalysesResponse Int
pStatus_ =
  ListAnalysesResponse' :: Maybe Text
-> Maybe Text
-> Maybe [AnalysisSummary]
-> Int
-> ListAnalysesResponse
ListAnalysesResponse'
    { $sel:requestId:ListAnalysesResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAnalysesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:analysisSummaryList:ListAnalysesResponse' :: Maybe [AnalysisSummary]
analysisSummaryList = Maybe [AnalysisSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListAnalysesResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
listAnalysesResponse_requestId :: Lens.Lens' ListAnalysesResponse (Prelude.Maybe Prelude.Text)
listAnalysesResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListAnalysesResponse -> f ListAnalysesResponse
listAnalysesResponse_requestId = (ListAnalysesResponse -> Maybe Text)
-> (ListAnalysesResponse -> Maybe Text -> ListAnalysesResponse)
-> Lens' ListAnalysesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalysesResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListAnalysesResponse' :: ListAnalysesResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListAnalysesResponse
s@ListAnalysesResponse' {} Maybe Text
a -> ListAnalysesResponse
s {$sel:requestId:ListAnalysesResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListAnalysesResponse)

-- | A pagination token that can be used in a subsequent request.
listAnalysesResponse_nextToken :: Lens.Lens' ListAnalysesResponse (Prelude.Maybe Prelude.Text)
listAnalysesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAnalysesResponse -> f ListAnalysesResponse
listAnalysesResponse_nextToken = (ListAnalysesResponse -> Maybe Text)
-> (ListAnalysesResponse -> Maybe Text -> ListAnalysesResponse)
-> Lens' ListAnalysesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalysesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAnalysesResponse' :: ListAnalysesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAnalysesResponse
s@ListAnalysesResponse' {} Maybe Text
a -> ListAnalysesResponse
s {$sel:nextToken:ListAnalysesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAnalysesResponse)

-- | Metadata describing each of the analyses that are listed.
listAnalysesResponse_analysisSummaryList :: Lens.Lens' ListAnalysesResponse (Prelude.Maybe [AnalysisSummary])
listAnalysesResponse_analysisSummaryList :: (Maybe [AnalysisSummary] -> f (Maybe [AnalysisSummary]))
-> ListAnalysesResponse -> f ListAnalysesResponse
listAnalysesResponse_analysisSummaryList = (ListAnalysesResponse -> Maybe [AnalysisSummary])
-> (ListAnalysesResponse
    -> Maybe [AnalysisSummary] -> ListAnalysesResponse)
-> Lens' ListAnalysesResponse (Maybe [AnalysisSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalysesResponse' {Maybe [AnalysisSummary]
analysisSummaryList :: Maybe [AnalysisSummary]
$sel:analysisSummaryList:ListAnalysesResponse' :: ListAnalysesResponse -> Maybe [AnalysisSummary]
analysisSummaryList} -> Maybe [AnalysisSummary]
analysisSummaryList) (\s :: ListAnalysesResponse
s@ListAnalysesResponse' {} Maybe [AnalysisSummary]
a -> ListAnalysesResponse
s {$sel:analysisSummaryList:ListAnalysesResponse' :: Maybe [AnalysisSummary]
analysisSummaryList = Maybe [AnalysisSummary]
a} :: ListAnalysesResponse) ((Maybe [AnalysisSummary] -> f (Maybe [AnalysisSummary]))
 -> ListAnalysesResponse -> f ListAnalysesResponse)
-> ((Maybe [AnalysisSummary] -> f (Maybe [AnalysisSummary]))
    -> Maybe [AnalysisSummary] -> f (Maybe [AnalysisSummary]))
-> (Maybe [AnalysisSummary] -> f (Maybe [AnalysisSummary]))
-> ListAnalysesResponse
-> f ListAnalysesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AnalysisSummary]
  [AnalysisSummary]
  [AnalysisSummary]
  [AnalysisSummary]
-> Iso
     (Maybe [AnalysisSummary])
     (Maybe [AnalysisSummary])
     (Maybe [AnalysisSummary])
     (Maybe [AnalysisSummary])
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
  [AnalysisSummary]
  [AnalysisSummary]
  [AnalysisSummary]
  [AnalysisSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The HTTP status of the request.
listAnalysesResponse_status :: Lens.Lens' ListAnalysesResponse Prelude.Int
listAnalysesResponse_status :: (Int -> f Int) -> ListAnalysesResponse -> f ListAnalysesResponse
listAnalysesResponse_status = (ListAnalysesResponse -> Int)
-> (ListAnalysesResponse -> Int -> ListAnalysesResponse)
-> Lens ListAnalysesResponse ListAnalysesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnalysesResponse' {Int
status :: Int
$sel:status:ListAnalysesResponse' :: ListAnalysesResponse -> Int
status} -> Int
status) (\s :: ListAnalysesResponse
s@ListAnalysesResponse' {} Int
a -> ListAnalysesResponse
s {$sel:status:ListAnalysesResponse' :: Int
status = Int
a} :: ListAnalysesResponse)

instance Prelude.NFData ListAnalysesResponse