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