{-# 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.DeleteSuggester
(
DeleteSuggester (..),
newDeleteSuggester,
deleteSuggester_domainName,
deleteSuggester_suggesterName,
DeleteSuggesterResponse (..),
newDeleteSuggesterResponse,
deleteSuggesterResponse_httpStatus,
deleteSuggesterResponse_suggester,
)
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 DeleteSuggester = DeleteSuggester'
{ DeleteSuggester -> Text
domainName :: Prelude.Text,
DeleteSuggester -> Text
suggesterName :: Prelude.Text
}
deriving (DeleteSuggester -> DeleteSuggester -> Bool
(DeleteSuggester -> DeleteSuggester -> Bool)
-> (DeleteSuggester -> DeleteSuggester -> Bool)
-> Eq DeleteSuggester
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSuggester -> DeleteSuggester -> Bool
$c/= :: DeleteSuggester -> DeleteSuggester -> Bool
== :: DeleteSuggester -> DeleteSuggester -> Bool
$c== :: DeleteSuggester -> DeleteSuggester -> Bool
Prelude.Eq, ReadPrec [DeleteSuggester]
ReadPrec DeleteSuggester
Int -> ReadS DeleteSuggester
ReadS [DeleteSuggester]
(Int -> ReadS DeleteSuggester)
-> ReadS [DeleteSuggester]
-> ReadPrec DeleteSuggester
-> ReadPrec [DeleteSuggester]
-> Read DeleteSuggester
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSuggester]
$creadListPrec :: ReadPrec [DeleteSuggester]
readPrec :: ReadPrec DeleteSuggester
$creadPrec :: ReadPrec DeleteSuggester
readList :: ReadS [DeleteSuggester]
$creadList :: ReadS [DeleteSuggester]
readsPrec :: Int -> ReadS DeleteSuggester
$creadsPrec :: Int -> ReadS DeleteSuggester
Prelude.Read, Int -> DeleteSuggester -> ShowS
[DeleteSuggester] -> ShowS
DeleteSuggester -> String
(Int -> DeleteSuggester -> ShowS)
-> (DeleteSuggester -> String)
-> ([DeleteSuggester] -> ShowS)
-> Show DeleteSuggester
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSuggester] -> ShowS
$cshowList :: [DeleteSuggester] -> ShowS
show :: DeleteSuggester -> String
$cshow :: DeleteSuggester -> String
showsPrec :: Int -> DeleteSuggester -> ShowS
$cshowsPrec :: Int -> DeleteSuggester -> ShowS
Prelude.Show, (forall x. DeleteSuggester -> Rep DeleteSuggester x)
-> (forall x. Rep DeleteSuggester x -> DeleteSuggester)
-> Generic DeleteSuggester
forall x. Rep DeleteSuggester x -> DeleteSuggester
forall x. DeleteSuggester -> Rep DeleteSuggester x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSuggester x -> DeleteSuggester
$cfrom :: forall x. DeleteSuggester -> Rep DeleteSuggester x
Prelude.Generic)
newDeleteSuggester ::
Prelude.Text ->
Prelude.Text ->
DeleteSuggester
newDeleteSuggester :: Text -> Text -> DeleteSuggester
newDeleteSuggester Text
pDomainName_ Text
pSuggesterName_ =
DeleteSuggester' :: Text -> Text -> DeleteSuggester
DeleteSuggester'
{ $sel:domainName:DeleteSuggester' :: Text
domainName = Text
pDomainName_,
$sel:suggesterName:DeleteSuggester' :: Text
suggesterName = Text
pSuggesterName_
}
deleteSuggester_domainName :: Lens.Lens' DeleteSuggester Prelude.Text
deleteSuggester_domainName :: (Text -> f Text) -> DeleteSuggester -> f DeleteSuggester
deleteSuggester_domainName = (DeleteSuggester -> Text)
-> (DeleteSuggester -> Text -> DeleteSuggester)
-> Lens DeleteSuggester DeleteSuggester Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSuggester' {Text
domainName :: Text
$sel:domainName:DeleteSuggester' :: DeleteSuggester -> Text
domainName} -> Text
domainName) (\s :: DeleteSuggester
s@DeleteSuggester' {} Text
a -> DeleteSuggester
s {$sel:domainName:DeleteSuggester' :: Text
domainName = Text
a} :: DeleteSuggester)
deleteSuggester_suggesterName :: Lens.Lens' DeleteSuggester Prelude.Text
deleteSuggester_suggesterName :: (Text -> f Text) -> DeleteSuggester -> f DeleteSuggester
deleteSuggester_suggesterName = (DeleteSuggester -> Text)
-> (DeleteSuggester -> Text -> DeleteSuggester)
-> Lens DeleteSuggester DeleteSuggester Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSuggester' {Text
suggesterName :: Text
$sel:suggesterName:DeleteSuggester' :: DeleteSuggester -> Text
suggesterName} -> Text
suggesterName) (\s :: DeleteSuggester
s@DeleteSuggester' {} Text
a -> DeleteSuggester
s {$sel:suggesterName:DeleteSuggester' :: Text
suggesterName = Text
a} :: DeleteSuggester)
instance Core.AWSRequest DeleteSuggester where
type
AWSResponse DeleteSuggester =
DeleteSuggesterResponse
request :: DeleteSuggester -> Request DeleteSuggester
request = Service -> DeleteSuggester -> Request DeleteSuggester
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSuggester
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSuggester)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DeleteSuggester))
-> Logger
-> Service
-> Proxy DeleteSuggester
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSuggester)))
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
"DeleteSuggesterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> SuggesterStatus -> DeleteSuggesterResponse
DeleteSuggesterResponse'
(Int -> SuggesterStatus -> DeleteSuggesterResponse)
-> Either String Int
-> Either String (SuggesterStatus -> DeleteSuggesterResponse)
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 (SuggesterStatus -> DeleteSuggesterResponse)
-> Either String SuggesterStatus
-> Either String DeleteSuggesterResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String SuggesterStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Suggester")
)
instance Prelude.Hashable DeleteSuggester
instance Prelude.NFData DeleteSuggester
instance Core.ToHeaders DeleteSuggester where
toHeaders :: DeleteSuggester -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteSuggester -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteSuggester where
toPath :: DeleteSuggester -> ByteString
toPath = ByteString -> DeleteSuggester -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteSuggester where
toQuery :: DeleteSuggester -> QueryString
toQuery DeleteSuggester' {Text
suggesterName :: Text
domainName :: Text
$sel:suggesterName:DeleteSuggester' :: DeleteSuggester -> Text
$sel:domainName:DeleteSuggester' :: DeleteSuggester -> 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
"DeleteSuggester" :: 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
"SuggesterName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
suggesterName
]
data DeleteSuggesterResponse = DeleteSuggesterResponse'
{
DeleteSuggesterResponse -> Int
httpStatus :: Prelude.Int,
DeleteSuggesterResponse -> SuggesterStatus
suggester :: SuggesterStatus
}
deriving (DeleteSuggesterResponse -> DeleteSuggesterResponse -> Bool
(DeleteSuggesterResponse -> DeleteSuggesterResponse -> Bool)
-> (DeleteSuggesterResponse -> DeleteSuggesterResponse -> Bool)
-> Eq DeleteSuggesterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSuggesterResponse -> DeleteSuggesterResponse -> Bool
$c/= :: DeleteSuggesterResponse -> DeleteSuggesterResponse -> Bool
== :: DeleteSuggesterResponse -> DeleteSuggesterResponse -> Bool
$c== :: DeleteSuggesterResponse -> DeleteSuggesterResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSuggesterResponse]
ReadPrec DeleteSuggesterResponse
Int -> ReadS DeleteSuggesterResponse
ReadS [DeleteSuggesterResponse]
(Int -> ReadS DeleteSuggesterResponse)
-> ReadS [DeleteSuggesterResponse]
-> ReadPrec DeleteSuggesterResponse
-> ReadPrec [DeleteSuggesterResponse]
-> Read DeleteSuggesterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSuggesterResponse]
$creadListPrec :: ReadPrec [DeleteSuggesterResponse]
readPrec :: ReadPrec DeleteSuggesterResponse
$creadPrec :: ReadPrec DeleteSuggesterResponse
readList :: ReadS [DeleteSuggesterResponse]
$creadList :: ReadS [DeleteSuggesterResponse]
readsPrec :: Int -> ReadS DeleteSuggesterResponse
$creadsPrec :: Int -> ReadS DeleteSuggesterResponse
Prelude.Read, Int -> DeleteSuggesterResponse -> ShowS
[DeleteSuggesterResponse] -> ShowS
DeleteSuggesterResponse -> String
(Int -> DeleteSuggesterResponse -> ShowS)
-> (DeleteSuggesterResponse -> String)
-> ([DeleteSuggesterResponse] -> ShowS)
-> Show DeleteSuggesterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSuggesterResponse] -> ShowS
$cshowList :: [DeleteSuggesterResponse] -> ShowS
show :: DeleteSuggesterResponse -> String
$cshow :: DeleteSuggesterResponse -> String
showsPrec :: Int -> DeleteSuggesterResponse -> ShowS
$cshowsPrec :: Int -> DeleteSuggesterResponse -> ShowS
Prelude.Show, (forall x.
DeleteSuggesterResponse -> Rep DeleteSuggesterResponse x)
-> (forall x.
Rep DeleteSuggesterResponse x -> DeleteSuggesterResponse)
-> Generic DeleteSuggesterResponse
forall x. Rep DeleteSuggesterResponse x -> DeleteSuggesterResponse
forall x. DeleteSuggesterResponse -> Rep DeleteSuggesterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSuggesterResponse x -> DeleteSuggesterResponse
$cfrom :: forall x. DeleteSuggesterResponse -> Rep DeleteSuggesterResponse x
Prelude.Generic)
newDeleteSuggesterResponse ::
Prelude.Int ->
SuggesterStatus ->
DeleteSuggesterResponse
newDeleteSuggesterResponse :: Int -> SuggesterStatus -> DeleteSuggesterResponse
newDeleteSuggesterResponse Int
pHttpStatus_ SuggesterStatus
pSuggester_ =
DeleteSuggesterResponse' :: Int -> SuggesterStatus -> DeleteSuggesterResponse
DeleteSuggesterResponse'
{ $sel:httpStatus:DeleteSuggesterResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:suggester:DeleteSuggesterResponse' :: SuggesterStatus
suggester = SuggesterStatus
pSuggester_
}
deleteSuggesterResponse_httpStatus :: Lens.Lens' DeleteSuggesterResponse Prelude.Int
deleteSuggesterResponse_httpStatus :: (Int -> f Int)
-> DeleteSuggesterResponse -> f DeleteSuggesterResponse
deleteSuggesterResponse_httpStatus = (DeleteSuggesterResponse -> Int)
-> (DeleteSuggesterResponse -> Int -> DeleteSuggesterResponse)
-> Lens DeleteSuggesterResponse DeleteSuggesterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSuggesterResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSuggesterResponse' :: DeleteSuggesterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSuggesterResponse
s@DeleteSuggesterResponse' {} Int
a -> DeleteSuggesterResponse
s {$sel:httpStatus:DeleteSuggesterResponse' :: Int
httpStatus = Int
a} :: DeleteSuggesterResponse)
deleteSuggesterResponse_suggester :: Lens.Lens' DeleteSuggesterResponse SuggesterStatus
deleteSuggesterResponse_suggester :: (SuggesterStatus -> f SuggesterStatus)
-> DeleteSuggesterResponse -> f DeleteSuggesterResponse
deleteSuggesterResponse_suggester = (DeleteSuggesterResponse -> SuggesterStatus)
-> (DeleteSuggesterResponse
-> SuggesterStatus -> DeleteSuggesterResponse)
-> Lens
DeleteSuggesterResponse
DeleteSuggesterResponse
SuggesterStatus
SuggesterStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSuggesterResponse' {SuggesterStatus
suggester :: SuggesterStatus
$sel:suggester:DeleteSuggesterResponse' :: DeleteSuggesterResponse -> SuggesterStatus
suggester} -> SuggesterStatus
suggester) (\s :: DeleteSuggesterResponse
s@DeleteSuggesterResponse' {} SuggesterStatus
a -> DeleteSuggesterResponse
s {$sel:suggester:DeleteSuggesterResponse' :: SuggesterStatus
suggester = SuggesterStatus
a} :: DeleteSuggesterResponse)
instance Prelude.NFData DeleteSuggesterResponse