{-# 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.DeleteElasticsearchDomain
(
DeleteElasticsearchDomain (..),
newDeleteElasticsearchDomain,
deleteElasticsearchDomain_domainName,
DeleteElasticsearchDomainResponse (..),
newDeleteElasticsearchDomainResponse,
deleteElasticsearchDomainResponse_domainStatus,
deleteElasticsearchDomainResponse_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 DeleteElasticsearchDomain = DeleteElasticsearchDomain'
{
DeleteElasticsearchDomain -> Text
domainName :: Prelude.Text
}
deriving (DeleteElasticsearchDomain -> DeleteElasticsearchDomain -> Bool
(DeleteElasticsearchDomain -> DeleteElasticsearchDomain -> Bool)
-> (DeleteElasticsearchDomain -> DeleteElasticsearchDomain -> Bool)
-> Eq DeleteElasticsearchDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteElasticsearchDomain -> DeleteElasticsearchDomain -> Bool
$c/= :: DeleteElasticsearchDomain -> DeleteElasticsearchDomain -> Bool
== :: DeleteElasticsearchDomain -> DeleteElasticsearchDomain -> Bool
$c== :: DeleteElasticsearchDomain -> DeleteElasticsearchDomain -> Bool
Prelude.Eq, ReadPrec [DeleteElasticsearchDomain]
ReadPrec DeleteElasticsearchDomain
Int -> ReadS DeleteElasticsearchDomain
ReadS [DeleteElasticsearchDomain]
(Int -> ReadS DeleteElasticsearchDomain)
-> ReadS [DeleteElasticsearchDomain]
-> ReadPrec DeleteElasticsearchDomain
-> ReadPrec [DeleteElasticsearchDomain]
-> Read DeleteElasticsearchDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteElasticsearchDomain]
$creadListPrec :: ReadPrec [DeleteElasticsearchDomain]
readPrec :: ReadPrec DeleteElasticsearchDomain
$creadPrec :: ReadPrec DeleteElasticsearchDomain
readList :: ReadS [DeleteElasticsearchDomain]
$creadList :: ReadS [DeleteElasticsearchDomain]
readsPrec :: Int -> ReadS DeleteElasticsearchDomain
$creadsPrec :: Int -> ReadS DeleteElasticsearchDomain
Prelude.Read, Int -> DeleteElasticsearchDomain -> ShowS
[DeleteElasticsearchDomain] -> ShowS
DeleteElasticsearchDomain -> String
(Int -> DeleteElasticsearchDomain -> ShowS)
-> (DeleteElasticsearchDomain -> String)
-> ([DeleteElasticsearchDomain] -> ShowS)
-> Show DeleteElasticsearchDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteElasticsearchDomain] -> ShowS
$cshowList :: [DeleteElasticsearchDomain] -> ShowS
show :: DeleteElasticsearchDomain -> String
$cshow :: DeleteElasticsearchDomain -> String
showsPrec :: Int -> DeleteElasticsearchDomain -> ShowS
$cshowsPrec :: Int -> DeleteElasticsearchDomain -> ShowS
Prelude.Show, (forall x.
DeleteElasticsearchDomain -> Rep DeleteElasticsearchDomain x)
-> (forall x.
Rep DeleteElasticsearchDomain x -> DeleteElasticsearchDomain)
-> Generic DeleteElasticsearchDomain
forall x.
Rep DeleteElasticsearchDomain x -> DeleteElasticsearchDomain
forall x.
DeleteElasticsearchDomain -> Rep DeleteElasticsearchDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteElasticsearchDomain x -> DeleteElasticsearchDomain
$cfrom :: forall x.
DeleteElasticsearchDomain -> Rep DeleteElasticsearchDomain x
Prelude.Generic)
newDeleteElasticsearchDomain ::
Prelude.Text ->
DeleteElasticsearchDomain
newDeleteElasticsearchDomain :: Text -> DeleteElasticsearchDomain
newDeleteElasticsearchDomain Text
pDomainName_ =
DeleteElasticsearchDomain' :: Text -> DeleteElasticsearchDomain
DeleteElasticsearchDomain'
{ $sel:domainName:DeleteElasticsearchDomain' :: Text
domainName =
Text
pDomainName_
}
deleteElasticsearchDomain_domainName :: Lens.Lens' DeleteElasticsearchDomain Prelude.Text
deleteElasticsearchDomain_domainName :: (Text -> f Text)
-> DeleteElasticsearchDomain -> f DeleteElasticsearchDomain
deleteElasticsearchDomain_domainName = (DeleteElasticsearchDomain -> Text)
-> (DeleteElasticsearchDomain -> Text -> DeleteElasticsearchDomain)
-> Lens
DeleteElasticsearchDomain DeleteElasticsearchDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteElasticsearchDomain' {Text
domainName :: Text
$sel:domainName:DeleteElasticsearchDomain' :: DeleteElasticsearchDomain -> Text
domainName} -> Text
domainName) (\s :: DeleteElasticsearchDomain
s@DeleteElasticsearchDomain' {} Text
a -> DeleteElasticsearchDomain
s {$sel:domainName:DeleteElasticsearchDomain' :: Text
domainName = Text
a} :: DeleteElasticsearchDomain)
instance Core.AWSRequest DeleteElasticsearchDomain where
type
AWSResponse DeleteElasticsearchDomain =
DeleteElasticsearchDomainResponse
request :: DeleteElasticsearchDomain -> Request DeleteElasticsearchDomain
request = Service
-> DeleteElasticsearchDomain -> Request DeleteElasticsearchDomain
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteElasticsearchDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteElasticsearchDomain)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteElasticsearchDomain))
-> Logger
-> Service
-> Proxy DeleteElasticsearchDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteElasticsearchDomain)))
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 ElasticsearchDomainStatus
-> Int -> DeleteElasticsearchDomainResponse
DeleteElasticsearchDomainResponse'
(Maybe ElasticsearchDomainStatus
-> Int -> DeleteElasticsearchDomainResponse)
-> Either String (Maybe ElasticsearchDomainStatus)
-> Either String (Int -> DeleteElasticsearchDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ElasticsearchDomainStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DomainStatus")
Either String (Int -> DeleteElasticsearchDomainResponse)
-> Either String Int
-> Either String DeleteElasticsearchDomainResponse
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 DeleteElasticsearchDomain
instance Prelude.NFData DeleteElasticsearchDomain
instance Core.ToHeaders DeleteElasticsearchDomain where
toHeaders :: DeleteElasticsearchDomain -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteElasticsearchDomain -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteElasticsearchDomain where
toPath :: DeleteElasticsearchDomain -> ByteString
toPath DeleteElasticsearchDomain' {Text
domainName :: Text
$sel:domainName:DeleteElasticsearchDomain' :: DeleteElasticsearchDomain -> 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 DeleteElasticsearchDomain where
toQuery :: DeleteElasticsearchDomain -> QueryString
toQuery = QueryString -> DeleteElasticsearchDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteElasticsearchDomainResponse = DeleteElasticsearchDomainResponse'
{
DeleteElasticsearchDomainResponse
-> Maybe ElasticsearchDomainStatus
domainStatus :: Prelude.Maybe ElasticsearchDomainStatus,
DeleteElasticsearchDomainResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteElasticsearchDomainResponse
-> DeleteElasticsearchDomainResponse -> Bool
(DeleteElasticsearchDomainResponse
-> DeleteElasticsearchDomainResponse -> Bool)
-> (DeleteElasticsearchDomainResponse
-> DeleteElasticsearchDomainResponse -> Bool)
-> Eq DeleteElasticsearchDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteElasticsearchDomainResponse
-> DeleteElasticsearchDomainResponse -> Bool
$c/= :: DeleteElasticsearchDomainResponse
-> DeleteElasticsearchDomainResponse -> Bool
== :: DeleteElasticsearchDomainResponse
-> DeleteElasticsearchDomainResponse -> Bool
$c== :: DeleteElasticsearchDomainResponse
-> DeleteElasticsearchDomainResponse -> Bool
Prelude.Eq, ReadPrec [DeleteElasticsearchDomainResponse]
ReadPrec DeleteElasticsearchDomainResponse
Int -> ReadS DeleteElasticsearchDomainResponse
ReadS [DeleteElasticsearchDomainResponse]
(Int -> ReadS DeleteElasticsearchDomainResponse)
-> ReadS [DeleteElasticsearchDomainResponse]
-> ReadPrec DeleteElasticsearchDomainResponse
-> ReadPrec [DeleteElasticsearchDomainResponse]
-> Read DeleteElasticsearchDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteElasticsearchDomainResponse]
$creadListPrec :: ReadPrec [DeleteElasticsearchDomainResponse]
readPrec :: ReadPrec DeleteElasticsearchDomainResponse
$creadPrec :: ReadPrec DeleteElasticsearchDomainResponse
readList :: ReadS [DeleteElasticsearchDomainResponse]
$creadList :: ReadS [DeleteElasticsearchDomainResponse]
readsPrec :: Int -> ReadS DeleteElasticsearchDomainResponse
$creadsPrec :: Int -> ReadS DeleteElasticsearchDomainResponse
Prelude.Read, Int -> DeleteElasticsearchDomainResponse -> ShowS
[DeleteElasticsearchDomainResponse] -> ShowS
DeleteElasticsearchDomainResponse -> String
(Int -> DeleteElasticsearchDomainResponse -> ShowS)
-> (DeleteElasticsearchDomainResponse -> String)
-> ([DeleteElasticsearchDomainResponse] -> ShowS)
-> Show DeleteElasticsearchDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteElasticsearchDomainResponse] -> ShowS
$cshowList :: [DeleteElasticsearchDomainResponse] -> ShowS
show :: DeleteElasticsearchDomainResponse -> String
$cshow :: DeleteElasticsearchDomainResponse -> String
showsPrec :: Int -> DeleteElasticsearchDomainResponse -> ShowS
$cshowsPrec :: Int -> DeleteElasticsearchDomainResponse -> ShowS
Prelude.Show, (forall x.
DeleteElasticsearchDomainResponse
-> Rep DeleteElasticsearchDomainResponse x)
-> (forall x.
Rep DeleteElasticsearchDomainResponse x
-> DeleteElasticsearchDomainResponse)
-> Generic DeleteElasticsearchDomainResponse
forall x.
Rep DeleteElasticsearchDomainResponse x
-> DeleteElasticsearchDomainResponse
forall x.
DeleteElasticsearchDomainResponse
-> Rep DeleteElasticsearchDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteElasticsearchDomainResponse x
-> DeleteElasticsearchDomainResponse
$cfrom :: forall x.
DeleteElasticsearchDomainResponse
-> Rep DeleteElasticsearchDomainResponse x
Prelude.Generic)
newDeleteElasticsearchDomainResponse ::
Prelude.Int ->
DeleteElasticsearchDomainResponse
newDeleteElasticsearchDomainResponse :: Int -> DeleteElasticsearchDomainResponse
newDeleteElasticsearchDomainResponse Int
pHttpStatus_ =
DeleteElasticsearchDomainResponse' :: Maybe ElasticsearchDomainStatus
-> Int -> DeleteElasticsearchDomainResponse
DeleteElasticsearchDomainResponse'
{ $sel:domainStatus:DeleteElasticsearchDomainResponse' :: Maybe ElasticsearchDomainStatus
domainStatus =
Maybe ElasticsearchDomainStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteElasticsearchDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteElasticsearchDomainResponse_domainStatus :: Lens.Lens' DeleteElasticsearchDomainResponse (Prelude.Maybe ElasticsearchDomainStatus)
deleteElasticsearchDomainResponse_domainStatus :: (Maybe ElasticsearchDomainStatus
-> f (Maybe ElasticsearchDomainStatus))
-> DeleteElasticsearchDomainResponse
-> f DeleteElasticsearchDomainResponse
deleteElasticsearchDomainResponse_domainStatus = (DeleteElasticsearchDomainResponse
-> Maybe ElasticsearchDomainStatus)
-> (DeleteElasticsearchDomainResponse
-> Maybe ElasticsearchDomainStatus
-> DeleteElasticsearchDomainResponse)
-> Lens
DeleteElasticsearchDomainResponse
DeleteElasticsearchDomainResponse
(Maybe ElasticsearchDomainStatus)
(Maybe ElasticsearchDomainStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteElasticsearchDomainResponse' {Maybe ElasticsearchDomainStatus
domainStatus :: Maybe ElasticsearchDomainStatus
$sel:domainStatus:DeleteElasticsearchDomainResponse' :: DeleteElasticsearchDomainResponse
-> Maybe ElasticsearchDomainStatus
domainStatus} -> Maybe ElasticsearchDomainStatus
domainStatus) (\s :: DeleteElasticsearchDomainResponse
s@DeleteElasticsearchDomainResponse' {} Maybe ElasticsearchDomainStatus
a -> DeleteElasticsearchDomainResponse
s {$sel:domainStatus:DeleteElasticsearchDomainResponse' :: Maybe ElasticsearchDomainStatus
domainStatus = Maybe ElasticsearchDomainStatus
a} :: DeleteElasticsearchDomainResponse)
deleteElasticsearchDomainResponse_httpStatus :: Lens.Lens' DeleteElasticsearchDomainResponse Prelude.Int
deleteElasticsearchDomainResponse_httpStatus :: (Int -> f Int)
-> DeleteElasticsearchDomainResponse
-> f DeleteElasticsearchDomainResponse
deleteElasticsearchDomainResponse_httpStatus = (DeleteElasticsearchDomainResponse -> Int)
-> (DeleteElasticsearchDomainResponse
-> Int -> DeleteElasticsearchDomainResponse)
-> Lens
DeleteElasticsearchDomainResponse
DeleteElasticsearchDomainResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteElasticsearchDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteElasticsearchDomainResponse' :: DeleteElasticsearchDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteElasticsearchDomainResponse
s@DeleteElasticsearchDomainResponse' {} Int
a -> DeleteElasticsearchDomainResponse
s {$sel:httpStatus:DeleteElasticsearchDomainResponse' :: Int
httpStatus = Int
a} :: DeleteElasticsearchDomainResponse)
instance
Prelude.NFData
DeleteElasticsearchDomainResponse