{-# 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.ListIngestions
(
ListIngestions (..),
newListIngestions,
listIngestions_maxResults,
listIngestions_nextToken,
listIngestions_dataSetId,
listIngestions_awsAccountId,
ListIngestionsResponse (..),
newListIngestionsResponse,
listIngestionsResponse_ingestions,
listIngestionsResponse_nextToken,
listIngestionsResponse_requestId,
listIngestionsResponse_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 ListIngestions = ListIngestions'
{
ListIngestions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListIngestions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIngestions -> Text
dataSetId :: Prelude.Text,
ListIngestions -> Text
awsAccountId :: Prelude.Text
}
deriving (ListIngestions -> ListIngestions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIngestions -> ListIngestions -> Bool
$c/= :: ListIngestions -> ListIngestions -> Bool
== :: ListIngestions -> ListIngestions -> Bool
$c== :: ListIngestions -> ListIngestions -> Bool
Prelude.Eq, ReadPrec [ListIngestions]
ReadPrec ListIngestions
Int -> ReadS ListIngestions
ReadS [ListIngestions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIngestions]
$creadListPrec :: ReadPrec [ListIngestions]
readPrec :: ReadPrec ListIngestions
$creadPrec :: ReadPrec ListIngestions
readList :: ReadS [ListIngestions]
$creadList :: ReadS [ListIngestions]
readsPrec :: Int -> ReadS ListIngestions
$creadsPrec :: Int -> ReadS ListIngestions
Prelude.Read, Int -> ListIngestions -> ShowS
[ListIngestions] -> ShowS
ListIngestions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIngestions] -> ShowS
$cshowList :: [ListIngestions] -> ShowS
show :: ListIngestions -> String
$cshow :: ListIngestions -> String
showsPrec :: Int -> ListIngestions -> ShowS
$cshowsPrec :: Int -> ListIngestions -> ShowS
Prelude.Show, forall x. Rep ListIngestions x -> ListIngestions
forall x. ListIngestions -> Rep ListIngestions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIngestions x -> ListIngestions
$cfrom :: forall x. ListIngestions -> Rep ListIngestions x
Prelude.Generic)
newListIngestions ::
Prelude.Text ->
Prelude.Text ->
ListIngestions
newListIngestions :: Text -> Text -> ListIngestions
newListIngestions Text
pDataSetId_ Text
pAwsAccountId_ =
ListIngestions'
{ $sel:maxResults:ListIngestions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIngestions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:dataSetId:ListIngestions' :: Text
dataSetId = Text
pDataSetId_,
$sel:awsAccountId:ListIngestions' :: Text
awsAccountId = Text
pAwsAccountId_
}
listIngestions_maxResults :: Lens.Lens' ListIngestions (Prelude.Maybe Prelude.Natural)
listIngestions_maxResults :: Lens' ListIngestions (Maybe Natural)
listIngestions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListIngestions' :: ListIngestions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListIngestions
s@ListIngestions' {} Maybe Natural
a -> ListIngestions
s {$sel:maxResults:ListIngestions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListIngestions)
listIngestions_nextToken :: Lens.Lens' ListIngestions (Prelude.Maybe Prelude.Text)
listIngestions_nextToken :: Lens' ListIngestions (Maybe Text)
listIngestions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIngestions' :: ListIngestions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIngestions
s@ListIngestions' {} Maybe Text
a -> ListIngestions
s {$sel:nextToken:ListIngestions' :: Maybe Text
nextToken = Maybe Text
a} :: ListIngestions)
listIngestions_dataSetId :: Lens.Lens' ListIngestions Prelude.Text
listIngestions_dataSetId :: Lens' ListIngestions Text
listIngestions_dataSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestions' {Text
dataSetId :: Text
$sel:dataSetId:ListIngestions' :: ListIngestions -> Text
dataSetId} -> Text
dataSetId) (\s :: ListIngestions
s@ListIngestions' {} Text
a -> ListIngestions
s {$sel:dataSetId:ListIngestions' :: Text
dataSetId = Text
a} :: ListIngestions)
listIngestions_awsAccountId :: Lens.Lens' ListIngestions Prelude.Text
listIngestions_awsAccountId :: Lens' ListIngestions Text
listIngestions_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestions' {Text
awsAccountId :: Text
$sel:awsAccountId:ListIngestions' :: ListIngestions -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListIngestions
s@ListIngestions' {} Text
a -> ListIngestions
s {$sel:awsAccountId:ListIngestions' :: Text
awsAccountId = Text
a} :: ListIngestions)
instance Core.AWSPager ListIngestions where
page :: ListIngestions
-> AWSResponse ListIngestions -> Maybe ListIngestions
page ListIngestions
rq AWSResponse ListIngestions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListIngestions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListIngestionsResponse (Maybe Text)
listIngestionsResponse_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 ListIngestions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListIngestionsResponse (Maybe [Ingestion])
listIngestionsResponse_ingestions
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.$ ListIngestions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListIngestions (Maybe Text)
listIngestions_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListIngestions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListIngestionsResponse (Maybe Text)
listIngestionsResponse_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 ListIngestions where
type
AWSResponse ListIngestions =
ListIngestionsResponse
request :: (Service -> Service) -> ListIngestions -> Request ListIngestions
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 ListIngestions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListIngestions)))
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 [Ingestion]
-> Maybe Text -> Maybe Text -> Int -> ListIngestionsResponse
ListIngestionsResponse'
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
"Ingestions" 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 ListIngestions where
hashWithSalt :: Int -> ListIngestions -> Int
hashWithSalt Int
_salt ListIngestions' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
dataSetId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListIngestions' :: ListIngestions -> Text
$sel:dataSetId:ListIngestions' :: ListIngestions -> Text
$sel:nextToken:ListIngestions' :: ListIngestions -> Maybe Text
$sel:maxResults:ListIngestions' :: ListIngestions -> 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
dataSetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
instance Prelude.NFData ListIngestions where
rnf :: ListIngestions -> ()
rnf ListIngestions' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
dataSetId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListIngestions' :: ListIngestions -> Text
$sel:dataSetId:ListIngestions' :: ListIngestions -> Text
$sel:nextToken:ListIngestions' :: ListIngestions -> Maybe Text
$sel:maxResults:ListIngestions' :: ListIngestions -> 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
dataSetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
instance Data.ToHeaders ListIngestions where
toHeaders :: ListIngestions -> 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 ListIngestions where
toPath :: ListIngestions -> ByteString
toPath ListIngestions' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
dataSetId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListIngestions' :: ListIngestions -> Text
$sel:dataSetId:ListIngestions' :: ListIngestions -> Text
$sel:nextToken:ListIngestions' :: ListIngestions -> Maybe Text
$sel:maxResults:ListIngestions' :: ListIngestions -> 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/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
dataSetId,
ByteString
"/ingestions"
]
instance Data.ToQuery ListIngestions where
toQuery :: ListIngestions -> QueryString
toQuery ListIngestions' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
dataSetId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:awsAccountId:ListIngestions' :: ListIngestions -> Text
$sel:dataSetId:ListIngestions' :: ListIngestions -> Text
$sel:nextToken:ListIngestions' :: ListIngestions -> Maybe Text
$sel:maxResults:ListIngestions' :: ListIngestions -> 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 ListIngestionsResponse = ListIngestionsResponse'
{
ListIngestionsResponse -> Maybe [Ingestion]
ingestions :: Prelude.Maybe [Ingestion],
ListIngestionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIngestionsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
ListIngestionsResponse -> Int
status :: Prelude.Int
}
deriving (ListIngestionsResponse -> ListIngestionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIngestionsResponse -> ListIngestionsResponse -> Bool
$c/= :: ListIngestionsResponse -> ListIngestionsResponse -> Bool
== :: ListIngestionsResponse -> ListIngestionsResponse -> Bool
$c== :: ListIngestionsResponse -> ListIngestionsResponse -> Bool
Prelude.Eq, ReadPrec [ListIngestionsResponse]
ReadPrec ListIngestionsResponse
Int -> ReadS ListIngestionsResponse
ReadS [ListIngestionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIngestionsResponse]
$creadListPrec :: ReadPrec [ListIngestionsResponse]
readPrec :: ReadPrec ListIngestionsResponse
$creadPrec :: ReadPrec ListIngestionsResponse
readList :: ReadS [ListIngestionsResponse]
$creadList :: ReadS [ListIngestionsResponse]
readsPrec :: Int -> ReadS ListIngestionsResponse
$creadsPrec :: Int -> ReadS ListIngestionsResponse
Prelude.Read, Int -> ListIngestionsResponse -> ShowS
[ListIngestionsResponse] -> ShowS
ListIngestionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIngestionsResponse] -> ShowS
$cshowList :: [ListIngestionsResponse] -> ShowS
show :: ListIngestionsResponse -> String
$cshow :: ListIngestionsResponse -> String
showsPrec :: Int -> ListIngestionsResponse -> ShowS
$cshowsPrec :: Int -> ListIngestionsResponse -> ShowS
Prelude.Show, forall x. Rep ListIngestionsResponse x -> ListIngestionsResponse
forall x. ListIngestionsResponse -> Rep ListIngestionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIngestionsResponse x -> ListIngestionsResponse
$cfrom :: forall x. ListIngestionsResponse -> Rep ListIngestionsResponse x
Prelude.Generic)
newListIngestionsResponse ::
Prelude.Int ->
ListIngestionsResponse
newListIngestionsResponse :: Int -> ListIngestionsResponse
newListIngestionsResponse Int
pStatus_ =
ListIngestionsResponse'
{ $sel:ingestions:ListIngestionsResponse' :: Maybe [Ingestion]
ingestions =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIngestionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:requestId:ListIngestionsResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
$sel:status:ListIngestionsResponse' :: Int
status = Int
pStatus_
}
listIngestionsResponse_ingestions :: Lens.Lens' ListIngestionsResponse (Prelude.Maybe [Ingestion])
listIngestionsResponse_ingestions :: Lens' ListIngestionsResponse (Maybe [Ingestion])
listIngestionsResponse_ingestions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestionsResponse' {Maybe [Ingestion]
ingestions :: Maybe [Ingestion]
$sel:ingestions:ListIngestionsResponse' :: ListIngestionsResponse -> Maybe [Ingestion]
ingestions} -> Maybe [Ingestion]
ingestions) (\s :: ListIngestionsResponse
s@ListIngestionsResponse' {} Maybe [Ingestion]
a -> ListIngestionsResponse
s {$sel:ingestions:ListIngestionsResponse' :: Maybe [Ingestion]
ingestions = Maybe [Ingestion]
a} :: ListIngestionsResponse) 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
listIngestionsResponse_nextToken :: Lens.Lens' ListIngestionsResponse (Prelude.Maybe Prelude.Text)
listIngestionsResponse_nextToken :: Lens' ListIngestionsResponse (Maybe Text)
listIngestionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIngestionsResponse' :: ListIngestionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIngestionsResponse
s@ListIngestionsResponse' {} Maybe Text
a -> ListIngestionsResponse
s {$sel:nextToken:ListIngestionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIngestionsResponse)
listIngestionsResponse_requestId :: Lens.Lens' ListIngestionsResponse (Prelude.Maybe Prelude.Text)
listIngestionsResponse_requestId :: Lens' ListIngestionsResponse (Maybe Text)
listIngestionsResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestionsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListIngestionsResponse' :: ListIngestionsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListIngestionsResponse
s@ListIngestionsResponse' {} Maybe Text
a -> ListIngestionsResponse
s {$sel:requestId:ListIngestionsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListIngestionsResponse)
listIngestionsResponse_status :: Lens.Lens' ListIngestionsResponse Prelude.Int
listIngestionsResponse_status :: Lens' ListIngestionsResponse Int
listIngestionsResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIngestionsResponse' {Int
status :: Int
$sel:status:ListIngestionsResponse' :: ListIngestionsResponse -> Int
status} -> Int
status) (\s :: ListIngestionsResponse
s@ListIngestionsResponse' {} Int
a -> ListIngestionsResponse
s {$sel:status:ListIngestionsResponse' :: Int
status = Int
a} :: ListIngestionsResponse)
instance Prelude.NFData ListIngestionsResponse where
rnf :: ListIngestionsResponse -> ()
rnf ListIngestionsResponse' {Int
Maybe [Ingestion]
Maybe Text
status :: Int
requestId :: Maybe Text
nextToken :: Maybe Text
ingestions :: Maybe [Ingestion]
$sel:status:ListIngestionsResponse' :: ListIngestionsResponse -> Int
$sel:requestId:ListIngestionsResponse' :: ListIngestionsResponse -> Maybe Text
$sel:nextToken:ListIngestionsResponse' :: ListIngestionsResponse -> Maybe Text
$sel:ingestions:ListIngestionsResponse' :: ListIngestionsResponse -> Maybe [Ingestion]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Ingestion]
ingestions
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