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