{-# 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.DescribeElasticsearchDomain
(
DescribeElasticsearchDomain (..),
newDescribeElasticsearchDomain,
describeElasticsearchDomain_domainName,
DescribeElasticsearchDomainResponse (..),
newDescribeElasticsearchDomainResponse,
describeElasticsearchDomainResponse_httpStatus,
describeElasticsearchDomainResponse_domainStatus,
)
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 DescribeElasticsearchDomain = DescribeElasticsearchDomain'
{
DescribeElasticsearchDomain -> Text
domainName :: Prelude.Text
}
deriving (DescribeElasticsearchDomain -> DescribeElasticsearchDomain -> Bool
(DescribeElasticsearchDomain
-> DescribeElasticsearchDomain -> Bool)
-> (DescribeElasticsearchDomain
-> DescribeElasticsearchDomain -> Bool)
-> Eq DescribeElasticsearchDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeElasticsearchDomain -> DescribeElasticsearchDomain -> Bool
$c/= :: DescribeElasticsearchDomain -> DescribeElasticsearchDomain -> Bool
== :: DescribeElasticsearchDomain -> DescribeElasticsearchDomain -> Bool
$c== :: DescribeElasticsearchDomain -> DescribeElasticsearchDomain -> Bool
Prelude.Eq, ReadPrec [DescribeElasticsearchDomain]
ReadPrec DescribeElasticsearchDomain
Int -> ReadS DescribeElasticsearchDomain
ReadS [DescribeElasticsearchDomain]
(Int -> ReadS DescribeElasticsearchDomain)
-> ReadS [DescribeElasticsearchDomain]
-> ReadPrec DescribeElasticsearchDomain
-> ReadPrec [DescribeElasticsearchDomain]
-> Read DescribeElasticsearchDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeElasticsearchDomain]
$creadListPrec :: ReadPrec [DescribeElasticsearchDomain]
readPrec :: ReadPrec DescribeElasticsearchDomain
$creadPrec :: ReadPrec DescribeElasticsearchDomain
readList :: ReadS [DescribeElasticsearchDomain]
$creadList :: ReadS [DescribeElasticsearchDomain]
readsPrec :: Int -> ReadS DescribeElasticsearchDomain
$creadsPrec :: Int -> ReadS DescribeElasticsearchDomain
Prelude.Read, Int -> DescribeElasticsearchDomain -> ShowS
[DescribeElasticsearchDomain] -> ShowS
DescribeElasticsearchDomain -> String
(Int -> DescribeElasticsearchDomain -> ShowS)
-> (DescribeElasticsearchDomain -> String)
-> ([DescribeElasticsearchDomain] -> ShowS)
-> Show DescribeElasticsearchDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeElasticsearchDomain] -> ShowS
$cshowList :: [DescribeElasticsearchDomain] -> ShowS
show :: DescribeElasticsearchDomain -> String
$cshow :: DescribeElasticsearchDomain -> String
showsPrec :: Int -> DescribeElasticsearchDomain -> ShowS
$cshowsPrec :: Int -> DescribeElasticsearchDomain -> ShowS
Prelude.Show, (forall x.
DescribeElasticsearchDomain -> Rep DescribeElasticsearchDomain x)
-> (forall x.
Rep DescribeElasticsearchDomain x -> DescribeElasticsearchDomain)
-> Generic DescribeElasticsearchDomain
forall x.
Rep DescribeElasticsearchDomain x -> DescribeElasticsearchDomain
forall x.
DescribeElasticsearchDomain -> Rep DescribeElasticsearchDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeElasticsearchDomain x -> DescribeElasticsearchDomain
$cfrom :: forall x.
DescribeElasticsearchDomain -> Rep DescribeElasticsearchDomain x
Prelude.Generic)
newDescribeElasticsearchDomain ::
Prelude.Text ->
DescribeElasticsearchDomain
newDescribeElasticsearchDomain :: Text -> DescribeElasticsearchDomain
newDescribeElasticsearchDomain Text
pDomainName_ =
DescribeElasticsearchDomain' :: Text -> DescribeElasticsearchDomain
DescribeElasticsearchDomain'
{ $sel:domainName:DescribeElasticsearchDomain' :: Text
domainName =
Text
pDomainName_
}
describeElasticsearchDomain_domainName :: Lens.Lens' DescribeElasticsearchDomain Prelude.Text
describeElasticsearchDomain_domainName :: (Text -> f Text)
-> DescribeElasticsearchDomain -> f DescribeElasticsearchDomain
describeElasticsearchDomain_domainName = (DescribeElasticsearchDomain -> Text)
-> (DescribeElasticsearchDomain
-> Text -> DescribeElasticsearchDomain)
-> Lens
DescribeElasticsearchDomain DescribeElasticsearchDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeElasticsearchDomain' {Text
domainName :: Text
$sel:domainName:DescribeElasticsearchDomain' :: DescribeElasticsearchDomain -> Text
domainName} -> Text
domainName) (\s :: DescribeElasticsearchDomain
s@DescribeElasticsearchDomain' {} Text
a -> DescribeElasticsearchDomain
s {$sel:domainName:DescribeElasticsearchDomain' :: Text
domainName = Text
a} :: DescribeElasticsearchDomain)
instance Core.AWSRequest DescribeElasticsearchDomain where
type
AWSResponse DescribeElasticsearchDomain =
DescribeElasticsearchDomainResponse
request :: DescribeElasticsearchDomain -> Request DescribeElasticsearchDomain
request = Service
-> DescribeElasticsearchDomain
-> Request DescribeElasticsearchDomain
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeElasticsearchDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeElasticsearchDomain)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeElasticsearchDomain))
-> Logger
-> Service
-> Proxy DescribeElasticsearchDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeElasticsearchDomain)))
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 ->
Int
-> ElasticsearchDomainStatus -> DescribeElasticsearchDomainResponse
DescribeElasticsearchDomainResponse'
(Int
-> ElasticsearchDomainStatus
-> DescribeElasticsearchDomainResponse)
-> Either String Int
-> Either
String
(ElasticsearchDomainStatus -> DescribeElasticsearchDomainResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String
(ElasticsearchDomainStatus -> DescribeElasticsearchDomainResponse)
-> Either String ElasticsearchDomainStatus
-> Either String DescribeElasticsearchDomainResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ElasticsearchDomainStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DomainStatus")
)
instance Prelude.Hashable DescribeElasticsearchDomain
instance Prelude.NFData DescribeElasticsearchDomain
instance Core.ToHeaders DescribeElasticsearchDomain where
toHeaders :: DescribeElasticsearchDomain -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeElasticsearchDomain -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeElasticsearchDomain where
toPath :: DescribeElasticsearchDomain -> ByteString
toPath DescribeElasticsearchDomain' {Text
domainName :: Text
$sel:domainName:DescribeElasticsearchDomain' :: DescribeElasticsearchDomain -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2015-01-01/es/domain/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName]
instance Core.ToQuery DescribeElasticsearchDomain where
toQuery :: DescribeElasticsearchDomain -> QueryString
toQuery = QueryString -> DescribeElasticsearchDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeElasticsearchDomainResponse = DescribeElasticsearchDomainResponse'
{
DescribeElasticsearchDomainResponse -> Int
httpStatus :: Prelude.Int,
DescribeElasticsearchDomainResponse -> ElasticsearchDomainStatus
domainStatus :: ElasticsearchDomainStatus
}
deriving (DescribeElasticsearchDomainResponse
-> DescribeElasticsearchDomainResponse -> Bool
(DescribeElasticsearchDomainResponse
-> DescribeElasticsearchDomainResponse -> Bool)
-> (DescribeElasticsearchDomainResponse
-> DescribeElasticsearchDomainResponse -> Bool)
-> Eq DescribeElasticsearchDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeElasticsearchDomainResponse
-> DescribeElasticsearchDomainResponse -> Bool
$c/= :: DescribeElasticsearchDomainResponse
-> DescribeElasticsearchDomainResponse -> Bool
== :: DescribeElasticsearchDomainResponse
-> DescribeElasticsearchDomainResponse -> Bool
$c== :: DescribeElasticsearchDomainResponse
-> DescribeElasticsearchDomainResponse -> Bool
Prelude.Eq, ReadPrec [DescribeElasticsearchDomainResponse]
ReadPrec DescribeElasticsearchDomainResponse
Int -> ReadS DescribeElasticsearchDomainResponse
ReadS [DescribeElasticsearchDomainResponse]
(Int -> ReadS DescribeElasticsearchDomainResponse)
-> ReadS [DescribeElasticsearchDomainResponse]
-> ReadPrec DescribeElasticsearchDomainResponse
-> ReadPrec [DescribeElasticsearchDomainResponse]
-> Read DescribeElasticsearchDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeElasticsearchDomainResponse]
$creadListPrec :: ReadPrec [DescribeElasticsearchDomainResponse]
readPrec :: ReadPrec DescribeElasticsearchDomainResponse
$creadPrec :: ReadPrec DescribeElasticsearchDomainResponse
readList :: ReadS [DescribeElasticsearchDomainResponse]
$creadList :: ReadS [DescribeElasticsearchDomainResponse]
readsPrec :: Int -> ReadS DescribeElasticsearchDomainResponse
$creadsPrec :: Int -> ReadS DescribeElasticsearchDomainResponse
Prelude.Read, Int -> DescribeElasticsearchDomainResponse -> ShowS
[DescribeElasticsearchDomainResponse] -> ShowS
DescribeElasticsearchDomainResponse -> String
(Int -> DescribeElasticsearchDomainResponse -> ShowS)
-> (DescribeElasticsearchDomainResponse -> String)
-> ([DescribeElasticsearchDomainResponse] -> ShowS)
-> Show DescribeElasticsearchDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeElasticsearchDomainResponse] -> ShowS
$cshowList :: [DescribeElasticsearchDomainResponse] -> ShowS
show :: DescribeElasticsearchDomainResponse -> String
$cshow :: DescribeElasticsearchDomainResponse -> String
showsPrec :: Int -> DescribeElasticsearchDomainResponse -> ShowS
$cshowsPrec :: Int -> DescribeElasticsearchDomainResponse -> ShowS
Prelude.Show, (forall x.
DescribeElasticsearchDomainResponse
-> Rep DescribeElasticsearchDomainResponse x)
-> (forall x.
Rep DescribeElasticsearchDomainResponse x
-> DescribeElasticsearchDomainResponse)
-> Generic DescribeElasticsearchDomainResponse
forall x.
Rep DescribeElasticsearchDomainResponse x
-> DescribeElasticsearchDomainResponse
forall x.
DescribeElasticsearchDomainResponse
-> Rep DescribeElasticsearchDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeElasticsearchDomainResponse x
-> DescribeElasticsearchDomainResponse
$cfrom :: forall x.
DescribeElasticsearchDomainResponse
-> Rep DescribeElasticsearchDomainResponse x
Prelude.Generic)
newDescribeElasticsearchDomainResponse ::
Prelude.Int ->
ElasticsearchDomainStatus ->
DescribeElasticsearchDomainResponse
newDescribeElasticsearchDomainResponse :: Int
-> ElasticsearchDomainStatus -> DescribeElasticsearchDomainResponse
newDescribeElasticsearchDomainResponse
Int
pHttpStatus_
ElasticsearchDomainStatus
pDomainStatus_ =
DescribeElasticsearchDomainResponse' :: Int
-> ElasticsearchDomainStatus -> DescribeElasticsearchDomainResponse
DescribeElasticsearchDomainResponse'
{ $sel:httpStatus:DescribeElasticsearchDomainResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:domainStatus:DescribeElasticsearchDomainResponse' :: ElasticsearchDomainStatus
domainStatus = ElasticsearchDomainStatus
pDomainStatus_
}
describeElasticsearchDomainResponse_httpStatus :: Lens.Lens' DescribeElasticsearchDomainResponse Prelude.Int
describeElasticsearchDomainResponse_httpStatus :: (Int -> f Int)
-> DescribeElasticsearchDomainResponse
-> f DescribeElasticsearchDomainResponse
describeElasticsearchDomainResponse_httpStatus = (DescribeElasticsearchDomainResponse -> Int)
-> (DescribeElasticsearchDomainResponse
-> Int -> DescribeElasticsearchDomainResponse)
-> Lens
DescribeElasticsearchDomainResponse
DescribeElasticsearchDomainResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeElasticsearchDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeElasticsearchDomainResponse' :: DescribeElasticsearchDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeElasticsearchDomainResponse
s@DescribeElasticsearchDomainResponse' {} Int
a -> DescribeElasticsearchDomainResponse
s {$sel:httpStatus:DescribeElasticsearchDomainResponse' :: Int
httpStatus = Int
a} :: DescribeElasticsearchDomainResponse)
describeElasticsearchDomainResponse_domainStatus :: Lens.Lens' DescribeElasticsearchDomainResponse ElasticsearchDomainStatus
describeElasticsearchDomainResponse_domainStatus :: (ElasticsearchDomainStatus -> f ElasticsearchDomainStatus)
-> DescribeElasticsearchDomainResponse
-> f DescribeElasticsearchDomainResponse
describeElasticsearchDomainResponse_domainStatus = (DescribeElasticsearchDomainResponse -> ElasticsearchDomainStatus)
-> (DescribeElasticsearchDomainResponse
-> ElasticsearchDomainStatus
-> DescribeElasticsearchDomainResponse)
-> Lens
DescribeElasticsearchDomainResponse
DescribeElasticsearchDomainResponse
ElasticsearchDomainStatus
ElasticsearchDomainStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeElasticsearchDomainResponse' {ElasticsearchDomainStatus
domainStatus :: ElasticsearchDomainStatus
$sel:domainStatus:DescribeElasticsearchDomainResponse' :: DescribeElasticsearchDomainResponse -> ElasticsearchDomainStatus
domainStatus} -> ElasticsearchDomainStatus
domainStatus) (\s :: DescribeElasticsearchDomainResponse
s@DescribeElasticsearchDomainResponse' {} ElasticsearchDomainStatus
a -> DescribeElasticsearchDomainResponse
s {$sel:domainStatus:DescribeElasticsearchDomainResponse' :: ElasticsearchDomainStatus
domainStatus = ElasticsearchDomainStatus
a} :: DescribeElasticsearchDomainResponse)
instance
Prelude.NFData
DescribeElasticsearchDomainResponse