{-# 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.InputConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.Types.InputStartingPositionConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputConfiguration = InputConfiguration'
{
InputConfiguration -> Text
id :: Prelude.Text,
InputConfiguration -> InputStartingPositionConfiguration
inputStartingPositionConfiguration :: InputStartingPositionConfiguration
}
deriving (InputConfiguration -> InputConfiguration -> Bool
(InputConfiguration -> InputConfiguration -> Bool)
-> (InputConfiguration -> InputConfiguration -> Bool)
-> Eq InputConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputConfiguration -> InputConfiguration -> Bool
$c/= :: InputConfiguration -> InputConfiguration -> Bool
== :: InputConfiguration -> InputConfiguration -> Bool
$c== :: InputConfiguration -> InputConfiguration -> Bool
Prelude.Eq, ReadPrec [InputConfiguration]
ReadPrec InputConfiguration
Int -> ReadS InputConfiguration
ReadS [InputConfiguration]
(Int -> ReadS InputConfiguration)
-> ReadS [InputConfiguration]
-> ReadPrec InputConfiguration
-> ReadPrec [InputConfiguration]
-> Read InputConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputConfiguration]
$creadListPrec :: ReadPrec [InputConfiguration]
readPrec :: ReadPrec InputConfiguration
$creadPrec :: ReadPrec InputConfiguration
readList :: ReadS [InputConfiguration]
$creadList :: ReadS [InputConfiguration]
readsPrec :: Int -> ReadS InputConfiguration
$creadsPrec :: Int -> ReadS InputConfiguration
Prelude.Read, Int -> InputConfiguration -> ShowS
[InputConfiguration] -> ShowS
InputConfiguration -> String
(Int -> InputConfiguration -> ShowS)
-> (InputConfiguration -> String)
-> ([InputConfiguration] -> ShowS)
-> Show InputConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputConfiguration] -> ShowS
$cshowList :: [InputConfiguration] -> ShowS
show :: InputConfiguration -> String
$cshow :: InputConfiguration -> String
showsPrec :: Int -> InputConfiguration -> ShowS
$cshowsPrec :: Int -> InputConfiguration -> ShowS
Prelude.Show, (forall x. InputConfiguration -> Rep InputConfiguration x)
-> (forall x. Rep InputConfiguration x -> InputConfiguration)
-> Generic InputConfiguration
forall x. Rep InputConfiguration x -> InputConfiguration
forall x. InputConfiguration -> Rep InputConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputConfiguration x -> InputConfiguration
$cfrom :: forall x. InputConfiguration -> Rep InputConfiguration x
Prelude.Generic)
newInputConfiguration ::
Prelude.Text ->
InputStartingPositionConfiguration ->
InputConfiguration
newInputConfiguration :: Text -> InputStartingPositionConfiguration -> InputConfiguration
newInputConfiguration
Text
pId_
InputStartingPositionConfiguration
pInputStartingPositionConfiguration_ =
InputConfiguration' :: Text -> InputStartingPositionConfiguration -> InputConfiguration
InputConfiguration'
{ $sel:id:InputConfiguration' :: Text
id = Text
pId_,
$sel:inputStartingPositionConfiguration:InputConfiguration' :: InputStartingPositionConfiguration
inputStartingPositionConfiguration =
InputStartingPositionConfiguration
pInputStartingPositionConfiguration_
}
inputConfiguration_id :: Lens.Lens' InputConfiguration Prelude.Text
inputConfiguration_id :: (Text -> f Text) -> InputConfiguration -> f InputConfiguration
inputConfiguration_id = (InputConfiguration -> Text)
-> (InputConfiguration -> Text -> InputConfiguration)
-> Lens InputConfiguration InputConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfiguration' {Text
id :: Text
$sel:id:InputConfiguration' :: InputConfiguration -> Text
id} -> Text
id) (\s :: InputConfiguration
s@InputConfiguration' {} Text
a -> InputConfiguration
s {$sel:id:InputConfiguration' :: Text
id = Text
a} :: InputConfiguration)
inputConfiguration_inputStartingPositionConfiguration :: Lens.Lens' InputConfiguration InputStartingPositionConfiguration
inputConfiguration_inputStartingPositionConfiguration :: (InputStartingPositionConfiguration
-> f InputStartingPositionConfiguration)
-> InputConfiguration -> f InputConfiguration
inputConfiguration_inputStartingPositionConfiguration = (InputConfiguration -> InputStartingPositionConfiguration)
-> (InputConfiguration
-> InputStartingPositionConfiguration -> InputConfiguration)
-> Lens
InputConfiguration
InputConfiguration
InputStartingPositionConfiguration
InputStartingPositionConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfiguration' {InputStartingPositionConfiguration
inputStartingPositionConfiguration :: InputStartingPositionConfiguration
$sel:inputStartingPositionConfiguration:InputConfiguration' :: InputConfiguration -> InputStartingPositionConfiguration
inputStartingPositionConfiguration} -> InputStartingPositionConfiguration
inputStartingPositionConfiguration) (\s :: InputConfiguration
s@InputConfiguration' {} InputStartingPositionConfiguration
a -> InputConfiguration
s {$sel:inputStartingPositionConfiguration:InputConfiguration' :: InputStartingPositionConfiguration
inputStartingPositionConfiguration = InputStartingPositionConfiguration
a} :: InputConfiguration)
instance Prelude.Hashable InputConfiguration
instance Prelude.NFData InputConfiguration
instance Core.ToJSON InputConfiguration where
toJSON :: InputConfiguration -> Value
toJSON InputConfiguration' {Text
InputStartingPositionConfiguration
inputStartingPositionConfiguration :: InputStartingPositionConfiguration
id :: Text
$sel:inputStartingPositionConfiguration:InputConfiguration' :: InputConfiguration -> InputStartingPositionConfiguration
$sel:id:InputConfiguration' :: InputConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"InputStartingPositionConfiguration"
Text -> InputStartingPositionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputStartingPositionConfiguration
inputStartingPositionConfiguration
)
]
)