{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Rekognition.Types.StreamProcessorInput
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Rekognition.Types.StreamProcessorInput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.KinesisVideoStream

-- | Information about the source streaming video.
--
-- /See:/ 'newStreamProcessorInput' smart constructor.
data StreamProcessorInput = StreamProcessorInput'
  { -- | The Kinesis video stream input stream for the source streaming video.
    StreamProcessorInput -> Maybe KinesisVideoStream
kinesisVideoStream :: Prelude.Maybe KinesisVideoStream
  }
  deriving (StreamProcessorInput -> StreamProcessorInput -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'StreamProcessorInput' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'kinesisVideoStream', 'streamProcessorInput_kinesisVideoStream' - The Kinesis video stream input stream for the source streaming video.
newStreamProcessorInput ::
  StreamProcessorInput
newStreamProcessorInput :: StreamProcessorInput
newStreamProcessorInput =
  StreamProcessorInput'
    { $sel:kinesisVideoStream:StreamProcessorInput' :: Maybe KinesisVideoStream
kinesisVideoStream =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The Kinesis video stream input stream for the source streaming video.
streamProcessorInput_kinesisVideoStream :: Lens.Lens' StreamProcessorInput (Prelude.Maybe KinesisVideoStream)
streamProcessorInput_kinesisVideoStream :: Lens' StreamProcessorInput (Maybe KinesisVideoStream)
streamProcessorInput_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 Data.FromJSON StreamProcessorInput where
  parseJSON :: Value -> Parser StreamProcessorInput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StreamProcessorInput"
      ( \Object
x ->
          Maybe KinesisVideoStream -> StreamProcessorInput
StreamProcessorInput'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"KinesisVideoStream")
      )

instance Prelude.Hashable StreamProcessorInput where
  hashWithSalt :: Int -> StreamProcessorInput -> Int
hashWithSalt Int
_salt StreamProcessorInput' {Maybe KinesisVideoStream
kinesisVideoStream :: Maybe KinesisVideoStream
$sel:kinesisVideoStream:StreamProcessorInput' :: StreamProcessorInput -> Maybe KinesisVideoStream
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe KinesisVideoStream
kinesisVideoStream

instance Prelude.NFData StreamProcessorInput where
  rnf :: StreamProcessorInput -> ()
rnf StreamProcessorInput' {Maybe KinesisVideoStream
kinesisVideoStream :: Maybe KinesisVideoStream
$sel:kinesisVideoStream:StreamProcessorInput' :: StreamProcessorInput -> Maybe KinesisVideoStream
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe KinesisVideoStream
kinesisVideoStream

instance Data.ToJSON StreamProcessorInput where
  toJSON :: StreamProcessorInput -> Value
toJSON StreamProcessorInput' {Maybe KinesisVideoStream
kinesisVideoStream :: Maybe KinesisVideoStream
$sel:kinesisVideoStream:StreamProcessorInput' :: StreamProcessorInput -> Maybe KinesisVideoStream
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"KinesisVideoStream" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KinesisVideoStream
kinesisVideoStream
          ]
      )