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