{-# 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.StopEntitiesDetectionJob
(
StopEntitiesDetectionJob (..),
newStopEntitiesDetectionJob,
stopEntitiesDetectionJob_jobId,
StopEntitiesDetectionJobResponse (..),
newStopEntitiesDetectionJobResponse,
stopEntitiesDetectionJobResponse_jobId,
stopEntitiesDetectionJobResponse_jobStatus,
stopEntitiesDetectionJobResponse_httpStatus,
)
where
import Amazonka.Comprehend.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StopEntitiesDetectionJob = StopEntitiesDetectionJob'
{
StopEntitiesDetectionJob -> Text
jobId :: Prelude.Text
}
deriving (StopEntitiesDetectionJob -> StopEntitiesDetectionJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopEntitiesDetectionJob -> StopEntitiesDetectionJob -> Bool
$c/= :: StopEntitiesDetectionJob -> StopEntitiesDetectionJob -> Bool
== :: StopEntitiesDetectionJob -> StopEntitiesDetectionJob -> Bool
$c== :: StopEntitiesDetectionJob -> StopEntitiesDetectionJob -> Bool
Prelude.Eq, ReadPrec [StopEntitiesDetectionJob]
ReadPrec StopEntitiesDetectionJob
Int -> ReadS StopEntitiesDetectionJob
ReadS [StopEntitiesDetectionJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopEntitiesDetectionJob]
$creadListPrec :: ReadPrec [StopEntitiesDetectionJob]
readPrec :: ReadPrec StopEntitiesDetectionJob
$creadPrec :: ReadPrec StopEntitiesDetectionJob
readList :: ReadS [StopEntitiesDetectionJob]
$creadList :: ReadS [StopEntitiesDetectionJob]
readsPrec :: Int -> ReadS StopEntitiesDetectionJob
$creadsPrec :: Int -> ReadS StopEntitiesDetectionJob
Prelude.Read, Int -> StopEntitiesDetectionJob -> ShowS
[StopEntitiesDetectionJob] -> ShowS
StopEntitiesDetectionJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopEntitiesDetectionJob] -> ShowS
$cshowList :: [StopEntitiesDetectionJob] -> ShowS
show :: StopEntitiesDetectionJob -> String
$cshow :: StopEntitiesDetectionJob -> String
showsPrec :: Int -> StopEntitiesDetectionJob -> ShowS
$cshowsPrec :: Int -> StopEntitiesDetectionJob -> ShowS
Prelude.Show, forall x.
Rep StopEntitiesDetectionJob x -> StopEntitiesDetectionJob
forall x.
StopEntitiesDetectionJob -> Rep StopEntitiesDetectionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopEntitiesDetectionJob x -> StopEntitiesDetectionJob
$cfrom :: forall x.
StopEntitiesDetectionJob -> Rep StopEntitiesDetectionJob x
Prelude.Generic)
newStopEntitiesDetectionJob ::
Prelude.Text ->
StopEntitiesDetectionJob
newStopEntitiesDetectionJob :: Text -> StopEntitiesDetectionJob
newStopEntitiesDetectionJob Text
pJobId_ =
StopEntitiesDetectionJob' {$sel:jobId:StopEntitiesDetectionJob' :: Text
jobId = Text
pJobId_}
stopEntitiesDetectionJob_jobId :: Lens.Lens' StopEntitiesDetectionJob Prelude.Text
stopEntitiesDetectionJob_jobId :: Lens' StopEntitiesDetectionJob Text
stopEntitiesDetectionJob_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopEntitiesDetectionJob' {Text
jobId :: Text
$sel:jobId:StopEntitiesDetectionJob' :: StopEntitiesDetectionJob -> Text
jobId} -> Text
jobId) (\s :: StopEntitiesDetectionJob
s@StopEntitiesDetectionJob' {} Text
a -> StopEntitiesDetectionJob
s {$sel:jobId:StopEntitiesDetectionJob' :: Text
jobId = Text
a} :: StopEntitiesDetectionJob)
instance Core.AWSRequest StopEntitiesDetectionJob where
type
AWSResponse StopEntitiesDetectionJob =
StopEntitiesDetectionJobResponse
request :: (Service -> Service)
-> StopEntitiesDetectionJob -> Request StopEntitiesDetectionJob
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StopEntitiesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopEntitiesDetectionJob)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe JobStatus -> Int -> StopEntitiesDetectionJobResponse
StopEntitiesDetectionJobResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"JobId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"JobStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StopEntitiesDetectionJob where
hashWithSalt :: Int -> StopEntitiesDetectionJob -> Int
hashWithSalt Int
_salt StopEntitiesDetectionJob' {Text
jobId :: Text
$sel:jobId:StopEntitiesDetectionJob' :: StopEntitiesDetectionJob -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
instance Prelude.NFData StopEntitiesDetectionJob where
rnf :: StopEntitiesDetectionJob -> ()
rnf StopEntitiesDetectionJob' {Text
jobId :: Text
$sel:jobId:StopEntitiesDetectionJob' :: StopEntitiesDetectionJob -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
instance Data.ToHeaders StopEntitiesDetectionJob where
toHeaders :: StopEntitiesDetectionJob -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Comprehend_20171127.StopEntitiesDetectionJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StopEntitiesDetectionJob where
toJSON :: StopEntitiesDetectionJob -> Value
toJSON StopEntitiesDetectionJob' {Text
jobId :: Text
$sel:jobId:StopEntitiesDetectionJob' :: StopEntitiesDetectionJob -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"JobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)]
)
instance Data.ToPath StopEntitiesDetectionJob where
toPath :: StopEntitiesDetectionJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopEntitiesDetectionJob where
toQuery :: StopEntitiesDetectionJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopEntitiesDetectionJobResponse = StopEntitiesDetectionJobResponse'
{
StopEntitiesDetectionJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
StopEntitiesDetectionJobResponse -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
StopEntitiesDetectionJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopEntitiesDetectionJobResponse
-> StopEntitiesDetectionJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopEntitiesDetectionJobResponse
-> StopEntitiesDetectionJobResponse -> Bool
$c/= :: StopEntitiesDetectionJobResponse
-> StopEntitiesDetectionJobResponse -> Bool
== :: StopEntitiesDetectionJobResponse
-> StopEntitiesDetectionJobResponse -> Bool
$c== :: StopEntitiesDetectionJobResponse
-> StopEntitiesDetectionJobResponse -> Bool
Prelude.Eq, ReadPrec [StopEntitiesDetectionJobResponse]
ReadPrec StopEntitiesDetectionJobResponse
Int -> ReadS StopEntitiesDetectionJobResponse
ReadS [StopEntitiesDetectionJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopEntitiesDetectionJobResponse]
$creadListPrec :: ReadPrec [StopEntitiesDetectionJobResponse]
readPrec :: ReadPrec StopEntitiesDetectionJobResponse
$creadPrec :: ReadPrec StopEntitiesDetectionJobResponse
readList :: ReadS [StopEntitiesDetectionJobResponse]
$creadList :: ReadS [StopEntitiesDetectionJobResponse]
readsPrec :: Int -> ReadS StopEntitiesDetectionJobResponse
$creadsPrec :: Int -> ReadS StopEntitiesDetectionJobResponse
Prelude.Read, Int -> StopEntitiesDetectionJobResponse -> ShowS
[StopEntitiesDetectionJobResponse] -> ShowS
StopEntitiesDetectionJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopEntitiesDetectionJobResponse] -> ShowS
$cshowList :: [StopEntitiesDetectionJobResponse] -> ShowS
show :: StopEntitiesDetectionJobResponse -> String
$cshow :: StopEntitiesDetectionJobResponse -> String
showsPrec :: Int -> StopEntitiesDetectionJobResponse -> ShowS
$cshowsPrec :: Int -> StopEntitiesDetectionJobResponse -> ShowS
Prelude.Show, forall x.
Rep StopEntitiesDetectionJobResponse x
-> StopEntitiesDetectionJobResponse
forall x.
StopEntitiesDetectionJobResponse
-> Rep StopEntitiesDetectionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopEntitiesDetectionJobResponse x
-> StopEntitiesDetectionJobResponse
$cfrom :: forall x.
StopEntitiesDetectionJobResponse
-> Rep StopEntitiesDetectionJobResponse x
Prelude.Generic)
newStopEntitiesDetectionJobResponse ::
Prelude.Int ->
StopEntitiesDetectionJobResponse
newStopEntitiesDetectionJobResponse :: Int -> StopEntitiesDetectionJobResponse
newStopEntitiesDetectionJobResponse Int
pHttpStatus_ =
StopEntitiesDetectionJobResponse'
{ $sel:jobId:StopEntitiesDetectionJobResponse' :: Maybe Text
jobId =
forall a. Maybe a
Prelude.Nothing,
$sel:jobStatus:StopEntitiesDetectionJobResponse' :: Maybe JobStatus
jobStatus = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopEntitiesDetectionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopEntitiesDetectionJobResponse_jobId :: Lens.Lens' StopEntitiesDetectionJobResponse (Prelude.Maybe Prelude.Text)
stopEntitiesDetectionJobResponse_jobId :: Lens' StopEntitiesDetectionJobResponse (Maybe Text)
stopEntitiesDetectionJobResponse_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopEntitiesDetectionJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StopEntitiesDetectionJobResponse' :: StopEntitiesDetectionJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StopEntitiesDetectionJobResponse
s@StopEntitiesDetectionJobResponse' {} Maybe Text
a -> StopEntitiesDetectionJobResponse
s {$sel:jobId:StopEntitiesDetectionJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: StopEntitiesDetectionJobResponse)
stopEntitiesDetectionJobResponse_jobStatus :: Lens.Lens' StopEntitiesDetectionJobResponse (Prelude.Maybe JobStatus)
stopEntitiesDetectionJobResponse_jobStatus :: Lens' StopEntitiesDetectionJobResponse (Maybe JobStatus)
stopEntitiesDetectionJobResponse_jobStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopEntitiesDetectionJobResponse' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:StopEntitiesDetectionJobResponse' :: StopEntitiesDetectionJobResponse -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: StopEntitiesDetectionJobResponse
s@StopEntitiesDetectionJobResponse' {} Maybe JobStatus
a -> StopEntitiesDetectionJobResponse
s {$sel:jobStatus:StopEntitiesDetectionJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: StopEntitiesDetectionJobResponse)
stopEntitiesDetectionJobResponse_httpStatus :: Lens.Lens' StopEntitiesDetectionJobResponse Prelude.Int
stopEntitiesDetectionJobResponse_httpStatus :: Lens' StopEntitiesDetectionJobResponse Int
stopEntitiesDetectionJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopEntitiesDetectionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopEntitiesDetectionJobResponse' :: StopEntitiesDetectionJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopEntitiesDetectionJobResponse
s@StopEntitiesDetectionJobResponse' {} Int
a -> StopEntitiesDetectionJobResponse
s {$sel:httpStatus:StopEntitiesDetectionJobResponse' :: Int
httpStatus = Int
a} :: StopEntitiesDetectionJobResponse)
instance
Prelude.NFData
StopEntitiesDetectionJobResponse
where
rnf :: StopEntitiesDetectionJobResponse -> ()
rnf StopEntitiesDetectionJobResponse' {Int
Maybe Text
Maybe JobStatus
httpStatus :: Int
jobStatus :: Maybe JobStatus
jobId :: Maybe Text
$sel:httpStatus:StopEntitiesDetectionJobResponse' :: StopEntitiesDetectionJobResponse -> Int
$sel:jobStatus:StopEntitiesDetectionJobResponse' :: StopEntitiesDetectionJobResponse -> Maybe JobStatus
$sel:jobId:StopEntitiesDetectionJobResponse' :: StopEntitiesDetectionJobResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobStatus
jobStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus