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