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