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