{-# 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.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 DescribeKeyPhrasesDetectionJob = DescribeKeyPhrasesDetectionJob'
{
DescribeKeyPhrasesDetectionJob -> Text
jobId :: Prelude.Text
}
deriving (DescribeKeyPhrasesDetectionJob
-> DescribeKeyPhrasesDetectionJob -> Bool
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]
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
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.
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' {$sel:jobId:DescribeKeyPhrasesDetectionJob' :: Text
jobId = Text
pJobId_}
describeKeyPhrasesDetectionJob_jobId :: Lens.Lens' DescribeKeyPhrasesDetectionJob Prelude.Text
describeKeyPhrasesDetectionJob_jobId :: Lens' DescribeKeyPhrasesDetectionJob Text
describeKeyPhrasesDetectionJob_jobId = 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 :: (Service -> Service)
-> DescribeKeyPhrasesDetectionJob
-> Request DescribeKeyPhrasesDetectionJob
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 DescribeKeyPhrasesDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeKeyPhrasesDetectionJob)))
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 KeyPhrasesDetectionJobProperties
-> Int -> DescribeKeyPhrasesDetectionJobResponse
DescribeKeyPhrasesDetectionJobResponse'
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
"KeyPhrasesDetectionJobProperties")
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
DescribeKeyPhrasesDetectionJob
where
hashWithSalt :: Int -> DescribeKeyPhrasesDetectionJob -> Int
hashWithSalt
Int
_salt
DescribeKeyPhrasesDetectionJob' {Text
jobId :: Text
$sel:jobId:DescribeKeyPhrasesDetectionJob' :: DescribeKeyPhrasesDetectionJob -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
instance
Prelude.NFData
DescribeKeyPhrasesDetectionJob
where
rnf :: DescribeKeyPhrasesDetectionJob -> ()
rnf DescribeKeyPhrasesDetectionJob' {Text
jobId :: Text
$sel:jobId:DescribeKeyPhrasesDetectionJob' :: DescribeKeyPhrasesDetectionJob -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
instance
Data.ToHeaders
DescribeKeyPhrasesDetectionJob
where
toHeaders :: DescribeKeyPhrasesDetectionJob -> 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.DescribeKeyPhrasesDetectionJob" ::
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 DescribeKeyPhrasesDetectionJob where
toJSON :: DescribeKeyPhrasesDetectionJob -> Value
toJSON DescribeKeyPhrasesDetectionJob' {Text
jobId :: Text
$sel:jobId:DescribeKeyPhrasesDetectionJob' :: DescribeKeyPhrasesDetectionJob -> 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 DescribeKeyPhrasesDetectionJob where
toPath :: DescribeKeyPhrasesDetectionJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeKeyPhrasesDetectionJob where
toQuery :: DescribeKeyPhrasesDetectionJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:keyPhrasesDetectionJobProperties:DescribeKeyPhrasesDetectionJobResponse' :: Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeKeyPhrasesDetectionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeKeyPhrasesDetectionJobResponse_keyPhrasesDetectionJobProperties :: Lens.Lens' DescribeKeyPhrasesDetectionJobResponse (Prelude.Maybe KeyPhrasesDetectionJobProperties)
describeKeyPhrasesDetectionJobResponse_keyPhrasesDetectionJobProperties :: Lens'
DescribeKeyPhrasesDetectionJobResponse
(Maybe KeyPhrasesDetectionJobProperties)
describeKeyPhrasesDetectionJobResponse_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 :: Lens' DescribeKeyPhrasesDetectionJobResponse Int
describeKeyPhrasesDetectionJobResponse_httpStatus = 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
where
rnf :: DescribeKeyPhrasesDetectionJobResponse -> ()
rnf DescribeKeyPhrasesDetectionJobResponse' {Int
Maybe KeyPhrasesDetectionJobProperties
httpStatus :: Int
keyPhrasesDetectionJobProperties :: Maybe KeyPhrasesDetectionJobProperties
$sel:httpStatus:DescribeKeyPhrasesDetectionJobResponse' :: DescribeKeyPhrasesDetectionJobResponse -> Int
$sel:keyPhrasesDetectionJobProperties:DescribeKeyPhrasesDetectionJobResponse' :: DescribeKeyPhrasesDetectionJobResponse
-> Maybe KeyPhrasesDetectionJobProperties
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe KeyPhrasesDetectionJobProperties
keyPhrasesDetectionJobProperties
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus