{-# 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.StopKeyPhrasesDetectionJob
(
StopKeyPhrasesDetectionJob (..),
newStopKeyPhrasesDetectionJob,
stopKeyPhrasesDetectionJob_jobId,
StopKeyPhrasesDetectionJobResponse (..),
newStopKeyPhrasesDetectionJobResponse,
stopKeyPhrasesDetectionJobResponse_jobId,
stopKeyPhrasesDetectionJobResponse_jobStatus,
stopKeyPhrasesDetectionJobResponse_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 StopKeyPhrasesDetectionJob = StopKeyPhrasesDetectionJob'
{
StopKeyPhrasesDetectionJob -> Text
jobId :: Prelude.Text
}
deriving (StopKeyPhrasesDetectionJob -> StopKeyPhrasesDetectionJob -> Bool
(StopKeyPhrasesDetectionJob -> StopKeyPhrasesDetectionJob -> Bool)
-> (StopKeyPhrasesDetectionJob
-> StopKeyPhrasesDetectionJob -> Bool)
-> Eq StopKeyPhrasesDetectionJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopKeyPhrasesDetectionJob -> StopKeyPhrasesDetectionJob -> Bool
$c/= :: StopKeyPhrasesDetectionJob -> StopKeyPhrasesDetectionJob -> Bool
== :: StopKeyPhrasesDetectionJob -> StopKeyPhrasesDetectionJob -> Bool
$c== :: StopKeyPhrasesDetectionJob -> StopKeyPhrasesDetectionJob -> Bool
Prelude.Eq, ReadPrec [StopKeyPhrasesDetectionJob]
ReadPrec StopKeyPhrasesDetectionJob
Int -> ReadS StopKeyPhrasesDetectionJob
ReadS [StopKeyPhrasesDetectionJob]
(Int -> ReadS StopKeyPhrasesDetectionJob)
-> ReadS [StopKeyPhrasesDetectionJob]
-> ReadPrec StopKeyPhrasesDetectionJob
-> ReadPrec [StopKeyPhrasesDetectionJob]
-> Read StopKeyPhrasesDetectionJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopKeyPhrasesDetectionJob]
$creadListPrec :: ReadPrec [StopKeyPhrasesDetectionJob]
readPrec :: ReadPrec StopKeyPhrasesDetectionJob
$creadPrec :: ReadPrec StopKeyPhrasesDetectionJob
readList :: ReadS [StopKeyPhrasesDetectionJob]
$creadList :: ReadS [StopKeyPhrasesDetectionJob]
readsPrec :: Int -> ReadS StopKeyPhrasesDetectionJob
$creadsPrec :: Int -> ReadS StopKeyPhrasesDetectionJob
Prelude.Read, Int -> StopKeyPhrasesDetectionJob -> ShowS
[StopKeyPhrasesDetectionJob] -> ShowS
StopKeyPhrasesDetectionJob -> String
(Int -> StopKeyPhrasesDetectionJob -> ShowS)
-> (StopKeyPhrasesDetectionJob -> String)
-> ([StopKeyPhrasesDetectionJob] -> ShowS)
-> Show StopKeyPhrasesDetectionJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopKeyPhrasesDetectionJob] -> ShowS
$cshowList :: [StopKeyPhrasesDetectionJob] -> ShowS
show :: StopKeyPhrasesDetectionJob -> String
$cshow :: StopKeyPhrasesDetectionJob -> String
showsPrec :: Int -> StopKeyPhrasesDetectionJob -> ShowS
$cshowsPrec :: Int -> StopKeyPhrasesDetectionJob -> ShowS
Prelude.Show, (forall x.
StopKeyPhrasesDetectionJob -> Rep StopKeyPhrasesDetectionJob x)
-> (forall x.
Rep StopKeyPhrasesDetectionJob x -> StopKeyPhrasesDetectionJob)
-> Generic StopKeyPhrasesDetectionJob
forall x.
Rep StopKeyPhrasesDetectionJob x -> StopKeyPhrasesDetectionJob
forall x.
StopKeyPhrasesDetectionJob -> Rep StopKeyPhrasesDetectionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopKeyPhrasesDetectionJob x -> StopKeyPhrasesDetectionJob
$cfrom :: forall x.
StopKeyPhrasesDetectionJob -> Rep StopKeyPhrasesDetectionJob x
Prelude.Generic)
newStopKeyPhrasesDetectionJob ::
Prelude.Text ->
StopKeyPhrasesDetectionJob
newStopKeyPhrasesDetectionJob :: Text -> StopKeyPhrasesDetectionJob
newStopKeyPhrasesDetectionJob Text
pJobId_ =
StopKeyPhrasesDetectionJob' :: Text -> StopKeyPhrasesDetectionJob
StopKeyPhrasesDetectionJob' {$sel:jobId:StopKeyPhrasesDetectionJob' :: Text
jobId = Text
pJobId_}
stopKeyPhrasesDetectionJob_jobId :: Lens.Lens' StopKeyPhrasesDetectionJob Prelude.Text
stopKeyPhrasesDetectionJob_jobId :: (Text -> f Text)
-> StopKeyPhrasesDetectionJob -> f StopKeyPhrasesDetectionJob
stopKeyPhrasesDetectionJob_jobId = (StopKeyPhrasesDetectionJob -> Text)
-> (StopKeyPhrasesDetectionJob
-> Text -> StopKeyPhrasesDetectionJob)
-> Lens
StopKeyPhrasesDetectionJob StopKeyPhrasesDetectionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopKeyPhrasesDetectionJob' {Text
jobId :: Text
$sel:jobId:StopKeyPhrasesDetectionJob' :: StopKeyPhrasesDetectionJob -> Text
jobId} -> Text
jobId) (\s :: StopKeyPhrasesDetectionJob
s@StopKeyPhrasesDetectionJob' {} Text
a -> StopKeyPhrasesDetectionJob
s {$sel:jobId:StopKeyPhrasesDetectionJob' :: Text
jobId = Text
a} :: StopKeyPhrasesDetectionJob)
instance Core.AWSRequest StopKeyPhrasesDetectionJob where
type
AWSResponse StopKeyPhrasesDetectionJob =
StopKeyPhrasesDetectionJobResponse
request :: StopKeyPhrasesDetectionJob -> Request StopKeyPhrasesDetectionJob
request = Service
-> StopKeyPhrasesDetectionJob -> Request StopKeyPhrasesDetectionJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopKeyPhrasesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopKeyPhrasesDetectionJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopKeyPhrasesDetectionJob))
-> Logger
-> Service
-> Proxy StopKeyPhrasesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopKeyPhrasesDetectionJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe JobStatus -> Int -> StopKeyPhrasesDetectionJobResponse
StopKeyPhrasesDetectionJobResponse'
(Maybe Text
-> Maybe JobStatus -> Int -> StopKeyPhrasesDetectionJobResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe JobStatus -> Int -> StopKeyPhrasesDetectionJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobId")
Either
String
(Maybe JobStatus -> Int -> StopKeyPhrasesDetectionJobResponse)
-> Either String (Maybe JobStatus)
-> Either String (Int -> StopKeyPhrasesDetectionJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobStatus")
Either String (Int -> StopKeyPhrasesDetectionJobResponse)
-> Either String Int
-> Either String StopKeyPhrasesDetectionJobResponse
forall (f :: * -> *) a b. Applicative f => 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 StopKeyPhrasesDetectionJob
instance Prelude.NFData StopKeyPhrasesDetectionJob
instance Core.ToHeaders StopKeyPhrasesDetectionJob where
toHeaders :: StopKeyPhrasesDetectionJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopKeyPhrasesDetectionJob -> 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.StopKeyPhrasesDetectionJob" ::
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 StopKeyPhrasesDetectionJob where
toJSON :: StopKeyPhrasesDetectionJob -> Value
toJSON StopKeyPhrasesDetectionJob' {Text
jobId :: Text
$sel:jobId:StopKeyPhrasesDetectionJob' :: StopKeyPhrasesDetectionJob -> 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
"JobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobId)]
)
instance Core.ToPath StopKeyPhrasesDetectionJob where
toPath :: StopKeyPhrasesDetectionJob -> ByteString
toPath = ByteString -> StopKeyPhrasesDetectionJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopKeyPhrasesDetectionJob where
toQuery :: StopKeyPhrasesDetectionJob -> QueryString
toQuery = QueryString -> StopKeyPhrasesDetectionJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopKeyPhrasesDetectionJobResponse = StopKeyPhrasesDetectionJobResponse'
{
StopKeyPhrasesDetectionJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
StopKeyPhrasesDetectionJobResponse -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
StopKeyPhrasesDetectionJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopKeyPhrasesDetectionJobResponse
-> StopKeyPhrasesDetectionJobResponse -> Bool
(StopKeyPhrasesDetectionJobResponse
-> StopKeyPhrasesDetectionJobResponse -> Bool)
-> (StopKeyPhrasesDetectionJobResponse
-> StopKeyPhrasesDetectionJobResponse -> Bool)
-> Eq StopKeyPhrasesDetectionJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopKeyPhrasesDetectionJobResponse
-> StopKeyPhrasesDetectionJobResponse -> Bool
$c/= :: StopKeyPhrasesDetectionJobResponse
-> StopKeyPhrasesDetectionJobResponse -> Bool
== :: StopKeyPhrasesDetectionJobResponse
-> StopKeyPhrasesDetectionJobResponse -> Bool
$c== :: StopKeyPhrasesDetectionJobResponse
-> StopKeyPhrasesDetectionJobResponse -> Bool
Prelude.Eq, ReadPrec [StopKeyPhrasesDetectionJobResponse]
ReadPrec StopKeyPhrasesDetectionJobResponse
Int -> ReadS StopKeyPhrasesDetectionJobResponse
ReadS [StopKeyPhrasesDetectionJobResponse]
(Int -> ReadS StopKeyPhrasesDetectionJobResponse)
-> ReadS [StopKeyPhrasesDetectionJobResponse]
-> ReadPrec StopKeyPhrasesDetectionJobResponse
-> ReadPrec [StopKeyPhrasesDetectionJobResponse]
-> Read StopKeyPhrasesDetectionJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopKeyPhrasesDetectionJobResponse]
$creadListPrec :: ReadPrec [StopKeyPhrasesDetectionJobResponse]
readPrec :: ReadPrec StopKeyPhrasesDetectionJobResponse
$creadPrec :: ReadPrec StopKeyPhrasesDetectionJobResponse
readList :: ReadS [StopKeyPhrasesDetectionJobResponse]
$creadList :: ReadS [StopKeyPhrasesDetectionJobResponse]
readsPrec :: Int -> ReadS StopKeyPhrasesDetectionJobResponse
$creadsPrec :: Int -> ReadS StopKeyPhrasesDetectionJobResponse
Prelude.Read, Int -> StopKeyPhrasesDetectionJobResponse -> ShowS
[StopKeyPhrasesDetectionJobResponse] -> ShowS
StopKeyPhrasesDetectionJobResponse -> String
(Int -> StopKeyPhrasesDetectionJobResponse -> ShowS)
-> (StopKeyPhrasesDetectionJobResponse -> String)
-> ([StopKeyPhrasesDetectionJobResponse] -> ShowS)
-> Show StopKeyPhrasesDetectionJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopKeyPhrasesDetectionJobResponse] -> ShowS
$cshowList :: [StopKeyPhrasesDetectionJobResponse] -> ShowS
show :: StopKeyPhrasesDetectionJobResponse -> String
$cshow :: StopKeyPhrasesDetectionJobResponse -> String
showsPrec :: Int -> StopKeyPhrasesDetectionJobResponse -> ShowS
$cshowsPrec :: Int -> StopKeyPhrasesDetectionJobResponse -> ShowS
Prelude.Show, (forall x.
StopKeyPhrasesDetectionJobResponse
-> Rep StopKeyPhrasesDetectionJobResponse x)
-> (forall x.
Rep StopKeyPhrasesDetectionJobResponse x
-> StopKeyPhrasesDetectionJobResponse)
-> Generic StopKeyPhrasesDetectionJobResponse
forall x.
Rep StopKeyPhrasesDetectionJobResponse x
-> StopKeyPhrasesDetectionJobResponse
forall x.
StopKeyPhrasesDetectionJobResponse
-> Rep StopKeyPhrasesDetectionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopKeyPhrasesDetectionJobResponse x
-> StopKeyPhrasesDetectionJobResponse
$cfrom :: forall x.
StopKeyPhrasesDetectionJobResponse
-> Rep StopKeyPhrasesDetectionJobResponse x
Prelude.Generic)
newStopKeyPhrasesDetectionJobResponse ::
Prelude.Int ->
StopKeyPhrasesDetectionJobResponse
newStopKeyPhrasesDetectionJobResponse :: Int -> StopKeyPhrasesDetectionJobResponse
newStopKeyPhrasesDetectionJobResponse Int
pHttpStatus_ =
StopKeyPhrasesDetectionJobResponse' :: Maybe Text
-> Maybe JobStatus -> Int -> StopKeyPhrasesDetectionJobResponse
StopKeyPhrasesDetectionJobResponse'
{ $sel:jobId:StopKeyPhrasesDetectionJobResponse' :: Maybe Text
jobId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:jobStatus:StopKeyPhrasesDetectionJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopKeyPhrasesDetectionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopKeyPhrasesDetectionJobResponse_jobId :: Lens.Lens' StopKeyPhrasesDetectionJobResponse (Prelude.Maybe Prelude.Text)
stopKeyPhrasesDetectionJobResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> StopKeyPhrasesDetectionJobResponse
-> f StopKeyPhrasesDetectionJobResponse
stopKeyPhrasesDetectionJobResponse_jobId = (StopKeyPhrasesDetectionJobResponse -> Maybe Text)
-> (StopKeyPhrasesDetectionJobResponse
-> Maybe Text -> StopKeyPhrasesDetectionJobResponse)
-> Lens
StopKeyPhrasesDetectionJobResponse
StopKeyPhrasesDetectionJobResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopKeyPhrasesDetectionJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StopKeyPhrasesDetectionJobResponse' :: StopKeyPhrasesDetectionJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StopKeyPhrasesDetectionJobResponse
s@StopKeyPhrasesDetectionJobResponse' {} Maybe Text
a -> StopKeyPhrasesDetectionJobResponse
s {$sel:jobId:StopKeyPhrasesDetectionJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: StopKeyPhrasesDetectionJobResponse)
stopKeyPhrasesDetectionJobResponse_jobStatus :: Lens.Lens' StopKeyPhrasesDetectionJobResponse (Prelude.Maybe JobStatus)
stopKeyPhrasesDetectionJobResponse_jobStatus :: (Maybe JobStatus -> f (Maybe JobStatus))
-> StopKeyPhrasesDetectionJobResponse
-> f StopKeyPhrasesDetectionJobResponse
stopKeyPhrasesDetectionJobResponse_jobStatus = (StopKeyPhrasesDetectionJobResponse -> Maybe JobStatus)
-> (StopKeyPhrasesDetectionJobResponse
-> Maybe JobStatus -> StopKeyPhrasesDetectionJobResponse)
-> Lens
StopKeyPhrasesDetectionJobResponse
StopKeyPhrasesDetectionJobResponse
(Maybe JobStatus)
(Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopKeyPhrasesDetectionJobResponse' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:StopKeyPhrasesDetectionJobResponse' :: StopKeyPhrasesDetectionJobResponse -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: StopKeyPhrasesDetectionJobResponse
s@StopKeyPhrasesDetectionJobResponse' {} Maybe JobStatus
a -> StopKeyPhrasesDetectionJobResponse
s {$sel:jobStatus:StopKeyPhrasesDetectionJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: StopKeyPhrasesDetectionJobResponse)
stopKeyPhrasesDetectionJobResponse_httpStatus :: Lens.Lens' StopKeyPhrasesDetectionJobResponse Prelude.Int
stopKeyPhrasesDetectionJobResponse_httpStatus :: (Int -> f Int)
-> StopKeyPhrasesDetectionJobResponse
-> f StopKeyPhrasesDetectionJobResponse
stopKeyPhrasesDetectionJobResponse_httpStatus = (StopKeyPhrasesDetectionJobResponse -> Int)
-> (StopKeyPhrasesDetectionJobResponse
-> Int -> StopKeyPhrasesDetectionJobResponse)
-> Lens
StopKeyPhrasesDetectionJobResponse
StopKeyPhrasesDetectionJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopKeyPhrasesDetectionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopKeyPhrasesDetectionJobResponse' :: StopKeyPhrasesDetectionJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopKeyPhrasesDetectionJobResponse
s@StopKeyPhrasesDetectionJobResponse' {} Int
a -> StopKeyPhrasesDetectionJobResponse
s {$sel:httpStatus:StopKeyPhrasesDetectionJobResponse' :: Int
httpStatus = Int
a} :: StopKeyPhrasesDetectionJobResponse)
instance
Prelude.NFData
StopKeyPhrasesDetectionJobResponse