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