{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.HoneyCode.Types.SourceDataColumnProperties
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
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]
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
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. 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' {$sel:columnMap:DestinationOptions' :: Maybe (HashMap Text SourceDataColumnProperties)
columnMap = forall a. Maybe a
Prelude.Nothing}
destinationOptions_columnMap :: Lens.Lens' DestinationOptions (Prelude.Maybe (Prelude.HashMap Prelude.Text SourceDataColumnProperties))
destinationOptions_columnMap :: Lens'
DestinationOptions
(Maybe (HashMap Text SourceDataColumnProperties))
destinationOptions_columnMap = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON DestinationOptions where
parseJSON :: Value -> Parser DestinationOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DestinationOptions"
( \Object
x ->
Maybe (HashMap Text SourceDataColumnProperties)
-> DestinationOptions
DestinationOptions'
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
"columnMap" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable DestinationOptions where
hashWithSalt :: Int -> DestinationOptions -> Int
hashWithSalt Int
_salt DestinationOptions' {Maybe (HashMap Text SourceDataColumnProperties)
columnMap :: Maybe (HashMap Text SourceDataColumnProperties)
$sel:columnMap:DestinationOptions' :: DestinationOptions
-> Maybe (HashMap Text SourceDataColumnProperties)
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text SourceDataColumnProperties)
columnMap
instance Prelude.NFData DestinationOptions where
rnf :: DestinationOptions -> ()
rnf DestinationOptions' {Maybe (HashMap Text SourceDataColumnProperties)
columnMap :: Maybe (HashMap Text SourceDataColumnProperties)
$sel:columnMap:DestinationOptions' :: DestinationOptions
-> Maybe (HashMap Text SourceDataColumnProperties)
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text SourceDataColumnProperties)
columnMap
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"columnMap" 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 (HashMap Text SourceDataColumnProperties)
columnMap]
)