{-# 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.KinesisAnalyticsV2.Types.CSVMappingParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CSVMappingParameters = CSVMappingParameters'
{
CSVMappingParameters -> Text
recordRowDelimiter :: Prelude.Text,
CSVMappingParameters -> Text
recordColumnDelimiter :: Prelude.Text
}
deriving (CSVMappingParameters -> CSVMappingParameters -> Bool
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]
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
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. 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'
{ $sel:recordRowDelimiter:CSVMappingParameters' :: Text
recordRowDelimiter =
Text
pRecordRowDelimiter_,
$sel:recordColumnDelimiter:CSVMappingParameters' :: Text
recordColumnDelimiter = Text
pRecordColumnDelimiter_
}
cSVMappingParameters_recordRowDelimiter :: Lens.Lens' CSVMappingParameters Prelude.Text
cSVMappingParameters_recordRowDelimiter :: Lens' CSVMappingParameters Text
cSVMappingParameters_recordRowDelimiter = 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 :: Lens' CSVMappingParameters Text
cSVMappingParameters_recordColumnDelimiter = 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 Data.FromJSON CSVMappingParameters where
parseJSON :: Value -> Parser CSVMappingParameters
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CSVMappingParameters"
( \Object
x ->
Text -> Text -> CSVMappingParameters
CSVMappingParameters'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RecordRowDelimiter")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RecordColumnDelimiter")
)
instance Prelude.Hashable CSVMappingParameters where
hashWithSalt :: Int -> CSVMappingParameters -> Int
hashWithSalt Int
_salt CSVMappingParameters' {Text
recordColumnDelimiter :: Text
recordRowDelimiter :: Text
$sel:recordColumnDelimiter:CSVMappingParameters' :: CSVMappingParameters -> Text
$sel:recordRowDelimiter:CSVMappingParameters' :: CSVMappingParameters -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recordRowDelimiter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recordColumnDelimiter
instance Prelude.NFData CSVMappingParameters where
rnf :: CSVMappingParameters -> ()
rnf CSVMappingParameters' {Text
recordColumnDelimiter :: Text
recordRowDelimiter :: Text
$sel:recordColumnDelimiter:CSVMappingParameters' :: CSVMappingParameters -> Text
$sel:recordRowDelimiter:CSVMappingParameters' :: CSVMappingParameters -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
recordRowDelimiter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recordColumnDelimiter
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"RecordRowDelimiter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
recordRowDelimiter),
forall a. a -> Maybe a
Prelude.Just
( Key
"RecordColumnDelimiter"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
recordColumnDelimiter
)
]
)