{-# 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.StreamProcessor
-- 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.StreamProcessor 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.StreamProcessorStatus

-- | An object that recognizes faces or labels in a streaming video. An
-- Amazon Rekognition stream processor is created by a call to
-- CreateStreamProcessor. The request parameters for
-- @CreateStreamProcessor@ describe the Kinesis video stream source for the
-- streaming video, face recognition parameters, and where to stream the
-- analysis resullts.
--
-- /See:/ 'newStreamProcessor' smart constructor.
data StreamProcessor = StreamProcessor'
  { -- | Name of the Amazon Rekognition stream processor.
    StreamProcessor -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Current status of the Amazon Rekognition stream processor.
    StreamProcessor -> Maybe StreamProcessorStatus
status :: Prelude.Maybe StreamProcessorStatus
  }
  deriving (StreamProcessor -> StreamProcessor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamProcessor -> StreamProcessor -> Bool
$c/= :: StreamProcessor -> StreamProcessor -> Bool
== :: StreamProcessor -> StreamProcessor -> Bool
$c== :: StreamProcessor -> StreamProcessor -> Bool
Prelude.Eq, ReadPrec [StreamProcessor]
ReadPrec StreamProcessor
Int -> ReadS StreamProcessor
ReadS [StreamProcessor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamProcessor]
$creadListPrec :: ReadPrec [StreamProcessor]
readPrec :: ReadPrec StreamProcessor
$creadPrec :: ReadPrec StreamProcessor
readList :: ReadS [StreamProcessor]
$creadList :: ReadS [StreamProcessor]
readsPrec :: Int -> ReadS StreamProcessor
$creadsPrec :: Int -> ReadS StreamProcessor
Prelude.Read, Int -> StreamProcessor -> ShowS
[StreamProcessor] -> ShowS
StreamProcessor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamProcessor] -> ShowS
$cshowList :: [StreamProcessor] -> ShowS
show :: StreamProcessor -> String
$cshow :: StreamProcessor -> String
showsPrec :: Int -> StreamProcessor -> ShowS
$cshowsPrec :: Int -> StreamProcessor -> ShowS
Prelude.Show, forall x. Rep StreamProcessor x -> StreamProcessor
forall x. StreamProcessor -> Rep StreamProcessor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamProcessor x -> StreamProcessor
$cfrom :: forall x. StreamProcessor -> Rep StreamProcessor x
Prelude.Generic)

-- |
-- Create a value of 'StreamProcessor' 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:
--
-- 'name', 'streamProcessor_name' - Name of the Amazon Rekognition stream processor.
--
-- 'status', 'streamProcessor_status' - Current status of the Amazon Rekognition stream processor.
newStreamProcessor ::
  StreamProcessor
newStreamProcessor :: StreamProcessor
newStreamProcessor =
  StreamProcessor'
    { $sel:name:StreamProcessor' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:StreamProcessor' :: Maybe StreamProcessorStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | Name of the Amazon Rekognition stream processor.
streamProcessor_name :: Lens.Lens' StreamProcessor (Prelude.Maybe Prelude.Text)
streamProcessor_name :: Lens' StreamProcessor (Maybe Text)
streamProcessor_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamProcessor' {Maybe Text
name :: Maybe Text
$sel:name:StreamProcessor' :: StreamProcessor -> Maybe Text
name} -> Maybe Text
name) (\s :: StreamProcessor
s@StreamProcessor' {} Maybe Text
a -> StreamProcessor
s {$sel:name:StreamProcessor' :: Maybe Text
name = Maybe Text
a} :: StreamProcessor)

-- | Current status of the Amazon Rekognition stream processor.
streamProcessor_status :: Lens.Lens' StreamProcessor (Prelude.Maybe StreamProcessorStatus)
streamProcessor_status :: Lens' StreamProcessor (Maybe StreamProcessorStatus)
streamProcessor_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamProcessor' {Maybe StreamProcessorStatus
status :: Maybe StreamProcessorStatus
$sel:status:StreamProcessor' :: StreamProcessor -> Maybe StreamProcessorStatus
status} -> Maybe StreamProcessorStatus
status) (\s :: StreamProcessor
s@StreamProcessor' {} Maybe StreamProcessorStatus
a -> StreamProcessor
s {$sel:status:StreamProcessor' :: Maybe StreamProcessorStatus
status = Maybe StreamProcessorStatus
a} :: StreamProcessor)

instance Data.FromJSON StreamProcessor where
  parseJSON :: Value -> Parser StreamProcessor
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StreamProcessor"
      ( \Object
x ->
          Maybe Text -> Maybe StreamProcessorStatus -> StreamProcessor
StreamProcessor'
            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
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
      )

instance Prelude.Hashable StreamProcessor where
  hashWithSalt :: Int -> StreamProcessor -> Int
hashWithSalt Int
_salt StreamProcessor' {Maybe Text
Maybe StreamProcessorStatus
status :: Maybe StreamProcessorStatus
name :: Maybe Text
$sel:status:StreamProcessor' :: StreamProcessor -> Maybe StreamProcessorStatus
$sel:name:StreamProcessor' :: StreamProcessor -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamProcessorStatus
status

instance Prelude.NFData StreamProcessor where
  rnf :: StreamProcessor -> ()
rnf StreamProcessor' {Maybe Text
Maybe StreamProcessorStatus
status :: Maybe StreamProcessorStatus
name :: Maybe Text
$sel:status:StreamProcessor' :: StreamProcessor -> Maybe StreamProcessorStatus
$sel:name:StreamProcessor' :: StreamProcessor -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamProcessorStatus
status