{-# 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.Wisdom.DeleteKnowledgeBase
(
DeleteKnowledgeBase (..),
newDeleteKnowledgeBase,
deleteKnowledgeBase_knowledgeBaseId,
DeleteKnowledgeBaseResponse (..),
newDeleteKnowledgeBaseResponse,
deleteKnowledgeBaseResponse_httpStatus,
)
where
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
import Amazonka.Wisdom.Types
data DeleteKnowledgeBase = DeleteKnowledgeBase'
{
DeleteKnowledgeBase -> Text
knowledgeBaseId :: Prelude.Text
}
deriving (DeleteKnowledgeBase -> DeleteKnowledgeBase -> Bool
(DeleteKnowledgeBase -> DeleteKnowledgeBase -> Bool)
-> (DeleteKnowledgeBase -> DeleteKnowledgeBase -> Bool)
-> Eq DeleteKnowledgeBase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteKnowledgeBase -> DeleteKnowledgeBase -> Bool
$c/= :: DeleteKnowledgeBase -> DeleteKnowledgeBase -> Bool
== :: DeleteKnowledgeBase -> DeleteKnowledgeBase -> Bool
$c== :: DeleteKnowledgeBase -> DeleteKnowledgeBase -> Bool
Prelude.Eq, ReadPrec [DeleteKnowledgeBase]
ReadPrec DeleteKnowledgeBase
Int -> ReadS DeleteKnowledgeBase
ReadS [DeleteKnowledgeBase]
(Int -> ReadS DeleteKnowledgeBase)
-> ReadS [DeleteKnowledgeBase]
-> ReadPrec DeleteKnowledgeBase
-> ReadPrec [DeleteKnowledgeBase]
-> Read DeleteKnowledgeBase
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteKnowledgeBase]
$creadListPrec :: ReadPrec [DeleteKnowledgeBase]
readPrec :: ReadPrec DeleteKnowledgeBase
$creadPrec :: ReadPrec DeleteKnowledgeBase
readList :: ReadS [DeleteKnowledgeBase]
$creadList :: ReadS [DeleteKnowledgeBase]
readsPrec :: Int -> ReadS DeleteKnowledgeBase
$creadsPrec :: Int -> ReadS DeleteKnowledgeBase
Prelude.Read, Int -> DeleteKnowledgeBase -> ShowS
[DeleteKnowledgeBase] -> ShowS
DeleteKnowledgeBase -> String
(Int -> DeleteKnowledgeBase -> ShowS)
-> (DeleteKnowledgeBase -> String)
-> ([DeleteKnowledgeBase] -> ShowS)
-> Show DeleteKnowledgeBase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteKnowledgeBase] -> ShowS
$cshowList :: [DeleteKnowledgeBase] -> ShowS
show :: DeleteKnowledgeBase -> String
$cshow :: DeleteKnowledgeBase -> String
showsPrec :: Int -> DeleteKnowledgeBase -> ShowS
$cshowsPrec :: Int -> DeleteKnowledgeBase -> ShowS
Prelude.Show, (forall x. DeleteKnowledgeBase -> Rep DeleteKnowledgeBase x)
-> (forall x. Rep DeleteKnowledgeBase x -> DeleteKnowledgeBase)
-> Generic DeleteKnowledgeBase
forall x. Rep DeleteKnowledgeBase x -> DeleteKnowledgeBase
forall x. DeleteKnowledgeBase -> Rep DeleteKnowledgeBase x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteKnowledgeBase x -> DeleteKnowledgeBase
$cfrom :: forall x. DeleteKnowledgeBase -> Rep DeleteKnowledgeBase x
Prelude.Generic)
newDeleteKnowledgeBase ::
Prelude.Text ->
DeleteKnowledgeBase
newDeleteKnowledgeBase :: Text -> DeleteKnowledgeBase
newDeleteKnowledgeBase Text
pKnowledgeBaseId_ =
DeleteKnowledgeBase' :: Text -> DeleteKnowledgeBase
DeleteKnowledgeBase'
{ $sel:knowledgeBaseId:DeleteKnowledgeBase' :: Text
knowledgeBaseId =
Text
pKnowledgeBaseId_
}
deleteKnowledgeBase_knowledgeBaseId :: Lens.Lens' DeleteKnowledgeBase Prelude.Text
deleteKnowledgeBase_knowledgeBaseId :: (Text -> f Text) -> DeleteKnowledgeBase -> f DeleteKnowledgeBase
deleteKnowledgeBase_knowledgeBaseId = (DeleteKnowledgeBase -> Text)
-> (DeleteKnowledgeBase -> Text -> DeleteKnowledgeBase)
-> Lens DeleteKnowledgeBase DeleteKnowledgeBase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteKnowledgeBase' {Text
knowledgeBaseId :: Text
$sel:knowledgeBaseId:DeleteKnowledgeBase' :: DeleteKnowledgeBase -> Text
knowledgeBaseId} -> Text
knowledgeBaseId) (\s :: DeleteKnowledgeBase
s@DeleteKnowledgeBase' {} Text
a -> DeleteKnowledgeBase
s {$sel:knowledgeBaseId:DeleteKnowledgeBase' :: Text
knowledgeBaseId = Text
a} :: DeleteKnowledgeBase)
instance Core.AWSRequest DeleteKnowledgeBase where
type
AWSResponse DeleteKnowledgeBase =
DeleteKnowledgeBaseResponse
request :: DeleteKnowledgeBase -> Request DeleteKnowledgeBase
request = Service -> DeleteKnowledgeBase -> Request DeleteKnowledgeBase
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteKnowledgeBase
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteKnowledgeBase)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteKnowledgeBase))
-> Logger
-> Service
-> Proxy DeleteKnowledgeBase
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteKnowledgeBase)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteKnowledgeBaseResponse
DeleteKnowledgeBaseResponse'
(Int -> DeleteKnowledgeBaseResponse)
-> Either String Int -> Either String DeleteKnowledgeBaseResponse
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))
)
instance Prelude.Hashable DeleteKnowledgeBase
instance Prelude.NFData DeleteKnowledgeBase
instance Core.ToHeaders DeleteKnowledgeBase where
toHeaders :: DeleteKnowledgeBase -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteKnowledgeBase -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteKnowledgeBase where
toPath :: DeleteKnowledgeBase -> ByteString
toPath DeleteKnowledgeBase' {Text
knowledgeBaseId :: Text
$sel:knowledgeBaseId:DeleteKnowledgeBase' :: DeleteKnowledgeBase -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/knowledgeBases/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
knowledgeBaseId]
instance Core.ToQuery DeleteKnowledgeBase where
toQuery :: DeleteKnowledgeBase -> QueryString
toQuery = QueryString -> DeleteKnowledgeBase -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteKnowledgeBaseResponse = DeleteKnowledgeBaseResponse'
{
DeleteKnowledgeBaseResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteKnowledgeBaseResponse -> DeleteKnowledgeBaseResponse -> Bool
(DeleteKnowledgeBaseResponse
-> DeleteKnowledgeBaseResponse -> Bool)
-> (DeleteKnowledgeBaseResponse
-> DeleteKnowledgeBaseResponse -> Bool)
-> Eq DeleteKnowledgeBaseResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteKnowledgeBaseResponse -> DeleteKnowledgeBaseResponse -> Bool
$c/= :: DeleteKnowledgeBaseResponse -> DeleteKnowledgeBaseResponse -> Bool
== :: DeleteKnowledgeBaseResponse -> DeleteKnowledgeBaseResponse -> Bool
$c== :: DeleteKnowledgeBaseResponse -> DeleteKnowledgeBaseResponse -> Bool
Prelude.Eq, ReadPrec [DeleteKnowledgeBaseResponse]
ReadPrec DeleteKnowledgeBaseResponse
Int -> ReadS DeleteKnowledgeBaseResponse
ReadS [DeleteKnowledgeBaseResponse]
(Int -> ReadS DeleteKnowledgeBaseResponse)
-> ReadS [DeleteKnowledgeBaseResponse]
-> ReadPrec DeleteKnowledgeBaseResponse
-> ReadPrec [DeleteKnowledgeBaseResponse]
-> Read DeleteKnowledgeBaseResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteKnowledgeBaseResponse]
$creadListPrec :: ReadPrec [DeleteKnowledgeBaseResponse]
readPrec :: ReadPrec DeleteKnowledgeBaseResponse
$creadPrec :: ReadPrec DeleteKnowledgeBaseResponse
readList :: ReadS [DeleteKnowledgeBaseResponse]
$creadList :: ReadS [DeleteKnowledgeBaseResponse]
readsPrec :: Int -> ReadS DeleteKnowledgeBaseResponse
$creadsPrec :: Int -> ReadS DeleteKnowledgeBaseResponse
Prelude.Read, Int -> DeleteKnowledgeBaseResponse -> ShowS
[DeleteKnowledgeBaseResponse] -> ShowS
DeleteKnowledgeBaseResponse -> String
(Int -> DeleteKnowledgeBaseResponse -> ShowS)
-> (DeleteKnowledgeBaseResponse -> String)
-> ([DeleteKnowledgeBaseResponse] -> ShowS)
-> Show DeleteKnowledgeBaseResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteKnowledgeBaseResponse] -> ShowS
$cshowList :: [DeleteKnowledgeBaseResponse] -> ShowS
show :: DeleteKnowledgeBaseResponse -> String
$cshow :: DeleteKnowledgeBaseResponse -> String
showsPrec :: Int -> DeleteKnowledgeBaseResponse -> ShowS
$cshowsPrec :: Int -> DeleteKnowledgeBaseResponse -> ShowS
Prelude.Show, (forall x.
DeleteKnowledgeBaseResponse -> Rep DeleteKnowledgeBaseResponse x)
-> (forall x.
Rep DeleteKnowledgeBaseResponse x -> DeleteKnowledgeBaseResponse)
-> Generic DeleteKnowledgeBaseResponse
forall x.
Rep DeleteKnowledgeBaseResponse x -> DeleteKnowledgeBaseResponse
forall x.
DeleteKnowledgeBaseResponse -> Rep DeleteKnowledgeBaseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteKnowledgeBaseResponse x -> DeleteKnowledgeBaseResponse
$cfrom :: forall x.
DeleteKnowledgeBaseResponse -> Rep DeleteKnowledgeBaseResponse x
Prelude.Generic)
newDeleteKnowledgeBaseResponse ::
Prelude.Int ->
DeleteKnowledgeBaseResponse
newDeleteKnowledgeBaseResponse :: Int -> DeleteKnowledgeBaseResponse
newDeleteKnowledgeBaseResponse Int
pHttpStatus_ =
DeleteKnowledgeBaseResponse' :: Int -> DeleteKnowledgeBaseResponse
DeleteKnowledgeBaseResponse'
{ $sel:httpStatus:DeleteKnowledgeBaseResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteKnowledgeBaseResponse_httpStatus :: Lens.Lens' DeleteKnowledgeBaseResponse Prelude.Int
deleteKnowledgeBaseResponse_httpStatus :: (Int -> f Int)
-> DeleteKnowledgeBaseResponse -> f DeleteKnowledgeBaseResponse
deleteKnowledgeBaseResponse_httpStatus = (DeleteKnowledgeBaseResponse -> Int)
-> (DeleteKnowledgeBaseResponse
-> Int -> DeleteKnowledgeBaseResponse)
-> Lens
DeleteKnowledgeBaseResponse DeleteKnowledgeBaseResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteKnowledgeBaseResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteKnowledgeBaseResponse' :: DeleteKnowledgeBaseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteKnowledgeBaseResponse
s@DeleteKnowledgeBaseResponse' {} Int
a -> DeleteKnowledgeBaseResponse
s {$sel:httpStatus:DeleteKnowledgeBaseResponse' :: Int
httpStatus = Int
a} :: DeleteKnowledgeBaseResponse)
instance Prelude.NFData DeleteKnowledgeBaseResponse