{-# 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 #-}
module Amazonka.QuickSight.ListAnalyses
(
ListAnalyses (..),
newListAnalyses,
listAnalyses_maxResults,
listAnalyses_nextToken,
listAnalyses_awsAccountId,
ListAnalysesResponse (..),
newListAnalysesResponse,
listAnalysesResponse_analysisSummaryList,
listAnalysesResponse_nextToken,
listAnalysesResponse_requestId,
listAnalysesResponse_status,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListAnalyses = ListAnalyses'
{
ListAnalyses -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAnalyses -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAnalyses -> Text
awsAccountId :: Prelude.Text
}
deriving (ListAnalyses -> ListAnalyses -> Bool
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]
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
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. 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)
newListAnalyses ::
Prelude.Text ->
ListAnalyses
newListAnalyses :: Text -> ListAnalyses
newListAnalyses Text
pAwsAccountId_ =
ListAnalyses'
{ $sel:maxResults:ListAnalyses' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAnalyses' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:ListAnalyses' :: Text
awsAccountId = Text
pAwsAccountId_
}
listAnalyses_maxResults :: Lens.Lens' ListAnalyses (Prelude.Maybe Prelude.Natural)
listAnalyses_maxResults :: Lens' ListAnalyses (Maybe Natural)
listAnalyses_maxResults = 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)
listAnalyses_nextToken :: Lens.Lens' ListAnalyses (Prelude.Maybe Prelude.Text)
listAnalyses_nextToken :: Lens' ListAnalyses (Maybe Text)
listAnalyses_nextToken = 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)
listAnalyses_awsAccountId :: Lens.Lens' ListAnalyses Prelude.Text
listAnalyses_awsAccountId :: Lens' ListAnalyses Text
listAnalyses_awsAccountId = 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
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAnalyses
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAnalysesResponse (Maybe Text)
listAnalysesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAnalyses
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAnalysesResponse (Maybe [AnalysisSummary])
listAnalysesResponse_analysisSummaryList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListAnalyses
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAnalyses (Maybe Text)
listAnalyses_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAnalyses
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAnalysesResponse (Maybe Text)
listAnalysesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListAnalyses where
type AWSResponse ListAnalyses = ListAnalysesResponse
request :: (Service -> Service) -> ListAnalyses -> Request ListAnalyses
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAnalyses
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAnalyses)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [AnalysisSummary]
-> Maybe Text -> Maybe Text -> Int -> ListAnalysesResponse
ListAnalysesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AnalysisSummaryList"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RequestId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListAnalyses where
hashWithSalt :: Int -> ListAnalyses -> Int
hashWithSalt Int
_salt ListAnalyses' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListAnalyses' :: ListAnalyses -> Text
$sel:nextToken:ListAnalyses' :: ListAnalyses -> Maybe Text
$sel:maxResults:ListAnalyses' :: ListAnalyses -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
instance Prelude.NFData ListAnalyses where
rnf :: ListAnalyses -> ()
rnf ListAnalyses' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListAnalyses' :: ListAnalyses -> Text
$sel:nextToken:ListAnalyses' :: ListAnalyses -> Maybe Text
$sel:maxResults:ListAnalyses' :: ListAnalyses -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
instance Data.ToHeaders ListAnalyses where
toHeaders :: ListAnalyses -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListAnalyses where
toPath :: ListAnalyses -> ByteString
toPath ListAnalyses' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListAnalyses' :: ListAnalyses -> Text
$sel:nextToken:ListAnalyses' :: ListAnalyses -> Maybe Text
$sel:maxResults:ListAnalyses' :: ListAnalyses -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/accounts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId, ByteString
"/analyses"]
instance Data.ToQuery ListAnalyses where
toQuery :: ListAnalyses -> QueryString
toQuery ListAnalyses' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListAnalyses' :: ListAnalyses -> Text
$sel:nextToken:ListAnalyses' :: ListAnalyses -> Maybe Text
$sel:maxResults:ListAnalyses' :: ListAnalyses -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"max-results" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"next-token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListAnalysesResponse = ListAnalysesResponse'
{
ListAnalysesResponse -> Maybe [AnalysisSummary]
analysisSummaryList :: Prelude.Maybe [AnalysisSummary],
ListAnalysesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAnalysesResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
ListAnalysesResponse -> Int
status :: Prelude.Int
}
deriving (ListAnalysesResponse -> ListAnalysesResponse -> Bool
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]
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
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. 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)
newListAnalysesResponse ::
Prelude.Int ->
ListAnalysesResponse
newListAnalysesResponse :: Int -> ListAnalysesResponse
newListAnalysesResponse Int
pStatus_ =
ListAnalysesResponse'
{ $sel:analysisSummaryList:ListAnalysesResponse' :: Maybe [AnalysisSummary]
analysisSummaryList =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAnalysesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:requestId:ListAnalysesResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
$sel:status:ListAnalysesResponse' :: Int
status = Int
pStatus_
}
listAnalysesResponse_analysisSummaryList :: Lens.Lens' ListAnalysesResponse (Prelude.Maybe [AnalysisSummary])
listAnalysesResponse_analysisSummaryList :: Lens' ListAnalysesResponse (Maybe [AnalysisSummary])
listAnalysesResponse_analysisSummaryList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAnalysesResponse_nextToken :: Lens.Lens' ListAnalysesResponse (Prelude.Maybe Prelude.Text)
listAnalysesResponse_nextToken :: Lens' ListAnalysesResponse (Maybe Text)
listAnalysesResponse_nextToken = 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)
listAnalysesResponse_requestId :: Lens.Lens' ListAnalysesResponse (Prelude.Maybe Prelude.Text)
listAnalysesResponse_requestId :: Lens' ListAnalysesResponse (Maybe Text)
listAnalysesResponse_requestId = 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)
listAnalysesResponse_status :: Lens.Lens' ListAnalysesResponse Prelude.Int
listAnalysesResponse_status :: Lens' ListAnalysesResponse Int
listAnalysesResponse_status = 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 where
rnf :: ListAnalysesResponse -> ()
rnf ListAnalysesResponse' {Int
Maybe [AnalysisSummary]
Maybe Text
status :: Int
requestId :: Maybe Text
nextToken :: Maybe Text
analysisSummaryList :: Maybe [AnalysisSummary]
$sel:status:ListAnalysesResponse' :: ListAnalysesResponse -> Int
$sel:requestId:ListAnalysesResponse' :: ListAnalysesResponse -> Maybe Text
$sel:nextToken:ListAnalysesResponse' :: ListAnalysesResponse -> Maybe Text
$sel:analysisSummaryList:ListAnalysesResponse' :: ListAnalysesResponse -> Maybe [AnalysisSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AnalysisSummary]
analysisSummaryList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status