{-# 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.Comprehend.StopTrainingDocumentClassifier
(
StopTrainingDocumentClassifier (..),
newStopTrainingDocumentClassifier,
stopTrainingDocumentClassifier_documentClassifierArn,
StopTrainingDocumentClassifierResponse (..),
newStopTrainingDocumentClassifierResponse,
stopTrainingDocumentClassifierResponse_httpStatus,
)
where
import Amazonka.Comprehend.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 StopTrainingDocumentClassifier = StopTrainingDocumentClassifier'
{
StopTrainingDocumentClassifier -> Text
documentClassifierArn :: Prelude.Text
}
deriving (StopTrainingDocumentClassifier
-> StopTrainingDocumentClassifier -> Bool
(StopTrainingDocumentClassifier
-> StopTrainingDocumentClassifier -> Bool)
-> (StopTrainingDocumentClassifier
-> StopTrainingDocumentClassifier -> Bool)
-> Eq StopTrainingDocumentClassifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopTrainingDocumentClassifier
-> StopTrainingDocumentClassifier -> Bool
$c/= :: StopTrainingDocumentClassifier
-> StopTrainingDocumentClassifier -> Bool
== :: StopTrainingDocumentClassifier
-> StopTrainingDocumentClassifier -> Bool
$c== :: StopTrainingDocumentClassifier
-> StopTrainingDocumentClassifier -> Bool
Prelude.Eq, ReadPrec [StopTrainingDocumentClassifier]
ReadPrec StopTrainingDocumentClassifier
Int -> ReadS StopTrainingDocumentClassifier
ReadS [StopTrainingDocumentClassifier]
(Int -> ReadS StopTrainingDocumentClassifier)
-> ReadS [StopTrainingDocumentClassifier]
-> ReadPrec StopTrainingDocumentClassifier
-> ReadPrec [StopTrainingDocumentClassifier]
-> Read StopTrainingDocumentClassifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopTrainingDocumentClassifier]
$creadListPrec :: ReadPrec [StopTrainingDocumentClassifier]
readPrec :: ReadPrec StopTrainingDocumentClassifier
$creadPrec :: ReadPrec StopTrainingDocumentClassifier
readList :: ReadS [StopTrainingDocumentClassifier]
$creadList :: ReadS [StopTrainingDocumentClassifier]
readsPrec :: Int -> ReadS StopTrainingDocumentClassifier
$creadsPrec :: Int -> ReadS StopTrainingDocumentClassifier
Prelude.Read, Int -> StopTrainingDocumentClassifier -> ShowS
[StopTrainingDocumentClassifier] -> ShowS
StopTrainingDocumentClassifier -> String
(Int -> StopTrainingDocumentClassifier -> ShowS)
-> (StopTrainingDocumentClassifier -> String)
-> ([StopTrainingDocumentClassifier] -> ShowS)
-> Show StopTrainingDocumentClassifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopTrainingDocumentClassifier] -> ShowS
$cshowList :: [StopTrainingDocumentClassifier] -> ShowS
show :: StopTrainingDocumentClassifier -> String
$cshow :: StopTrainingDocumentClassifier -> String
showsPrec :: Int -> StopTrainingDocumentClassifier -> ShowS
$cshowsPrec :: Int -> StopTrainingDocumentClassifier -> ShowS
Prelude.Show, (forall x.
StopTrainingDocumentClassifier
-> Rep StopTrainingDocumentClassifier x)
-> (forall x.
Rep StopTrainingDocumentClassifier x
-> StopTrainingDocumentClassifier)
-> Generic StopTrainingDocumentClassifier
forall x.
Rep StopTrainingDocumentClassifier x
-> StopTrainingDocumentClassifier
forall x.
StopTrainingDocumentClassifier
-> Rep StopTrainingDocumentClassifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopTrainingDocumentClassifier x
-> StopTrainingDocumentClassifier
$cfrom :: forall x.
StopTrainingDocumentClassifier
-> Rep StopTrainingDocumentClassifier x
Prelude.Generic)
newStopTrainingDocumentClassifier ::
Prelude.Text ->
StopTrainingDocumentClassifier
newStopTrainingDocumentClassifier :: Text -> StopTrainingDocumentClassifier
newStopTrainingDocumentClassifier
Text
pDocumentClassifierArn_ =
StopTrainingDocumentClassifier' :: Text -> StopTrainingDocumentClassifier
StopTrainingDocumentClassifier'
{ $sel:documentClassifierArn:StopTrainingDocumentClassifier' :: Text
documentClassifierArn =
Text
pDocumentClassifierArn_
}
stopTrainingDocumentClassifier_documentClassifierArn :: Lens.Lens' StopTrainingDocumentClassifier Prelude.Text
stopTrainingDocumentClassifier_documentClassifierArn :: (Text -> f Text)
-> StopTrainingDocumentClassifier
-> f StopTrainingDocumentClassifier
stopTrainingDocumentClassifier_documentClassifierArn = (StopTrainingDocumentClassifier -> Text)
-> (StopTrainingDocumentClassifier
-> Text -> StopTrainingDocumentClassifier)
-> Lens
StopTrainingDocumentClassifier
StopTrainingDocumentClassifier
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopTrainingDocumentClassifier' {Text
documentClassifierArn :: Text
$sel:documentClassifierArn:StopTrainingDocumentClassifier' :: StopTrainingDocumentClassifier -> Text
documentClassifierArn} -> Text
documentClassifierArn) (\s :: StopTrainingDocumentClassifier
s@StopTrainingDocumentClassifier' {} Text
a -> StopTrainingDocumentClassifier
s {$sel:documentClassifierArn:StopTrainingDocumentClassifier' :: Text
documentClassifierArn = Text
a} :: StopTrainingDocumentClassifier)
instance
Core.AWSRequest
StopTrainingDocumentClassifier
where
type
AWSResponse StopTrainingDocumentClassifier =
StopTrainingDocumentClassifierResponse
request :: StopTrainingDocumentClassifier
-> Request StopTrainingDocumentClassifier
request = Service
-> StopTrainingDocumentClassifier
-> Request StopTrainingDocumentClassifier
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopTrainingDocumentClassifier
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse StopTrainingDocumentClassifier)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StopTrainingDocumentClassifier))
-> Logger
-> Service
-> Proxy StopTrainingDocumentClassifier
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse StopTrainingDocumentClassifier)))
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 -> StopTrainingDocumentClassifierResponse
StopTrainingDocumentClassifierResponse'
(Int -> StopTrainingDocumentClassifierResponse)
-> Either String Int
-> Either String StopTrainingDocumentClassifierResponse
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
StopTrainingDocumentClassifier
instance
Prelude.NFData
StopTrainingDocumentClassifier
instance
Core.ToHeaders
StopTrainingDocumentClassifier
where
toHeaders :: StopTrainingDocumentClassifier -> ResponseHeaders
toHeaders =
ResponseHeaders
-> StopTrainingDocumentClassifier -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Comprehend_20171127.StopTrainingDocumentClassifier" ::
Prelude.ByteString
),
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.ToJSON StopTrainingDocumentClassifier where
toJSON :: StopTrainingDocumentClassifier -> Value
toJSON StopTrainingDocumentClassifier' {Text
documentClassifierArn :: Text
$sel:documentClassifierArn:StopTrainingDocumentClassifier' :: StopTrainingDocumentClassifier -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DocumentClassifierArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
documentClassifierArn
)
]
)
instance Core.ToPath StopTrainingDocumentClassifier where
toPath :: StopTrainingDocumentClassifier -> ByteString
toPath = ByteString -> StopTrainingDocumentClassifier -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopTrainingDocumentClassifier where
toQuery :: StopTrainingDocumentClassifier -> QueryString
toQuery = QueryString -> StopTrainingDocumentClassifier -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopTrainingDocumentClassifierResponse = StopTrainingDocumentClassifierResponse'
{
StopTrainingDocumentClassifierResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopTrainingDocumentClassifierResponse
-> StopTrainingDocumentClassifierResponse -> Bool
(StopTrainingDocumentClassifierResponse
-> StopTrainingDocumentClassifierResponse -> Bool)
-> (StopTrainingDocumentClassifierResponse
-> StopTrainingDocumentClassifierResponse -> Bool)
-> Eq StopTrainingDocumentClassifierResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopTrainingDocumentClassifierResponse
-> StopTrainingDocumentClassifierResponse -> Bool
$c/= :: StopTrainingDocumentClassifierResponse
-> StopTrainingDocumentClassifierResponse -> Bool
== :: StopTrainingDocumentClassifierResponse
-> StopTrainingDocumentClassifierResponse -> Bool
$c== :: StopTrainingDocumentClassifierResponse
-> StopTrainingDocumentClassifierResponse -> Bool
Prelude.Eq, ReadPrec [StopTrainingDocumentClassifierResponse]
ReadPrec StopTrainingDocumentClassifierResponse
Int -> ReadS StopTrainingDocumentClassifierResponse
ReadS [StopTrainingDocumentClassifierResponse]
(Int -> ReadS StopTrainingDocumentClassifierResponse)
-> ReadS [StopTrainingDocumentClassifierResponse]
-> ReadPrec StopTrainingDocumentClassifierResponse
-> ReadPrec [StopTrainingDocumentClassifierResponse]
-> Read StopTrainingDocumentClassifierResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopTrainingDocumentClassifierResponse]
$creadListPrec :: ReadPrec [StopTrainingDocumentClassifierResponse]
readPrec :: ReadPrec StopTrainingDocumentClassifierResponse
$creadPrec :: ReadPrec StopTrainingDocumentClassifierResponse
readList :: ReadS [StopTrainingDocumentClassifierResponse]
$creadList :: ReadS [StopTrainingDocumentClassifierResponse]
readsPrec :: Int -> ReadS StopTrainingDocumentClassifierResponse
$creadsPrec :: Int -> ReadS StopTrainingDocumentClassifierResponse
Prelude.Read, Int -> StopTrainingDocumentClassifierResponse -> ShowS
[StopTrainingDocumentClassifierResponse] -> ShowS
StopTrainingDocumentClassifierResponse -> String
(Int -> StopTrainingDocumentClassifierResponse -> ShowS)
-> (StopTrainingDocumentClassifierResponse -> String)
-> ([StopTrainingDocumentClassifierResponse] -> ShowS)
-> Show StopTrainingDocumentClassifierResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopTrainingDocumentClassifierResponse] -> ShowS
$cshowList :: [StopTrainingDocumentClassifierResponse] -> ShowS
show :: StopTrainingDocumentClassifierResponse -> String
$cshow :: StopTrainingDocumentClassifierResponse -> String
showsPrec :: Int -> StopTrainingDocumentClassifierResponse -> ShowS
$cshowsPrec :: Int -> StopTrainingDocumentClassifierResponse -> ShowS
Prelude.Show, (forall x.
StopTrainingDocumentClassifierResponse
-> Rep StopTrainingDocumentClassifierResponse x)
-> (forall x.
Rep StopTrainingDocumentClassifierResponse x
-> StopTrainingDocumentClassifierResponse)
-> Generic StopTrainingDocumentClassifierResponse
forall x.
Rep StopTrainingDocumentClassifierResponse x
-> StopTrainingDocumentClassifierResponse
forall x.
StopTrainingDocumentClassifierResponse
-> Rep StopTrainingDocumentClassifierResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopTrainingDocumentClassifierResponse x
-> StopTrainingDocumentClassifierResponse
$cfrom :: forall x.
StopTrainingDocumentClassifierResponse
-> Rep StopTrainingDocumentClassifierResponse x
Prelude.Generic)
newStopTrainingDocumentClassifierResponse ::
Prelude.Int ->
StopTrainingDocumentClassifierResponse
newStopTrainingDocumentClassifierResponse :: Int -> StopTrainingDocumentClassifierResponse
newStopTrainingDocumentClassifierResponse
Int
pHttpStatus_ =
StopTrainingDocumentClassifierResponse' :: Int -> StopTrainingDocumentClassifierResponse
StopTrainingDocumentClassifierResponse'
{ $sel:httpStatus:StopTrainingDocumentClassifierResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
stopTrainingDocumentClassifierResponse_httpStatus :: Lens.Lens' StopTrainingDocumentClassifierResponse Prelude.Int
stopTrainingDocumentClassifierResponse_httpStatus :: (Int -> f Int)
-> StopTrainingDocumentClassifierResponse
-> f StopTrainingDocumentClassifierResponse
stopTrainingDocumentClassifierResponse_httpStatus = (StopTrainingDocumentClassifierResponse -> Int)
-> (StopTrainingDocumentClassifierResponse
-> Int -> StopTrainingDocumentClassifierResponse)
-> Lens
StopTrainingDocumentClassifierResponse
StopTrainingDocumentClassifierResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopTrainingDocumentClassifierResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopTrainingDocumentClassifierResponse' :: StopTrainingDocumentClassifierResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopTrainingDocumentClassifierResponse
s@StopTrainingDocumentClassifierResponse' {} Int
a -> StopTrainingDocumentClassifierResponse
s {$sel:httpStatus:StopTrainingDocumentClassifierResponse' :: Int
httpStatus = Int
a} :: StopTrainingDocumentClassifierResponse)
instance
Prelude.NFData
StopTrainingDocumentClassifierResponse