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