{-# 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.S3.Types.InputSerialization where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.CSVInput
import Amazonka.S3.Types.CompressionType
import Amazonka.S3.Types.JSONInput
import Amazonka.S3.Types.ParquetInput
data InputSerialization = InputSerialization'
{
InputSerialization -> Maybe JSONInput
json :: Prelude.Maybe JSONInput,
InputSerialization -> Maybe CSVInput
csv :: Prelude.Maybe CSVInput,
InputSerialization -> Maybe ParquetInput
parquet :: Prelude.Maybe ParquetInput,
InputSerialization -> Maybe CompressionType
compressionType :: Prelude.Maybe CompressionType
}
deriving (InputSerialization -> InputSerialization -> Bool
(InputSerialization -> InputSerialization -> Bool)
-> (InputSerialization -> InputSerialization -> Bool)
-> Eq InputSerialization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputSerialization -> InputSerialization -> Bool
$c/= :: InputSerialization -> InputSerialization -> Bool
== :: InputSerialization -> InputSerialization -> Bool
$c== :: InputSerialization -> InputSerialization -> Bool
Prelude.Eq, ReadPrec [InputSerialization]
ReadPrec InputSerialization
Int -> ReadS InputSerialization
ReadS [InputSerialization]
(Int -> ReadS InputSerialization)
-> ReadS [InputSerialization]
-> ReadPrec InputSerialization
-> ReadPrec [InputSerialization]
-> Read InputSerialization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputSerialization]
$creadListPrec :: ReadPrec [InputSerialization]
readPrec :: ReadPrec InputSerialization
$creadPrec :: ReadPrec InputSerialization
readList :: ReadS [InputSerialization]
$creadList :: ReadS [InputSerialization]
readsPrec :: Int -> ReadS InputSerialization
$creadsPrec :: Int -> ReadS InputSerialization
Prelude.Read, Int -> InputSerialization -> ShowS
[InputSerialization] -> ShowS
InputSerialization -> String
(Int -> InputSerialization -> ShowS)
-> (InputSerialization -> String)
-> ([InputSerialization] -> ShowS)
-> Show InputSerialization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputSerialization] -> ShowS
$cshowList :: [InputSerialization] -> ShowS
show :: InputSerialization -> String
$cshow :: InputSerialization -> String
showsPrec :: Int -> InputSerialization -> ShowS
$cshowsPrec :: Int -> InputSerialization -> ShowS
Prelude.Show, (forall x. InputSerialization -> Rep InputSerialization x)
-> (forall x. Rep InputSerialization x -> InputSerialization)
-> Generic InputSerialization
forall x. Rep InputSerialization x -> InputSerialization
forall x. InputSerialization -> Rep InputSerialization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputSerialization x -> InputSerialization
$cfrom :: forall x. InputSerialization -> Rep InputSerialization x
Prelude.Generic)
newInputSerialization ::
InputSerialization
newInputSerialization :: InputSerialization
newInputSerialization =
InputSerialization' :: Maybe JSONInput
-> Maybe CSVInput
-> Maybe ParquetInput
-> Maybe CompressionType
-> InputSerialization
InputSerialization'
{ $sel:json:InputSerialization' :: Maybe JSONInput
json = Maybe JSONInput
forall a. Maybe a
Prelude.Nothing,
$sel:csv:InputSerialization' :: Maybe CSVInput
csv = Maybe CSVInput
forall a. Maybe a
Prelude.Nothing,
$sel:parquet:InputSerialization' :: Maybe ParquetInput
parquet = Maybe ParquetInput
forall a. Maybe a
Prelude.Nothing,
$sel:compressionType:InputSerialization' :: Maybe CompressionType
compressionType = Maybe CompressionType
forall a. Maybe a
Prelude.Nothing
}
inputSerialization_json :: Lens.Lens' InputSerialization (Prelude.Maybe JSONInput)
inputSerialization_json :: (Maybe JSONInput -> f (Maybe JSONInput))
-> InputSerialization -> f InputSerialization
inputSerialization_json = (InputSerialization -> Maybe JSONInput)
-> (InputSerialization -> Maybe JSONInput -> InputSerialization)
-> Lens
InputSerialization
InputSerialization
(Maybe JSONInput)
(Maybe JSONInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSerialization' {Maybe JSONInput
json :: Maybe JSONInput
$sel:json:InputSerialization' :: InputSerialization -> Maybe JSONInput
json} -> Maybe JSONInput
json) (\s :: InputSerialization
s@InputSerialization' {} Maybe JSONInput
a -> InputSerialization
s {$sel:json:InputSerialization' :: Maybe JSONInput
json = Maybe JSONInput
a} :: InputSerialization)
inputSerialization_csv :: Lens.Lens' InputSerialization (Prelude.Maybe CSVInput)
inputSerialization_csv :: (Maybe CSVInput -> f (Maybe CSVInput))
-> InputSerialization -> f InputSerialization
inputSerialization_csv = (InputSerialization -> Maybe CSVInput)
-> (InputSerialization -> Maybe CSVInput -> InputSerialization)
-> Lens
InputSerialization
InputSerialization
(Maybe CSVInput)
(Maybe CSVInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSerialization' {Maybe CSVInput
csv :: Maybe CSVInput
$sel:csv:InputSerialization' :: InputSerialization -> Maybe CSVInput
csv} -> Maybe CSVInput
csv) (\s :: InputSerialization
s@InputSerialization' {} Maybe CSVInput
a -> InputSerialization
s {$sel:csv:InputSerialization' :: Maybe CSVInput
csv = Maybe CSVInput
a} :: InputSerialization)
inputSerialization_parquet :: Lens.Lens' InputSerialization (Prelude.Maybe ParquetInput)
inputSerialization_parquet :: (Maybe ParquetInput -> f (Maybe ParquetInput))
-> InputSerialization -> f InputSerialization
inputSerialization_parquet = (InputSerialization -> Maybe ParquetInput)
-> (InputSerialization -> Maybe ParquetInput -> InputSerialization)
-> Lens
InputSerialization
InputSerialization
(Maybe ParquetInput)
(Maybe ParquetInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSerialization' {Maybe ParquetInput
parquet :: Maybe ParquetInput
$sel:parquet:InputSerialization' :: InputSerialization -> Maybe ParquetInput
parquet} -> Maybe ParquetInput
parquet) (\s :: InputSerialization
s@InputSerialization' {} Maybe ParquetInput
a -> InputSerialization
s {$sel:parquet:InputSerialization' :: Maybe ParquetInput
parquet = Maybe ParquetInput
a} :: InputSerialization)
inputSerialization_compressionType :: Lens.Lens' InputSerialization (Prelude.Maybe CompressionType)
inputSerialization_compressionType :: (Maybe CompressionType -> f (Maybe CompressionType))
-> InputSerialization -> f InputSerialization
inputSerialization_compressionType = (InputSerialization -> Maybe CompressionType)
-> (InputSerialization
-> Maybe CompressionType -> InputSerialization)
-> Lens
InputSerialization
InputSerialization
(Maybe CompressionType)
(Maybe CompressionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSerialization' {Maybe CompressionType
compressionType :: Maybe CompressionType
$sel:compressionType:InputSerialization' :: InputSerialization -> Maybe CompressionType
compressionType} -> Maybe CompressionType
compressionType) (\s :: InputSerialization
s@InputSerialization' {} Maybe CompressionType
a -> InputSerialization
s {$sel:compressionType:InputSerialization' :: Maybe CompressionType
compressionType = Maybe CompressionType
a} :: InputSerialization)
instance Prelude.Hashable InputSerialization
instance Prelude.NFData InputSerialization
instance Core.ToXML InputSerialization where
toXML :: InputSerialization -> XML
toXML InputSerialization' {Maybe CompressionType
Maybe CSVInput
Maybe JSONInput
Maybe ParquetInput
compressionType :: Maybe CompressionType
parquet :: Maybe ParquetInput
csv :: Maybe CSVInput
json :: Maybe JSONInput
$sel:compressionType:InputSerialization' :: InputSerialization -> Maybe CompressionType
$sel:parquet:InputSerialization' :: InputSerialization -> Maybe ParquetInput
$sel:csv:InputSerialization' :: InputSerialization -> Maybe CSVInput
$sel:json:InputSerialization' :: InputSerialization -> Maybe JSONInput
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"JSON" Name -> Maybe JSONInput -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe JSONInput
json,
Name
"CSV" Name -> Maybe CSVInput -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe CSVInput
csv,
Name
"Parquet" Name -> Maybe ParquetInput -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe ParquetInput
parquet,
Name
"CompressionType" Name -> Maybe CompressionType -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe CompressionType
compressionType
]