{-# 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.StopSentimentDetectionJob
(
StopSentimentDetectionJob (..),
newStopSentimentDetectionJob,
stopSentimentDetectionJob_jobId,
StopSentimentDetectionJobResponse (..),
newStopSentimentDetectionJobResponse,
stopSentimentDetectionJobResponse_jobId,
stopSentimentDetectionJobResponse_jobStatus,
stopSentimentDetectionJobResponse_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 StopSentimentDetectionJob = StopSentimentDetectionJob'
{
StopSentimentDetectionJob -> Text
jobId :: Prelude.Text
}
deriving (StopSentimentDetectionJob -> StopSentimentDetectionJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopSentimentDetectionJob -> StopSentimentDetectionJob -> Bool
$c/= :: StopSentimentDetectionJob -> StopSentimentDetectionJob -> Bool
== :: StopSentimentDetectionJob -> StopSentimentDetectionJob -> Bool
$c== :: StopSentimentDetectionJob -> StopSentimentDetectionJob -> Bool
Prelude.Eq, ReadPrec [StopSentimentDetectionJob]
ReadPrec StopSentimentDetectionJob
Int -> ReadS StopSentimentDetectionJob
ReadS [StopSentimentDetectionJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopSentimentDetectionJob]
$creadListPrec :: ReadPrec [StopSentimentDetectionJob]
readPrec :: ReadPrec StopSentimentDetectionJob
$creadPrec :: ReadPrec StopSentimentDetectionJob
readList :: ReadS [StopSentimentDetectionJob]
$creadList :: ReadS [StopSentimentDetectionJob]
readsPrec :: Int -> ReadS StopSentimentDetectionJob
$creadsPrec :: Int -> ReadS StopSentimentDetectionJob
Prelude.Read, Int -> StopSentimentDetectionJob -> ShowS
[StopSentimentDetectionJob] -> ShowS
StopSentimentDetectionJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopSentimentDetectionJob] -> ShowS
$cshowList :: [StopSentimentDetectionJob] -> ShowS
show :: StopSentimentDetectionJob -> String
$cshow :: StopSentimentDetectionJob -> String
showsPrec :: Int -> StopSentimentDetectionJob -> ShowS
$cshowsPrec :: Int -> StopSentimentDetectionJob -> ShowS
Prelude.Show, forall x.
Rep StopSentimentDetectionJob x -> StopSentimentDetectionJob
forall x.
StopSentimentDetectionJob -> Rep StopSentimentDetectionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopSentimentDetectionJob x -> StopSentimentDetectionJob
$cfrom :: forall x.
StopSentimentDetectionJob -> Rep StopSentimentDetectionJob x
Prelude.Generic)
newStopSentimentDetectionJob ::
Prelude.Text ->
StopSentimentDetectionJob
newStopSentimentDetectionJob :: Text -> StopSentimentDetectionJob
newStopSentimentDetectionJob Text
pJobId_ =
StopSentimentDetectionJob' {$sel:jobId:StopSentimentDetectionJob' :: Text
jobId = Text
pJobId_}
stopSentimentDetectionJob_jobId :: Lens.Lens' StopSentimentDetectionJob Prelude.Text
stopSentimentDetectionJob_jobId :: Lens' StopSentimentDetectionJob Text
stopSentimentDetectionJob_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopSentimentDetectionJob' {Text
jobId :: Text
$sel:jobId:StopSentimentDetectionJob' :: StopSentimentDetectionJob -> Text
jobId} -> Text
jobId) (\s :: StopSentimentDetectionJob
s@StopSentimentDetectionJob' {} Text
a -> StopSentimentDetectionJob
s {$sel:jobId:StopSentimentDetectionJob' :: Text
jobId = Text
a} :: StopSentimentDetectionJob)
instance Core.AWSRequest StopSentimentDetectionJob where
type
AWSResponse StopSentimentDetectionJob =
StopSentimentDetectionJobResponse
request :: (Service -> Service)
-> StopSentimentDetectionJob -> Request StopSentimentDetectionJob
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 StopSentimentDetectionJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopSentimentDetectionJob)))
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 -> StopSentimentDetectionJobResponse
StopSentimentDetectionJobResponse'
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 StopSentimentDetectionJob where
hashWithSalt :: Int -> StopSentimentDetectionJob -> Int
hashWithSalt Int
_salt StopSentimentDetectionJob' {Text
jobId :: Text
$sel:jobId:StopSentimentDetectionJob' :: StopSentimentDetectionJob -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
instance Prelude.NFData StopSentimentDetectionJob where
rnf :: StopSentimentDetectionJob -> ()
rnf StopSentimentDetectionJob' {Text
jobId :: Text
$sel:jobId:StopSentimentDetectionJob' :: StopSentimentDetectionJob -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
instance Data.ToHeaders StopSentimentDetectionJob where
toHeaders :: StopSentimentDetectionJob -> 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.StopSentimentDetectionJob" ::
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 StopSentimentDetectionJob where
toJSON :: StopSentimentDetectionJob -> Value
toJSON StopSentimentDetectionJob' {Text
jobId :: Text
$sel:jobId:StopSentimentDetectionJob' :: StopSentimentDetectionJob -> 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 StopSentimentDetectionJob where
toPath :: StopSentimentDetectionJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopSentimentDetectionJob where
toQuery :: StopSentimentDetectionJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopSentimentDetectionJobResponse = StopSentimentDetectionJobResponse'
{
StopSentimentDetectionJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
StopSentimentDetectionJobResponse -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
StopSentimentDetectionJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopSentimentDetectionJobResponse
-> StopSentimentDetectionJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopSentimentDetectionJobResponse
-> StopSentimentDetectionJobResponse -> Bool
$c/= :: StopSentimentDetectionJobResponse
-> StopSentimentDetectionJobResponse -> Bool
== :: StopSentimentDetectionJobResponse
-> StopSentimentDetectionJobResponse -> Bool
$c== :: StopSentimentDetectionJobResponse
-> StopSentimentDetectionJobResponse -> Bool
Prelude.Eq, ReadPrec [StopSentimentDetectionJobResponse]
ReadPrec StopSentimentDetectionJobResponse
Int -> ReadS StopSentimentDetectionJobResponse
ReadS [StopSentimentDetectionJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopSentimentDetectionJobResponse]
$creadListPrec :: ReadPrec [StopSentimentDetectionJobResponse]
readPrec :: ReadPrec StopSentimentDetectionJobResponse
$creadPrec :: ReadPrec StopSentimentDetectionJobResponse
readList :: ReadS [StopSentimentDetectionJobResponse]
$creadList :: ReadS [StopSentimentDetectionJobResponse]
readsPrec :: Int -> ReadS StopSentimentDetectionJobResponse
$creadsPrec :: Int -> ReadS StopSentimentDetectionJobResponse
Prelude.Read, Int -> StopSentimentDetectionJobResponse -> ShowS
[StopSentimentDetectionJobResponse] -> ShowS
StopSentimentDetectionJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopSentimentDetectionJobResponse] -> ShowS
$cshowList :: [StopSentimentDetectionJobResponse] -> ShowS
show :: StopSentimentDetectionJobResponse -> String
$cshow :: StopSentimentDetectionJobResponse -> String
showsPrec :: Int -> StopSentimentDetectionJobResponse -> ShowS
$cshowsPrec :: Int -> StopSentimentDetectionJobResponse -> ShowS
Prelude.Show, forall x.
Rep StopSentimentDetectionJobResponse x
-> StopSentimentDetectionJobResponse
forall x.
StopSentimentDetectionJobResponse
-> Rep StopSentimentDetectionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopSentimentDetectionJobResponse x
-> StopSentimentDetectionJobResponse
$cfrom :: forall x.
StopSentimentDetectionJobResponse
-> Rep StopSentimentDetectionJobResponse x
Prelude.Generic)
newStopSentimentDetectionJobResponse ::
Prelude.Int ->
StopSentimentDetectionJobResponse
newStopSentimentDetectionJobResponse :: Int -> StopSentimentDetectionJobResponse
newStopSentimentDetectionJobResponse Int
pHttpStatus_ =
StopSentimentDetectionJobResponse'
{ $sel:jobId:StopSentimentDetectionJobResponse' :: Maybe Text
jobId =
forall a. Maybe a
Prelude.Nothing,
$sel:jobStatus:StopSentimentDetectionJobResponse' :: Maybe JobStatus
jobStatus = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopSentimentDetectionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopSentimentDetectionJobResponse_jobId :: Lens.Lens' StopSentimentDetectionJobResponse (Prelude.Maybe Prelude.Text)
stopSentimentDetectionJobResponse_jobId :: Lens' StopSentimentDetectionJobResponse (Maybe Text)
stopSentimentDetectionJobResponse_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopSentimentDetectionJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StopSentimentDetectionJobResponse' :: StopSentimentDetectionJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StopSentimentDetectionJobResponse
s@StopSentimentDetectionJobResponse' {} Maybe Text
a -> StopSentimentDetectionJobResponse
s {$sel:jobId:StopSentimentDetectionJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: StopSentimentDetectionJobResponse)
stopSentimentDetectionJobResponse_jobStatus :: Lens.Lens' StopSentimentDetectionJobResponse (Prelude.Maybe JobStatus)
stopSentimentDetectionJobResponse_jobStatus :: Lens' StopSentimentDetectionJobResponse (Maybe JobStatus)
stopSentimentDetectionJobResponse_jobStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopSentimentDetectionJobResponse' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:StopSentimentDetectionJobResponse' :: StopSentimentDetectionJobResponse -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: StopSentimentDetectionJobResponse
s@StopSentimentDetectionJobResponse' {} Maybe JobStatus
a -> StopSentimentDetectionJobResponse
s {$sel:jobStatus:StopSentimentDetectionJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: StopSentimentDetectionJobResponse)
stopSentimentDetectionJobResponse_httpStatus :: Lens.Lens' StopSentimentDetectionJobResponse Prelude.Int
stopSentimentDetectionJobResponse_httpStatus :: Lens' StopSentimentDetectionJobResponse Int
stopSentimentDetectionJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopSentimentDetectionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopSentimentDetectionJobResponse' :: StopSentimentDetectionJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopSentimentDetectionJobResponse
s@StopSentimentDetectionJobResponse' {} Int
a -> StopSentimentDetectionJobResponse
s {$sel:httpStatus:StopSentimentDetectionJobResponse' :: Int
httpStatus = Int
a} :: StopSentimentDetectionJobResponse)
instance
Prelude.NFData
StopSentimentDetectionJobResponse
where
rnf :: StopSentimentDetectionJobResponse -> ()
rnf StopSentimentDetectionJobResponse' {Int
Maybe Text
Maybe JobStatus
httpStatus :: Int
jobStatus :: Maybe JobStatus
jobId :: Maybe Text
$sel:httpStatus:StopSentimentDetectionJobResponse' :: StopSentimentDetectionJobResponse -> Int
$sel:jobStatus:StopSentimentDetectionJobResponse' :: StopSentimentDetectionJobResponse -> Maybe JobStatus
$sel:jobId:StopSentimentDetectionJobResponse' :: StopSentimentDetectionJobResponse -> 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