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