{-# 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.InputUpdate where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.Types.InputParallelismUpdate
import Amazonka.KinesisAnalytics.Types.InputProcessingConfigurationUpdate
import Amazonka.KinesisAnalytics.Types.InputSchemaUpdate
import Amazonka.KinesisAnalytics.Types.KinesisFirehoseInputUpdate
import Amazonka.KinesisAnalytics.Types.KinesisStreamsInputUpdate
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputUpdate = InputUpdate'
{
InputUpdate -> Maybe InputProcessingConfigurationUpdate
inputProcessingConfigurationUpdate :: Prelude.Maybe InputProcessingConfigurationUpdate,
InputUpdate -> Maybe KinesisStreamsInputUpdate
kinesisStreamsInputUpdate :: Prelude.Maybe KinesisStreamsInputUpdate,
InputUpdate -> Maybe InputParallelismUpdate
inputParallelismUpdate :: Prelude.Maybe InputParallelismUpdate,
InputUpdate -> Maybe Text
namePrefixUpdate :: Prelude.Maybe Prelude.Text,
InputUpdate -> Maybe InputSchemaUpdate
inputSchemaUpdate :: Prelude.Maybe InputSchemaUpdate,
InputUpdate -> Maybe KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate :: Prelude.Maybe KinesisFirehoseInputUpdate,
InputUpdate -> Text
inputId :: Prelude.Text
}
deriving (InputUpdate -> InputUpdate -> Bool
(InputUpdate -> InputUpdate -> Bool)
-> (InputUpdate -> InputUpdate -> Bool) -> Eq InputUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputUpdate -> InputUpdate -> Bool
$c/= :: InputUpdate -> InputUpdate -> Bool
== :: InputUpdate -> InputUpdate -> Bool
$c== :: InputUpdate -> InputUpdate -> Bool
Prelude.Eq, ReadPrec [InputUpdate]
ReadPrec InputUpdate
Int -> ReadS InputUpdate
ReadS [InputUpdate]
(Int -> ReadS InputUpdate)
-> ReadS [InputUpdate]
-> ReadPrec InputUpdate
-> ReadPrec [InputUpdate]
-> Read InputUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputUpdate]
$creadListPrec :: ReadPrec [InputUpdate]
readPrec :: ReadPrec InputUpdate
$creadPrec :: ReadPrec InputUpdate
readList :: ReadS [InputUpdate]
$creadList :: ReadS [InputUpdate]
readsPrec :: Int -> ReadS InputUpdate
$creadsPrec :: Int -> ReadS InputUpdate
Prelude.Read, Int -> InputUpdate -> ShowS
[InputUpdate] -> ShowS
InputUpdate -> String
(Int -> InputUpdate -> ShowS)
-> (InputUpdate -> String)
-> ([InputUpdate] -> ShowS)
-> Show InputUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputUpdate] -> ShowS
$cshowList :: [InputUpdate] -> ShowS
show :: InputUpdate -> String
$cshow :: InputUpdate -> String
showsPrec :: Int -> InputUpdate -> ShowS
$cshowsPrec :: Int -> InputUpdate -> ShowS
Prelude.Show, (forall x. InputUpdate -> Rep InputUpdate x)
-> (forall x. Rep InputUpdate x -> InputUpdate)
-> Generic InputUpdate
forall x. Rep InputUpdate x -> InputUpdate
forall x. InputUpdate -> Rep InputUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputUpdate x -> InputUpdate
$cfrom :: forall x. InputUpdate -> Rep InputUpdate x
Prelude.Generic)
newInputUpdate ::
Prelude.Text ->
InputUpdate
newInputUpdate :: Text -> InputUpdate
newInputUpdate Text
pInputId_ =
InputUpdate' :: Maybe InputProcessingConfigurationUpdate
-> Maybe KinesisStreamsInputUpdate
-> Maybe InputParallelismUpdate
-> Maybe Text
-> Maybe InputSchemaUpdate
-> Maybe KinesisFirehoseInputUpdate
-> Text
-> InputUpdate
InputUpdate'
{ $sel:inputProcessingConfigurationUpdate:InputUpdate' :: Maybe InputProcessingConfigurationUpdate
inputProcessingConfigurationUpdate =
Maybe InputProcessingConfigurationUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:kinesisStreamsInputUpdate:InputUpdate' :: Maybe KinesisStreamsInputUpdate
kinesisStreamsInputUpdate = Maybe KinesisStreamsInputUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:inputParallelismUpdate:InputUpdate' :: Maybe InputParallelismUpdate
inputParallelismUpdate = Maybe InputParallelismUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:namePrefixUpdate:InputUpdate' :: Maybe Text
namePrefixUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:inputSchemaUpdate:InputUpdate' :: Maybe InputSchemaUpdate
inputSchemaUpdate = Maybe InputSchemaUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:kinesisFirehoseInputUpdate:InputUpdate' :: Maybe KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate = Maybe KinesisFirehoseInputUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:inputId:InputUpdate' :: Text
inputId = Text
pInputId_
}
inputUpdate_inputProcessingConfigurationUpdate :: Lens.Lens' InputUpdate (Prelude.Maybe InputProcessingConfigurationUpdate)
inputUpdate_inputProcessingConfigurationUpdate :: (Maybe InputProcessingConfigurationUpdate
-> f (Maybe InputProcessingConfigurationUpdate))
-> InputUpdate -> f InputUpdate
inputUpdate_inputProcessingConfigurationUpdate = (InputUpdate -> Maybe InputProcessingConfigurationUpdate)
-> (InputUpdate
-> Maybe InputProcessingConfigurationUpdate -> InputUpdate)
-> Lens
InputUpdate
InputUpdate
(Maybe InputProcessingConfigurationUpdate)
(Maybe InputProcessingConfigurationUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputUpdate' {Maybe InputProcessingConfigurationUpdate
inputProcessingConfigurationUpdate :: Maybe InputProcessingConfigurationUpdate
$sel:inputProcessingConfigurationUpdate:InputUpdate' :: InputUpdate -> Maybe InputProcessingConfigurationUpdate
inputProcessingConfigurationUpdate} -> Maybe InputProcessingConfigurationUpdate
inputProcessingConfigurationUpdate) (\s :: InputUpdate
s@InputUpdate' {} Maybe InputProcessingConfigurationUpdate
a -> InputUpdate
s {$sel:inputProcessingConfigurationUpdate:InputUpdate' :: Maybe InputProcessingConfigurationUpdate
inputProcessingConfigurationUpdate = Maybe InputProcessingConfigurationUpdate
a} :: InputUpdate)
inputUpdate_kinesisStreamsInputUpdate :: Lens.Lens' InputUpdate (Prelude.Maybe KinesisStreamsInputUpdate)
inputUpdate_kinesisStreamsInputUpdate :: (Maybe KinesisStreamsInputUpdate
-> f (Maybe KinesisStreamsInputUpdate))
-> InputUpdate -> f InputUpdate
inputUpdate_kinesisStreamsInputUpdate = (InputUpdate -> Maybe KinesisStreamsInputUpdate)
-> (InputUpdate -> Maybe KinesisStreamsInputUpdate -> InputUpdate)
-> Lens
InputUpdate
InputUpdate
(Maybe KinesisStreamsInputUpdate)
(Maybe KinesisStreamsInputUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputUpdate' {Maybe KinesisStreamsInputUpdate
kinesisStreamsInputUpdate :: Maybe KinesisStreamsInputUpdate
$sel:kinesisStreamsInputUpdate:InputUpdate' :: InputUpdate -> Maybe KinesisStreamsInputUpdate
kinesisStreamsInputUpdate} -> Maybe KinesisStreamsInputUpdate
kinesisStreamsInputUpdate) (\s :: InputUpdate
s@InputUpdate' {} Maybe KinesisStreamsInputUpdate
a -> InputUpdate
s {$sel:kinesisStreamsInputUpdate:InputUpdate' :: Maybe KinesisStreamsInputUpdate
kinesisStreamsInputUpdate = Maybe KinesisStreamsInputUpdate
a} :: InputUpdate)
inputUpdate_inputParallelismUpdate :: Lens.Lens' InputUpdate (Prelude.Maybe InputParallelismUpdate)
inputUpdate_inputParallelismUpdate :: (Maybe InputParallelismUpdate -> f (Maybe InputParallelismUpdate))
-> InputUpdate -> f InputUpdate
inputUpdate_inputParallelismUpdate = (InputUpdate -> Maybe InputParallelismUpdate)
-> (InputUpdate -> Maybe InputParallelismUpdate -> InputUpdate)
-> Lens
InputUpdate
InputUpdate
(Maybe InputParallelismUpdate)
(Maybe InputParallelismUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputUpdate' {Maybe InputParallelismUpdate
inputParallelismUpdate :: Maybe InputParallelismUpdate
$sel:inputParallelismUpdate:InputUpdate' :: InputUpdate -> Maybe InputParallelismUpdate
inputParallelismUpdate} -> Maybe InputParallelismUpdate
inputParallelismUpdate) (\s :: InputUpdate
s@InputUpdate' {} Maybe InputParallelismUpdate
a -> InputUpdate
s {$sel:inputParallelismUpdate:InputUpdate' :: Maybe InputParallelismUpdate
inputParallelismUpdate = Maybe InputParallelismUpdate
a} :: InputUpdate)
inputUpdate_namePrefixUpdate :: Lens.Lens' InputUpdate (Prelude.Maybe Prelude.Text)
inputUpdate_namePrefixUpdate :: (Maybe Text -> f (Maybe Text)) -> InputUpdate -> f InputUpdate
inputUpdate_namePrefixUpdate = (InputUpdate -> Maybe Text)
-> (InputUpdate -> Maybe Text -> InputUpdate)
-> Lens InputUpdate InputUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputUpdate' {Maybe Text
namePrefixUpdate :: Maybe Text
$sel:namePrefixUpdate:InputUpdate' :: InputUpdate -> Maybe Text
namePrefixUpdate} -> Maybe Text
namePrefixUpdate) (\s :: InputUpdate
s@InputUpdate' {} Maybe Text
a -> InputUpdate
s {$sel:namePrefixUpdate:InputUpdate' :: Maybe Text
namePrefixUpdate = Maybe Text
a} :: InputUpdate)
inputUpdate_inputSchemaUpdate :: Lens.Lens' InputUpdate (Prelude.Maybe InputSchemaUpdate)
inputUpdate_inputSchemaUpdate :: (Maybe InputSchemaUpdate -> f (Maybe InputSchemaUpdate))
-> InputUpdate -> f InputUpdate
inputUpdate_inputSchemaUpdate = (InputUpdate -> Maybe InputSchemaUpdate)
-> (InputUpdate -> Maybe InputSchemaUpdate -> InputUpdate)
-> Lens
InputUpdate
InputUpdate
(Maybe InputSchemaUpdate)
(Maybe InputSchemaUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputUpdate' {Maybe InputSchemaUpdate
inputSchemaUpdate :: Maybe InputSchemaUpdate
$sel:inputSchemaUpdate:InputUpdate' :: InputUpdate -> Maybe InputSchemaUpdate
inputSchemaUpdate} -> Maybe InputSchemaUpdate
inputSchemaUpdate) (\s :: InputUpdate
s@InputUpdate' {} Maybe InputSchemaUpdate
a -> InputUpdate
s {$sel:inputSchemaUpdate:InputUpdate' :: Maybe InputSchemaUpdate
inputSchemaUpdate = Maybe InputSchemaUpdate
a} :: InputUpdate)
inputUpdate_kinesisFirehoseInputUpdate :: Lens.Lens' InputUpdate (Prelude.Maybe KinesisFirehoseInputUpdate)
inputUpdate_kinesisFirehoseInputUpdate :: (Maybe KinesisFirehoseInputUpdate
-> f (Maybe KinesisFirehoseInputUpdate))
-> InputUpdate -> f InputUpdate
inputUpdate_kinesisFirehoseInputUpdate = (InputUpdate -> Maybe KinesisFirehoseInputUpdate)
-> (InputUpdate -> Maybe KinesisFirehoseInputUpdate -> InputUpdate)
-> Lens
InputUpdate
InputUpdate
(Maybe KinesisFirehoseInputUpdate)
(Maybe KinesisFirehoseInputUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputUpdate' {Maybe KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate :: Maybe KinesisFirehoseInputUpdate
$sel:kinesisFirehoseInputUpdate:InputUpdate' :: InputUpdate -> Maybe KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate} -> Maybe KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate) (\s :: InputUpdate
s@InputUpdate' {} Maybe KinesisFirehoseInputUpdate
a -> InputUpdate
s {$sel:kinesisFirehoseInputUpdate:InputUpdate' :: Maybe KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate = Maybe KinesisFirehoseInputUpdate
a} :: InputUpdate)
inputUpdate_inputId :: Lens.Lens' InputUpdate Prelude.Text
inputUpdate_inputId :: (Text -> f Text) -> InputUpdate -> f InputUpdate
inputUpdate_inputId = (InputUpdate -> Text)
-> (InputUpdate -> Text -> InputUpdate)
-> Lens InputUpdate InputUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputUpdate' {Text
inputId :: Text
$sel:inputId:InputUpdate' :: InputUpdate -> Text
inputId} -> Text
inputId) (\s :: InputUpdate
s@InputUpdate' {} Text
a -> InputUpdate
s {$sel:inputId:InputUpdate' :: Text
inputId = Text
a} :: InputUpdate)
instance Prelude.Hashable InputUpdate
instance Prelude.NFData InputUpdate
instance Core.ToJSON InputUpdate where
toJSON :: InputUpdate -> Value
toJSON InputUpdate' {Maybe Text
Maybe InputParallelismUpdate
Maybe InputProcessingConfigurationUpdate
Maybe KinesisFirehoseInputUpdate
Maybe KinesisStreamsInputUpdate
Maybe InputSchemaUpdate
Text
inputId :: Text
kinesisFirehoseInputUpdate :: Maybe KinesisFirehoseInputUpdate
inputSchemaUpdate :: Maybe InputSchemaUpdate
namePrefixUpdate :: Maybe Text
inputParallelismUpdate :: Maybe InputParallelismUpdate
kinesisStreamsInputUpdate :: Maybe KinesisStreamsInputUpdate
inputProcessingConfigurationUpdate :: Maybe InputProcessingConfigurationUpdate
$sel:inputId:InputUpdate' :: InputUpdate -> Text
$sel:kinesisFirehoseInputUpdate:InputUpdate' :: InputUpdate -> Maybe KinesisFirehoseInputUpdate
$sel:inputSchemaUpdate:InputUpdate' :: InputUpdate -> Maybe InputSchemaUpdate
$sel:namePrefixUpdate:InputUpdate' :: InputUpdate -> Maybe Text
$sel:inputParallelismUpdate:InputUpdate' :: InputUpdate -> Maybe InputParallelismUpdate
$sel:kinesisStreamsInputUpdate:InputUpdate' :: InputUpdate -> Maybe KinesisStreamsInputUpdate
$sel:inputProcessingConfigurationUpdate:InputUpdate' :: InputUpdate -> Maybe InputProcessingConfigurationUpdate
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InputProcessingConfigurationUpdate" Text -> InputProcessingConfigurationUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputProcessingConfigurationUpdate -> Pair)
-> Maybe InputProcessingConfigurationUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputProcessingConfigurationUpdate
inputProcessingConfigurationUpdate,
(Text
"KinesisStreamsInputUpdate" Text -> KinesisStreamsInputUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KinesisStreamsInputUpdate -> Pair)
-> Maybe KinesisStreamsInputUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisStreamsInputUpdate
kinesisStreamsInputUpdate,
(Text
"InputParallelismUpdate" Text -> InputParallelismUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputParallelismUpdate -> Pair)
-> Maybe InputParallelismUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputParallelismUpdate
inputParallelismUpdate,
(Text
"NamePrefixUpdate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namePrefixUpdate,
(Text
"InputSchemaUpdate" Text -> InputSchemaUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputSchemaUpdate -> Pair)
-> Maybe InputSchemaUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputSchemaUpdate
inputSchemaUpdate,
(Text
"KinesisFirehoseInputUpdate" Text -> KinesisFirehoseInputUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KinesisFirehoseInputUpdate -> Pair)
-> Maybe KinesisFirehoseInputUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisFirehoseInputUpdate
kinesisFirehoseInputUpdate,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InputId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
inputId)
]
)