{-# 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.ElasticSearch.GetCompatibleElasticsearchVersions
(
GetCompatibleElasticsearchVersions (..),
newGetCompatibleElasticsearchVersions,
getCompatibleElasticsearchVersions_domainName,
GetCompatibleElasticsearchVersionsResponse (..),
newGetCompatibleElasticsearchVersionsResponse,
getCompatibleElasticsearchVersionsResponse_compatibleElasticsearchVersions,
getCompatibleElasticsearchVersionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types
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 GetCompatibleElasticsearchVersions = GetCompatibleElasticsearchVersions'
{ GetCompatibleElasticsearchVersions -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text
}
deriving (GetCompatibleElasticsearchVersions
-> GetCompatibleElasticsearchVersions -> Bool
(GetCompatibleElasticsearchVersions
-> GetCompatibleElasticsearchVersions -> Bool)
-> (GetCompatibleElasticsearchVersions
-> GetCompatibleElasticsearchVersions -> Bool)
-> Eq GetCompatibleElasticsearchVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCompatibleElasticsearchVersions
-> GetCompatibleElasticsearchVersions -> Bool
$c/= :: GetCompatibleElasticsearchVersions
-> GetCompatibleElasticsearchVersions -> Bool
== :: GetCompatibleElasticsearchVersions
-> GetCompatibleElasticsearchVersions -> Bool
$c== :: GetCompatibleElasticsearchVersions
-> GetCompatibleElasticsearchVersions -> Bool
Prelude.Eq, ReadPrec [GetCompatibleElasticsearchVersions]
ReadPrec GetCompatibleElasticsearchVersions
Int -> ReadS GetCompatibleElasticsearchVersions
ReadS [GetCompatibleElasticsearchVersions]
(Int -> ReadS GetCompatibleElasticsearchVersions)
-> ReadS [GetCompatibleElasticsearchVersions]
-> ReadPrec GetCompatibleElasticsearchVersions
-> ReadPrec [GetCompatibleElasticsearchVersions]
-> Read GetCompatibleElasticsearchVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCompatibleElasticsearchVersions]
$creadListPrec :: ReadPrec [GetCompatibleElasticsearchVersions]
readPrec :: ReadPrec GetCompatibleElasticsearchVersions
$creadPrec :: ReadPrec GetCompatibleElasticsearchVersions
readList :: ReadS [GetCompatibleElasticsearchVersions]
$creadList :: ReadS [GetCompatibleElasticsearchVersions]
readsPrec :: Int -> ReadS GetCompatibleElasticsearchVersions
$creadsPrec :: Int -> ReadS GetCompatibleElasticsearchVersions
Prelude.Read, Int -> GetCompatibleElasticsearchVersions -> ShowS
[GetCompatibleElasticsearchVersions] -> ShowS
GetCompatibleElasticsearchVersions -> String
(Int -> GetCompatibleElasticsearchVersions -> ShowS)
-> (GetCompatibleElasticsearchVersions -> String)
-> ([GetCompatibleElasticsearchVersions] -> ShowS)
-> Show GetCompatibleElasticsearchVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCompatibleElasticsearchVersions] -> ShowS
$cshowList :: [GetCompatibleElasticsearchVersions] -> ShowS
show :: GetCompatibleElasticsearchVersions -> String
$cshow :: GetCompatibleElasticsearchVersions -> String
showsPrec :: Int -> GetCompatibleElasticsearchVersions -> ShowS
$cshowsPrec :: Int -> GetCompatibleElasticsearchVersions -> ShowS
Prelude.Show, (forall x.
GetCompatibleElasticsearchVersions
-> Rep GetCompatibleElasticsearchVersions x)
-> (forall x.
Rep GetCompatibleElasticsearchVersions x
-> GetCompatibleElasticsearchVersions)
-> Generic GetCompatibleElasticsearchVersions
forall x.
Rep GetCompatibleElasticsearchVersions x
-> GetCompatibleElasticsearchVersions
forall x.
GetCompatibleElasticsearchVersions
-> Rep GetCompatibleElasticsearchVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCompatibleElasticsearchVersions x
-> GetCompatibleElasticsearchVersions
$cfrom :: forall x.
GetCompatibleElasticsearchVersions
-> Rep GetCompatibleElasticsearchVersions x
Prelude.Generic)
newGetCompatibleElasticsearchVersions ::
GetCompatibleElasticsearchVersions
newGetCompatibleElasticsearchVersions :: GetCompatibleElasticsearchVersions
newGetCompatibleElasticsearchVersions =
GetCompatibleElasticsearchVersions' :: Maybe Text -> GetCompatibleElasticsearchVersions
GetCompatibleElasticsearchVersions'
{ $sel:domainName:GetCompatibleElasticsearchVersions' :: Maybe Text
domainName =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
getCompatibleElasticsearchVersions_domainName :: Lens.Lens' GetCompatibleElasticsearchVersions (Prelude.Maybe Prelude.Text)
getCompatibleElasticsearchVersions_domainName :: (Maybe Text -> f (Maybe Text))
-> GetCompatibleElasticsearchVersions
-> f GetCompatibleElasticsearchVersions
getCompatibleElasticsearchVersions_domainName = (GetCompatibleElasticsearchVersions -> Maybe Text)
-> (GetCompatibleElasticsearchVersions
-> Maybe Text -> GetCompatibleElasticsearchVersions)
-> Lens
GetCompatibleElasticsearchVersions
GetCompatibleElasticsearchVersions
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCompatibleElasticsearchVersions' {Maybe Text
domainName :: Maybe Text
$sel:domainName:GetCompatibleElasticsearchVersions' :: GetCompatibleElasticsearchVersions -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: GetCompatibleElasticsearchVersions
s@GetCompatibleElasticsearchVersions' {} Maybe Text
a -> GetCompatibleElasticsearchVersions
s {$sel:domainName:GetCompatibleElasticsearchVersions' :: Maybe Text
domainName = Maybe Text
a} :: GetCompatibleElasticsearchVersions)
instance
Core.AWSRequest
GetCompatibleElasticsearchVersions
where
type
AWSResponse GetCompatibleElasticsearchVersions =
GetCompatibleElasticsearchVersionsResponse
request :: GetCompatibleElasticsearchVersions
-> Request GetCompatibleElasticsearchVersions
request = Service
-> GetCompatibleElasticsearchVersions
-> Request GetCompatibleElasticsearchVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetCompatibleElasticsearchVersions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetCompatibleElasticsearchVersions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetCompatibleElasticsearchVersions))
-> Logger
-> Service
-> Proxy GetCompatibleElasticsearchVersions
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetCompatibleElasticsearchVersions)))
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 [CompatibleVersionsMap]
-> Int -> GetCompatibleElasticsearchVersionsResponse
GetCompatibleElasticsearchVersionsResponse'
(Maybe [CompatibleVersionsMap]
-> Int -> GetCompatibleElasticsearchVersionsResponse)
-> Either String (Maybe [CompatibleVersionsMap])
-> Either
String (Int -> GetCompatibleElasticsearchVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [CompatibleVersionsMap]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CompatibleElasticsearchVersions"
Either String (Maybe (Maybe [CompatibleVersionsMap]))
-> Maybe [CompatibleVersionsMap]
-> Either String (Maybe [CompatibleVersionsMap])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CompatibleVersionsMap]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> GetCompatibleElasticsearchVersionsResponse)
-> Either String Int
-> Either String GetCompatibleElasticsearchVersionsResponse
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
GetCompatibleElasticsearchVersions
instance
Prelude.NFData
GetCompatibleElasticsearchVersions
instance
Core.ToHeaders
GetCompatibleElasticsearchVersions
where
toHeaders :: GetCompatibleElasticsearchVersions -> ResponseHeaders
toHeaders = ResponseHeaders
-> GetCompatibleElasticsearchVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance
Core.ToPath
GetCompatibleElasticsearchVersions
where
toPath :: GetCompatibleElasticsearchVersions -> ByteString
toPath =
ByteString -> GetCompatibleElasticsearchVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2015-01-01/es/compatibleVersions"
instance
Core.ToQuery
GetCompatibleElasticsearchVersions
where
toQuery :: GetCompatibleElasticsearchVersions -> QueryString
toQuery GetCompatibleElasticsearchVersions' {Maybe Text
domainName :: Maybe Text
$sel:domainName:GetCompatibleElasticsearchVersions' :: GetCompatibleElasticsearchVersions -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"domainName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
domainName]
data GetCompatibleElasticsearchVersionsResponse = GetCompatibleElasticsearchVersionsResponse'
{
GetCompatibleElasticsearchVersionsResponse
-> Maybe [CompatibleVersionsMap]
compatibleElasticsearchVersions :: Prelude.Maybe [CompatibleVersionsMap],
GetCompatibleElasticsearchVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetCompatibleElasticsearchVersionsResponse
-> GetCompatibleElasticsearchVersionsResponse -> Bool
(GetCompatibleElasticsearchVersionsResponse
-> GetCompatibleElasticsearchVersionsResponse -> Bool)
-> (GetCompatibleElasticsearchVersionsResponse
-> GetCompatibleElasticsearchVersionsResponse -> Bool)
-> Eq GetCompatibleElasticsearchVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCompatibleElasticsearchVersionsResponse
-> GetCompatibleElasticsearchVersionsResponse -> Bool
$c/= :: GetCompatibleElasticsearchVersionsResponse
-> GetCompatibleElasticsearchVersionsResponse -> Bool
== :: GetCompatibleElasticsearchVersionsResponse
-> GetCompatibleElasticsearchVersionsResponse -> Bool
$c== :: GetCompatibleElasticsearchVersionsResponse
-> GetCompatibleElasticsearchVersionsResponse -> Bool
Prelude.Eq, ReadPrec [GetCompatibleElasticsearchVersionsResponse]
ReadPrec GetCompatibleElasticsearchVersionsResponse
Int -> ReadS GetCompatibleElasticsearchVersionsResponse
ReadS [GetCompatibleElasticsearchVersionsResponse]
(Int -> ReadS GetCompatibleElasticsearchVersionsResponse)
-> ReadS [GetCompatibleElasticsearchVersionsResponse]
-> ReadPrec GetCompatibleElasticsearchVersionsResponse
-> ReadPrec [GetCompatibleElasticsearchVersionsResponse]
-> Read GetCompatibleElasticsearchVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCompatibleElasticsearchVersionsResponse]
$creadListPrec :: ReadPrec [GetCompatibleElasticsearchVersionsResponse]
readPrec :: ReadPrec GetCompatibleElasticsearchVersionsResponse
$creadPrec :: ReadPrec GetCompatibleElasticsearchVersionsResponse
readList :: ReadS [GetCompatibleElasticsearchVersionsResponse]
$creadList :: ReadS [GetCompatibleElasticsearchVersionsResponse]
readsPrec :: Int -> ReadS GetCompatibleElasticsearchVersionsResponse
$creadsPrec :: Int -> ReadS GetCompatibleElasticsearchVersionsResponse
Prelude.Read, Int -> GetCompatibleElasticsearchVersionsResponse -> ShowS
[GetCompatibleElasticsearchVersionsResponse] -> ShowS
GetCompatibleElasticsearchVersionsResponse -> String
(Int -> GetCompatibleElasticsearchVersionsResponse -> ShowS)
-> (GetCompatibleElasticsearchVersionsResponse -> String)
-> ([GetCompatibleElasticsearchVersionsResponse] -> ShowS)
-> Show GetCompatibleElasticsearchVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCompatibleElasticsearchVersionsResponse] -> ShowS
$cshowList :: [GetCompatibleElasticsearchVersionsResponse] -> ShowS
show :: GetCompatibleElasticsearchVersionsResponse -> String
$cshow :: GetCompatibleElasticsearchVersionsResponse -> String
showsPrec :: Int -> GetCompatibleElasticsearchVersionsResponse -> ShowS
$cshowsPrec :: Int -> GetCompatibleElasticsearchVersionsResponse -> ShowS
Prelude.Show, (forall x.
GetCompatibleElasticsearchVersionsResponse
-> Rep GetCompatibleElasticsearchVersionsResponse x)
-> (forall x.
Rep GetCompatibleElasticsearchVersionsResponse x
-> GetCompatibleElasticsearchVersionsResponse)
-> Generic GetCompatibleElasticsearchVersionsResponse
forall x.
Rep GetCompatibleElasticsearchVersionsResponse x
-> GetCompatibleElasticsearchVersionsResponse
forall x.
GetCompatibleElasticsearchVersionsResponse
-> Rep GetCompatibleElasticsearchVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCompatibleElasticsearchVersionsResponse x
-> GetCompatibleElasticsearchVersionsResponse
$cfrom :: forall x.
GetCompatibleElasticsearchVersionsResponse
-> Rep GetCompatibleElasticsearchVersionsResponse x
Prelude.Generic)
newGetCompatibleElasticsearchVersionsResponse ::
Prelude.Int ->
GetCompatibleElasticsearchVersionsResponse
newGetCompatibleElasticsearchVersionsResponse :: Int -> GetCompatibleElasticsearchVersionsResponse
newGetCompatibleElasticsearchVersionsResponse
Int
pHttpStatus_ =
GetCompatibleElasticsearchVersionsResponse' :: Maybe [CompatibleVersionsMap]
-> Int -> GetCompatibleElasticsearchVersionsResponse
GetCompatibleElasticsearchVersionsResponse'
{ $sel:compatibleElasticsearchVersions:GetCompatibleElasticsearchVersionsResponse' :: Maybe [CompatibleVersionsMap]
compatibleElasticsearchVersions =
Maybe [CompatibleVersionsMap]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCompatibleElasticsearchVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getCompatibleElasticsearchVersionsResponse_compatibleElasticsearchVersions :: Lens.Lens' GetCompatibleElasticsearchVersionsResponse (Prelude.Maybe [CompatibleVersionsMap])
getCompatibleElasticsearchVersionsResponse_compatibleElasticsearchVersions :: (Maybe [CompatibleVersionsMap]
-> f (Maybe [CompatibleVersionsMap]))
-> GetCompatibleElasticsearchVersionsResponse
-> f GetCompatibleElasticsearchVersionsResponse
getCompatibleElasticsearchVersionsResponse_compatibleElasticsearchVersions = (GetCompatibleElasticsearchVersionsResponse
-> Maybe [CompatibleVersionsMap])
-> (GetCompatibleElasticsearchVersionsResponse
-> Maybe [CompatibleVersionsMap]
-> GetCompatibleElasticsearchVersionsResponse)
-> Lens
GetCompatibleElasticsearchVersionsResponse
GetCompatibleElasticsearchVersionsResponse
(Maybe [CompatibleVersionsMap])
(Maybe [CompatibleVersionsMap])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCompatibleElasticsearchVersionsResponse' {Maybe [CompatibleVersionsMap]
compatibleElasticsearchVersions :: Maybe [CompatibleVersionsMap]
$sel:compatibleElasticsearchVersions:GetCompatibleElasticsearchVersionsResponse' :: GetCompatibleElasticsearchVersionsResponse
-> Maybe [CompatibleVersionsMap]
compatibleElasticsearchVersions} -> Maybe [CompatibleVersionsMap]
compatibleElasticsearchVersions) (\s :: GetCompatibleElasticsearchVersionsResponse
s@GetCompatibleElasticsearchVersionsResponse' {} Maybe [CompatibleVersionsMap]
a -> GetCompatibleElasticsearchVersionsResponse
s {$sel:compatibleElasticsearchVersions:GetCompatibleElasticsearchVersionsResponse' :: Maybe [CompatibleVersionsMap]
compatibleElasticsearchVersions = Maybe [CompatibleVersionsMap]
a} :: GetCompatibleElasticsearchVersionsResponse) ((Maybe [CompatibleVersionsMap]
-> f (Maybe [CompatibleVersionsMap]))
-> GetCompatibleElasticsearchVersionsResponse
-> f GetCompatibleElasticsearchVersionsResponse)
-> ((Maybe [CompatibleVersionsMap]
-> f (Maybe [CompatibleVersionsMap]))
-> Maybe [CompatibleVersionsMap]
-> f (Maybe [CompatibleVersionsMap]))
-> (Maybe [CompatibleVersionsMap]
-> f (Maybe [CompatibleVersionsMap]))
-> GetCompatibleElasticsearchVersionsResponse
-> f GetCompatibleElasticsearchVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CompatibleVersionsMap]
[CompatibleVersionsMap]
[CompatibleVersionsMap]
[CompatibleVersionsMap]
-> Iso
(Maybe [CompatibleVersionsMap])
(Maybe [CompatibleVersionsMap])
(Maybe [CompatibleVersionsMap])
(Maybe [CompatibleVersionsMap])
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
[CompatibleVersionsMap]
[CompatibleVersionsMap]
[CompatibleVersionsMap]
[CompatibleVersionsMap]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getCompatibleElasticsearchVersionsResponse_httpStatus :: Lens.Lens' GetCompatibleElasticsearchVersionsResponse Prelude.Int
getCompatibleElasticsearchVersionsResponse_httpStatus :: (Int -> f Int)
-> GetCompatibleElasticsearchVersionsResponse
-> f GetCompatibleElasticsearchVersionsResponse
getCompatibleElasticsearchVersionsResponse_httpStatus = (GetCompatibleElasticsearchVersionsResponse -> Int)
-> (GetCompatibleElasticsearchVersionsResponse
-> Int -> GetCompatibleElasticsearchVersionsResponse)
-> Lens
GetCompatibleElasticsearchVersionsResponse
GetCompatibleElasticsearchVersionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCompatibleElasticsearchVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCompatibleElasticsearchVersionsResponse' :: GetCompatibleElasticsearchVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCompatibleElasticsearchVersionsResponse
s@GetCompatibleElasticsearchVersionsResponse' {} Int
a -> GetCompatibleElasticsearchVersionsResponse
s {$sel:httpStatus:GetCompatibleElasticsearchVersionsResponse' :: Int
httpStatus = Int
a} :: GetCompatibleElasticsearchVersionsResponse)
instance
Prelude.NFData
GetCompatibleElasticsearchVersionsResponse