{-# 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.AppFlow.Types.S3OutputFormatConfig where
import Amazonka.AppFlow.Types.AggregationConfig
import Amazonka.AppFlow.Types.FileType
import Amazonka.AppFlow.Types.PrefixConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3OutputFormatConfig = S3OutputFormatConfig'
{
S3OutputFormatConfig -> Maybe PrefixConfig
prefixConfig :: Prelude.Maybe PrefixConfig,
S3OutputFormatConfig -> Maybe FileType
fileType :: Prelude.Maybe FileType,
S3OutputFormatConfig -> Maybe AggregationConfig
aggregationConfig :: Prelude.Maybe AggregationConfig
}
deriving (S3OutputFormatConfig -> S3OutputFormatConfig -> Bool
(S3OutputFormatConfig -> S3OutputFormatConfig -> Bool)
-> (S3OutputFormatConfig -> S3OutputFormatConfig -> Bool)
-> Eq S3OutputFormatConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3OutputFormatConfig -> S3OutputFormatConfig -> Bool
$c/= :: S3OutputFormatConfig -> S3OutputFormatConfig -> Bool
== :: S3OutputFormatConfig -> S3OutputFormatConfig -> Bool
$c== :: S3OutputFormatConfig -> S3OutputFormatConfig -> Bool
Prelude.Eq, ReadPrec [S3OutputFormatConfig]
ReadPrec S3OutputFormatConfig
Int -> ReadS S3OutputFormatConfig
ReadS [S3OutputFormatConfig]
(Int -> ReadS S3OutputFormatConfig)
-> ReadS [S3OutputFormatConfig]
-> ReadPrec S3OutputFormatConfig
-> ReadPrec [S3OutputFormatConfig]
-> Read S3OutputFormatConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3OutputFormatConfig]
$creadListPrec :: ReadPrec [S3OutputFormatConfig]
readPrec :: ReadPrec S3OutputFormatConfig
$creadPrec :: ReadPrec S3OutputFormatConfig
readList :: ReadS [S3OutputFormatConfig]
$creadList :: ReadS [S3OutputFormatConfig]
readsPrec :: Int -> ReadS S3OutputFormatConfig
$creadsPrec :: Int -> ReadS S3OutputFormatConfig
Prelude.Read, Int -> S3OutputFormatConfig -> ShowS
[S3OutputFormatConfig] -> ShowS
S3OutputFormatConfig -> String
(Int -> S3OutputFormatConfig -> ShowS)
-> (S3OutputFormatConfig -> String)
-> ([S3OutputFormatConfig] -> ShowS)
-> Show S3OutputFormatConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3OutputFormatConfig] -> ShowS
$cshowList :: [S3OutputFormatConfig] -> ShowS
show :: S3OutputFormatConfig -> String
$cshow :: S3OutputFormatConfig -> String
showsPrec :: Int -> S3OutputFormatConfig -> ShowS
$cshowsPrec :: Int -> S3OutputFormatConfig -> ShowS
Prelude.Show, (forall x. S3OutputFormatConfig -> Rep S3OutputFormatConfig x)
-> (forall x. Rep S3OutputFormatConfig x -> S3OutputFormatConfig)
-> Generic S3OutputFormatConfig
forall x. Rep S3OutputFormatConfig x -> S3OutputFormatConfig
forall x. S3OutputFormatConfig -> Rep S3OutputFormatConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3OutputFormatConfig x -> S3OutputFormatConfig
$cfrom :: forall x. S3OutputFormatConfig -> Rep S3OutputFormatConfig x
Prelude.Generic)
newS3OutputFormatConfig ::
S3OutputFormatConfig
newS3OutputFormatConfig :: S3OutputFormatConfig
newS3OutputFormatConfig =
S3OutputFormatConfig' :: Maybe PrefixConfig
-> Maybe FileType
-> Maybe AggregationConfig
-> S3OutputFormatConfig
S3OutputFormatConfig'
{ $sel:prefixConfig:S3OutputFormatConfig' :: Maybe PrefixConfig
prefixConfig =
Maybe PrefixConfig
forall a. Maybe a
Prelude.Nothing,
$sel:fileType:S3OutputFormatConfig' :: Maybe FileType
fileType = Maybe FileType
forall a. Maybe a
Prelude.Nothing,
$sel:aggregationConfig:S3OutputFormatConfig' :: Maybe AggregationConfig
aggregationConfig = Maybe AggregationConfig
forall a. Maybe a
Prelude.Nothing
}
s3OutputFormatConfig_prefixConfig :: Lens.Lens' S3OutputFormatConfig (Prelude.Maybe PrefixConfig)
s3OutputFormatConfig_prefixConfig :: (Maybe PrefixConfig -> f (Maybe PrefixConfig))
-> S3OutputFormatConfig -> f S3OutputFormatConfig
s3OutputFormatConfig_prefixConfig = (S3OutputFormatConfig -> Maybe PrefixConfig)
-> (S3OutputFormatConfig
-> Maybe PrefixConfig -> S3OutputFormatConfig)
-> Lens
S3OutputFormatConfig
S3OutputFormatConfig
(Maybe PrefixConfig)
(Maybe PrefixConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3OutputFormatConfig' {Maybe PrefixConfig
prefixConfig :: Maybe PrefixConfig
$sel:prefixConfig:S3OutputFormatConfig' :: S3OutputFormatConfig -> Maybe PrefixConfig
prefixConfig} -> Maybe PrefixConfig
prefixConfig) (\s :: S3OutputFormatConfig
s@S3OutputFormatConfig' {} Maybe PrefixConfig
a -> S3OutputFormatConfig
s {$sel:prefixConfig:S3OutputFormatConfig' :: Maybe PrefixConfig
prefixConfig = Maybe PrefixConfig
a} :: S3OutputFormatConfig)
s3OutputFormatConfig_fileType :: Lens.Lens' S3OutputFormatConfig (Prelude.Maybe FileType)
s3OutputFormatConfig_fileType :: (Maybe FileType -> f (Maybe FileType))
-> S3OutputFormatConfig -> f S3OutputFormatConfig
s3OutputFormatConfig_fileType = (S3OutputFormatConfig -> Maybe FileType)
-> (S3OutputFormatConfig -> Maybe FileType -> S3OutputFormatConfig)
-> Lens
S3OutputFormatConfig
S3OutputFormatConfig
(Maybe FileType)
(Maybe FileType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3OutputFormatConfig' {Maybe FileType
fileType :: Maybe FileType
$sel:fileType:S3OutputFormatConfig' :: S3OutputFormatConfig -> Maybe FileType
fileType} -> Maybe FileType
fileType) (\s :: S3OutputFormatConfig
s@S3OutputFormatConfig' {} Maybe FileType
a -> S3OutputFormatConfig
s {$sel:fileType:S3OutputFormatConfig' :: Maybe FileType
fileType = Maybe FileType
a} :: S3OutputFormatConfig)
s3OutputFormatConfig_aggregationConfig :: Lens.Lens' S3OutputFormatConfig (Prelude.Maybe AggregationConfig)
s3OutputFormatConfig_aggregationConfig :: (Maybe AggregationConfig -> f (Maybe AggregationConfig))
-> S3OutputFormatConfig -> f S3OutputFormatConfig
s3OutputFormatConfig_aggregationConfig = (S3OutputFormatConfig -> Maybe AggregationConfig)
-> (S3OutputFormatConfig
-> Maybe AggregationConfig -> S3OutputFormatConfig)
-> Lens
S3OutputFormatConfig
S3OutputFormatConfig
(Maybe AggregationConfig)
(Maybe AggregationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3OutputFormatConfig' {Maybe AggregationConfig
aggregationConfig :: Maybe AggregationConfig
$sel:aggregationConfig:S3OutputFormatConfig' :: S3OutputFormatConfig -> Maybe AggregationConfig
aggregationConfig} -> Maybe AggregationConfig
aggregationConfig) (\s :: S3OutputFormatConfig
s@S3OutputFormatConfig' {} Maybe AggregationConfig
a -> S3OutputFormatConfig
s {$sel:aggregationConfig:S3OutputFormatConfig' :: Maybe AggregationConfig
aggregationConfig = Maybe AggregationConfig
a} :: S3OutputFormatConfig)
instance Core.FromJSON S3OutputFormatConfig where
parseJSON :: Value -> Parser S3OutputFormatConfig
parseJSON =
String
-> (Object -> Parser S3OutputFormatConfig)
-> Value
-> Parser S3OutputFormatConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3OutputFormatConfig"
( \Object
x ->
Maybe PrefixConfig
-> Maybe FileType
-> Maybe AggregationConfig
-> S3OutputFormatConfig
S3OutputFormatConfig'
(Maybe PrefixConfig
-> Maybe FileType
-> Maybe AggregationConfig
-> S3OutputFormatConfig)
-> Parser (Maybe PrefixConfig)
-> Parser
(Maybe FileType -> Maybe AggregationConfig -> S3OutputFormatConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PrefixConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"prefixConfig")
Parser
(Maybe FileType -> Maybe AggregationConfig -> S3OutputFormatConfig)
-> Parser (Maybe FileType)
-> Parser (Maybe AggregationConfig -> S3OutputFormatConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FileType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fileType")
Parser (Maybe AggregationConfig -> S3OutputFormatConfig)
-> Parser (Maybe AggregationConfig) -> Parser S3OutputFormatConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AggregationConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"aggregationConfig")
)
instance Prelude.Hashable S3OutputFormatConfig
instance Prelude.NFData S3OutputFormatConfig
instance Core.ToJSON S3OutputFormatConfig where
toJSON :: S3OutputFormatConfig -> Value
toJSON S3OutputFormatConfig' {Maybe AggregationConfig
Maybe FileType
Maybe PrefixConfig
aggregationConfig :: Maybe AggregationConfig
fileType :: Maybe FileType
prefixConfig :: Maybe PrefixConfig
$sel:aggregationConfig:S3OutputFormatConfig' :: S3OutputFormatConfig -> Maybe AggregationConfig
$sel:fileType:S3OutputFormatConfig' :: S3OutputFormatConfig -> Maybe FileType
$sel:prefixConfig:S3OutputFormatConfig' :: S3OutputFormatConfig -> Maybe PrefixConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"prefixConfig" Text -> PrefixConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PrefixConfig -> Pair) -> Maybe PrefixConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PrefixConfig
prefixConfig,
(Text
"fileType" Text -> FileType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FileType -> Pair) -> Maybe FileType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FileType
fileType,
(Text
"aggregationConfig" Text -> AggregationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AggregationConfig -> Pair)
-> Maybe AggregationConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AggregationConfig
aggregationConfig
]
)