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