{-# 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.ListFolders
(
ListFolders (..),
newListFolders,
listFolders_nextToken,
listFolders_maxResults,
listFolders_awsAccountId,
ListFoldersResponse (..),
newListFoldersResponse,
listFoldersResponse_requestId,
listFoldersResponse_nextToken,
listFoldersResponse_folderSummaryList,
listFoldersResponse_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
data ListFolders = ListFolders'
{
ListFolders -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListFolders -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListFolders -> Text
awsAccountId :: Prelude.Text
}
deriving (ListFolders -> ListFolders -> Bool
(ListFolders -> ListFolders -> Bool)
-> (ListFolders -> ListFolders -> Bool) -> Eq ListFolders
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFolders -> ListFolders -> Bool
$c/= :: ListFolders -> ListFolders -> Bool
== :: ListFolders -> ListFolders -> Bool
$c== :: ListFolders -> ListFolders -> Bool
Prelude.Eq, ReadPrec [ListFolders]
ReadPrec ListFolders
Int -> ReadS ListFolders
ReadS [ListFolders]
(Int -> ReadS ListFolders)
-> ReadS [ListFolders]
-> ReadPrec ListFolders
-> ReadPrec [ListFolders]
-> Read ListFolders
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFolders]
$creadListPrec :: ReadPrec [ListFolders]
readPrec :: ReadPrec ListFolders
$creadPrec :: ReadPrec ListFolders
readList :: ReadS [ListFolders]
$creadList :: ReadS [ListFolders]
readsPrec :: Int -> ReadS ListFolders
$creadsPrec :: Int -> ReadS ListFolders
Prelude.Read, Int -> ListFolders -> ShowS
[ListFolders] -> ShowS
ListFolders -> String
(Int -> ListFolders -> ShowS)
-> (ListFolders -> String)
-> ([ListFolders] -> ShowS)
-> Show ListFolders
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFolders] -> ShowS
$cshowList :: [ListFolders] -> ShowS
show :: ListFolders -> String
$cshow :: ListFolders -> String
showsPrec :: Int -> ListFolders -> ShowS
$cshowsPrec :: Int -> ListFolders -> ShowS
Prelude.Show, (forall x. ListFolders -> Rep ListFolders x)
-> (forall x. Rep ListFolders x -> ListFolders)
-> Generic ListFolders
forall x. Rep ListFolders x -> ListFolders
forall x. ListFolders -> Rep ListFolders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFolders x -> ListFolders
$cfrom :: forall x. ListFolders -> Rep ListFolders x
Prelude.Generic)
newListFolders ::
Prelude.Text ->
ListFolders
newListFolders :: Text -> ListFolders
newListFolders Text
pAwsAccountId_ =
ListFolders' :: Maybe Text -> Maybe Natural -> Text -> ListFolders
ListFolders'
{ $sel:nextToken:ListFolders' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListFolders' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:ListFolders' :: Text
awsAccountId = Text
pAwsAccountId_
}
listFolders_nextToken :: Lens.Lens' ListFolders (Prelude.Maybe Prelude.Text)
listFolders_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListFolders -> f ListFolders
listFolders_nextToken = (ListFolders -> Maybe Text)
-> (ListFolders -> Maybe Text -> ListFolders)
-> Lens ListFolders ListFolders (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFolders' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFolders' :: ListFolders -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFolders
s@ListFolders' {} Maybe Text
a -> ListFolders
s {$sel:nextToken:ListFolders' :: Maybe Text
nextToken = Maybe Text
a} :: ListFolders)
listFolders_maxResults :: Lens.Lens' ListFolders (Prelude.Maybe Prelude.Natural)
listFolders_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListFolders -> f ListFolders
listFolders_maxResults = (ListFolders -> Maybe Natural)
-> (ListFolders -> Maybe Natural -> ListFolders)
-> Lens ListFolders ListFolders (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFolders' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFolders' :: ListFolders -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFolders
s@ListFolders' {} Maybe Natural
a -> ListFolders
s {$sel:maxResults:ListFolders' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFolders)
listFolders_awsAccountId :: Lens.Lens' ListFolders Prelude.Text
listFolders_awsAccountId :: (Text -> f Text) -> ListFolders -> f ListFolders
listFolders_awsAccountId = (ListFolders -> Text)
-> (ListFolders -> Text -> ListFolders)
-> Lens ListFolders ListFolders Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFolders' {Text
awsAccountId :: Text
$sel:awsAccountId:ListFolders' :: ListFolders -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListFolders
s@ListFolders' {} Text
a -> ListFolders
s {$sel:awsAccountId:ListFolders' :: Text
awsAccountId = Text
a} :: ListFolders)
instance Core.AWSRequest ListFolders where
type AWSResponse ListFolders = ListFoldersResponse
request :: ListFolders -> Request ListFolders
request = Service -> ListFolders -> Request ListFolders
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListFolders
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListFolders)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListFolders))
-> Logger
-> Service
-> Proxy ListFolders
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListFolders)))
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 [FolderSummary]
-> Int
-> ListFoldersResponse
ListFoldersResponse'
(Maybe Text
-> Maybe Text
-> Maybe [FolderSummary]
-> Int
-> ListFoldersResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe [FolderSummary] -> Int -> ListFoldersResponse)
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 [FolderSummary] -> Int -> ListFoldersResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [FolderSummary] -> Int -> ListFoldersResponse)
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 [FolderSummary] -> Int -> ListFoldersResponse)
-> Either String (Maybe [FolderSummary])
-> Either String (Int -> ListFoldersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [FolderSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FolderSummaryList"
Either String (Maybe (Maybe [FolderSummary]))
-> Maybe [FolderSummary] -> Either String (Maybe [FolderSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FolderSummary]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListFoldersResponse)
-> Either String Int -> Either String ListFoldersResponse
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 ListFolders
instance Prelude.NFData ListFolders
instance Core.ToHeaders ListFolders where
toHeaders :: ListFolders -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListFolders -> 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 ListFolders where
toPath :: ListFolders -> ByteString
toPath ListFolders' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListFolders' :: ListFolders -> Text
$sel:maxResults:ListFolders' :: ListFolders -> Maybe Natural
$sel:nextToken:ListFolders' :: ListFolders -> 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
"/folders"]
instance Core.ToQuery ListFolders where
toQuery :: ListFolders -> QueryString
toQuery ListFolders' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListFolders' :: ListFolders -> Text
$sel:maxResults:ListFolders' :: ListFolders -> Maybe Natural
$sel:nextToken:ListFolders' :: ListFolders -> 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
]
data ListFoldersResponse = ListFoldersResponse'
{
ListFoldersResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
ListFoldersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListFoldersResponse -> Maybe [FolderSummary]
folderSummaryList :: Prelude.Maybe [FolderSummary],
ListFoldersResponse -> Int
status :: Prelude.Int
}
deriving (ListFoldersResponse -> ListFoldersResponse -> Bool
(ListFoldersResponse -> ListFoldersResponse -> Bool)
-> (ListFoldersResponse -> ListFoldersResponse -> Bool)
-> Eq ListFoldersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFoldersResponse -> ListFoldersResponse -> Bool
$c/= :: ListFoldersResponse -> ListFoldersResponse -> Bool
== :: ListFoldersResponse -> ListFoldersResponse -> Bool
$c== :: ListFoldersResponse -> ListFoldersResponse -> Bool
Prelude.Eq, ReadPrec [ListFoldersResponse]
ReadPrec ListFoldersResponse
Int -> ReadS ListFoldersResponse
ReadS [ListFoldersResponse]
(Int -> ReadS ListFoldersResponse)
-> ReadS [ListFoldersResponse]
-> ReadPrec ListFoldersResponse
-> ReadPrec [ListFoldersResponse]
-> Read ListFoldersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFoldersResponse]
$creadListPrec :: ReadPrec [ListFoldersResponse]
readPrec :: ReadPrec ListFoldersResponse
$creadPrec :: ReadPrec ListFoldersResponse
readList :: ReadS [ListFoldersResponse]
$creadList :: ReadS [ListFoldersResponse]
readsPrec :: Int -> ReadS ListFoldersResponse
$creadsPrec :: Int -> ReadS ListFoldersResponse
Prelude.Read, Int -> ListFoldersResponse -> ShowS
[ListFoldersResponse] -> ShowS
ListFoldersResponse -> String
(Int -> ListFoldersResponse -> ShowS)
-> (ListFoldersResponse -> String)
-> ([ListFoldersResponse] -> ShowS)
-> Show ListFoldersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFoldersResponse] -> ShowS
$cshowList :: [ListFoldersResponse] -> ShowS
show :: ListFoldersResponse -> String
$cshow :: ListFoldersResponse -> String
showsPrec :: Int -> ListFoldersResponse -> ShowS
$cshowsPrec :: Int -> ListFoldersResponse -> ShowS
Prelude.Show, (forall x. ListFoldersResponse -> Rep ListFoldersResponse x)
-> (forall x. Rep ListFoldersResponse x -> ListFoldersResponse)
-> Generic ListFoldersResponse
forall x. Rep ListFoldersResponse x -> ListFoldersResponse
forall x. ListFoldersResponse -> Rep ListFoldersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFoldersResponse x -> ListFoldersResponse
$cfrom :: forall x. ListFoldersResponse -> Rep ListFoldersResponse x
Prelude.Generic)
newListFoldersResponse ::
Prelude.Int ->
ListFoldersResponse
newListFoldersResponse :: Int -> ListFoldersResponse
newListFoldersResponse Int
pStatus_ =
ListFoldersResponse' :: Maybe Text
-> Maybe Text
-> Maybe [FolderSummary]
-> Int
-> ListFoldersResponse
ListFoldersResponse'
{ $sel:requestId:ListFoldersResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFoldersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:folderSummaryList:ListFoldersResponse' :: Maybe [FolderSummary]
folderSummaryList = Maybe [FolderSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:status:ListFoldersResponse' :: Int
status = Int
pStatus_
}
listFoldersResponse_requestId :: Lens.Lens' ListFoldersResponse (Prelude.Maybe Prelude.Text)
listFoldersResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListFoldersResponse -> f ListFoldersResponse
listFoldersResponse_requestId = (ListFoldersResponse -> Maybe Text)
-> (ListFoldersResponse -> Maybe Text -> ListFoldersResponse)
-> Lens
ListFoldersResponse ListFoldersResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFoldersResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListFoldersResponse' :: ListFoldersResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListFoldersResponse
s@ListFoldersResponse' {} Maybe Text
a -> ListFoldersResponse
s {$sel:requestId:ListFoldersResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListFoldersResponse)
listFoldersResponse_nextToken :: Lens.Lens' ListFoldersResponse (Prelude.Maybe Prelude.Text)
listFoldersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFoldersResponse -> f ListFoldersResponse
listFoldersResponse_nextToken = (ListFoldersResponse -> Maybe Text)
-> (ListFoldersResponse -> Maybe Text -> ListFoldersResponse)
-> Lens
ListFoldersResponse ListFoldersResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFoldersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFoldersResponse' :: ListFoldersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFoldersResponse
s@ListFoldersResponse' {} Maybe Text
a -> ListFoldersResponse
s {$sel:nextToken:ListFoldersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFoldersResponse)
listFoldersResponse_folderSummaryList :: Lens.Lens' ListFoldersResponse (Prelude.Maybe [FolderSummary])
listFoldersResponse_folderSummaryList :: (Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> ListFoldersResponse -> f ListFoldersResponse
listFoldersResponse_folderSummaryList = (ListFoldersResponse -> Maybe [FolderSummary])
-> (ListFoldersResponse
-> Maybe [FolderSummary] -> ListFoldersResponse)
-> Lens
ListFoldersResponse
ListFoldersResponse
(Maybe [FolderSummary])
(Maybe [FolderSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFoldersResponse' {Maybe [FolderSummary]
folderSummaryList :: Maybe [FolderSummary]
$sel:folderSummaryList:ListFoldersResponse' :: ListFoldersResponse -> Maybe [FolderSummary]
folderSummaryList} -> Maybe [FolderSummary]
folderSummaryList) (\s :: ListFoldersResponse
s@ListFoldersResponse' {} Maybe [FolderSummary]
a -> ListFoldersResponse
s {$sel:folderSummaryList:ListFoldersResponse' :: Maybe [FolderSummary]
folderSummaryList = Maybe [FolderSummary]
a} :: ListFoldersResponse) ((Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> ListFoldersResponse -> f ListFoldersResponse)
-> ((Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> (Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> ListFoldersResponse
-> f ListFoldersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[FolderSummary] [FolderSummary] [FolderSummary] [FolderSummary]
-> Iso
(Maybe [FolderSummary])
(Maybe [FolderSummary])
(Maybe [FolderSummary])
(Maybe [FolderSummary])
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
[FolderSummary] [FolderSummary] [FolderSummary] [FolderSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listFoldersResponse_status :: Lens.Lens' ListFoldersResponse Prelude.Int
listFoldersResponse_status :: (Int -> f Int) -> ListFoldersResponse -> f ListFoldersResponse
listFoldersResponse_status = (ListFoldersResponse -> Int)
-> (ListFoldersResponse -> Int -> ListFoldersResponse)
-> Lens ListFoldersResponse ListFoldersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFoldersResponse' {Int
status :: Int
$sel:status:ListFoldersResponse' :: ListFoldersResponse -> Int
status} -> Int
status) (\s :: ListFoldersResponse
s@ListFoldersResponse' {} Int
a -> ListFoldersResponse
s {$sel:status:ListFoldersResponse' :: Int
status = Int
a} :: ListFoldersResponse)
instance Prelude.NFData ListFoldersResponse