{-# 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.ListDataSets
(
ListDataSets (..),
newListDataSets,
listDataSets_maxResults,
listDataSets_nextToken,
listDataSets_awsAccountId,
ListDataSetsResponse (..),
newListDataSetsResponse,
listDataSetsResponse_dataSetSummaries,
listDataSetsResponse_nextToken,
listDataSetsResponse_requestId,
listDataSetsResponse_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 ListDataSets = ListDataSets'
{
ListDataSets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListDataSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDataSets -> Text
awsAccountId :: Prelude.Text
}
deriving (ListDataSets -> ListDataSets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataSets -> ListDataSets -> Bool
$c/= :: ListDataSets -> ListDataSets -> Bool
== :: ListDataSets -> ListDataSets -> Bool
$c== :: ListDataSets -> ListDataSets -> Bool
Prelude.Eq, ReadPrec [ListDataSets]
ReadPrec ListDataSets
Int -> ReadS ListDataSets
ReadS [ListDataSets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataSets]
$creadListPrec :: ReadPrec [ListDataSets]
readPrec :: ReadPrec ListDataSets
$creadPrec :: ReadPrec ListDataSets
readList :: ReadS [ListDataSets]
$creadList :: ReadS [ListDataSets]
readsPrec :: Int -> ReadS ListDataSets
$creadsPrec :: Int -> ReadS ListDataSets
Prelude.Read, Int -> ListDataSets -> ShowS
[ListDataSets] -> ShowS
ListDataSets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataSets] -> ShowS
$cshowList :: [ListDataSets] -> ShowS
show :: ListDataSets -> String
$cshow :: ListDataSets -> String
showsPrec :: Int -> ListDataSets -> ShowS
$cshowsPrec :: Int -> ListDataSets -> ShowS
Prelude.Show, forall x. Rep ListDataSets x -> ListDataSets
forall x. ListDataSets -> Rep ListDataSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDataSets x -> ListDataSets
$cfrom :: forall x. ListDataSets -> Rep ListDataSets x
Prelude.Generic)
newListDataSets ::
Prelude.Text ->
ListDataSets
newListDataSets :: Text -> ListDataSets
newListDataSets Text
pAwsAccountId_ =
ListDataSets'
{ $sel:maxResults:ListDataSets' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDataSets' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:ListDataSets' :: Text
awsAccountId = Text
pAwsAccountId_
}
listDataSets_maxResults :: Lens.Lens' ListDataSets (Prelude.Maybe Prelude.Natural)
listDataSets_maxResults :: Lens' ListDataSets (Maybe Natural)
listDataSets_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDataSets' :: ListDataSets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDataSets
s@ListDataSets' {} Maybe Natural
a -> ListDataSets
s {$sel:maxResults:ListDataSets' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDataSets)
listDataSets_nextToken :: Lens.Lens' ListDataSets (Prelude.Maybe Prelude.Text)
listDataSets_nextToken :: Lens' ListDataSets (Maybe Text)
listDataSets_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataSets
s@ListDataSets' {} Maybe Text
a -> ListDataSets
s {$sel:nextToken:ListDataSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataSets)
listDataSets_awsAccountId :: Lens.Lens' ListDataSets Prelude.Text
listDataSets_awsAccountId :: Lens' ListDataSets Text
listDataSets_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSets' {Text
awsAccountId :: Text
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListDataSets
s@ListDataSets' {} Text
a -> ListDataSets
s {$sel:awsAccountId:ListDataSets' :: Text
awsAccountId = Text
a} :: ListDataSets)
instance Core.AWSPager ListDataSets where
page :: ListDataSets -> AWSResponse ListDataSets -> Maybe ListDataSets
page ListDataSets
rq AWSResponse ListDataSets
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDataSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDataSetsResponse (Maybe Text)
listDataSetsResponse_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 ListDataSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDataSetsResponse (Maybe [DataSetSummary])
listDataSetsResponse_dataSetSummaries
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.$ ListDataSets
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDataSets (Maybe Text)
listDataSets_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDataSets
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDataSetsResponse (Maybe Text)
listDataSetsResponse_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 ListDataSets where
type AWSResponse ListDataSets = ListDataSetsResponse
request :: (Service -> Service) -> ListDataSets -> Request ListDataSets
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 ListDataSets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDataSets)))
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 [DataSetSummary]
-> Maybe Text -> Maybe Text -> Int -> ListDataSetsResponse
ListDataSetsResponse'
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
"DataSetSummaries"
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 ListDataSets where
hashWithSalt :: Int -> ListDataSets -> Int
hashWithSalt Int
_salt ListDataSets' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
$sel:maxResults:ListDataSets' :: ListDataSets -> 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 ListDataSets where
rnf :: ListDataSets -> ()
rnf ListDataSets' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
$sel:maxResults:ListDataSets' :: ListDataSets -> 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 ListDataSets where
toHeaders :: ListDataSets -> 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 ListDataSets where
toPath :: ListDataSets -> ByteString
toPath ListDataSets' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
$sel:maxResults:ListDataSets' :: ListDataSets -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/accounts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId, ByteString
"/data-sets"]
instance Data.ToQuery ListDataSets where
toQuery :: ListDataSets -> QueryString
toQuery ListDataSets' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
$sel:maxResults:ListDataSets' :: ListDataSets -> 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 ListDataSetsResponse = ListDataSetsResponse'
{
ListDataSetsResponse -> Maybe [DataSetSummary]
dataSetSummaries :: Prelude.Maybe [DataSetSummary],
ListDataSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDataSetsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
ListDataSetsResponse -> Int
status :: Prelude.Int
}
deriving (ListDataSetsResponse -> ListDataSetsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
$c/= :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
== :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
$c== :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListDataSetsResponse]
ReadPrec ListDataSetsResponse
Int -> ReadS ListDataSetsResponse
ReadS [ListDataSetsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataSetsResponse]
$creadListPrec :: ReadPrec [ListDataSetsResponse]
readPrec :: ReadPrec ListDataSetsResponse
$creadPrec :: ReadPrec ListDataSetsResponse
readList :: ReadS [ListDataSetsResponse]
$creadList :: ReadS [ListDataSetsResponse]
readsPrec :: Int -> ReadS ListDataSetsResponse
$creadsPrec :: Int -> ReadS ListDataSetsResponse
Prelude.Read, Int -> ListDataSetsResponse -> ShowS
[ListDataSetsResponse] -> ShowS
ListDataSetsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataSetsResponse] -> ShowS
$cshowList :: [ListDataSetsResponse] -> ShowS
show :: ListDataSetsResponse -> String
$cshow :: ListDataSetsResponse -> String
showsPrec :: Int -> ListDataSetsResponse -> ShowS
$cshowsPrec :: Int -> ListDataSetsResponse -> ShowS
Prelude.Show, forall x. Rep ListDataSetsResponse x -> ListDataSetsResponse
forall x. ListDataSetsResponse -> Rep ListDataSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDataSetsResponse x -> ListDataSetsResponse
$cfrom :: forall x. ListDataSetsResponse -> Rep ListDataSetsResponse x
Prelude.Generic)
newListDataSetsResponse ::
Prelude.Int ->
ListDataSetsResponse
newListDataSetsResponse :: Int -> ListDataSetsResponse
newListDataSetsResponse Int
pStatus_ =
ListDataSetsResponse'
{ $sel:dataSetSummaries:ListDataSetsResponse' :: Maybe [DataSetSummary]
dataSetSummaries =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDataSetsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:requestId:ListDataSetsResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
$sel:status:ListDataSetsResponse' :: Int
status = Int
pStatus_
}
listDataSetsResponse_dataSetSummaries :: Lens.Lens' ListDataSetsResponse (Prelude.Maybe [DataSetSummary])
listDataSetsResponse_dataSetSummaries :: Lens' ListDataSetsResponse (Maybe [DataSetSummary])
listDataSetsResponse_dataSetSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Maybe [DataSetSummary]
dataSetSummaries :: Maybe [DataSetSummary]
$sel:dataSetSummaries:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe [DataSetSummary]
dataSetSummaries} -> Maybe [DataSetSummary]
dataSetSummaries) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Maybe [DataSetSummary]
a -> ListDataSetsResponse
s {$sel:dataSetSummaries:ListDataSetsResponse' :: Maybe [DataSetSummary]
dataSetSummaries = Maybe [DataSetSummary]
a} :: ListDataSetsResponse) 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
listDataSetsResponse_nextToken :: Lens.Lens' ListDataSetsResponse (Prelude.Maybe Prelude.Text)
listDataSetsResponse_nextToken :: Lens' ListDataSetsResponse (Maybe Text)
listDataSetsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Maybe Text
a -> ListDataSetsResponse
s {$sel:nextToken:ListDataSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataSetsResponse)
listDataSetsResponse_requestId :: Lens.Lens' ListDataSetsResponse (Prelude.Maybe Prelude.Text)
listDataSetsResponse_requestId :: Lens' ListDataSetsResponse (Maybe Text)
listDataSetsResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Maybe Text
a -> ListDataSetsResponse
s {$sel:requestId:ListDataSetsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListDataSetsResponse)
listDataSetsResponse_status :: Lens.Lens' ListDataSetsResponse Prelude.Int
listDataSetsResponse_status :: Lens' ListDataSetsResponse Int
listDataSetsResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Int
status :: Int
$sel:status:ListDataSetsResponse' :: ListDataSetsResponse -> Int
status} -> Int
status) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Int
a -> ListDataSetsResponse
s {$sel:status:ListDataSetsResponse' :: Int
status = Int
a} :: ListDataSetsResponse)
instance Prelude.NFData ListDataSetsResponse where
rnf :: ListDataSetsResponse -> ()
rnf ListDataSetsResponse' {Int
Maybe [DataSetSummary]
Maybe Text
status :: Int
requestId :: Maybe Text
nextToken :: Maybe Text
dataSetSummaries :: Maybe [DataSetSummary]
$sel:status:ListDataSetsResponse' :: ListDataSetsResponse -> Int
$sel:requestId:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe Text
$sel:nextToken:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe Text
$sel:dataSetSummaries:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe [DataSetSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [DataSetSummary]
dataSetSummaries
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