{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Translate.Types.JobDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data JobDetails = JobDetails'
{
JobDetails -> Maybe Int
translatedDocumentsCount :: Prelude.Maybe Prelude.Int,
JobDetails -> Maybe Int
documentsWithErrorsCount :: Prelude.Maybe Prelude.Int,
JobDetails -> Maybe Int
inputDocumentsCount :: Prelude.Maybe Prelude.Int
}
deriving (JobDetails -> JobDetails -> Bool
(JobDetails -> JobDetails -> Bool)
-> (JobDetails -> JobDetails -> Bool) -> Eq JobDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobDetails -> JobDetails -> Bool
$c/= :: JobDetails -> JobDetails -> Bool
== :: JobDetails -> JobDetails -> Bool
$c== :: JobDetails -> JobDetails -> Bool
Prelude.Eq, ReadPrec [JobDetails]
ReadPrec JobDetails
Int -> ReadS JobDetails
ReadS [JobDetails]
(Int -> ReadS JobDetails)
-> ReadS [JobDetails]
-> ReadPrec JobDetails
-> ReadPrec [JobDetails]
-> Read JobDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobDetails]
$creadListPrec :: ReadPrec [JobDetails]
readPrec :: ReadPrec JobDetails
$creadPrec :: ReadPrec JobDetails
readList :: ReadS [JobDetails]
$creadList :: ReadS [JobDetails]
readsPrec :: Int -> ReadS JobDetails
$creadsPrec :: Int -> ReadS JobDetails
Prelude.Read, Int -> JobDetails -> ShowS
[JobDetails] -> ShowS
JobDetails -> String
(Int -> JobDetails -> ShowS)
-> (JobDetails -> String)
-> ([JobDetails] -> ShowS)
-> Show JobDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobDetails] -> ShowS
$cshowList :: [JobDetails] -> ShowS
show :: JobDetails -> String
$cshow :: JobDetails -> String
showsPrec :: Int -> JobDetails -> ShowS
$cshowsPrec :: Int -> JobDetails -> ShowS
Prelude.Show, (forall x. JobDetails -> Rep JobDetails x)
-> (forall x. Rep JobDetails x -> JobDetails) -> Generic JobDetails
forall x. Rep JobDetails x -> JobDetails
forall x. JobDetails -> Rep JobDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobDetails x -> JobDetails
$cfrom :: forall x. JobDetails -> Rep JobDetails x
Prelude.Generic)
newJobDetails ::
JobDetails
newJobDetails :: JobDetails
newJobDetails =
JobDetails' :: Maybe Int -> Maybe Int -> Maybe Int -> JobDetails
JobDetails'
{ $sel:translatedDocumentsCount:JobDetails' :: Maybe Int
translatedDocumentsCount =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:documentsWithErrorsCount:JobDetails' :: Maybe Int
documentsWithErrorsCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:inputDocumentsCount:JobDetails' :: Maybe Int
inputDocumentsCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
jobDetails_translatedDocumentsCount :: Lens.Lens' JobDetails (Prelude.Maybe Prelude.Int)
jobDetails_translatedDocumentsCount :: (Maybe Int -> f (Maybe Int)) -> JobDetails -> f JobDetails
jobDetails_translatedDocumentsCount = (JobDetails -> Maybe Int)
-> (JobDetails -> Maybe Int -> JobDetails)
-> Lens JobDetails JobDetails (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetails' {Maybe Int
translatedDocumentsCount :: Maybe Int
$sel:translatedDocumentsCount:JobDetails' :: JobDetails -> Maybe Int
translatedDocumentsCount} -> Maybe Int
translatedDocumentsCount) (\s :: JobDetails
s@JobDetails' {} Maybe Int
a -> JobDetails
s {$sel:translatedDocumentsCount:JobDetails' :: Maybe Int
translatedDocumentsCount = Maybe Int
a} :: JobDetails)
jobDetails_documentsWithErrorsCount :: Lens.Lens' JobDetails (Prelude.Maybe Prelude.Int)
jobDetails_documentsWithErrorsCount :: (Maybe Int -> f (Maybe Int)) -> JobDetails -> f JobDetails
jobDetails_documentsWithErrorsCount = (JobDetails -> Maybe Int)
-> (JobDetails -> Maybe Int -> JobDetails)
-> Lens JobDetails JobDetails (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetails' {Maybe Int
documentsWithErrorsCount :: Maybe Int
$sel:documentsWithErrorsCount:JobDetails' :: JobDetails -> Maybe Int
documentsWithErrorsCount} -> Maybe Int
documentsWithErrorsCount) (\s :: JobDetails
s@JobDetails' {} Maybe Int
a -> JobDetails
s {$sel:documentsWithErrorsCount:JobDetails' :: Maybe Int
documentsWithErrorsCount = Maybe Int
a} :: JobDetails)
jobDetails_inputDocumentsCount :: Lens.Lens' JobDetails (Prelude.Maybe Prelude.Int)
jobDetails_inputDocumentsCount :: (Maybe Int -> f (Maybe Int)) -> JobDetails -> f JobDetails
jobDetails_inputDocumentsCount = (JobDetails -> Maybe Int)
-> (JobDetails -> Maybe Int -> JobDetails)
-> Lens JobDetails JobDetails (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetails' {Maybe Int
inputDocumentsCount :: Maybe Int
$sel:inputDocumentsCount:JobDetails' :: JobDetails -> Maybe Int
inputDocumentsCount} -> Maybe Int
inputDocumentsCount) (\s :: JobDetails
s@JobDetails' {} Maybe Int
a -> JobDetails
s {$sel:inputDocumentsCount:JobDetails' :: Maybe Int
inputDocumentsCount = Maybe Int
a} :: JobDetails)
instance Core.FromJSON JobDetails where
parseJSON :: Value -> Parser JobDetails
parseJSON =
String
-> (Object -> Parser JobDetails) -> Value -> Parser JobDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"JobDetails"
( \Object
x ->
Maybe Int -> Maybe Int -> Maybe Int -> JobDetails
JobDetails'
(Maybe Int -> Maybe Int -> Maybe Int -> JobDetails)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> JobDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TranslatedDocumentsCount")
Parser (Maybe Int -> Maybe Int -> JobDetails)
-> Parser (Maybe Int) -> Parser (Maybe Int -> JobDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DocumentsWithErrorsCount")
Parser (Maybe Int -> JobDetails)
-> Parser (Maybe Int) -> Parser JobDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InputDocumentsCount")
)
instance Prelude.Hashable JobDetails
instance Prelude.NFData JobDetails