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