{-# 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.InputStartingPositionConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.Types.InputStartingPosition
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputStartingPositionConfiguration = InputStartingPositionConfiguration'
{
InputStartingPositionConfiguration -> Maybe InputStartingPosition
inputStartingPosition :: Prelude.Maybe InputStartingPosition
}
deriving (InputStartingPositionConfiguration
-> InputStartingPositionConfiguration -> Bool
(InputStartingPositionConfiguration
-> InputStartingPositionConfiguration -> Bool)
-> (InputStartingPositionConfiguration
-> InputStartingPositionConfiguration -> Bool)
-> Eq InputStartingPositionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputStartingPositionConfiguration
-> InputStartingPositionConfiguration -> Bool
$c/= :: InputStartingPositionConfiguration
-> InputStartingPositionConfiguration -> Bool
== :: InputStartingPositionConfiguration
-> InputStartingPositionConfiguration -> Bool
$c== :: InputStartingPositionConfiguration
-> InputStartingPositionConfiguration -> Bool
Prelude.Eq, ReadPrec [InputStartingPositionConfiguration]
ReadPrec InputStartingPositionConfiguration
Int -> ReadS InputStartingPositionConfiguration
ReadS [InputStartingPositionConfiguration]
(Int -> ReadS InputStartingPositionConfiguration)
-> ReadS [InputStartingPositionConfiguration]
-> ReadPrec InputStartingPositionConfiguration
-> ReadPrec [InputStartingPositionConfiguration]
-> Read InputStartingPositionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputStartingPositionConfiguration]
$creadListPrec :: ReadPrec [InputStartingPositionConfiguration]
readPrec :: ReadPrec InputStartingPositionConfiguration
$creadPrec :: ReadPrec InputStartingPositionConfiguration
readList :: ReadS [InputStartingPositionConfiguration]
$creadList :: ReadS [InputStartingPositionConfiguration]
readsPrec :: Int -> ReadS InputStartingPositionConfiguration
$creadsPrec :: Int -> ReadS InputStartingPositionConfiguration
Prelude.Read, Int -> InputStartingPositionConfiguration -> ShowS
[InputStartingPositionConfiguration] -> ShowS
InputStartingPositionConfiguration -> String
(Int -> InputStartingPositionConfiguration -> ShowS)
-> (InputStartingPositionConfiguration -> String)
-> ([InputStartingPositionConfiguration] -> ShowS)
-> Show InputStartingPositionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputStartingPositionConfiguration] -> ShowS
$cshowList :: [InputStartingPositionConfiguration] -> ShowS
show :: InputStartingPositionConfiguration -> String
$cshow :: InputStartingPositionConfiguration -> String
showsPrec :: Int -> InputStartingPositionConfiguration -> ShowS
$cshowsPrec :: Int -> InputStartingPositionConfiguration -> ShowS
Prelude.Show, (forall x.
InputStartingPositionConfiguration
-> Rep InputStartingPositionConfiguration x)
-> (forall x.
Rep InputStartingPositionConfiguration x
-> InputStartingPositionConfiguration)
-> Generic InputStartingPositionConfiguration
forall x.
Rep InputStartingPositionConfiguration x
-> InputStartingPositionConfiguration
forall x.
InputStartingPositionConfiguration
-> Rep InputStartingPositionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InputStartingPositionConfiguration x
-> InputStartingPositionConfiguration
$cfrom :: forall x.
InputStartingPositionConfiguration
-> Rep InputStartingPositionConfiguration x
Prelude.Generic)
newInputStartingPositionConfiguration ::
InputStartingPositionConfiguration
newInputStartingPositionConfiguration :: InputStartingPositionConfiguration
newInputStartingPositionConfiguration =
InputStartingPositionConfiguration' :: Maybe InputStartingPosition -> InputStartingPositionConfiguration
InputStartingPositionConfiguration'
{ $sel:inputStartingPosition:InputStartingPositionConfiguration' :: Maybe InputStartingPosition
inputStartingPosition =
Maybe InputStartingPosition
forall a. Maybe a
Prelude.Nothing
}
inputStartingPositionConfiguration_inputStartingPosition :: Lens.Lens' InputStartingPositionConfiguration (Prelude.Maybe InputStartingPosition)
inputStartingPositionConfiguration_inputStartingPosition :: (Maybe InputStartingPosition -> f (Maybe InputStartingPosition))
-> InputStartingPositionConfiguration
-> f InputStartingPositionConfiguration
inputStartingPositionConfiguration_inputStartingPosition = (InputStartingPositionConfiguration -> Maybe InputStartingPosition)
-> (InputStartingPositionConfiguration
-> Maybe InputStartingPosition
-> InputStartingPositionConfiguration)
-> Lens
InputStartingPositionConfiguration
InputStartingPositionConfiguration
(Maybe InputStartingPosition)
(Maybe InputStartingPosition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputStartingPositionConfiguration' {Maybe InputStartingPosition
inputStartingPosition :: Maybe InputStartingPosition
$sel:inputStartingPosition:InputStartingPositionConfiguration' :: InputStartingPositionConfiguration -> Maybe InputStartingPosition
inputStartingPosition} -> Maybe InputStartingPosition
inputStartingPosition) (\s :: InputStartingPositionConfiguration
s@InputStartingPositionConfiguration' {} Maybe InputStartingPosition
a -> InputStartingPositionConfiguration
s {$sel:inputStartingPosition:InputStartingPositionConfiguration' :: Maybe InputStartingPosition
inputStartingPosition = Maybe InputStartingPosition
a} :: InputStartingPositionConfiguration)
instance
Core.FromJSON
InputStartingPositionConfiguration
where
parseJSON :: Value -> Parser InputStartingPositionConfiguration
parseJSON =
String
-> (Object -> Parser InputStartingPositionConfiguration)
-> Value
-> Parser InputStartingPositionConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InputStartingPositionConfiguration"
( \Object
x ->
Maybe InputStartingPosition -> InputStartingPositionConfiguration
InputStartingPositionConfiguration'
(Maybe InputStartingPosition -> InputStartingPositionConfiguration)
-> Parser (Maybe InputStartingPosition)
-> Parser InputStartingPositionConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InputStartingPosition)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InputStartingPosition")
)
instance
Prelude.Hashable
InputStartingPositionConfiguration
instance
Prelude.NFData
InputStartingPositionConfiguration
instance
Core.ToJSON
InputStartingPositionConfiguration
where
toJSON :: InputStartingPositionConfiguration -> Value
toJSON InputStartingPositionConfiguration' {Maybe InputStartingPosition
inputStartingPosition :: Maybe InputStartingPosition
$sel:inputStartingPosition:InputStartingPositionConfiguration' :: InputStartingPositionConfiguration -> Maybe InputStartingPosition
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InputStartingPosition" Text -> InputStartingPosition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputStartingPosition -> Pair)
-> Maybe InputStartingPosition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputStartingPosition
inputStartingPosition
]
)