{-# 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.SourceFlowConfig where
import Amazonka.AppFlow.Types.ConnectorType
import Amazonka.AppFlow.Types.IncrementalPullConfig
import Amazonka.AppFlow.Types.SourceConnectorProperties
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SourceFlowConfig = SourceFlowConfig'
{
SourceFlowConfig -> Maybe Text
apiVersion :: Prelude.Maybe Prelude.Text,
SourceFlowConfig -> Maybe Text
connectorProfileName :: Prelude.Maybe Prelude.Text,
SourceFlowConfig -> Maybe IncrementalPullConfig
incrementalPullConfig :: Prelude.Maybe IncrementalPullConfig,
SourceFlowConfig -> ConnectorType
connectorType :: ConnectorType,
SourceFlowConfig -> SourceConnectorProperties
sourceConnectorProperties :: SourceConnectorProperties
}
deriving (SourceFlowConfig -> SourceFlowConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceFlowConfig -> SourceFlowConfig -> Bool
$c/= :: SourceFlowConfig -> SourceFlowConfig -> Bool
== :: SourceFlowConfig -> SourceFlowConfig -> Bool
$c== :: SourceFlowConfig -> SourceFlowConfig -> Bool
Prelude.Eq, ReadPrec [SourceFlowConfig]
ReadPrec SourceFlowConfig
Int -> ReadS SourceFlowConfig
ReadS [SourceFlowConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceFlowConfig]
$creadListPrec :: ReadPrec [SourceFlowConfig]
readPrec :: ReadPrec SourceFlowConfig
$creadPrec :: ReadPrec SourceFlowConfig
readList :: ReadS [SourceFlowConfig]
$creadList :: ReadS [SourceFlowConfig]
readsPrec :: Int -> ReadS SourceFlowConfig
$creadsPrec :: Int -> ReadS SourceFlowConfig
Prelude.Read, Int -> SourceFlowConfig -> ShowS
[SourceFlowConfig] -> ShowS
SourceFlowConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceFlowConfig] -> ShowS
$cshowList :: [SourceFlowConfig] -> ShowS
show :: SourceFlowConfig -> String
$cshow :: SourceFlowConfig -> String
showsPrec :: Int -> SourceFlowConfig -> ShowS
$cshowsPrec :: Int -> SourceFlowConfig -> ShowS
Prelude.Show, forall x. Rep SourceFlowConfig x -> SourceFlowConfig
forall x. SourceFlowConfig -> Rep SourceFlowConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceFlowConfig x -> SourceFlowConfig
$cfrom :: forall x. SourceFlowConfig -> Rep SourceFlowConfig x
Prelude.Generic)
newSourceFlowConfig ::
ConnectorType ->
SourceConnectorProperties ->
SourceFlowConfig
newSourceFlowConfig :: ConnectorType -> SourceConnectorProperties -> SourceFlowConfig
newSourceFlowConfig
ConnectorType
pConnectorType_
SourceConnectorProperties
pSourceConnectorProperties_ =
SourceFlowConfig'
{ $sel:apiVersion:SourceFlowConfig' :: Maybe Text
apiVersion = forall a. Maybe a
Prelude.Nothing,
$sel:connectorProfileName:SourceFlowConfig' :: Maybe Text
connectorProfileName = forall a. Maybe a
Prelude.Nothing,
$sel:incrementalPullConfig:SourceFlowConfig' :: Maybe IncrementalPullConfig
incrementalPullConfig = forall a. Maybe a
Prelude.Nothing,
$sel:connectorType:SourceFlowConfig' :: ConnectorType
connectorType = ConnectorType
pConnectorType_,
$sel:sourceConnectorProperties:SourceFlowConfig' :: SourceConnectorProperties
sourceConnectorProperties =
SourceConnectorProperties
pSourceConnectorProperties_
}
sourceFlowConfig_apiVersion :: Lens.Lens' SourceFlowConfig (Prelude.Maybe Prelude.Text)
sourceFlowConfig_apiVersion :: Lens' SourceFlowConfig (Maybe Text)
sourceFlowConfig_apiVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceFlowConfig' {Maybe Text
apiVersion :: Maybe Text
$sel:apiVersion:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
apiVersion} -> Maybe Text
apiVersion) (\s :: SourceFlowConfig
s@SourceFlowConfig' {} Maybe Text
a -> SourceFlowConfig
s {$sel:apiVersion:SourceFlowConfig' :: Maybe Text
apiVersion = Maybe Text
a} :: SourceFlowConfig)
sourceFlowConfig_connectorProfileName :: Lens.Lens' SourceFlowConfig (Prelude.Maybe Prelude.Text)
sourceFlowConfig_connectorProfileName :: Lens' SourceFlowConfig (Maybe Text)
sourceFlowConfig_connectorProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceFlowConfig' {Maybe Text
connectorProfileName :: Maybe Text
$sel:connectorProfileName:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
connectorProfileName} -> Maybe Text
connectorProfileName) (\s :: SourceFlowConfig
s@SourceFlowConfig' {} Maybe Text
a -> SourceFlowConfig
s {$sel:connectorProfileName:SourceFlowConfig' :: Maybe Text
connectorProfileName = Maybe Text
a} :: SourceFlowConfig)
sourceFlowConfig_incrementalPullConfig :: Lens.Lens' SourceFlowConfig (Prelude.Maybe IncrementalPullConfig)
sourceFlowConfig_incrementalPullConfig :: Lens' SourceFlowConfig (Maybe IncrementalPullConfig)
sourceFlowConfig_incrementalPullConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceFlowConfig' {Maybe IncrementalPullConfig
incrementalPullConfig :: Maybe IncrementalPullConfig
$sel:incrementalPullConfig:SourceFlowConfig' :: SourceFlowConfig -> Maybe IncrementalPullConfig
incrementalPullConfig} -> Maybe IncrementalPullConfig
incrementalPullConfig) (\s :: SourceFlowConfig
s@SourceFlowConfig' {} Maybe IncrementalPullConfig
a -> SourceFlowConfig
s {$sel:incrementalPullConfig:SourceFlowConfig' :: Maybe IncrementalPullConfig
incrementalPullConfig = Maybe IncrementalPullConfig
a} :: SourceFlowConfig)
sourceFlowConfig_connectorType :: Lens.Lens' SourceFlowConfig ConnectorType
sourceFlowConfig_connectorType :: Lens' SourceFlowConfig ConnectorType
sourceFlowConfig_connectorType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceFlowConfig' {ConnectorType
connectorType :: ConnectorType
$sel:connectorType:SourceFlowConfig' :: SourceFlowConfig -> ConnectorType
connectorType} -> ConnectorType
connectorType) (\s :: SourceFlowConfig
s@SourceFlowConfig' {} ConnectorType
a -> SourceFlowConfig
s {$sel:connectorType:SourceFlowConfig' :: ConnectorType
connectorType = ConnectorType
a} :: SourceFlowConfig)
sourceFlowConfig_sourceConnectorProperties :: Lens.Lens' SourceFlowConfig SourceConnectorProperties
sourceFlowConfig_sourceConnectorProperties :: Lens' SourceFlowConfig SourceConnectorProperties
sourceFlowConfig_sourceConnectorProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceFlowConfig' {SourceConnectorProperties
sourceConnectorProperties :: SourceConnectorProperties
$sel:sourceConnectorProperties:SourceFlowConfig' :: SourceFlowConfig -> SourceConnectorProperties
sourceConnectorProperties} -> SourceConnectorProperties
sourceConnectorProperties) (\s :: SourceFlowConfig
s@SourceFlowConfig' {} SourceConnectorProperties
a -> SourceFlowConfig
s {$sel:sourceConnectorProperties:SourceFlowConfig' :: SourceConnectorProperties
sourceConnectorProperties = SourceConnectorProperties
a} :: SourceFlowConfig)
instance Data.FromJSON SourceFlowConfig where
parseJSON :: Value -> Parser SourceFlowConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SourceFlowConfig"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe IncrementalPullConfig
-> ConnectorType
-> SourceConnectorProperties
-> SourceFlowConfig
SourceFlowConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"apiVersion")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"connectorProfileName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"incrementalPullConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"connectorType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"sourceConnectorProperties")
)
instance Prelude.Hashable SourceFlowConfig where
hashWithSalt :: Int -> SourceFlowConfig -> Int
hashWithSalt Int
_salt SourceFlowConfig' {Maybe Text
Maybe IncrementalPullConfig
ConnectorType
SourceConnectorProperties
sourceConnectorProperties :: SourceConnectorProperties
connectorType :: ConnectorType
incrementalPullConfig :: Maybe IncrementalPullConfig
connectorProfileName :: Maybe Text
apiVersion :: Maybe Text
$sel:sourceConnectorProperties:SourceFlowConfig' :: SourceFlowConfig -> SourceConnectorProperties
$sel:connectorType:SourceFlowConfig' :: SourceFlowConfig -> ConnectorType
$sel:incrementalPullConfig:SourceFlowConfig' :: SourceFlowConfig -> Maybe IncrementalPullConfig
$sel:connectorProfileName:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
$sel:apiVersion:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
apiVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectorProfileName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IncrementalPullConfig
incrementalPullConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ConnectorType
connectorType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SourceConnectorProperties
sourceConnectorProperties
instance Prelude.NFData SourceFlowConfig where
rnf :: SourceFlowConfig -> ()
rnf SourceFlowConfig' {Maybe Text
Maybe IncrementalPullConfig
ConnectorType
SourceConnectorProperties
sourceConnectorProperties :: SourceConnectorProperties
connectorType :: ConnectorType
incrementalPullConfig :: Maybe IncrementalPullConfig
connectorProfileName :: Maybe Text
apiVersion :: Maybe Text
$sel:sourceConnectorProperties:SourceFlowConfig' :: SourceFlowConfig -> SourceConnectorProperties
$sel:connectorType:SourceFlowConfig' :: SourceFlowConfig -> ConnectorType
$sel:incrementalPullConfig:SourceFlowConfig' :: SourceFlowConfig -> Maybe IncrementalPullConfig
$sel:connectorProfileName:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
$sel:apiVersion:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
apiVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectorProfileName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IncrementalPullConfig
incrementalPullConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ConnectorType
connectorType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SourceConnectorProperties
sourceConnectorProperties
instance Data.ToJSON SourceFlowConfig where
toJSON :: SourceFlowConfig -> Value
toJSON SourceFlowConfig' {Maybe Text
Maybe IncrementalPullConfig
ConnectorType
SourceConnectorProperties
sourceConnectorProperties :: SourceConnectorProperties
connectorType :: ConnectorType
incrementalPullConfig :: Maybe IncrementalPullConfig
connectorProfileName :: Maybe Text
apiVersion :: Maybe Text
$sel:sourceConnectorProperties:SourceFlowConfig' :: SourceFlowConfig -> SourceConnectorProperties
$sel:connectorType:SourceFlowConfig' :: SourceFlowConfig -> ConnectorType
$sel:incrementalPullConfig:SourceFlowConfig' :: SourceFlowConfig -> Maybe IncrementalPullConfig
$sel:connectorProfileName:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
$sel:apiVersion:SourceFlowConfig' :: SourceFlowConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"apiVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
apiVersion,
(Key
"connectorProfileName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
connectorProfileName,
(Key
"incrementalPullConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IncrementalPullConfig
incrementalPullConfig,
forall a. a -> Maybe a
Prelude.Just (Key
"connectorType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ConnectorType
connectorType),
forall a. a -> Maybe a
Prelude.Just
( Key
"sourceConnectorProperties"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SourceConnectorProperties
sourceConnectorProperties
)
]
)