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