{-# 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.ListEngineVersions
(
ListEngineVersions (..),
newListEngineVersions,
listEngineVersions_nextToken,
listEngineVersions_maxResults,
ListEngineVersionsResponse (..),
newListEngineVersionsResponse,
listEngineVersionsResponse_nextToken,
listEngineVersionsResponse_engineVersions,
listEngineVersionsResponse_httpStatus,
)
where
import Amazonka.Athena.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListEngineVersions = ListEngineVersions'
{
ListEngineVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListEngineVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListEngineVersions -> ListEngineVersions -> Bool
(ListEngineVersions -> ListEngineVersions -> Bool)
-> (ListEngineVersions -> ListEngineVersions -> Bool)
-> Eq ListEngineVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEngineVersions -> ListEngineVersions -> Bool
$c/= :: ListEngineVersions -> ListEngineVersions -> Bool
== :: ListEngineVersions -> ListEngineVersions -> Bool
$c== :: ListEngineVersions -> ListEngineVersions -> Bool
Prelude.Eq, ReadPrec [ListEngineVersions]
ReadPrec ListEngineVersions
Int -> ReadS ListEngineVersions
ReadS [ListEngineVersions]
(Int -> ReadS ListEngineVersions)
-> ReadS [ListEngineVersions]
-> ReadPrec ListEngineVersions
-> ReadPrec [ListEngineVersions]
-> Read ListEngineVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEngineVersions]
$creadListPrec :: ReadPrec [ListEngineVersions]
readPrec :: ReadPrec ListEngineVersions
$creadPrec :: ReadPrec ListEngineVersions
readList :: ReadS [ListEngineVersions]
$creadList :: ReadS [ListEngineVersions]
readsPrec :: Int -> ReadS ListEngineVersions
$creadsPrec :: Int -> ReadS ListEngineVersions
Prelude.Read, Int -> ListEngineVersions -> ShowS
[ListEngineVersions] -> ShowS
ListEngineVersions -> String
(Int -> ListEngineVersions -> ShowS)
-> (ListEngineVersions -> String)
-> ([ListEngineVersions] -> ShowS)
-> Show ListEngineVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEngineVersions] -> ShowS
$cshowList :: [ListEngineVersions] -> ShowS
show :: ListEngineVersions -> String
$cshow :: ListEngineVersions -> String
showsPrec :: Int -> ListEngineVersions -> ShowS
$cshowsPrec :: Int -> ListEngineVersions -> ShowS
Prelude.Show, (forall x. ListEngineVersions -> Rep ListEngineVersions x)
-> (forall x. Rep ListEngineVersions x -> ListEngineVersions)
-> Generic ListEngineVersions
forall x. Rep ListEngineVersions x -> ListEngineVersions
forall x. ListEngineVersions -> Rep ListEngineVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEngineVersions x -> ListEngineVersions
$cfrom :: forall x. ListEngineVersions -> Rep ListEngineVersions x
Prelude.Generic)
newListEngineVersions ::
ListEngineVersions
newListEngineVersions :: ListEngineVersions
newListEngineVersions =
ListEngineVersions' :: Maybe Text -> Maybe Natural -> ListEngineVersions
ListEngineVersions'
{ $sel:nextToken:ListEngineVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListEngineVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listEngineVersions_nextToken :: Lens.Lens' ListEngineVersions (Prelude.Maybe Prelude.Text)
listEngineVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEngineVersions -> f ListEngineVersions
listEngineVersions_nextToken = (ListEngineVersions -> Maybe Text)
-> (ListEngineVersions -> Maybe Text -> ListEngineVersions)
-> Lens
ListEngineVersions ListEngineVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEngineVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEngineVersions' :: ListEngineVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEngineVersions
s@ListEngineVersions' {} Maybe Text
a -> ListEngineVersions
s {$sel:nextToken:ListEngineVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListEngineVersions)
listEngineVersions_maxResults :: Lens.Lens' ListEngineVersions (Prelude.Maybe Prelude.Natural)
listEngineVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListEngineVersions -> f ListEngineVersions
listEngineVersions_maxResults = (ListEngineVersions -> Maybe Natural)
-> (ListEngineVersions -> Maybe Natural -> ListEngineVersions)
-> Lens
ListEngineVersions
ListEngineVersions
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEngineVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListEngineVersions' :: ListEngineVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListEngineVersions
s@ListEngineVersions' {} Maybe Natural
a -> ListEngineVersions
s {$sel:maxResults:ListEngineVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListEngineVersions)
instance Core.AWSRequest ListEngineVersions where
type
AWSResponse ListEngineVersions =
ListEngineVersionsResponse
request :: ListEngineVersions -> Request ListEngineVersions
request = Service -> ListEngineVersions -> Request ListEngineVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListEngineVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListEngineVersions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListEngineVersions))
-> Logger
-> Service
-> Proxy ListEngineVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListEngineVersions)))
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 [EngineVersion] -> Int -> ListEngineVersionsResponse
ListEngineVersionsResponse'
(Maybe Text
-> Maybe [EngineVersion] -> Int -> ListEngineVersionsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [EngineVersion] -> Int -> ListEngineVersionsResponse)
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
"NextToken")
Either
String (Maybe [EngineVersion] -> Int -> ListEngineVersionsResponse)
-> Either String (Maybe [EngineVersion])
-> Either String (Int -> ListEngineVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [EngineVersion]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EngineVersions" Either String (Maybe (Maybe [EngineVersion]))
-> Maybe [EngineVersion] -> Either String (Maybe [EngineVersion])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EngineVersion]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListEngineVersionsResponse)
-> Either String Int -> Either String ListEngineVersionsResponse
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 ListEngineVersions
instance Prelude.NFData ListEngineVersions
instance Core.ToHeaders ListEngineVersions where
toHeaders :: ListEngineVersions -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListEngineVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonAthena.ListEngineVersions" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON ListEngineVersions where
toJSON :: ListEngineVersions -> Value
toJSON ListEngineVersions' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListEngineVersions' :: ListEngineVersions -> Maybe Natural
$sel:nextToken:ListEngineVersions' :: ListEngineVersions -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)
instance Core.ToPath ListEngineVersions where
toPath :: ListEngineVersions -> ByteString
toPath = ByteString -> ListEngineVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListEngineVersions where
toQuery :: ListEngineVersions -> QueryString
toQuery = QueryString -> ListEngineVersions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListEngineVersionsResponse = ListEngineVersionsResponse'
{
ListEngineVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListEngineVersionsResponse -> Maybe [EngineVersion]
engineVersions :: Prelude.Maybe [EngineVersion],
ListEngineVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListEngineVersionsResponse -> ListEngineVersionsResponse -> Bool
(ListEngineVersionsResponse -> ListEngineVersionsResponse -> Bool)
-> (ListEngineVersionsResponse
-> ListEngineVersionsResponse -> Bool)
-> Eq ListEngineVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEngineVersionsResponse -> ListEngineVersionsResponse -> Bool
$c/= :: ListEngineVersionsResponse -> ListEngineVersionsResponse -> Bool
== :: ListEngineVersionsResponse -> ListEngineVersionsResponse -> Bool
$c== :: ListEngineVersionsResponse -> ListEngineVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListEngineVersionsResponse]
ReadPrec ListEngineVersionsResponse
Int -> ReadS ListEngineVersionsResponse
ReadS [ListEngineVersionsResponse]
(Int -> ReadS ListEngineVersionsResponse)
-> ReadS [ListEngineVersionsResponse]
-> ReadPrec ListEngineVersionsResponse
-> ReadPrec [ListEngineVersionsResponse]
-> Read ListEngineVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEngineVersionsResponse]
$creadListPrec :: ReadPrec [ListEngineVersionsResponse]
readPrec :: ReadPrec ListEngineVersionsResponse
$creadPrec :: ReadPrec ListEngineVersionsResponse
readList :: ReadS [ListEngineVersionsResponse]
$creadList :: ReadS [ListEngineVersionsResponse]
readsPrec :: Int -> ReadS ListEngineVersionsResponse
$creadsPrec :: Int -> ReadS ListEngineVersionsResponse
Prelude.Read, Int -> ListEngineVersionsResponse -> ShowS
[ListEngineVersionsResponse] -> ShowS
ListEngineVersionsResponse -> String
(Int -> ListEngineVersionsResponse -> ShowS)
-> (ListEngineVersionsResponse -> String)
-> ([ListEngineVersionsResponse] -> ShowS)
-> Show ListEngineVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEngineVersionsResponse] -> ShowS
$cshowList :: [ListEngineVersionsResponse] -> ShowS
show :: ListEngineVersionsResponse -> String
$cshow :: ListEngineVersionsResponse -> String
showsPrec :: Int -> ListEngineVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListEngineVersionsResponse -> ShowS
Prelude.Show, (forall x.
ListEngineVersionsResponse -> Rep ListEngineVersionsResponse x)
-> (forall x.
Rep ListEngineVersionsResponse x -> ListEngineVersionsResponse)
-> Generic ListEngineVersionsResponse
forall x.
Rep ListEngineVersionsResponse x -> ListEngineVersionsResponse
forall x.
ListEngineVersionsResponse -> Rep ListEngineVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEngineVersionsResponse x -> ListEngineVersionsResponse
$cfrom :: forall x.
ListEngineVersionsResponse -> Rep ListEngineVersionsResponse x
Prelude.Generic)
newListEngineVersionsResponse ::
Prelude.Int ->
ListEngineVersionsResponse
newListEngineVersionsResponse :: Int -> ListEngineVersionsResponse
newListEngineVersionsResponse Int
pHttpStatus_ =
ListEngineVersionsResponse' :: Maybe Text
-> Maybe [EngineVersion] -> Int -> ListEngineVersionsResponse
ListEngineVersionsResponse'
{ $sel:nextToken:ListEngineVersionsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:engineVersions:ListEngineVersionsResponse' :: Maybe [EngineVersion]
engineVersions = Maybe [EngineVersion]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListEngineVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listEngineVersionsResponse_nextToken :: Lens.Lens' ListEngineVersionsResponse (Prelude.Maybe Prelude.Text)
listEngineVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEngineVersionsResponse -> f ListEngineVersionsResponse
listEngineVersionsResponse_nextToken = (ListEngineVersionsResponse -> Maybe Text)
-> (ListEngineVersionsResponse
-> Maybe Text -> ListEngineVersionsResponse)
-> Lens
ListEngineVersionsResponse
ListEngineVersionsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEngineVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEngineVersionsResponse' :: ListEngineVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEngineVersionsResponse
s@ListEngineVersionsResponse' {} Maybe Text
a -> ListEngineVersionsResponse
s {$sel:nextToken:ListEngineVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEngineVersionsResponse)
listEngineVersionsResponse_engineVersions :: Lens.Lens' ListEngineVersionsResponse (Prelude.Maybe [EngineVersion])
listEngineVersionsResponse_engineVersions :: (Maybe [EngineVersion] -> f (Maybe [EngineVersion]))
-> ListEngineVersionsResponse -> f ListEngineVersionsResponse
listEngineVersionsResponse_engineVersions = (ListEngineVersionsResponse -> Maybe [EngineVersion])
-> (ListEngineVersionsResponse
-> Maybe [EngineVersion] -> ListEngineVersionsResponse)
-> Lens
ListEngineVersionsResponse
ListEngineVersionsResponse
(Maybe [EngineVersion])
(Maybe [EngineVersion])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEngineVersionsResponse' {Maybe [EngineVersion]
engineVersions :: Maybe [EngineVersion]
$sel:engineVersions:ListEngineVersionsResponse' :: ListEngineVersionsResponse -> Maybe [EngineVersion]
engineVersions} -> Maybe [EngineVersion]
engineVersions) (\s :: ListEngineVersionsResponse
s@ListEngineVersionsResponse' {} Maybe [EngineVersion]
a -> ListEngineVersionsResponse
s {$sel:engineVersions:ListEngineVersionsResponse' :: Maybe [EngineVersion]
engineVersions = Maybe [EngineVersion]
a} :: ListEngineVersionsResponse) ((Maybe [EngineVersion] -> f (Maybe [EngineVersion]))
-> ListEngineVersionsResponse -> f ListEngineVersionsResponse)
-> ((Maybe [EngineVersion] -> f (Maybe [EngineVersion]))
-> Maybe [EngineVersion] -> f (Maybe [EngineVersion]))
-> (Maybe [EngineVersion] -> f (Maybe [EngineVersion]))
-> ListEngineVersionsResponse
-> f ListEngineVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EngineVersion] [EngineVersion] [EngineVersion] [EngineVersion]
-> Iso
(Maybe [EngineVersion])
(Maybe [EngineVersion])
(Maybe [EngineVersion])
(Maybe [EngineVersion])
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
[EngineVersion] [EngineVersion] [EngineVersion] [EngineVersion]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listEngineVersionsResponse_httpStatus :: Lens.Lens' ListEngineVersionsResponse Prelude.Int
listEngineVersionsResponse_httpStatus :: (Int -> f Int)
-> ListEngineVersionsResponse -> f ListEngineVersionsResponse
listEngineVersionsResponse_httpStatus = (ListEngineVersionsResponse -> Int)
-> (ListEngineVersionsResponse
-> Int -> ListEngineVersionsResponse)
-> Lens
ListEngineVersionsResponse ListEngineVersionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEngineVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListEngineVersionsResponse' :: ListEngineVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListEngineVersionsResponse
s@ListEngineVersionsResponse' {} Int
a -> ListEngineVersionsResponse
s {$sel:httpStatus:ListEngineVersionsResponse' :: Int
httpStatus = Int
a} :: ListEngineVersionsResponse)
instance Prelude.NFData ListEngineVersionsResponse