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