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