{-# 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.DeleteAssistant
(
DeleteAssistant (..),
newDeleteAssistant,
deleteAssistant_assistantId,
DeleteAssistantResponse (..),
newDeleteAssistantResponse,
deleteAssistantResponse_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 DeleteAssistant = DeleteAssistant'
{
DeleteAssistant -> Text
assistantId :: Prelude.Text
}
deriving (DeleteAssistant -> DeleteAssistant -> Bool
(DeleteAssistant -> DeleteAssistant -> Bool)
-> (DeleteAssistant -> DeleteAssistant -> Bool)
-> Eq DeleteAssistant
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssistant -> DeleteAssistant -> Bool
$c/= :: DeleteAssistant -> DeleteAssistant -> Bool
== :: DeleteAssistant -> DeleteAssistant -> Bool
$c== :: DeleteAssistant -> DeleteAssistant -> Bool
Prelude.Eq, ReadPrec [DeleteAssistant]
ReadPrec DeleteAssistant
Int -> ReadS DeleteAssistant
ReadS [DeleteAssistant]
(Int -> ReadS DeleteAssistant)
-> ReadS [DeleteAssistant]
-> ReadPrec DeleteAssistant
-> ReadPrec [DeleteAssistant]
-> Read DeleteAssistant
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssistant]
$creadListPrec :: ReadPrec [DeleteAssistant]
readPrec :: ReadPrec DeleteAssistant
$creadPrec :: ReadPrec DeleteAssistant
readList :: ReadS [DeleteAssistant]
$creadList :: ReadS [DeleteAssistant]
readsPrec :: Int -> ReadS DeleteAssistant
$creadsPrec :: Int -> ReadS DeleteAssistant
Prelude.Read, Int -> DeleteAssistant -> ShowS
[DeleteAssistant] -> ShowS
DeleteAssistant -> String
(Int -> DeleteAssistant -> ShowS)
-> (DeleteAssistant -> String)
-> ([DeleteAssistant] -> ShowS)
-> Show DeleteAssistant
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssistant] -> ShowS
$cshowList :: [DeleteAssistant] -> ShowS
show :: DeleteAssistant -> String
$cshow :: DeleteAssistant -> String
showsPrec :: Int -> DeleteAssistant -> ShowS
$cshowsPrec :: Int -> DeleteAssistant -> ShowS
Prelude.Show, (forall x. DeleteAssistant -> Rep DeleteAssistant x)
-> (forall x. Rep DeleteAssistant x -> DeleteAssistant)
-> Generic DeleteAssistant
forall x. Rep DeleteAssistant x -> DeleteAssistant
forall x. DeleteAssistant -> Rep DeleteAssistant x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAssistant x -> DeleteAssistant
$cfrom :: forall x. DeleteAssistant -> Rep DeleteAssistant x
Prelude.Generic)
newDeleteAssistant ::
Prelude.Text ->
DeleteAssistant
newDeleteAssistant :: Text -> DeleteAssistant
newDeleteAssistant Text
pAssistantId_ =
DeleteAssistant' :: Text -> DeleteAssistant
DeleteAssistant' {$sel:assistantId:DeleteAssistant' :: Text
assistantId = Text
pAssistantId_}
deleteAssistant_assistantId :: Lens.Lens' DeleteAssistant Prelude.Text
deleteAssistant_assistantId :: (Text -> f Text) -> DeleteAssistant -> f DeleteAssistant
deleteAssistant_assistantId = (DeleteAssistant -> Text)
-> (DeleteAssistant -> Text -> DeleteAssistant)
-> Lens DeleteAssistant DeleteAssistant Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssistant' {Text
assistantId :: Text
$sel:assistantId:DeleteAssistant' :: DeleteAssistant -> Text
assistantId} -> Text
assistantId) (\s :: DeleteAssistant
s@DeleteAssistant' {} Text
a -> DeleteAssistant
s {$sel:assistantId:DeleteAssistant' :: Text
assistantId = Text
a} :: DeleteAssistant)
instance Core.AWSRequest DeleteAssistant where
type
AWSResponse DeleteAssistant =
DeleteAssistantResponse
request :: DeleteAssistant -> Request DeleteAssistant
request = Service -> DeleteAssistant -> Request DeleteAssistant
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAssistant
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAssistant)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteAssistant))
-> Logger
-> Service
-> Proxy DeleteAssistant
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAssistant)))
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 -> DeleteAssistantResponse
DeleteAssistantResponse'
(Int -> DeleteAssistantResponse)
-> Either String Int -> Either String DeleteAssistantResponse
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 DeleteAssistant
instance Prelude.NFData DeleteAssistant
instance Core.ToHeaders DeleteAssistant where
toHeaders :: DeleteAssistant -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteAssistant -> 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 DeleteAssistant where
toPath :: DeleteAssistant -> ByteString
toPath DeleteAssistant' {Text
assistantId :: Text
$sel:assistantId:DeleteAssistant' :: DeleteAssistant -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/assistants/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assistantId]
instance Core.ToQuery DeleteAssistant where
toQuery :: DeleteAssistant -> QueryString
toQuery = QueryString -> DeleteAssistant -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteAssistantResponse = DeleteAssistantResponse'
{
DeleteAssistantResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteAssistantResponse -> DeleteAssistantResponse -> Bool
(DeleteAssistantResponse -> DeleteAssistantResponse -> Bool)
-> (DeleteAssistantResponse -> DeleteAssistantResponse -> Bool)
-> Eq DeleteAssistantResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssistantResponse -> DeleteAssistantResponse -> Bool
$c/= :: DeleteAssistantResponse -> DeleteAssistantResponse -> Bool
== :: DeleteAssistantResponse -> DeleteAssistantResponse -> Bool
$c== :: DeleteAssistantResponse -> DeleteAssistantResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAssistantResponse]
ReadPrec DeleteAssistantResponse
Int -> ReadS DeleteAssistantResponse
ReadS [DeleteAssistantResponse]
(Int -> ReadS DeleteAssistantResponse)
-> ReadS [DeleteAssistantResponse]
-> ReadPrec DeleteAssistantResponse
-> ReadPrec [DeleteAssistantResponse]
-> Read DeleteAssistantResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssistantResponse]
$creadListPrec :: ReadPrec [DeleteAssistantResponse]
readPrec :: ReadPrec DeleteAssistantResponse
$creadPrec :: ReadPrec DeleteAssistantResponse
readList :: ReadS [DeleteAssistantResponse]
$creadList :: ReadS [DeleteAssistantResponse]
readsPrec :: Int -> ReadS DeleteAssistantResponse
$creadsPrec :: Int -> ReadS DeleteAssistantResponse
Prelude.Read, Int -> DeleteAssistantResponse -> ShowS
[DeleteAssistantResponse] -> ShowS
DeleteAssistantResponse -> String
(Int -> DeleteAssistantResponse -> ShowS)
-> (DeleteAssistantResponse -> String)
-> ([DeleteAssistantResponse] -> ShowS)
-> Show DeleteAssistantResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssistantResponse] -> ShowS
$cshowList :: [DeleteAssistantResponse] -> ShowS
show :: DeleteAssistantResponse -> String
$cshow :: DeleteAssistantResponse -> String
showsPrec :: Int -> DeleteAssistantResponse -> ShowS
$cshowsPrec :: Int -> DeleteAssistantResponse -> ShowS
Prelude.Show, (forall x.
DeleteAssistantResponse -> Rep DeleteAssistantResponse x)
-> (forall x.
Rep DeleteAssistantResponse x -> DeleteAssistantResponse)
-> Generic DeleteAssistantResponse
forall x. Rep DeleteAssistantResponse x -> DeleteAssistantResponse
forall x. DeleteAssistantResponse -> Rep DeleteAssistantResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAssistantResponse x -> DeleteAssistantResponse
$cfrom :: forall x. DeleteAssistantResponse -> Rep DeleteAssistantResponse x
Prelude.Generic)
newDeleteAssistantResponse ::
Prelude.Int ->
DeleteAssistantResponse
newDeleteAssistantResponse :: Int -> DeleteAssistantResponse
newDeleteAssistantResponse Int
pHttpStatus_ =
DeleteAssistantResponse' :: Int -> DeleteAssistantResponse
DeleteAssistantResponse' {$sel:httpStatus:DeleteAssistantResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteAssistantResponse_httpStatus :: Lens.Lens' DeleteAssistantResponse Prelude.Int
deleteAssistantResponse_httpStatus :: (Int -> f Int)
-> DeleteAssistantResponse -> f DeleteAssistantResponse
deleteAssistantResponse_httpStatus = (DeleteAssistantResponse -> Int)
-> (DeleteAssistantResponse -> Int -> DeleteAssistantResponse)
-> Lens DeleteAssistantResponse DeleteAssistantResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssistantResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAssistantResponse' :: DeleteAssistantResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAssistantResponse
s@DeleteAssistantResponse' {} Int
a -> DeleteAssistantResponse
s {$sel:httpStatus:DeleteAssistantResponse' :: Int
httpStatus = Int
a} :: DeleteAssistantResponse)
instance Prelude.NFData DeleteAssistantResponse