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