{-# 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.Output where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.DestinationSchema
import Amazonka.KinesisAnalyticsV2.Types.KinesisFirehoseOutput
import Amazonka.KinesisAnalyticsV2.Types.KinesisStreamsOutput
import Amazonka.KinesisAnalyticsV2.Types.LambdaOutput
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Output = Output'
{
Output -> Maybe LambdaOutput
lambdaOutput :: Prelude.Maybe LambdaOutput,
Output -> Maybe KinesisStreamsOutput
kinesisStreamsOutput :: Prelude.Maybe KinesisStreamsOutput,
Output -> Maybe KinesisFirehoseOutput
kinesisFirehoseOutput :: Prelude.Maybe KinesisFirehoseOutput,
Output -> Text
name :: Prelude.Text,
Output -> DestinationSchema
destinationSchema :: DestinationSchema
}
deriving (Output -> Output -> Bool
(Output -> Output -> Bool)
-> (Output -> Output -> Bool) -> Eq Output
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Output -> Output -> Bool
$c/= :: Output -> Output -> Bool
== :: Output -> Output -> Bool
$c== :: Output -> Output -> Bool
Prelude.Eq, ReadPrec [Output]
ReadPrec Output
Int -> ReadS Output
ReadS [Output]
(Int -> ReadS Output)
-> ReadS [Output]
-> ReadPrec Output
-> ReadPrec [Output]
-> Read Output
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Output]
$creadListPrec :: ReadPrec [Output]
readPrec :: ReadPrec Output
$creadPrec :: ReadPrec Output
readList :: ReadS [Output]
$creadList :: ReadS [Output]
readsPrec :: Int -> ReadS Output
$creadsPrec :: Int -> ReadS Output
Prelude.Read, Int -> Output -> ShowS
[Output] -> ShowS
Output -> String
(Int -> Output -> ShowS)
-> (Output -> String) -> ([Output] -> ShowS) -> Show Output
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Output] -> ShowS
$cshowList :: [Output] -> ShowS
show :: Output -> String
$cshow :: Output -> String
showsPrec :: Int -> Output -> ShowS
$cshowsPrec :: Int -> Output -> ShowS
Prelude.Show, (forall x. Output -> Rep Output x)
-> (forall x. Rep Output x -> Output) -> Generic Output
forall x. Rep Output x -> Output
forall x. Output -> Rep Output x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Output x -> Output
$cfrom :: forall x. Output -> Rep Output x
Prelude.Generic)
newOutput ::
Prelude.Text ->
DestinationSchema ->
Output
newOutput :: Text -> DestinationSchema -> Output
newOutput Text
pName_ DestinationSchema
pDestinationSchema_ =
Output' :: Maybe LambdaOutput
-> Maybe KinesisStreamsOutput
-> Maybe KinesisFirehoseOutput
-> Text
-> DestinationSchema
-> Output
Output'
{ $sel:lambdaOutput:Output' :: Maybe LambdaOutput
lambdaOutput = Maybe LambdaOutput
forall a. Maybe a
Prelude.Nothing,
$sel:kinesisStreamsOutput:Output' :: Maybe KinesisStreamsOutput
kinesisStreamsOutput = Maybe KinesisStreamsOutput
forall a. Maybe a
Prelude.Nothing,
$sel:kinesisFirehoseOutput:Output' :: Maybe KinesisFirehoseOutput
kinesisFirehoseOutput = Maybe KinesisFirehoseOutput
forall a. Maybe a
Prelude.Nothing,
$sel:name:Output' :: Text
name = Text
pName_,
$sel:destinationSchema:Output' :: DestinationSchema
destinationSchema = DestinationSchema
pDestinationSchema_
}
output_lambdaOutput :: Lens.Lens' Output (Prelude.Maybe LambdaOutput)
output_lambdaOutput :: (Maybe LambdaOutput -> f (Maybe LambdaOutput))
-> Output -> f Output
output_lambdaOutput = (Output -> Maybe LambdaOutput)
-> (Output -> Maybe LambdaOutput -> Output)
-> Lens Output Output (Maybe LambdaOutput) (Maybe LambdaOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe LambdaOutput
lambdaOutput :: Maybe LambdaOutput
$sel:lambdaOutput:Output' :: Output -> Maybe LambdaOutput
lambdaOutput} -> Maybe LambdaOutput
lambdaOutput) (\s :: Output
s@Output' {} Maybe LambdaOutput
a -> Output
s {$sel:lambdaOutput:Output' :: Maybe LambdaOutput
lambdaOutput = Maybe LambdaOutput
a} :: Output)
output_kinesisStreamsOutput :: Lens.Lens' Output (Prelude.Maybe KinesisStreamsOutput)
output_kinesisStreamsOutput :: (Maybe KinesisStreamsOutput -> f (Maybe KinesisStreamsOutput))
-> Output -> f Output
output_kinesisStreamsOutput = (Output -> Maybe KinesisStreamsOutput)
-> (Output -> Maybe KinesisStreamsOutput -> Output)
-> Lens
Output
Output
(Maybe KinesisStreamsOutput)
(Maybe KinesisStreamsOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe KinesisStreamsOutput
kinesisStreamsOutput :: Maybe KinesisStreamsOutput
$sel:kinesisStreamsOutput:Output' :: Output -> Maybe KinesisStreamsOutput
kinesisStreamsOutput} -> Maybe KinesisStreamsOutput
kinesisStreamsOutput) (\s :: Output
s@Output' {} Maybe KinesisStreamsOutput
a -> Output
s {$sel:kinesisStreamsOutput:Output' :: Maybe KinesisStreamsOutput
kinesisStreamsOutput = Maybe KinesisStreamsOutput
a} :: Output)
output_kinesisFirehoseOutput :: Lens.Lens' Output (Prelude.Maybe KinesisFirehoseOutput)
output_kinesisFirehoseOutput :: (Maybe KinesisFirehoseOutput -> f (Maybe KinesisFirehoseOutput))
-> Output -> f Output
output_kinesisFirehoseOutput = (Output -> Maybe KinesisFirehoseOutput)
-> (Output -> Maybe KinesisFirehoseOutput -> Output)
-> Lens
Output
Output
(Maybe KinesisFirehoseOutput)
(Maybe KinesisFirehoseOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe KinesisFirehoseOutput
kinesisFirehoseOutput :: Maybe KinesisFirehoseOutput
$sel:kinesisFirehoseOutput:Output' :: Output -> Maybe KinesisFirehoseOutput
kinesisFirehoseOutput} -> Maybe KinesisFirehoseOutput
kinesisFirehoseOutput) (\s :: Output
s@Output' {} Maybe KinesisFirehoseOutput
a -> Output
s {$sel:kinesisFirehoseOutput:Output' :: Maybe KinesisFirehoseOutput
kinesisFirehoseOutput = Maybe KinesisFirehoseOutput
a} :: Output)
output_name :: Lens.Lens' Output Prelude.Text
output_name :: (Text -> f Text) -> Output -> f Output
output_name = (Output -> Text)
-> (Output -> Text -> Output) -> Lens Output Output Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Text
name :: Text
$sel:name:Output' :: Output -> Text
name} -> Text
name) (\s :: Output
s@Output' {} Text
a -> Output
s {$sel:name:Output' :: Text
name = Text
a} :: Output)
output_destinationSchema :: Lens.Lens' Output DestinationSchema
output_destinationSchema :: (DestinationSchema -> f DestinationSchema) -> Output -> f Output
output_destinationSchema = (Output -> DestinationSchema)
-> (Output -> DestinationSchema -> Output)
-> Lens Output Output DestinationSchema DestinationSchema
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {DestinationSchema
destinationSchema :: DestinationSchema
$sel:destinationSchema:Output' :: Output -> DestinationSchema
destinationSchema} -> DestinationSchema
destinationSchema) (\s :: Output
s@Output' {} DestinationSchema
a -> Output
s {$sel:destinationSchema:Output' :: DestinationSchema
destinationSchema = DestinationSchema
a} :: Output)
instance Prelude.Hashable Output
instance Prelude.NFData Output
instance Core.ToJSON Output where
toJSON :: Output -> Value
toJSON Output' {Maybe KinesisFirehoseOutput
Maybe KinesisStreamsOutput
Maybe LambdaOutput
Text
DestinationSchema
destinationSchema :: DestinationSchema
name :: Text
kinesisFirehoseOutput :: Maybe KinesisFirehoseOutput
kinesisStreamsOutput :: Maybe KinesisStreamsOutput
lambdaOutput :: Maybe LambdaOutput
$sel:destinationSchema:Output' :: Output -> DestinationSchema
$sel:name:Output' :: Output -> Text
$sel:kinesisFirehoseOutput:Output' :: Output -> Maybe KinesisFirehoseOutput
$sel:kinesisStreamsOutput:Output' :: Output -> Maybe KinesisStreamsOutput
$sel:lambdaOutput:Output' :: Output -> Maybe LambdaOutput
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LambdaOutput" Text -> LambdaOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LambdaOutput -> Pair) -> Maybe LambdaOutput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaOutput
lambdaOutput,
(Text
"KinesisStreamsOutput" Text -> KinesisStreamsOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KinesisStreamsOutput -> Pair)
-> Maybe KinesisStreamsOutput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisStreamsOutput
kinesisStreamsOutput,
(Text
"KinesisFirehoseOutput" Text -> KinesisFirehoseOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KinesisFirehoseOutput -> Pair)
-> Maybe KinesisFirehoseOutput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisFirehoseOutput
kinesisFirehoseOutput,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DestinationSchema" Text -> DestinationSchema -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DestinationSchema
destinationSchema)
]
)