{-# 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.CloudSearch.DeleteExpression
(
DeleteExpression (..),
newDeleteExpression,
deleteExpression_domainName,
deleteExpression_expressionName,
DeleteExpressionResponse (..),
newDeleteExpressionResponse,
deleteExpressionResponse_httpStatus,
deleteExpressionResponse_expression,
)
where
import Amazonka.CloudSearch.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 DeleteExpression = DeleteExpression'
{ DeleteExpression -> Text
domainName :: Prelude.Text,
DeleteExpression -> Text
expressionName :: Prelude.Text
}
deriving (DeleteExpression -> DeleteExpression -> Bool
(DeleteExpression -> DeleteExpression -> Bool)
-> (DeleteExpression -> DeleteExpression -> Bool)
-> Eq DeleteExpression
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteExpression -> DeleteExpression -> Bool
$c/= :: DeleteExpression -> DeleteExpression -> Bool
== :: DeleteExpression -> DeleteExpression -> Bool
$c== :: DeleteExpression -> DeleteExpression -> Bool
Prelude.Eq, ReadPrec [DeleteExpression]
ReadPrec DeleteExpression
Int -> ReadS DeleteExpression
ReadS [DeleteExpression]
(Int -> ReadS DeleteExpression)
-> ReadS [DeleteExpression]
-> ReadPrec DeleteExpression
-> ReadPrec [DeleteExpression]
-> Read DeleteExpression
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteExpression]
$creadListPrec :: ReadPrec [DeleteExpression]
readPrec :: ReadPrec DeleteExpression
$creadPrec :: ReadPrec DeleteExpression
readList :: ReadS [DeleteExpression]
$creadList :: ReadS [DeleteExpression]
readsPrec :: Int -> ReadS DeleteExpression
$creadsPrec :: Int -> ReadS DeleteExpression
Prelude.Read, Int -> DeleteExpression -> ShowS
[DeleteExpression] -> ShowS
DeleteExpression -> String
(Int -> DeleteExpression -> ShowS)
-> (DeleteExpression -> String)
-> ([DeleteExpression] -> ShowS)
-> Show DeleteExpression
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteExpression] -> ShowS
$cshowList :: [DeleteExpression] -> ShowS
show :: DeleteExpression -> String
$cshow :: DeleteExpression -> String
showsPrec :: Int -> DeleteExpression -> ShowS
$cshowsPrec :: Int -> DeleteExpression -> ShowS
Prelude.Show, (forall x. DeleteExpression -> Rep DeleteExpression x)
-> (forall x. Rep DeleteExpression x -> DeleteExpression)
-> Generic DeleteExpression
forall x. Rep DeleteExpression x -> DeleteExpression
forall x. DeleteExpression -> Rep DeleteExpression x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteExpression x -> DeleteExpression
$cfrom :: forall x. DeleteExpression -> Rep DeleteExpression x
Prelude.Generic)
newDeleteExpression ::
Prelude.Text ->
Prelude.Text ->
DeleteExpression
newDeleteExpression :: Text -> Text -> DeleteExpression
newDeleteExpression Text
pDomainName_ Text
pExpressionName_ =
DeleteExpression' :: Text -> Text -> DeleteExpression
DeleteExpression'
{ $sel:domainName:DeleteExpression' :: Text
domainName = Text
pDomainName_,
$sel:expressionName:DeleteExpression' :: Text
expressionName = Text
pExpressionName_
}
deleteExpression_domainName :: Lens.Lens' DeleteExpression Prelude.Text
deleteExpression_domainName :: (Text -> f Text) -> DeleteExpression -> f DeleteExpression
deleteExpression_domainName = (DeleteExpression -> Text)
-> (DeleteExpression -> Text -> DeleteExpression)
-> Lens DeleteExpression DeleteExpression Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteExpression' {Text
domainName :: Text
$sel:domainName:DeleteExpression' :: DeleteExpression -> Text
domainName} -> Text
domainName) (\s :: DeleteExpression
s@DeleteExpression' {} Text
a -> DeleteExpression
s {$sel:domainName:DeleteExpression' :: Text
domainName = Text
a} :: DeleteExpression)
deleteExpression_expressionName :: Lens.Lens' DeleteExpression Prelude.Text
deleteExpression_expressionName :: (Text -> f Text) -> DeleteExpression -> f DeleteExpression
deleteExpression_expressionName = (DeleteExpression -> Text)
-> (DeleteExpression -> Text -> DeleteExpression)
-> Lens DeleteExpression DeleteExpression Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteExpression' {Text
expressionName :: Text
$sel:expressionName:DeleteExpression' :: DeleteExpression -> Text
expressionName} -> Text
expressionName) (\s :: DeleteExpression
s@DeleteExpression' {} Text
a -> DeleteExpression
s {$sel:expressionName:DeleteExpression' :: Text
expressionName = Text
a} :: DeleteExpression)
instance Core.AWSRequest DeleteExpression where
type
AWSResponse DeleteExpression =
DeleteExpressionResponse
request :: DeleteExpression -> Request DeleteExpression
request = Service -> DeleteExpression -> Request DeleteExpression
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteExpression
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteExpression)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteExpression))
-> Logger
-> Service
-> Proxy DeleteExpression
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteExpression)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DeleteExpressionResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> ExpressionStatus -> DeleteExpressionResponse
DeleteExpressionResponse'
(Int -> ExpressionStatus -> DeleteExpressionResponse)
-> Either String Int
-> Either String (ExpressionStatus -> DeleteExpressionResponse)
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 (ExpressionStatus -> DeleteExpressionResponse)
-> Either String ExpressionStatus
-> Either String DeleteExpressionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ExpressionStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Expression")
)
instance Prelude.Hashable DeleteExpression
instance Prelude.NFData DeleteExpression
instance Core.ToHeaders DeleteExpression where
toHeaders :: DeleteExpression -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteExpression -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteExpression where
toPath :: DeleteExpression -> ByteString
toPath = ByteString -> DeleteExpression -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteExpression where
toQuery :: DeleteExpression -> QueryString
toQuery DeleteExpression' {Text
expressionName :: Text
domainName :: Text
$sel:expressionName:DeleteExpression' :: DeleteExpression -> Text
$sel:domainName:DeleteExpression' :: DeleteExpression -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteExpression" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2013-01-01" :: Prelude.ByteString),
ByteString
"DomainName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domainName,
ByteString
"ExpressionName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
expressionName
]
data DeleteExpressionResponse = DeleteExpressionResponse'
{
DeleteExpressionResponse -> Int
httpStatus :: Prelude.Int,
DeleteExpressionResponse -> ExpressionStatus
expression :: ExpressionStatus
}
deriving (DeleteExpressionResponse -> DeleteExpressionResponse -> Bool
(DeleteExpressionResponse -> DeleteExpressionResponse -> Bool)
-> (DeleteExpressionResponse -> DeleteExpressionResponse -> Bool)
-> Eq DeleteExpressionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteExpressionResponse -> DeleteExpressionResponse -> Bool
$c/= :: DeleteExpressionResponse -> DeleteExpressionResponse -> Bool
== :: DeleteExpressionResponse -> DeleteExpressionResponse -> Bool
$c== :: DeleteExpressionResponse -> DeleteExpressionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteExpressionResponse]
ReadPrec DeleteExpressionResponse
Int -> ReadS DeleteExpressionResponse
ReadS [DeleteExpressionResponse]
(Int -> ReadS DeleteExpressionResponse)
-> ReadS [DeleteExpressionResponse]
-> ReadPrec DeleteExpressionResponse
-> ReadPrec [DeleteExpressionResponse]
-> Read DeleteExpressionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteExpressionResponse]
$creadListPrec :: ReadPrec [DeleteExpressionResponse]
readPrec :: ReadPrec DeleteExpressionResponse
$creadPrec :: ReadPrec DeleteExpressionResponse
readList :: ReadS [DeleteExpressionResponse]
$creadList :: ReadS [DeleteExpressionResponse]
readsPrec :: Int -> ReadS DeleteExpressionResponse
$creadsPrec :: Int -> ReadS DeleteExpressionResponse
Prelude.Read, Int -> DeleteExpressionResponse -> ShowS
[DeleteExpressionResponse] -> ShowS
DeleteExpressionResponse -> String
(Int -> DeleteExpressionResponse -> ShowS)
-> (DeleteExpressionResponse -> String)
-> ([DeleteExpressionResponse] -> ShowS)
-> Show DeleteExpressionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteExpressionResponse] -> ShowS
$cshowList :: [DeleteExpressionResponse] -> ShowS
show :: DeleteExpressionResponse -> String
$cshow :: DeleteExpressionResponse -> String
showsPrec :: Int -> DeleteExpressionResponse -> ShowS
$cshowsPrec :: Int -> DeleteExpressionResponse -> ShowS
Prelude.Show, (forall x.
DeleteExpressionResponse -> Rep DeleteExpressionResponse x)
-> (forall x.
Rep DeleteExpressionResponse x -> DeleteExpressionResponse)
-> Generic DeleteExpressionResponse
forall x.
Rep DeleteExpressionResponse x -> DeleteExpressionResponse
forall x.
DeleteExpressionResponse -> Rep DeleteExpressionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteExpressionResponse x -> DeleteExpressionResponse
$cfrom :: forall x.
DeleteExpressionResponse -> Rep DeleteExpressionResponse x
Prelude.Generic)
newDeleteExpressionResponse ::
Prelude.Int ->
ExpressionStatus ->
DeleteExpressionResponse
newDeleteExpressionResponse :: Int -> ExpressionStatus -> DeleteExpressionResponse
newDeleteExpressionResponse Int
pHttpStatus_ ExpressionStatus
pExpression_ =
DeleteExpressionResponse' :: Int -> ExpressionStatus -> DeleteExpressionResponse
DeleteExpressionResponse'
{ $sel:httpStatus:DeleteExpressionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:expression:DeleteExpressionResponse' :: ExpressionStatus
expression = ExpressionStatus
pExpression_
}
deleteExpressionResponse_httpStatus :: Lens.Lens' DeleteExpressionResponse Prelude.Int
deleteExpressionResponse_httpStatus :: (Int -> f Int)
-> DeleteExpressionResponse -> f DeleteExpressionResponse
deleteExpressionResponse_httpStatus = (DeleteExpressionResponse -> Int)
-> (DeleteExpressionResponse -> Int -> DeleteExpressionResponse)
-> Lens DeleteExpressionResponse DeleteExpressionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteExpressionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteExpressionResponse' :: DeleteExpressionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteExpressionResponse
s@DeleteExpressionResponse' {} Int
a -> DeleteExpressionResponse
s {$sel:httpStatus:DeleteExpressionResponse' :: Int
httpStatus = Int
a} :: DeleteExpressionResponse)
deleteExpressionResponse_expression :: Lens.Lens' DeleteExpressionResponse ExpressionStatus
deleteExpressionResponse_expression :: (ExpressionStatus -> f ExpressionStatus)
-> DeleteExpressionResponse -> f DeleteExpressionResponse
deleteExpressionResponse_expression = (DeleteExpressionResponse -> ExpressionStatus)
-> (DeleteExpressionResponse
-> ExpressionStatus -> DeleteExpressionResponse)
-> Lens
DeleteExpressionResponse
DeleteExpressionResponse
ExpressionStatus
ExpressionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteExpressionResponse' {ExpressionStatus
expression :: ExpressionStatus
$sel:expression:DeleteExpressionResponse' :: DeleteExpressionResponse -> ExpressionStatus
expression} -> ExpressionStatus
expression) (\s :: DeleteExpressionResponse
s@DeleteExpressionResponse' {} ExpressionStatus
a -> DeleteExpressionResponse
s {$sel:expression:DeleteExpressionResponse' :: ExpressionStatus
expression = ExpressionStatus
a} :: DeleteExpressionResponse)
instance Prelude.NFData DeleteExpressionResponse