{-# 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.ListDashboards
(
ListDashboards (..),
newListDashboards,
listDashboards_maxResults,
listDashboards_nextToken,
listDashboards_awsAccountId,
ListDashboardsResponse (..),
newListDashboardsResponse,
listDashboardsResponse_dashboardSummaryList,
listDashboardsResponse_nextToken,
listDashboardsResponse_requestId,
listDashboardsResponse_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 ListDashboards = ListDashboards'
{
ListDashboards -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListDashboards -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDashboards -> Text
awsAccountId :: Prelude.Text
}
deriving (ListDashboards -> ListDashboards -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDashboards -> ListDashboards -> Bool
$c/= :: ListDashboards -> ListDashboards -> Bool
== :: ListDashboards -> ListDashboards -> Bool
$c== :: ListDashboards -> ListDashboards -> Bool
Prelude.Eq, ReadPrec [ListDashboards]
ReadPrec ListDashboards
Int -> ReadS ListDashboards
ReadS [ListDashboards]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDashboards]
$creadListPrec :: ReadPrec [ListDashboards]
readPrec :: ReadPrec ListDashboards
$creadPrec :: ReadPrec ListDashboards
readList :: ReadS [ListDashboards]
$creadList :: ReadS [ListDashboards]
readsPrec :: Int -> ReadS ListDashboards
$creadsPrec :: Int -> ReadS ListDashboards
Prelude.Read, Int -> ListDashboards -> ShowS
[ListDashboards] -> ShowS
ListDashboards -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDashboards] -> ShowS
$cshowList :: [ListDashboards] -> ShowS
show :: ListDashboards -> String
$cshow :: ListDashboards -> String
showsPrec :: Int -> ListDashboards -> ShowS
$cshowsPrec :: Int -> ListDashboards -> ShowS
Prelude.Show, forall x. Rep ListDashboards x -> ListDashboards
forall x. ListDashboards -> Rep ListDashboards x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDashboards x -> ListDashboards
$cfrom :: forall x. ListDashboards -> Rep ListDashboards x
Prelude.Generic)
newListDashboards ::
Prelude.Text ->
ListDashboards
newListDashboards :: Text -> ListDashboards
newListDashboards Text
pAwsAccountId_ =
ListDashboards'
{ $sel:maxResults:ListDashboards' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDashboards' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:ListDashboards' :: Text
awsAccountId = Text
pAwsAccountId_
}
listDashboards_maxResults :: Lens.Lens' ListDashboards (Prelude.Maybe Prelude.Natural)
listDashboards_maxResults :: Lens' ListDashboards (Maybe Natural)
listDashboards_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDashboards' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDashboards' :: ListDashboards -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDashboards
s@ListDashboards' {} Maybe Natural
a -> ListDashboards
s {$sel:maxResults:ListDashboards' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDashboards)
listDashboards_nextToken :: Lens.Lens' ListDashboards (Prelude.Maybe Prelude.Text)
listDashboards_nextToken :: Lens' ListDashboards (Maybe Text)
listDashboards_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDashboards' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDashboards' :: ListDashboards -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDashboards
s@ListDashboards' {} Maybe Text
a -> ListDashboards
s {$sel:nextToken:ListDashboards' :: Maybe Text
nextToken = Maybe Text
a} :: ListDashboards)
listDashboards_awsAccountId :: Lens.Lens' ListDashboards Prelude.Text
listDashboards_awsAccountId :: Lens' ListDashboards Text
listDashboards_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDashboards' {Text
awsAccountId :: Text
$sel:awsAccountId:ListDashboards' :: ListDashboards -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListDashboards
s@ListDashboards' {} Text
a -> ListDashboards
s {$sel:awsAccountId:ListDashboards' :: Text
awsAccountId = Text
a} :: ListDashboards)
instance Core.AWSPager ListDashboards where
page :: ListDashboards
-> AWSResponse ListDashboards -> Maybe ListDashboards
page ListDashboards
rq AWSResponse ListDashboards
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDashboards
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDashboardsResponse (Maybe Text)
listDashboardsResponse_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 ListDashboards
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDashboardsResponse (Maybe [DashboardSummary])
listDashboardsResponse_dashboardSummaryList
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.$ ListDashboards
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDashboards (Maybe Text)
listDashboards_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDashboards
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDashboardsResponse (Maybe Text)
listDashboardsResponse_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 ListDashboards where
type
AWSResponse ListDashboards =
ListDashboardsResponse
request :: (Service -> Service) -> ListDashboards -> Request ListDashboards
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 ListDashboards
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDashboards)))
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 [DashboardSummary]
-> Maybe Text -> Maybe Text -> Int -> ListDashboardsResponse
ListDashboardsResponse'
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
"DashboardSummaryList"
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 ListDashboards where
hashWithSalt :: Int -> ListDashboards -> Int
hashWithSalt Int
_salt ListDashboards' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDashboards' :: ListDashboards -> Text
$sel:nextToken:ListDashboards' :: ListDashboards -> Maybe Text
$sel:maxResults:ListDashboards' :: ListDashboards -> 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 ListDashboards where
rnf :: ListDashboards -> ()
rnf ListDashboards' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDashboards' :: ListDashboards -> Text
$sel:nextToken:ListDashboards' :: ListDashboards -> Maybe Text
$sel:maxResults:ListDashboards' :: ListDashboards -> 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 ListDashboards where
toHeaders :: ListDashboards -> 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 ListDashboards where
toPath :: ListDashboards -> ByteString
toPath ListDashboards' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDashboards' :: ListDashboards -> Text
$sel:nextToken:ListDashboards' :: ListDashboards -> Maybe Text
$sel:maxResults:ListDashboards' :: ListDashboards -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/accounts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId, ByteString
"/dashboards"]
instance Data.ToQuery ListDashboards where
toQuery :: ListDashboards -> QueryString
toQuery ListDashboards' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListDashboards' :: ListDashboards -> Text
$sel:nextToken:ListDashboards' :: ListDashboards -> Maybe Text
$sel:maxResults:ListDashboards' :: ListDashboards -> 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 ListDashboardsResponse = ListDashboardsResponse'
{
ListDashboardsResponse -> Maybe [DashboardSummary]
dashboardSummaryList :: Prelude.Maybe [DashboardSummary],
ListDashboardsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDashboardsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
ListDashboardsResponse -> Int
status :: Prelude.Int
}
deriving (ListDashboardsResponse -> ListDashboardsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDashboardsResponse -> ListDashboardsResponse -> Bool
$c/= :: ListDashboardsResponse -> ListDashboardsResponse -> Bool
== :: ListDashboardsResponse -> ListDashboardsResponse -> Bool
$c== :: ListDashboardsResponse -> ListDashboardsResponse -> Bool
Prelude.Eq, ReadPrec [ListDashboardsResponse]
ReadPrec ListDashboardsResponse
Int -> ReadS ListDashboardsResponse
ReadS [ListDashboardsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDashboardsResponse]
$creadListPrec :: ReadPrec [ListDashboardsResponse]
readPrec :: ReadPrec ListDashboardsResponse
$creadPrec :: ReadPrec ListDashboardsResponse
readList :: ReadS [ListDashboardsResponse]
$creadList :: ReadS [ListDashboardsResponse]
readsPrec :: Int -> ReadS ListDashboardsResponse
$creadsPrec :: Int -> ReadS ListDashboardsResponse
Prelude.Read, Int -> ListDashboardsResponse -> ShowS
[ListDashboardsResponse] -> ShowS
ListDashboardsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDashboardsResponse] -> ShowS
$cshowList :: [ListDashboardsResponse] -> ShowS
show :: ListDashboardsResponse -> String
$cshow :: ListDashboardsResponse -> String
showsPrec :: Int -> ListDashboardsResponse -> ShowS
$cshowsPrec :: Int -> ListDashboardsResponse -> ShowS
Prelude.Show, forall x. Rep ListDashboardsResponse x -> ListDashboardsResponse
forall x. ListDashboardsResponse -> Rep ListDashboardsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDashboardsResponse x -> ListDashboardsResponse
$cfrom :: forall x. ListDashboardsResponse -> Rep ListDashboardsResponse x
Prelude.Generic)
newListDashboardsResponse ::
Prelude.Int ->
ListDashboardsResponse
newListDashboardsResponse :: Int -> ListDashboardsResponse
newListDashboardsResponse Int
pStatus_ =
ListDashboardsResponse'
{ $sel:dashboardSummaryList:ListDashboardsResponse' :: Maybe [DashboardSummary]
dashboardSummaryList =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDashboardsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:requestId:ListDashboardsResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
$sel:status:ListDashboardsResponse' :: Int
status = Int
pStatus_
}
listDashboardsResponse_dashboardSummaryList :: Lens.Lens' ListDashboardsResponse (Prelude.Maybe [DashboardSummary])
listDashboardsResponse_dashboardSummaryList :: Lens' ListDashboardsResponse (Maybe [DashboardSummary])
listDashboardsResponse_dashboardSummaryList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDashboardsResponse' {Maybe [DashboardSummary]
dashboardSummaryList :: Maybe [DashboardSummary]
$sel:dashboardSummaryList:ListDashboardsResponse' :: ListDashboardsResponse -> Maybe [DashboardSummary]
dashboardSummaryList} -> Maybe [DashboardSummary]
dashboardSummaryList) (\s :: ListDashboardsResponse
s@ListDashboardsResponse' {} Maybe [DashboardSummary]
a -> ListDashboardsResponse
s {$sel:dashboardSummaryList:ListDashboardsResponse' :: Maybe [DashboardSummary]
dashboardSummaryList = Maybe [DashboardSummary]
a} :: ListDashboardsResponse) 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
listDashboardsResponse_nextToken :: Lens.Lens' ListDashboardsResponse (Prelude.Maybe Prelude.Text)
listDashboardsResponse_nextToken :: Lens' ListDashboardsResponse (Maybe Text)
listDashboardsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDashboardsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDashboardsResponse' :: ListDashboardsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDashboardsResponse
s@ListDashboardsResponse' {} Maybe Text
a -> ListDashboardsResponse
s {$sel:nextToken:ListDashboardsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDashboardsResponse)
listDashboardsResponse_requestId :: Lens.Lens' ListDashboardsResponse (Prelude.Maybe Prelude.Text)
listDashboardsResponse_requestId :: Lens' ListDashboardsResponse (Maybe Text)
listDashboardsResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDashboardsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListDashboardsResponse' :: ListDashboardsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListDashboardsResponse
s@ListDashboardsResponse' {} Maybe Text
a -> ListDashboardsResponse
s {$sel:requestId:ListDashboardsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListDashboardsResponse)
listDashboardsResponse_status :: Lens.Lens' ListDashboardsResponse Prelude.Int
listDashboardsResponse_status :: Lens' ListDashboardsResponse Int
listDashboardsResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDashboardsResponse' {Int
status :: Int
$sel:status:ListDashboardsResponse' :: ListDashboardsResponse -> Int
status} -> Int
status) (\s :: ListDashboardsResponse
s@ListDashboardsResponse' {} Int
a -> ListDashboardsResponse
s {$sel:status:ListDashboardsResponse' :: Int
status = Int
a} :: ListDashboardsResponse)
instance Prelude.NFData ListDashboardsResponse where
rnf :: ListDashboardsResponse -> ()
rnf ListDashboardsResponse' {Int
Maybe [DashboardSummary]
Maybe Text
status :: Int
requestId :: Maybe Text
nextToken :: Maybe Text
dashboardSummaryList :: Maybe [DashboardSummary]
$sel:status:ListDashboardsResponse' :: ListDashboardsResponse -> Int
$sel:requestId:ListDashboardsResponse' :: ListDashboardsResponse -> Maybe Text
$sel:nextToken:ListDashboardsResponse' :: ListDashboardsResponse -> Maybe Text
$sel:dashboardSummaryList:ListDashboardsResponse' :: ListDashboardsResponse -> Maybe [DashboardSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [DashboardSummary]
dashboardSummaryList
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