{-# 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.Athena.ListCalculationExecutions
(
ListCalculationExecutions (..),
newListCalculationExecutions,
listCalculationExecutions_maxResults,
listCalculationExecutions_nextToken,
listCalculationExecutions_stateFilter,
listCalculationExecutions_sessionId,
ListCalculationExecutionsResponse (..),
newListCalculationExecutionsResponse,
listCalculationExecutionsResponse_calculations,
listCalculationExecutionsResponse_nextToken,
listCalculationExecutionsResponse_httpStatus,
)
where
import Amazonka.Athena.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListCalculationExecutions = ListCalculationExecutions'
{
ListCalculationExecutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListCalculationExecutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCalculationExecutions -> Maybe CalculationExecutionState
stateFilter :: Prelude.Maybe CalculationExecutionState,
ListCalculationExecutions -> Text
sessionId :: Prelude.Text
}
deriving (ListCalculationExecutions -> ListCalculationExecutions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCalculationExecutions -> ListCalculationExecutions -> Bool
$c/= :: ListCalculationExecutions -> ListCalculationExecutions -> Bool
== :: ListCalculationExecutions -> ListCalculationExecutions -> Bool
$c== :: ListCalculationExecutions -> ListCalculationExecutions -> Bool
Prelude.Eq, ReadPrec [ListCalculationExecutions]
ReadPrec ListCalculationExecutions
Int -> ReadS ListCalculationExecutions
ReadS [ListCalculationExecutions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCalculationExecutions]
$creadListPrec :: ReadPrec [ListCalculationExecutions]
readPrec :: ReadPrec ListCalculationExecutions
$creadPrec :: ReadPrec ListCalculationExecutions
readList :: ReadS [ListCalculationExecutions]
$creadList :: ReadS [ListCalculationExecutions]
readsPrec :: Int -> ReadS ListCalculationExecutions
$creadsPrec :: Int -> ReadS ListCalculationExecutions
Prelude.Read, Int -> ListCalculationExecutions -> ShowS
[ListCalculationExecutions] -> ShowS
ListCalculationExecutions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCalculationExecutions] -> ShowS
$cshowList :: [ListCalculationExecutions] -> ShowS
show :: ListCalculationExecutions -> String
$cshow :: ListCalculationExecutions -> String
showsPrec :: Int -> ListCalculationExecutions -> ShowS
$cshowsPrec :: Int -> ListCalculationExecutions -> ShowS
Prelude.Show, forall x.
Rep ListCalculationExecutions x -> ListCalculationExecutions
forall x.
ListCalculationExecutions -> Rep ListCalculationExecutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCalculationExecutions x -> ListCalculationExecutions
$cfrom :: forall x.
ListCalculationExecutions -> Rep ListCalculationExecutions x
Prelude.Generic)
newListCalculationExecutions ::
Prelude.Text ->
ListCalculationExecutions
newListCalculationExecutions :: Text -> ListCalculationExecutions
newListCalculationExecutions Text
pSessionId_ =
ListCalculationExecutions'
{ $sel:maxResults:ListCalculationExecutions' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCalculationExecutions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:stateFilter:ListCalculationExecutions' :: Maybe CalculationExecutionState
stateFilter = forall a. Maybe a
Prelude.Nothing,
$sel:sessionId:ListCalculationExecutions' :: Text
sessionId = Text
pSessionId_
}
listCalculationExecutions_maxResults :: Lens.Lens' ListCalculationExecutions (Prelude.Maybe Prelude.Natural)
listCalculationExecutions_maxResults :: Lens' ListCalculationExecutions (Maybe Natural)
listCalculationExecutions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCalculationExecutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCalculationExecutions
s@ListCalculationExecutions' {} Maybe Natural
a -> ListCalculationExecutions
s {$sel:maxResults:ListCalculationExecutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCalculationExecutions)
listCalculationExecutions_nextToken :: Lens.Lens' ListCalculationExecutions (Prelude.Maybe Prelude.Text)
listCalculationExecutions_nextToken :: Lens' ListCalculationExecutions (Maybe Text)
listCalculationExecutions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCalculationExecutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCalculationExecutions
s@ListCalculationExecutions' {} Maybe Text
a -> ListCalculationExecutions
s {$sel:nextToken:ListCalculationExecutions' :: Maybe Text
nextToken = Maybe Text
a} :: ListCalculationExecutions)
listCalculationExecutions_stateFilter :: Lens.Lens' ListCalculationExecutions (Prelude.Maybe CalculationExecutionState)
listCalculationExecutions_stateFilter :: Lens' ListCalculationExecutions (Maybe CalculationExecutionState)
listCalculationExecutions_stateFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCalculationExecutions' {Maybe CalculationExecutionState
stateFilter :: Maybe CalculationExecutionState
$sel:stateFilter:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe CalculationExecutionState
stateFilter} -> Maybe CalculationExecutionState
stateFilter) (\s :: ListCalculationExecutions
s@ListCalculationExecutions' {} Maybe CalculationExecutionState
a -> ListCalculationExecutions
s {$sel:stateFilter:ListCalculationExecutions' :: Maybe CalculationExecutionState
stateFilter = Maybe CalculationExecutionState
a} :: ListCalculationExecutions)
listCalculationExecutions_sessionId :: Lens.Lens' ListCalculationExecutions Prelude.Text
listCalculationExecutions_sessionId :: Lens' ListCalculationExecutions Text
listCalculationExecutions_sessionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCalculationExecutions' {Text
sessionId :: Text
$sel:sessionId:ListCalculationExecutions' :: ListCalculationExecutions -> Text
sessionId} -> Text
sessionId) (\s :: ListCalculationExecutions
s@ListCalculationExecutions' {} Text
a -> ListCalculationExecutions
s {$sel:sessionId:ListCalculationExecutions' :: Text
sessionId = Text
a} :: ListCalculationExecutions)
instance Core.AWSRequest ListCalculationExecutions where
type
AWSResponse ListCalculationExecutions =
ListCalculationExecutionsResponse
request :: (Service -> Service)
-> ListCalculationExecutions -> Request ListCalculationExecutions
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListCalculationExecutions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListCalculationExecutions)))
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 [CalculationSummary]
-> Maybe Text -> Int -> ListCalculationExecutionsResponse
ListCalculationExecutionsResponse'
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
"Calculations" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListCalculationExecutions where
hashWithSalt :: Int -> ListCalculationExecutions -> Int
hashWithSalt Int
_salt ListCalculationExecutions' {Maybe Natural
Maybe Text
Maybe CalculationExecutionState
Text
sessionId :: Text
stateFilter :: Maybe CalculationExecutionState
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sessionId:ListCalculationExecutions' :: ListCalculationExecutions -> Text
$sel:stateFilter:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe CalculationExecutionState
$sel:nextToken:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe Text
$sel:maxResults:ListCalculationExecutions' :: ListCalculationExecutions -> 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` Maybe CalculationExecutionState
stateFilter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sessionId
instance Prelude.NFData ListCalculationExecutions where
rnf :: ListCalculationExecutions -> ()
rnf ListCalculationExecutions' {Maybe Natural
Maybe Text
Maybe CalculationExecutionState
Text
sessionId :: Text
stateFilter :: Maybe CalculationExecutionState
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sessionId:ListCalculationExecutions' :: ListCalculationExecutions -> Text
$sel:stateFilter:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe CalculationExecutionState
$sel:nextToken:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe Text
$sel:maxResults:ListCalculationExecutions' :: ListCalculationExecutions -> 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 Maybe CalculationExecutionState
stateFilter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sessionId
instance Data.ToHeaders ListCalculationExecutions where
toHeaders :: ListCalculationExecutions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonAthena.ListCalculationExecutions" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListCalculationExecutions where
toJSON :: ListCalculationExecutions -> Value
toJSON ListCalculationExecutions' {Maybe Natural
Maybe Text
Maybe CalculationExecutionState
Text
sessionId :: Text
stateFilter :: Maybe CalculationExecutionState
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sessionId:ListCalculationExecutions' :: ListCalculationExecutions -> Text
$sel:stateFilter:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe CalculationExecutionState
$sel:nextToken:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe Text
$sel:maxResults:ListCalculationExecutions' :: ListCalculationExecutions -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Key
"StateFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CalculationExecutionState
stateFilter,
forall a. a -> Maybe a
Prelude.Just (Key
"SessionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sessionId)
]
)
instance Data.ToPath ListCalculationExecutions where
toPath :: ListCalculationExecutions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListCalculationExecutions where
toQuery :: ListCalculationExecutions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListCalculationExecutionsResponse = ListCalculationExecutionsResponse'
{
ListCalculationExecutionsResponse -> Maybe [CalculationSummary]
calculations :: Prelude.Maybe [CalculationSummary],
ListCalculationExecutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCalculationExecutionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListCalculationExecutionsResponse
-> ListCalculationExecutionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCalculationExecutionsResponse
-> ListCalculationExecutionsResponse -> Bool
$c/= :: ListCalculationExecutionsResponse
-> ListCalculationExecutionsResponse -> Bool
== :: ListCalculationExecutionsResponse
-> ListCalculationExecutionsResponse -> Bool
$c== :: ListCalculationExecutionsResponse
-> ListCalculationExecutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListCalculationExecutionsResponse]
ReadPrec ListCalculationExecutionsResponse
Int -> ReadS ListCalculationExecutionsResponse
ReadS [ListCalculationExecutionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCalculationExecutionsResponse]
$creadListPrec :: ReadPrec [ListCalculationExecutionsResponse]
readPrec :: ReadPrec ListCalculationExecutionsResponse
$creadPrec :: ReadPrec ListCalculationExecutionsResponse
readList :: ReadS [ListCalculationExecutionsResponse]
$creadList :: ReadS [ListCalculationExecutionsResponse]
readsPrec :: Int -> ReadS ListCalculationExecutionsResponse
$creadsPrec :: Int -> ReadS ListCalculationExecutionsResponse
Prelude.Read, Int -> ListCalculationExecutionsResponse -> ShowS
[ListCalculationExecutionsResponse] -> ShowS
ListCalculationExecutionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCalculationExecutionsResponse] -> ShowS
$cshowList :: [ListCalculationExecutionsResponse] -> ShowS
show :: ListCalculationExecutionsResponse -> String
$cshow :: ListCalculationExecutionsResponse -> String
showsPrec :: Int -> ListCalculationExecutionsResponse -> ShowS
$cshowsPrec :: Int -> ListCalculationExecutionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListCalculationExecutionsResponse x
-> ListCalculationExecutionsResponse
forall x.
ListCalculationExecutionsResponse
-> Rep ListCalculationExecutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCalculationExecutionsResponse x
-> ListCalculationExecutionsResponse
$cfrom :: forall x.
ListCalculationExecutionsResponse
-> Rep ListCalculationExecutionsResponse x
Prelude.Generic)
newListCalculationExecutionsResponse ::
Prelude.Int ->
ListCalculationExecutionsResponse
newListCalculationExecutionsResponse :: Int -> ListCalculationExecutionsResponse
newListCalculationExecutionsResponse Int
pHttpStatus_ =
ListCalculationExecutionsResponse'
{ $sel:calculations:ListCalculationExecutionsResponse' :: Maybe [CalculationSummary]
calculations =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCalculationExecutionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListCalculationExecutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listCalculationExecutionsResponse_calculations :: Lens.Lens' ListCalculationExecutionsResponse (Prelude.Maybe [CalculationSummary])
listCalculationExecutionsResponse_calculations :: Lens'
ListCalculationExecutionsResponse (Maybe [CalculationSummary])
listCalculationExecutionsResponse_calculations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCalculationExecutionsResponse' {Maybe [CalculationSummary]
calculations :: Maybe [CalculationSummary]
$sel:calculations:ListCalculationExecutionsResponse' :: ListCalculationExecutionsResponse -> Maybe [CalculationSummary]
calculations} -> Maybe [CalculationSummary]
calculations) (\s :: ListCalculationExecutionsResponse
s@ListCalculationExecutionsResponse' {} Maybe [CalculationSummary]
a -> ListCalculationExecutionsResponse
s {$sel:calculations:ListCalculationExecutionsResponse' :: Maybe [CalculationSummary]
calculations = Maybe [CalculationSummary]
a} :: ListCalculationExecutionsResponse) 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
listCalculationExecutionsResponse_nextToken :: Lens.Lens' ListCalculationExecutionsResponse (Prelude.Maybe Prelude.Text)
listCalculationExecutionsResponse_nextToken :: Lens' ListCalculationExecutionsResponse (Maybe Text)
listCalculationExecutionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCalculationExecutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCalculationExecutionsResponse' :: ListCalculationExecutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCalculationExecutionsResponse
s@ListCalculationExecutionsResponse' {} Maybe Text
a -> ListCalculationExecutionsResponse
s {$sel:nextToken:ListCalculationExecutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCalculationExecutionsResponse)
listCalculationExecutionsResponse_httpStatus :: Lens.Lens' ListCalculationExecutionsResponse Prelude.Int
listCalculationExecutionsResponse_httpStatus :: Lens' ListCalculationExecutionsResponse Int
listCalculationExecutionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCalculationExecutionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListCalculationExecutionsResponse' :: ListCalculationExecutionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListCalculationExecutionsResponse
s@ListCalculationExecutionsResponse' {} Int
a -> ListCalculationExecutionsResponse
s {$sel:httpStatus:ListCalculationExecutionsResponse' :: Int
httpStatus = Int
a} :: ListCalculationExecutionsResponse)
instance
Prelude.NFData
ListCalculationExecutionsResponse
where
rnf :: ListCalculationExecutionsResponse -> ()
rnf ListCalculationExecutionsResponse' {Int
Maybe [CalculationSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
calculations :: Maybe [CalculationSummary]
$sel:httpStatus:ListCalculationExecutionsResponse' :: ListCalculationExecutionsResponse -> Int
$sel:nextToken:ListCalculationExecutionsResponse' :: ListCalculationExecutionsResponse -> Maybe Text
$sel:calculations:ListCalculationExecutionsResponse' :: ListCalculationExecutionsResponse -> Maybe [CalculationSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [CalculationSummary]
calculations
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 Int
httpStatus