{-# 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.StartTextTranslationJob
(
StartTextTranslationJob (..),
newStartTextTranslationJob,
startTextTranslationJob_jobName,
startTextTranslationJob_parallelDataNames,
startTextTranslationJob_terminologyNames,
startTextTranslationJob_inputDataConfig,
startTextTranslationJob_outputDataConfig,
startTextTranslationJob_dataAccessRoleArn,
startTextTranslationJob_sourceLanguageCode,
startTextTranslationJob_targetLanguageCodes,
startTextTranslationJob_clientToken,
StartTextTranslationJobResponse (..),
newStartTextTranslationJobResponse,
startTextTranslationJobResponse_jobId,
startTextTranslationJobResponse_jobStatus,
startTextTranslationJobResponse_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 StartTextTranslationJob = StartTextTranslationJob'
{
StartTextTranslationJob -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
StartTextTranslationJob -> Maybe [Text]
parallelDataNames :: Prelude.Maybe [Prelude.Text],
StartTextTranslationJob -> Maybe [Text]
terminologyNames :: Prelude.Maybe [Prelude.Text],
StartTextTranslationJob -> InputDataConfig
inputDataConfig :: InputDataConfig,
StartTextTranslationJob -> OutputDataConfig
outputDataConfig :: OutputDataConfig,
StartTextTranslationJob -> Text
dataAccessRoleArn :: Prelude.Text,
StartTextTranslationJob -> Text
sourceLanguageCode :: Prelude.Text,
StartTextTranslationJob -> NonEmpty Text
targetLanguageCodes :: Prelude.NonEmpty Prelude.Text,
StartTextTranslationJob -> Text
clientToken :: Prelude.Text
}
deriving (StartTextTranslationJob -> StartTextTranslationJob -> Bool
(StartTextTranslationJob -> StartTextTranslationJob -> Bool)
-> (StartTextTranslationJob -> StartTextTranslationJob -> Bool)
-> Eq StartTextTranslationJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTextTranslationJob -> StartTextTranslationJob -> Bool
$c/= :: StartTextTranslationJob -> StartTextTranslationJob -> Bool
== :: StartTextTranslationJob -> StartTextTranslationJob -> Bool
$c== :: StartTextTranslationJob -> StartTextTranslationJob -> Bool
Prelude.Eq, ReadPrec [StartTextTranslationJob]
ReadPrec StartTextTranslationJob
Int -> ReadS StartTextTranslationJob
ReadS [StartTextTranslationJob]
(Int -> ReadS StartTextTranslationJob)
-> ReadS [StartTextTranslationJob]
-> ReadPrec StartTextTranslationJob
-> ReadPrec [StartTextTranslationJob]
-> Read StartTextTranslationJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTextTranslationJob]
$creadListPrec :: ReadPrec [StartTextTranslationJob]
readPrec :: ReadPrec StartTextTranslationJob
$creadPrec :: ReadPrec StartTextTranslationJob
readList :: ReadS [StartTextTranslationJob]
$creadList :: ReadS [StartTextTranslationJob]
readsPrec :: Int -> ReadS StartTextTranslationJob
$creadsPrec :: Int -> ReadS StartTextTranslationJob
Prelude.Read, Int -> StartTextTranslationJob -> ShowS
[StartTextTranslationJob] -> ShowS
StartTextTranslationJob -> String
(Int -> StartTextTranslationJob -> ShowS)
-> (StartTextTranslationJob -> String)
-> ([StartTextTranslationJob] -> ShowS)
-> Show StartTextTranslationJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTextTranslationJob] -> ShowS
$cshowList :: [StartTextTranslationJob] -> ShowS
show :: StartTextTranslationJob -> String
$cshow :: StartTextTranslationJob -> String
showsPrec :: Int -> StartTextTranslationJob -> ShowS
$cshowsPrec :: Int -> StartTextTranslationJob -> ShowS
Prelude.Show, (forall x.
StartTextTranslationJob -> Rep StartTextTranslationJob x)
-> (forall x.
Rep StartTextTranslationJob x -> StartTextTranslationJob)
-> Generic StartTextTranslationJob
forall x. Rep StartTextTranslationJob x -> StartTextTranslationJob
forall x. StartTextTranslationJob -> Rep StartTextTranslationJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTextTranslationJob x -> StartTextTranslationJob
$cfrom :: forall x. StartTextTranslationJob -> Rep StartTextTranslationJob x
Prelude.Generic)
newStartTextTranslationJob ::
InputDataConfig ->
OutputDataConfig ->
Prelude.Text ->
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
Prelude.Text ->
StartTextTranslationJob
newStartTextTranslationJob :: InputDataConfig
-> OutputDataConfig
-> Text
-> Text
-> NonEmpty Text
-> Text
-> StartTextTranslationJob
newStartTextTranslationJob
InputDataConfig
pInputDataConfig_
OutputDataConfig
pOutputDataConfig_
Text
pDataAccessRoleArn_
Text
pSourceLanguageCode_
NonEmpty Text
pTargetLanguageCodes_
Text
pClientToken_ =
StartTextTranslationJob' :: Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> InputDataConfig
-> OutputDataConfig
-> Text
-> Text
-> NonEmpty Text
-> Text
-> StartTextTranslationJob
StartTextTranslationJob'
{ $sel:jobName:StartTextTranslationJob' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parallelDataNames:StartTextTranslationJob' :: Maybe [Text]
parallelDataNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:terminologyNames:StartTextTranslationJob' :: Maybe [Text]
terminologyNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:inputDataConfig:StartTextTranslationJob' :: InputDataConfig
inputDataConfig = InputDataConfig
pInputDataConfig_,
$sel:outputDataConfig:StartTextTranslationJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
pOutputDataConfig_,
$sel:dataAccessRoleArn:StartTextTranslationJob' :: Text
dataAccessRoleArn = Text
pDataAccessRoleArn_,
$sel:sourceLanguageCode:StartTextTranslationJob' :: Text
sourceLanguageCode = Text
pSourceLanguageCode_,
$sel:targetLanguageCodes:StartTextTranslationJob' :: NonEmpty Text
targetLanguageCodes =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pTargetLanguageCodes_,
$sel:clientToken:StartTextTranslationJob' :: Text
clientToken = Text
pClientToken_
}
startTextTranslationJob_jobName :: Lens.Lens' StartTextTranslationJob (Prelude.Maybe Prelude.Text)
startTextTranslationJob_jobName :: (Maybe Text -> f (Maybe Text))
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_jobName = (StartTextTranslationJob -> Maybe Text)
-> (StartTextTranslationJob
-> Maybe Text -> StartTextTranslationJob)
-> Lens
StartTextTranslationJob
StartTextTranslationJob
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {Maybe Text
jobName :: Maybe Text
$sel:jobName:StartTextTranslationJob' :: StartTextTranslationJob -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} Maybe Text
a -> StartTextTranslationJob
s {$sel:jobName:StartTextTranslationJob' :: Maybe Text
jobName = Maybe Text
a} :: StartTextTranslationJob)
startTextTranslationJob_parallelDataNames :: Lens.Lens' StartTextTranslationJob (Prelude.Maybe [Prelude.Text])
startTextTranslationJob_parallelDataNames :: (Maybe [Text] -> f (Maybe [Text]))
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_parallelDataNames = (StartTextTranslationJob -> Maybe [Text])
-> (StartTextTranslationJob
-> Maybe [Text] -> StartTextTranslationJob)
-> Lens
StartTextTranslationJob
StartTextTranslationJob
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {Maybe [Text]
parallelDataNames :: Maybe [Text]
$sel:parallelDataNames:StartTextTranslationJob' :: StartTextTranslationJob -> Maybe [Text]
parallelDataNames} -> Maybe [Text]
parallelDataNames) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} Maybe [Text]
a -> StartTextTranslationJob
s {$sel:parallelDataNames:StartTextTranslationJob' :: Maybe [Text]
parallelDataNames = Maybe [Text]
a} :: StartTextTranslationJob) ((Maybe [Text] -> f (Maybe [Text]))
-> StartTextTranslationJob -> f StartTextTranslationJob)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StartTextTranslationJob
-> f StartTextTranslationJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startTextTranslationJob_terminologyNames :: Lens.Lens' StartTextTranslationJob (Prelude.Maybe [Prelude.Text])
startTextTranslationJob_terminologyNames :: (Maybe [Text] -> f (Maybe [Text]))
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_terminologyNames = (StartTextTranslationJob -> Maybe [Text])
-> (StartTextTranslationJob
-> Maybe [Text] -> StartTextTranslationJob)
-> Lens
StartTextTranslationJob
StartTextTranslationJob
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {Maybe [Text]
terminologyNames :: Maybe [Text]
$sel:terminologyNames:StartTextTranslationJob' :: StartTextTranslationJob -> Maybe [Text]
terminologyNames} -> Maybe [Text]
terminologyNames) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} Maybe [Text]
a -> StartTextTranslationJob
s {$sel:terminologyNames:StartTextTranslationJob' :: Maybe [Text]
terminologyNames = Maybe [Text]
a} :: StartTextTranslationJob) ((Maybe [Text] -> f (Maybe [Text]))
-> StartTextTranslationJob -> f StartTextTranslationJob)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StartTextTranslationJob
-> f StartTextTranslationJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startTextTranslationJob_inputDataConfig :: Lens.Lens' StartTextTranslationJob InputDataConfig
startTextTranslationJob_inputDataConfig :: (InputDataConfig -> f InputDataConfig)
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_inputDataConfig = (StartTextTranslationJob -> InputDataConfig)
-> (StartTextTranslationJob
-> InputDataConfig -> StartTextTranslationJob)
-> Lens
StartTextTranslationJob
StartTextTranslationJob
InputDataConfig
InputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {InputDataConfig
inputDataConfig :: InputDataConfig
$sel:inputDataConfig:StartTextTranslationJob' :: StartTextTranslationJob -> InputDataConfig
inputDataConfig} -> InputDataConfig
inputDataConfig) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} InputDataConfig
a -> StartTextTranslationJob
s {$sel:inputDataConfig:StartTextTranslationJob' :: InputDataConfig
inputDataConfig = InputDataConfig
a} :: StartTextTranslationJob)
startTextTranslationJob_outputDataConfig :: Lens.Lens' StartTextTranslationJob OutputDataConfig
startTextTranslationJob_outputDataConfig :: (OutputDataConfig -> f OutputDataConfig)
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_outputDataConfig = (StartTextTranslationJob -> OutputDataConfig)
-> (StartTextTranslationJob
-> OutputDataConfig -> StartTextTranslationJob)
-> Lens
StartTextTranslationJob
StartTextTranslationJob
OutputDataConfig
OutputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {OutputDataConfig
outputDataConfig :: OutputDataConfig
$sel:outputDataConfig:StartTextTranslationJob' :: StartTextTranslationJob -> OutputDataConfig
outputDataConfig} -> OutputDataConfig
outputDataConfig) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} OutputDataConfig
a -> StartTextTranslationJob
s {$sel:outputDataConfig:StartTextTranslationJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
a} :: StartTextTranslationJob)
startTextTranslationJob_dataAccessRoleArn :: Lens.Lens' StartTextTranslationJob Prelude.Text
startTextTranslationJob_dataAccessRoleArn :: (Text -> f Text)
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_dataAccessRoleArn = (StartTextTranslationJob -> Text)
-> (StartTextTranslationJob -> Text -> StartTextTranslationJob)
-> Lens StartTextTranslationJob StartTextTranslationJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {Text
dataAccessRoleArn :: Text
$sel:dataAccessRoleArn:StartTextTranslationJob' :: StartTextTranslationJob -> Text
dataAccessRoleArn} -> Text
dataAccessRoleArn) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} Text
a -> StartTextTranslationJob
s {$sel:dataAccessRoleArn:StartTextTranslationJob' :: Text
dataAccessRoleArn = Text
a} :: StartTextTranslationJob)
startTextTranslationJob_sourceLanguageCode :: Lens.Lens' StartTextTranslationJob Prelude.Text
startTextTranslationJob_sourceLanguageCode :: (Text -> f Text)
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_sourceLanguageCode = (StartTextTranslationJob -> Text)
-> (StartTextTranslationJob -> Text -> StartTextTranslationJob)
-> Lens StartTextTranslationJob StartTextTranslationJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {Text
sourceLanguageCode :: Text
$sel:sourceLanguageCode:StartTextTranslationJob' :: StartTextTranslationJob -> Text
sourceLanguageCode} -> Text
sourceLanguageCode) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} Text
a -> StartTextTranslationJob
s {$sel:sourceLanguageCode:StartTextTranslationJob' :: Text
sourceLanguageCode = Text
a} :: StartTextTranslationJob)
startTextTranslationJob_targetLanguageCodes :: Lens.Lens' StartTextTranslationJob (Prelude.NonEmpty Prelude.Text)
startTextTranslationJob_targetLanguageCodes :: (NonEmpty Text -> f (NonEmpty Text))
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_targetLanguageCodes = (StartTextTranslationJob -> NonEmpty Text)
-> (StartTextTranslationJob
-> NonEmpty Text -> StartTextTranslationJob)
-> Lens
StartTextTranslationJob
StartTextTranslationJob
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {NonEmpty Text
targetLanguageCodes :: NonEmpty Text
$sel:targetLanguageCodes:StartTextTranslationJob' :: StartTextTranslationJob -> NonEmpty Text
targetLanguageCodes} -> NonEmpty Text
targetLanguageCodes) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} NonEmpty Text
a -> StartTextTranslationJob
s {$sel:targetLanguageCodes:StartTextTranslationJob' :: NonEmpty Text
targetLanguageCodes = NonEmpty Text
a} :: StartTextTranslationJob) ((NonEmpty Text -> f (NonEmpty Text))
-> StartTextTranslationJob -> f StartTextTranslationJob)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> StartTextTranslationJob
-> f StartTextTranslationJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startTextTranslationJob_clientToken :: Lens.Lens' StartTextTranslationJob Prelude.Text
startTextTranslationJob_clientToken :: (Text -> f Text)
-> StartTextTranslationJob -> f StartTextTranslationJob
startTextTranslationJob_clientToken = (StartTextTranslationJob -> Text)
-> (StartTextTranslationJob -> Text -> StartTextTranslationJob)
-> Lens StartTextTranslationJob StartTextTranslationJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJob' {Text
clientToken :: Text
$sel:clientToken:StartTextTranslationJob' :: StartTextTranslationJob -> Text
clientToken} -> Text
clientToken) (\s :: StartTextTranslationJob
s@StartTextTranslationJob' {} Text
a -> StartTextTranslationJob
s {$sel:clientToken:StartTextTranslationJob' :: Text
clientToken = Text
a} :: StartTextTranslationJob)
instance Core.AWSRequest StartTextTranslationJob where
type
AWSResponse StartTextTranslationJob =
StartTextTranslationJobResponse
request :: StartTextTranslationJob -> Request StartTextTranslationJob
request = Service
-> StartTextTranslationJob -> Request StartTextTranslationJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartTextTranslationJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartTextTranslationJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartTextTranslationJob))
-> Logger
-> Service
-> Proxy StartTextTranslationJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartTextTranslationJob)))
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 Text
-> Maybe JobStatus -> Int -> StartTextTranslationJobResponse
StartTextTranslationJobResponse'
(Maybe Text
-> Maybe JobStatus -> Int -> StartTextTranslationJobResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe JobStatus -> Int -> StartTextTranslationJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobId")
Either
String (Maybe JobStatus -> Int -> StartTextTranslationJobResponse)
-> Either String (Maybe JobStatus)
-> Either String (Int -> StartTextTranslationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobStatus")
Either String (Int -> StartTextTranslationJobResponse)
-> Either String Int
-> Either String StartTextTranslationJobResponse
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 StartTextTranslationJob
instance Prelude.NFData StartTextTranslationJob
instance Core.ToHeaders StartTextTranslationJob where
toHeaders :: StartTextTranslationJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartTextTranslationJob -> 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.StartTextTranslationJob" ::
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 StartTextTranslationJob where
toJSON :: StartTextTranslationJob -> Value
toJSON StartTextTranslationJob' {Maybe [Text]
Maybe Text
NonEmpty Text
Text
InputDataConfig
OutputDataConfig
clientToken :: Text
targetLanguageCodes :: NonEmpty Text
sourceLanguageCode :: Text
dataAccessRoleArn :: Text
outputDataConfig :: OutputDataConfig
inputDataConfig :: InputDataConfig
terminologyNames :: Maybe [Text]
parallelDataNames :: Maybe [Text]
jobName :: Maybe Text
$sel:clientToken:StartTextTranslationJob' :: StartTextTranslationJob -> Text
$sel:targetLanguageCodes:StartTextTranslationJob' :: StartTextTranslationJob -> NonEmpty Text
$sel:sourceLanguageCode:StartTextTranslationJob' :: StartTextTranslationJob -> Text
$sel:dataAccessRoleArn:StartTextTranslationJob' :: StartTextTranslationJob -> Text
$sel:outputDataConfig:StartTextTranslationJob' :: StartTextTranslationJob -> OutputDataConfig
$sel:inputDataConfig:StartTextTranslationJob' :: StartTextTranslationJob -> InputDataConfig
$sel:terminologyNames:StartTextTranslationJob' :: StartTextTranslationJob -> Maybe [Text]
$sel:parallelDataNames:StartTextTranslationJob' :: StartTextTranslationJob -> Maybe [Text]
$sel:jobName:StartTextTranslationJob' :: StartTextTranslationJob -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"JobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobName,
(Text
"ParallelDataNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
parallelDataNames,
(Text
"TerminologyNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
terminologyNames,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"InputDataConfig" Text -> InputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputDataConfig
inputDataConfig),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"OutputDataConfig" Text -> OutputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputDataConfig
outputDataConfig),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DataAccessRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataAccessRoleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SourceLanguageCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceLanguageCode),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"TargetLanguageCodes" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
targetLanguageCodes),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
]
)
instance Core.ToPath StartTextTranslationJob where
toPath :: StartTextTranslationJob -> ByteString
toPath = ByteString -> StartTextTranslationJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartTextTranslationJob where
toQuery :: StartTextTranslationJob -> QueryString
toQuery = QueryString -> StartTextTranslationJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartTextTranslationJobResponse = StartTextTranslationJobResponse'
{
StartTextTranslationJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
StartTextTranslationJobResponse -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
StartTextTranslationJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartTextTranslationJobResponse
-> StartTextTranslationJobResponse -> Bool
(StartTextTranslationJobResponse
-> StartTextTranslationJobResponse -> Bool)
-> (StartTextTranslationJobResponse
-> StartTextTranslationJobResponse -> Bool)
-> Eq StartTextTranslationJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTextTranslationJobResponse
-> StartTextTranslationJobResponse -> Bool
$c/= :: StartTextTranslationJobResponse
-> StartTextTranslationJobResponse -> Bool
== :: StartTextTranslationJobResponse
-> StartTextTranslationJobResponse -> Bool
$c== :: StartTextTranslationJobResponse
-> StartTextTranslationJobResponse -> Bool
Prelude.Eq, ReadPrec [StartTextTranslationJobResponse]
ReadPrec StartTextTranslationJobResponse
Int -> ReadS StartTextTranslationJobResponse
ReadS [StartTextTranslationJobResponse]
(Int -> ReadS StartTextTranslationJobResponse)
-> ReadS [StartTextTranslationJobResponse]
-> ReadPrec StartTextTranslationJobResponse
-> ReadPrec [StartTextTranslationJobResponse]
-> Read StartTextTranslationJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTextTranslationJobResponse]
$creadListPrec :: ReadPrec [StartTextTranslationJobResponse]
readPrec :: ReadPrec StartTextTranslationJobResponse
$creadPrec :: ReadPrec StartTextTranslationJobResponse
readList :: ReadS [StartTextTranslationJobResponse]
$creadList :: ReadS [StartTextTranslationJobResponse]
readsPrec :: Int -> ReadS StartTextTranslationJobResponse
$creadsPrec :: Int -> ReadS StartTextTranslationJobResponse
Prelude.Read, Int -> StartTextTranslationJobResponse -> ShowS
[StartTextTranslationJobResponse] -> ShowS
StartTextTranslationJobResponse -> String
(Int -> StartTextTranslationJobResponse -> ShowS)
-> (StartTextTranslationJobResponse -> String)
-> ([StartTextTranslationJobResponse] -> ShowS)
-> Show StartTextTranslationJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTextTranslationJobResponse] -> ShowS
$cshowList :: [StartTextTranslationJobResponse] -> ShowS
show :: StartTextTranslationJobResponse -> String
$cshow :: StartTextTranslationJobResponse -> String
showsPrec :: Int -> StartTextTranslationJobResponse -> ShowS
$cshowsPrec :: Int -> StartTextTranslationJobResponse -> ShowS
Prelude.Show, (forall x.
StartTextTranslationJobResponse
-> Rep StartTextTranslationJobResponse x)
-> (forall x.
Rep StartTextTranslationJobResponse x
-> StartTextTranslationJobResponse)
-> Generic StartTextTranslationJobResponse
forall x.
Rep StartTextTranslationJobResponse x
-> StartTextTranslationJobResponse
forall x.
StartTextTranslationJobResponse
-> Rep StartTextTranslationJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartTextTranslationJobResponse x
-> StartTextTranslationJobResponse
$cfrom :: forall x.
StartTextTranslationJobResponse
-> Rep StartTextTranslationJobResponse x
Prelude.Generic)
newStartTextTranslationJobResponse ::
Prelude.Int ->
StartTextTranslationJobResponse
newStartTextTranslationJobResponse :: Int -> StartTextTranslationJobResponse
newStartTextTranslationJobResponse Int
pHttpStatus_ =
StartTextTranslationJobResponse' :: Maybe Text
-> Maybe JobStatus -> Int -> StartTextTranslationJobResponse
StartTextTranslationJobResponse'
{ $sel:jobId:StartTextTranslationJobResponse' :: Maybe Text
jobId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:jobStatus:StartTextTranslationJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartTextTranslationJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startTextTranslationJobResponse_jobId :: Lens.Lens' StartTextTranslationJobResponse (Prelude.Maybe Prelude.Text)
startTextTranslationJobResponse_jobId :: (Maybe Text -> f (Maybe Text))
-> StartTextTranslationJobResponse
-> f StartTextTranslationJobResponse
startTextTranslationJobResponse_jobId = (StartTextTranslationJobResponse -> Maybe Text)
-> (StartTextTranslationJobResponse
-> Maybe Text -> StartTextTranslationJobResponse)
-> Lens
StartTextTranslationJobResponse
StartTextTranslationJobResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StartTextTranslationJobResponse' :: StartTextTranslationJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StartTextTranslationJobResponse
s@StartTextTranslationJobResponse' {} Maybe Text
a -> StartTextTranslationJobResponse
s {$sel:jobId:StartTextTranslationJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: StartTextTranslationJobResponse)
startTextTranslationJobResponse_jobStatus :: Lens.Lens' StartTextTranslationJobResponse (Prelude.Maybe JobStatus)
startTextTranslationJobResponse_jobStatus :: (Maybe JobStatus -> f (Maybe JobStatus))
-> StartTextTranslationJobResponse
-> f StartTextTranslationJobResponse
startTextTranslationJobResponse_jobStatus = (StartTextTranslationJobResponse -> Maybe JobStatus)
-> (StartTextTranslationJobResponse
-> Maybe JobStatus -> StartTextTranslationJobResponse)
-> Lens
StartTextTranslationJobResponse
StartTextTranslationJobResponse
(Maybe JobStatus)
(Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJobResponse' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:StartTextTranslationJobResponse' :: StartTextTranslationJobResponse -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: StartTextTranslationJobResponse
s@StartTextTranslationJobResponse' {} Maybe JobStatus
a -> StartTextTranslationJobResponse
s {$sel:jobStatus:StartTextTranslationJobResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: StartTextTranslationJobResponse)
startTextTranslationJobResponse_httpStatus :: Lens.Lens' StartTextTranslationJobResponse Prelude.Int
startTextTranslationJobResponse_httpStatus :: (Int -> f Int)
-> StartTextTranslationJobResponse
-> f StartTextTranslationJobResponse
startTextTranslationJobResponse_httpStatus = (StartTextTranslationJobResponse -> Int)
-> (StartTextTranslationJobResponse
-> Int -> StartTextTranslationJobResponse)
-> Lens
StartTextTranslationJobResponse
StartTextTranslationJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTextTranslationJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartTextTranslationJobResponse' :: StartTextTranslationJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartTextTranslationJobResponse
s@StartTextTranslationJobResponse' {} Int
a -> StartTextTranslationJobResponse
s {$sel:httpStatus:StartTextTranslationJobResponse' :: Int
httpStatus = Int
a} :: StartTextTranslationJobResponse)
instance
Prelude.NFData
StartTextTranslationJobResponse