{-# 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.ParallelDataConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Translate.Types.ParallelDataFormat
data ParallelDataConfig = ParallelDataConfig'
{
ParallelDataConfig -> Text
s3Uri :: Prelude.Text,
ParallelDataConfig -> ParallelDataFormat
format :: ParallelDataFormat
}
deriving (ParallelDataConfig -> ParallelDataConfig -> Bool
(ParallelDataConfig -> ParallelDataConfig -> Bool)
-> (ParallelDataConfig -> ParallelDataConfig -> Bool)
-> Eq ParallelDataConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParallelDataConfig -> ParallelDataConfig -> Bool
$c/= :: ParallelDataConfig -> ParallelDataConfig -> Bool
== :: ParallelDataConfig -> ParallelDataConfig -> Bool
$c== :: ParallelDataConfig -> ParallelDataConfig -> Bool
Prelude.Eq, ReadPrec [ParallelDataConfig]
ReadPrec ParallelDataConfig
Int -> ReadS ParallelDataConfig
ReadS [ParallelDataConfig]
(Int -> ReadS ParallelDataConfig)
-> ReadS [ParallelDataConfig]
-> ReadPrec ParallelDataConfig
-> ReadPrec [ParallelDataConfig]
-> Read ParallelDataConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParallelDataConfig]
$creadListPrec :: ReadPrec [ParallelDataConfig]
readPrec :: ReadPrec ParallelDataConfig
$creadPrec :: ReadPrec ParallelDataConfig
readList :: ReadS [ParallelDataConfig]
$creadList :: ReadS [ParallelDataConfig]
readsPrec :: Int -> ReadS ParallelDataConfig
$creadsPrec :: Int -> ReadS ParallelDataConfig
Prelude.Read, Int -> ParallelDataConfig -> ShowS
[ParallelDataConfig] -> ShowS
ParallelDataConfig -> String
(Int -> ParallelDataConfig -> ShowS)
-> (ParallelDataConfig -> String)
-> ([ParallelDataConfig] -> ShowS)
-> Show ParallelDataConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParallelDataConfig] -> ShowS
$cshowList :: [ParallelDataConfig] -> ShowS
show :: ParallelDataConfig -> String
$cshow :: ParallelDataConfig -> String
showsPrec :: Int -> ParallelDataConfig -> ShowS
$cshowsPrec :: Int -> ParallelDataConfig -> ShowS
Prelude.Show, (forall x. ParallelDataConfig -> Rep ParallelDataConfig x)
-> (forall x. Rep ParallelDataConfig x -> ParallelDataConfig)
-> Generic ParallelDataConfig
forall x. Rep ParallelDataConfig x -> ParallelDataConfig
forall x. ParallelDataConfig -> Rep ParallelDataConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParallelDataConfig x -> ParallelDataConfig
$cfrom :: forall x. ParallelDataConfig -> Rep ParallelDataConfig x
Prelude.Generic)
newParallelDataConfig ::
Prelude.Text ->
ParallelDataFormat ->
ParallelDataConfig
newParallelDataConfig :: Text -> ParallelDataFormat -> ParallelDataConfig
newParallelDataConfig Text
pS3Uri_ ParallelDataFormat
pFormat_ =
ParallelDataConfig' :: Text -> ParallelDataFormat -> ParallelDataConfig
ParallelDataConfig'
{ $sel:s3Uri:ParallelDataConfig' :: Text
s3Uri = Text
pS3Uri_,
$sel:format:ParallelDataConfig' :: ParallelDataFormat
format = ParallelDataFormat
pFormat_
}
parallelDataConfig_s3Uri :: Lens.Lens' ParallelDataConfig Prelude.Text
parallelDataConfig_s3Uri :: (Text -> f Text) -> ParallelDataConfig -> f ParallelDataConfig
parallelDataConfig_s3Uri = (ParallelDataConfig -> Text)
-> (ParallelDataConfig -> Text -> ParallelDataConfig)
-> Lens ParallelDataConfig ParallelDataConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelDataConfig' {Text
s3Uri :: Text
$sel:s3Uri:ParallelDataConfig' :: ParallelDataConfig -> Text
s3Uri} -> Text
s3Uri) (\s :: ParallelDataConfig
s@ParallelDataConfig' {} Text
a -> ParallelDataConfig
s {$sel:s3Uri:ParallelDataConfig' :: Text
s3Uri = Text
a} :: ParallelDataConfig)
parallelDataConfig_format :: Lens.Lens' ParallelDataConfig ParallelDataFormat
parallelDataConfig_format :: (ParallelDataFormat -> f ParallelDataFormat)
-> ParallelDataConfig -> f ParallelDataConfig
parallelDataConfig_format = (ParallelDataConfig -> ParallelDataFormat)
-> (ParallelDataConfig -> ParallelDataFormat -> ParallelDataConfig)
-> Lens
ParallelDataConfig
ParallelDataConfig
ParallelDataFormat
ParallelDataFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParallelDataConfig' {ParallelDataFormat
format :: ParallelDataFormat
$sel:format:ParallelDataConfig' :: ParallelDataConfig -> ParallelDataFormat
format} -> ParallelDataFormat
format) (\s :: ParallelDataConfig
s@ParallelDataConfig' {} ParallelDataFormat
a -> ParallelDataConfig
s {$sel:format:ParallelDataConfig' :: ParallelDataFormat
format = ParallelDataFormat
a} :: ParallelDataConfig)
instance Core.FromJSON ParallelDataConfig where
parseJSON :: Value -> Parser ParallelDataConfig
parseJSON =
String
-> (Object -> Parser ParallelDataConfig)
-> Value
-> Parser ParallelDataConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ParallelDataConfig"
( \Object
x ->
Text -> ParallelDataFormat -> ParallelDataConfig
ParallelDataConfig'
(Text -> ParallelDataFormat -> ParallelDataConfig)
-> Parser Text -> Parser (ParallelDataFormat -> ParallelDataConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3Uri") Parser (ParallelDataFormat -> ParallelDataConfig)
-> Parser ParallelDataFormat -> Parser ParallelDataConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ParallelDataFormat
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Format")
)
instance Prelude.Hashable ParallelDataConfig
instance Prelude.NFData ParallelDataConfig
instance Core.ToJSON ParallelDataConfig where
toJSON :: ParallelDataConfig -> Value
toJSON ParallelDataConfig' {Text
ParallelDataFormat
format :: ParallelDataFormat
s3Uri :: Text
$sel:format:ParallelDataConfig' :: ParallelDataConfig -> ParallelDataFormat
$sel:s3Uri:ParallelDataConfig' :: ParallelDataConfig -> 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
"S3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Uri),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Format" Text -> ParallelDataFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ParallelDataFormat
format)
]
)