{-# 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.DescribeKeyPhrasesDetectionJob
(
DescribeKeyPhrasesDetectionJob (..),
newDescribeKeyPhrasesDetectionJob,
describeKeyPhrasesDetectionJob_jobId,
DescribeKeyPhrasesDetectionJobResponse (..),
newDescribeKeyPhrasesDetectionJobResponse,
describeKeyPhrasesDetectionJobResponse_keyPhrasesDetectionJobProperties,
describeKeyPhrasesDetectionJobResponse_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 DescribeKeyPhrasesDetectionJob = DescribeKeyPhrasesDetectionJob'
{
DescribeKeyPhrasesDetectionJob -> Text
jobId :: Prelude.Text
}
deriving (DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool
(DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool)
-> (DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool)
-> Eq DescribeKeyPhrasesDetectionJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool
$c/= :: DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool
== :: DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool
$c== :: DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool
Prelude.Eq, ReadPrec [DescribeKeyPhrasesDetectionJob]
ReadPrec DescribeKeyPhrasesDetectionJob
Int -> ReadS DescribeKeyPhrasesDetectionJob
ReadS [DescribeKeyPhrasesDetectionJob]
(Int -> ReadS DescribeKeyPhrasesDetectionJob)
-> ReadS [DescribeKeyPhrasesDetectionJob]
-> ReadPrec DescribeKeyPhrasesDetectionJob
-> ReadPrec [DescribeKeyPhrasesDetectionJob]
-> Read DescribeKeyPhrasesDetectionJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeKeyPhrasesDetectionJob]
$creadListPrec :: ReadPrec [DescribeKeyPhrasesDetectionJob]
readPrec :: ReadPrec DescribeKeyPhrasesDetectionJob
$creadPrec :: ReadPrec DescribeKeyPhrasesDetectionJob
readList :: ReadS [DescribeKeyPhrasesDetectionJob]
$creadList :: ReadS [DescribeKeyPhrasesDetectionJob]
readsPrec :: Int -> ReadS DescribeKeyPhrasesDetectionJob
$creadsPrec :: Int -> ReadS DescribeKeyPhrasesDetectionJob
Prelude.Read, Int -> DescribeKeyPhrasesDetectionJob -> ShowS
[DescribeKeyPhrasesDetectionJob] -> ShowS
DescribeKeyPhrasesDetectionJob -> String
(Int -> DescribeKeyPhrasesDetectionJob -> ShowS)
-> (DescribeKeyPhrasesDetectionJob -> String)
-> ([DescribeKeyPhrasesDetectionJob] -> ShowS)
-> Show DescribeKeyPhrasesDetectionJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeKeyPhrasesDetectionJob] -> ShowS
$cshowList :: [DescribeKeyPhrasesDetectionJob] -> ShowS
show :: DescribeKeyPhrasesDetectionJob -> String
$cshow :: DescribeKeyPhrasesDetectionJob -> String
showsPrec :: Int -> DescribeKeyPhrasesDetectionJob -> ShowS
$cshowsPrec :: Int -> DescribeKeyPhrasesDetectionJob -> ShowS
Prelude.Show, (forall x.
DescribeKeyPhrasesDetectionJob
-> Rep DescribeKeyPhrasesDetectionJob x)
-> (forall x.
Rep DescribeKeyPhrasesDetectionJob x
-> DescribeKeyPhrasesDetectionJob)
-> Generic DescribeKeyPhrasesDetectionJob
forall x.
Rep DescribeKeyPhrasesDetectionJob x
-> DescribeKeyPhrasesDetectionJob
forall x.
DescribeKeyPhrasesDetectionJob
-> Rep DescribeKeyPhrasesDetectionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeKeyPhrasesDetectionJob x
-> DescribeKeyPhrasesDetectionJob
$cfrom :: forall x.
DescribeKeyPhrasesDetectionJob
-> Rep DescribeKeyPhrasesDetectionJob x
Prelude.Generic)
newDescribeKeyPhrasesDetectionJob ::
Prelude.Text ->
DescribeKeyPhrasesDetectionJob
newDescribeKeyPhrasesDetectionJob :: Text -> DescribeKeyPhrasesDetectionJob
newDescribeKeyPhrasesDetectionJob Text
pJobId_ =
DescribeKeyPhrasesDetectionJob' :: Text -> DescribeKeyPhrasesDetectionJob
DescribeKeyPhrasesDetectionJob' {$sel:jobId:DescribeKeyPhrasesDetectionJob' :: Text
jobId = Text
pJobId_}
describeKeyPhrasesDetectionJob_jobId :: Lens.Lens' DescribeKeyPhrasesDetectionJob Prelude.Text
describeKeyPhrasesDetectionJob_jobId :: (Text -> f Text)
-> DescribeKeyPhrasesDetectionJob
-> f DescribeKeyPhrasesDetectionJob
describeKeyPhrasesDetectionJob_jobId = (DescribeKeyPhrasesDetectionJob -> Text)
-> (DescribeKeyPhrasesDetectionJob
-> Text -> DescribeKeyPhrasesDetectionJob)
-> Lens
DescribeKeyPhrasesDetectionJob
DescribeKeyPhrasesDetectionJob
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeKeyPhrasesDetectionJob' {Text
jobId :: Text
$sel:jobId:DescribeKeyPhrasesDetectionJob' :: DescribeKeyPhrasesDetectionJob -> Text
jobId} -> Text
jobId) (\s :: DescribeKeyPhrasesDetectionJob
s@DescribeKeyPhrasesDetectionJob' {} Text
a -> DescribeKeyPhrasesDetectionJob
s {$sel:jobId:DescribeKeyPhrasesDetectionJob' :: Text
jobId = Text
a} :: DescribeKeyPhrasesDetectionJob)
instance
Core.AWSRequest
DescribeKeyPhrasesDetectionJob
where
type
AWSResponse DescribeKeyPhrasesDetectionJob =
DescribeKeyPhrasesDetectionJobResponse
request :: DescribeKeyPhrasesDetectionJob
-> Request DescribeKeyPhrasesDetectionJob
request = Service
-> DescribeKeyPhrasesDetectionJob
-> Request DescribeKeyPhrasesDetectionJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeKeyPhrasesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeKeyPhrasesDetectionJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeKeyPhrasesDetectionJob))
-> Logger
-> Service
-> Proxy DescribeKeyPhrasesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeKeyPhrasesDetectionJob)))
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 KeyPhrasesDetectionJobProperties
-> Int -> DescribeKeyPhrasesDetectionJobResponse
DescribeKeyPhrasesDetectionJobResponse'
(Maybe KeyPhrasesDetectionJobProperties
-> Int -> DescribeKeyPhrasesDetectionJobResponse)
-> Either String (Maybe KeyPhrasesDetectionJobProperties)
-> Either String (Int -> DescribeKeyPhrasesDetectionJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe KeyPhrasesDetectionJobProperties)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"KeyPhrasesDetectionJobProperties")
Either String (Int -> DescribeKeyPhrasesDetectionJobResponse)
-> Either String Int
-> Either String DescribeKeyPhrasesDetectionJobResponse
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
DescribeKeyPhrasesDetectionJob
instance
Prelude.NFData
DescribeKeyPhrasesDetectionJob
instance
Core.ToHeaders
DescribeKeyPhrasesDetectionJob
where
toHeaders :: DescribeKeyPhrasesDetectionJob -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeKeyPhrasesDetectionJob -> 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.DescribeKeyPhrasesDetectionJob" ::
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 DescribeKeyPhrasesDetectionJob where
toJSON :: DescribeKeyPhrasesDetectionJob -> Value
toJSON DescribeKeyPhrasesDetectionJob' {Text
jobId :: Text
$sel:jobId:DescribeKeyPhrasesDetectionJob' :: DescribeKeyPhrasesDetectionJob -> 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 DescribeKeyPhrasesDetectionJob where
toPath :: DescribeKeyPhrasesDetectionJob -> ByteString
toPath = ByteString -> DescribeKeyPhrasesDetectionJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeKeyPhrasesDetectionJob where
toQuery :: DescribeKeyPhrasesDetectionJob -> QueryString
toQuery = QueryString -> DescribeKeyPhrasesDetectionJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeKeyPhrasesDetectionJobResponse = DescribeKeyPhrasesDetectionJobResponse'
{
DescribeKeyPhrasesDetectionJobResponse
-> Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties :: Prelude.Maybe KeyPhrasesDetectionJobProperties,
DescribeKeyPhrasesDetectionJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeKeyPhrasesDetectionJobResponse
-> DescribeKeyPhrasesDetectionJobResponse -> Bool
(DescribeKeyPhrasesDetectionJobResponse
-> DescribeKeyPhrasesDetectionJobResponse -> Bool)
-> (DescribeKeyPhrasesDetectionJobResponse
-> DescribeKeyPhrasesDetectionJobResponse -> Bool)
-> Eq DescribeKeyPhrasesDetectionJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeKeyPhrasesDetectionJobResponse
-> DescribeKeyPhrasesDetectionJobResponse -> Bool
$c/= :: DescribeKeyPhrasesDetectionJobResponse
-> DescribeKeyPhrasesDetectionJobResponse -> Bool
== :: DescribeKeyPhrasesDetectionJobResponse
-> DescribeKeyPhrasesDetectionJobResponse -> Bool
$c== :: DescribeKeyPhrasesDetectionJobResponse
-> DescribeKeyPhrasesDetectionJobResponse -> Bool
Prelude.Eq, ReadPrec [DescribeKeyPhrasesDetectionJobResponse]
ReadPrec DescribeKeyPhrasesDetectionJobResponse
Int -> ReadS DescribeKeyPhrasesDetectionJobResponse
ReadS [DescribeKeyPhrasesDetectionJobResponse]
(Int -> ReadS DescribeKeyPhrasesDetectionJobResponse)
-> ReadS [DescribeKeyPhrasesDetectionJobResponse]
-> ReadPrec DescribeKeyPhrasesDetectionJobResponse
-> ReadPrec [DescribeKeyPhrasesDetectionJobResponse]
-> Read DescribeKeyPhrasesDetectionJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeKeyPhrasesDetectionJobResponse]
$creadListPrec :: ReadPrec [DescribeKeyPhrasesDetectionJobResponse]
readPrec :: ReadPrec DescribeKeyPhrasesDetectionJobResponse
$creadPrec :: ReadPrec DescribeKeyPhrasesDetectionJobResponse
readList :: ReadS [DescribeKeyPhrasesDetectionJobResponse]
$creadList :: ReadS [DescribeKeyPhrasesDetectionJobResponse]
readsPrec :: Int -> ReadS DescribeKeyPhrasesDetectionJobResponse
$creadsPrec :: Int -> ReadS DescribeKeyPhrasesDetectionJobResponse
Prelude.Read, Int -> DescribeKeyPhrasesDetectionJobResponse -> ShowS
[DescribeKeyPhrasesDetectionJobResponse] -> ShowS
DescribeKeyPhrasesDetectionJobResponse -> String
(Int -> DescribeKeyPhrasesDetectionJobResponse -> ShowS)
-> (DescribeKeyPhrasesDetectionJobResponse -> String)
-> ([DescribeKeyPhrasesDetectionJobResponse] -> ShowS)
-> Show DescribeKeyPhrasesDetectionJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeKeyPhrasesDetectionJobResponse] -> ShowS
$cshowList :: [DescribeKeyPhrasesDetectionJobResponse] -> ShowS
show :: DescribeKeyPhrasesDetectionJobResponse -> String
$cshow :: DescribeKeyPhrasesDetectionJobResponse -> String
showsPrec :: Int -> DescribeKeyPhrasesDetectionJobResponse -> ShowS
$cshowsPrec :: Int -> DescribeKeyPhrasesDetectionJobResponse -> ShowS
Prelude.Show, (forall x.
DescribeKeyPhrasesDetectionJobResponse
-> Rep DescribeKeyPhrasesDetectionJobResponse x)
-> (forall x.
Rep DescribeKeyPhrasesDetectionJobResponse x
-> DescribeKeyPhrasesDetectionJobResponse)
-> Generic DescribeKeyPhrasesDetectionJobResponse
forall x.
Rep DescribeKeyPhrasesDetectionJobResponse x
-> DescribeKeyPhrasesDetectionJobResponse
forall x.
DescribeKeyPhrasesDetectionJobResponse
-> Rep DescribeKeyPhrasesDetectionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeKeyPhrasesDetectionJobResponse x
-> DescribeKeyPhrasesDetectionJobResponse
$cfrom :: forall x.
DescribeKeyPhrasesDetectionJobResponse
-> Rep DescribeKeyPhrasesDetectionJobResponse x
Prelude.Generic)
newDescribeKeyPhrasesDetectionJobResponse ::
Prelude.Int ->
DescribeKeyPhrasesDetectionJobResponse
newDescribeKeyPhrasesDetectionJobResponse :: Int -> DescribeKeyPhrasesDetectionJobResponse
newDescribeKeyPhrasesDetectionJobResponse
Int
pHttpStatus_ =
DescribeKeyPhrasesDetectionJobResponse' :: Maybe KeyPhrasesDetectionJobProperties
-> Int -> DescribeKeyPhrasesDetectionJobResponse
DescribeKeyPhrasesDetectionJobResponse'
{ $sel:keyPhrasesDetectionJobProperties:DescribeKeyPhrasesDetectionJobResponse' :: Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties =
Maybe KeyPhrasesDetectionJobProperties
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeKeyPhrasesDetectionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeKeyPhrasesDetectionJobResponse_keyPhrasesDetectionJobProperties :: Lens.Lens' DescribeKeyPhrasesDetectionJobResponse (Prelude.Maybe KeyPhrasesDetectionJobProperties)
describeKeyPhrasesDetectionJobResponse_keyPhrasesDetectionJobProperties :: (Maybe KeyPhrasesDetectionJobProperties
-> f (Maybe KeyPhrasesDetectionJobProperties))
-> DescribeKeyPhrasesDetectionJobResponse
-> f DescribeKeyPhrasesDetectionJobResponse
describeKeyPhrasesDetectionJobResponse_keyPhrasesDetectionJobProperties = (DescribeKeyPhrasesDetectionJobResponse
-> Maybe KeyPhrasesDetectionJobProperties)
-> (DescribeKeyPhrasesDetectionJobResponse
-> Maybe KeyPhrasesDetectionJobProperties
-> DescribeKeyPhrasesDetectionJobResponse)
-> Lens
DescribeKeyPhrasesDetectionJobResponse
DescribeKeyPhrasesDetectionJobResponse
(Maybe KeyPhrasesDetectionJobProperties)
(Maybe KeyPhrasesDetectionJobProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeKeyPhrasesDetectionJobResponse' {Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties :: Maybe KeyPhrasesDetectionJobProperties
$sel:keyPhrasesDetectionJobProperties:DescribeKeyPhrasesDetectionJobResponse' :: DescribeKeyPhrasesDetectionJobResponse
-> Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties} -> Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties) (\s :: DescribeKeyPhrasesDetectionJobResponse
s@DescribeKeyPhrasesDetectionJobResponse' {} Maybe KeyPhrasesDetectionJobProperties
a -> DescribeKeyPhrasesDetectionJobResponse
s {$sel:keyPhrasesDetectionJobProperties:DescribeKeyPhrasesDetectionJobResponse' :: Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties = Maybe KeyPhrasesDetectionJobProperties
a} :: DescribeKeyPhrasesDetectionJobResponse)
describeKeyPhrasesDetectionJobResponse_httpStatus :: Lens.Lens' DescribeKeyPhrasesDetectionJobResponse Prelude.Int
describeKeyPhrasesDetectionJobResponse_httpStatus :: (Int -> f Int)
-> DescribeKeyPhrasesDetectionJobResponse
-> f DescribeKeyPhrasesDetectionJobResponse
describeKeyPhrasesDetectionJobResponse_httpStatus = (DescribeKeyPhrasesDetectionJobResponse -> Int)
-> (DescribeKeyPhrasesDetectionJobResponse
-> Int -> DescribeKeyPhrasesDetectionJobResponse)
-> Lens
DescribeKeyPhrasesDetectionJobResponse
DescribeKeyPhrasesDetectionJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeKeyPhrasesDetectionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeKeyPhrasesDetectionJobResponse' :: DescribeKeyPhrasesDetectionJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeKeyPhrasesDetectionJobResponse
s@DescribeKeyPhrasesDetectionJobResponse' {} Int
a -> DescribeKeyPhrasesDetectionJobResponse
s {$sel:httpStatus:DescribeKeyPhrasesDetectionJobResponse' :: Int
httpStatus = Int
a} :: DescribeKeyPhrasesDetectionJobResponse)
instance
Prelude.NFData
DescribeKeyPhrasesDetectionJobResponse