{-# 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.KinesisAnalytics.Types.Input where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.Types.InputParallelism
import Amazonka.KinesisAnalytics.Types.InputProcessingConfiguration
import Amazonka.KinesisAnalytics.Types.KinesisFirehoseInput
import Amazonka.KinesisAnalytics.Types.KinesisStreamsInput
import Amazonka.KinesisAnalytics.Types.SourceSchema
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Input = Input'
{
Input -> Maybe InputParallelism
inputParallelism :: Prelude.Maybe InputParallelism,
Input -> Maybe InputProcessingConfiguration
inputProcessingConfiguration :: Prelude.Maybe InputProcessingConfiguration,
Input -> Maybe KinesisStreamsInput
kinesisStreamsInput :: Prelude.Maybe KinesisStreamsInput,
Input -> Maybe KinesisFirehoseInput
kinesisFirehoseInput :: Prelude.Maybe KinesisFirehoseInput,
Input -> Text
namePrefix :: Prelude.Text,
Input -> SourceSchema
inputSchema :: SourceSchema
}
deriving (Input -> Input -> Bool
(Input -> Input -> Bool) -> (Input -> Input -> Bool) -> Eq Input
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Input -> Input -> Bool
$c/= :: Input -> Input -> Bool
== :: Input -> Input -> Bool
$c== :: Input -> Input -> Bool
Prelude.Eq, ReadPrec [Input]
ReadPrec Input
Int -> ReadS Input
ReadS [Input]
(Int -> ReadS Input)
-> ReadS [Input]
-> ReadPrec Input
-> ReadPrec [Input]
-> Read Input
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Input]
$creadListPrec :: ReadPrec [Input]
readPrec :: ReadPrec Input
$creadPrec :: ReadPrec Input
readList :: ReadS [Input]
$creadList :: ReadS [Input]
readsPrec :: Int -> ReadS Input
$creadsPrec :: Int -> ReadS Input
Prelude.Read, Int -> Input -> ShowS
[Input] -> ShowS
Input -> String
(Int -> Input -> ShowS)
-> (Input -> String) -> ([Input] -> ShowS) -> Show Input
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Input] -> ShowS
$cshowList :: [Input] -> ShowS
show :: Input -> String
$cshow :: Input -> String
showsPrec :: Int -> Input -> ShowS
$cshowsPrec :: Int -> Input -> ShowS
Prelude.Show, (forall x. Input -> Rep Input x)
-> (forall x. Rep Input x -> Input) -> Generic Input
forall x. Rep Input x -> Input
forall x. Input -> Rep Input x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Input x -> Input
$cfrom :: forall x. Input -> Rep Input x
Prelude.Generic)
newInput ::
Prelude.Text ->
SourceSchema ->
Input
newInput :: Text -> SourceSchema -> Input
newInput Text
pNamePrefix_ SourceSchema
pInputSchema_ =
Input' :: Maybe InputParallelism
-> Maybe InputProcessingConfiguration
-> Maybe KinesisStreamsInput
-> Maybe KinesisFirehoseInput
-> Text
-> SourceSchema
-> Input
Input'
{ $sel:inputParallelism:Input' :: Maybe InputParallelism
inputParallelism = Maybe InputParallelism
forall a. Maybe a
Prelude.Nothing,
$sel:inputProcessingConfiguration:Input' :: Maybe InputProcessingConfiguration
inputProcessingConfiguration = Maybe InputProcessingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:kinesisStreamsInput:Input' :: Maybe KinesisStreamsInput
kinesisStreamsInput = Maybe KinesisStreamsInput
forall a. Maybe a
Prelude.Nothing,
$sel:kinesisFirehoseInput:Input' :: Maybe KinesisFirehoseInput
kinesisFirehoseInput = Maybe KinesisFirehoseInput
forall a. Maybe a
Prelude.Nothing,
$sel:namePrefix:Input' :: Text
namePrefix = Text
pNamePrefix_,
$sel:inputSchema:Input' :: SourceSchema
inputSchema = SourceSchema
pInputSchema_
}
input_inputParallelism :: Lens.Lens' Input (Prelude.Maybe InputParallelism)
input_inputParallelism :: (Maybe InputParallelism -> f (Maybe InputParallelism))
-> Input -> f Input
input_inputParallelism = (Input -> Maybe InputParallelism)
-> (Input -> Maybe InputParallelism -> Input)
-> Lens
Input Input (Maybe InputParallelism) (Maybe InputParallelism)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Input' {Maybe InputParallelism
inputParallelism :: Maybe InputParallelism
$sel:inputParallelism:Input' :: Input -> Maybe InputParallelism
inputParallelism} -> Maybe InputParallelism
inputParallelism) (\s :: Input
s@Input' {} Maybe InputParallelism
a -> Input
s {$sel:inputParallelism:Input' :: Maybe InputParallelism
inputParallelism = Maybe InputParallelism
a} :: Input)
input_inputProcessingConfiguration :: Lens.Lens' Input (Prelude.Maybe InputProcessingConfiguration)
input_inputProcessingConfiguration :: (Maybe InputProcessingConfiguration
-> f (Maybe InputProcessingConfiguration))
-> Input -> f Input
input_inputProcessingConfiguration = (Input -> Maybe InputProcessingConfiguration)
-> (Input -> Maybe InputProcessingConfiguration -> Input)
-> Lens
Input
Input
(Maybe InputProcessingConfiguration)
(Maybe InputProcessingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Input' {Maybe InputProcessingConfiguration
inputProcessingConfiguration :: Maybe InputProcessingConfiguration
$sel:inputProcessingConfiguration:Input' :: Input -> Maybe InputProcessingConfiguration
inputProcessingConfiguration} -> Maybe InputProcessingConfiguration
inputProcessingConfiguration) (\s :: Input
s@Input' {} Maybe InputProcessingConfiguration
a -> Input
s {$sel:inputProcessingConfiguration:Input' :: Maybe InputProcessingConfiguration
inputProcessingConfiguration = Maybe InputProcessingConfiguration
a} :: Input)
input_kinesisStreamsInput :: Lens.Lens' Input (Prelude.Maybe KinesisStreamsInput)
input_kinesisStreamsInput :: (Maybe KinesisStreamsInput -> f (Maybe KinesisStreamsInput))
-> Input -> f Input
input_kinesisStreamsInput = (Input -> Maybe KinesisStreamsInput)
-> (Input -> Maybe KinesisStreamsInput -> Input)
-> Lens
Input Input (Maybe KinesisStreamsInput) (Maybe KinesisStreamsInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Input' {Maybe KinesisStreamsInput
kinesisStreamsInput :: Maybe KinesisStreamsInput
$sel:kinesisStreamsInput:Input' :: Input -> Maybe KinesisStreamsInput
kinesisStreamsInput} -> Maybe KinesisStreamsInput
kinesisStreamsInput) (\s :: Input
s@Input' {} Maybe KinesisStreamsInput
a -> Input
s {$sel:kinesisStreamsInput:Input' :: Maybe KinesisStreamsInput
kinesisStreamsInput = Maybe KinesisStreamsInput
a} :: Input)
input_kinesisFirehoseInput :: Lens.Lens' Input (Prelude.Maybe KinesisFirehoseInput)
input_kinesisFirehoseInput :: (Maybe KinesisFirehoseInput -> f (Maybe KinesisFirehoseInput))
-> Input -> f Input
input_kinesisFirehoseInput = (Input -> Maybe KinesisFirehoseInput)
-> (Input -> Maybe KinesisFirehoseInput -> Input)
-> Lens
Input
Input
(Maybe KinesisFirehoseInput)
(Maybe KinesisFirehoseInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Input' {Maybe KinesisFirehoseInput
kinesisFirehoseInput :: Maybe KinesisFirehoseInput
$sel:kinesisFirehoseInput:Input' :: Input -> Maybe KinesisFirehoseInput
kinesisFirehoseInput} -> Maybe KinesisFirehoseInput
kinesisFirehoseInput) (\s :: Input
s@Input' {} Maybe KinesisFirehoseInput
a -> Input
s {$sel:kinesisFirehoseInput:Input' :: Maybe KinesisFirehoseInput
kinesisFirehoseInput = Maybe KinesisFirehoseInput
a} :: Input)
input_namePrefix :: Lens.Lens' Input Prelude.Text
input_namePrefix :: (Text -> f Text) -> Input -> f Input
input_namePrefix = (Input -> Text)
-> (Input -> Text -> Input) -> Lens Input Input Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Input' {Text
namePrefix :: Text
$sel:namePrefix:Input' :: Input -> Text
namePrefix} -> Text
namePrefix) (\s :: Input
s@Input' {} Text
a -> Input
s {$sel:namePrefix:Input' :: Text
namePrefix = Text
a} :: Input)
input_inputSchema :: Lens.Lens' Input SourceSchema
input_inputSchema :: (SourceSchema -> f SourceSchema) -> Input -> f Input
input_inputSchema = (Input -> SourceSchema)
-> (Input -> SourceSchema -> Input)
-> Lens Input Input SourceSchema SourceSchema
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Input' {SourceSchema
inputSchema :: SourceSchema
$sel:inputSchema:Input' :: Input -> SourceSchema
inputSchema} -> SourceSchema
inputSchema) (\s :: Input
s@Input' {} SourceSchema
a -> Input
s {$sel:inputSchema:Input' :: SourceSchema
inputSchema = SourceSchema
a} :: Input)
instance Prelude.Hashable Input
instance Prelude.NFData Input
instance Core.ToJSON Input where
toJSON :: Input -> Value
toJSON Input' {Maybe InputParallelism
Maybe InputProcessingConfiguration
Maybe KinesisFirehoseInput
Maybe KinesisStreamsInput
Text
SourceSchema
inputSchema :: SourceSchema
namePrefix :: Text
kinesisFirehoseInput :: Maybe KinesisFirehoseInput
kinesisStreamsInput :: Maybe KinesisStreamsInput
inputProcessingConfiguration :: Maybe InputProcessingConfiguration
inputParallelism :: Maybe InputParallelism
$sel:inputSchema:Input' :: Input -> SourceSchema
$sel:namePrefix:Input' :: Input -> Text
$sel:kinesisFirehoseInput:Input' :: Input -> Maybe KinesisFirehoseInput
$sel:kinesisStreamsInput:Input' :: Input -> Maybe KinesisStreamsInput
$sel:inputProcessingConfiguration:Input' :: Input -> Maybe InputProcessingConfiguration
$sel:inputParallelism:Input' :: Input -> Maybe InputParallelism
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InputParallelism" Text -> InputParallelism -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputParallelism -> Pair) -> Maybe InputParallelism -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputParallelism
inputParallelism,
(Text
"InputProcessingConfiguration" Text -> InputProcessingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputProcessingConfiguration -> Pair)
-> Maybe InputProcessingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputProcessingConfiguration
inputProcessingConfiguration,
(Text
"KinesisStreamsInput" Text -> KinesisStreamsInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KinesisStreamsInput -> Pair)
-> Maybe KinesisStreamsInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisStreamsInput
kinesisStreamsInput,
(Text
"KinesisFirehoseInput" Text -> KinesisFirehoseInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KinesisFirehoseInput -> Pair)
-> Maybe KinesisFirehoseInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisFirehoseInput
kinesisFirehoseInput,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"NamePrefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
namePrefix),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InputSchema" Text -> SourceSchema -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SourceSchema
inputSchema)
]
)