{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Firehose.Types.Serializer
import qualified Amazonka.Prelude as Prelude
data OutputFormatConfiguration = OutputFormatConfiguration'
{
OutputFormatConfiguration -> Maybe Serializer
serializer :: Prelude.Maybe Serializer
}
deriving (OutputFormatConfiguration -> OutputFormatConfiguration -> Bool
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]
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
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.
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'
{ $sel:serializer:OutputFormatConfiguration' :: Maybe Serializer
serializer =
forall a. Maybe a
Prelude.Nothing
}
outputFormatConfiguration_serializer :: Lens.Lens' OutputFormatConfiguration (Prelude.Maybe Serializer)
outputFormatConfiguration_serializer :: Lens' OutputFormatConfiguration (Maybe Serializer)
outputFormatConfiguration_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 Data.FromJSON OutputFormatConfiguration where
parseJSON :: Value -> Parser OutputFormatConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OutputFormatConfiguration"
( \Object
x ->
Maybe Serializer -> OutputFormatConfiguration
OutputFormatConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Serializer")
)
instance Prelude.Hashable OutputFormatConfiguration where
hashWithSalt :: Int -> OutputFormatConfiguration -> Int
hashWithSalt Int
_salt OutputFormatConfiguration' {Maybe Serializer
serializer :: Maybe Serializer
$sel:serializer:OutputFormatConfiguration' :: OutputFormatConfiguration -> Maybe Serializer
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Serializer
serializer
instance Prelude.NFData OutputFormatConfiguration where
rnf :: OutputFormatConfiguration -> ()
rnf OutputFormatConfiguration' {Maybe Serializer
serializer :: Maybe Serializer
$sel:serializer:OutputFormatConfiguration' :: OutputFormatConfiguration -> Maybe Serializer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Serializer
serializer
instance Data.ToJSON OutputFormatConfiguration where
toJSON :: OutputFormatConfiguration -> Value
toJSON OutputFormatConfiguration' {Maybe Serializer
serializer :: Maybe Serializer
$sel:serializer:OutputFormatConfiguration' :: OutputFormatConfiguration -> Maybe Serializer
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Serializer" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Serializer
serializer]
)