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