{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Rekognition.Types.StreamProcessor where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.StreamProcessorStatus

-- | An object that recognizes faces 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'
  { -- | Current status of the Amazon Rekognition stream processor.
    StreamProcessor -> Maybe StreamProcessorStatus
status :: Prelude.Maybe StreamProcessorStatus,
    -- | Name of the Amazon Rekognition stream processor.
    StreamProcessor -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (StreamProcessor -> StreamProcessor -> Bool
(StreamProcessor -> StreamProcessor -> Bool)
-> (StreamProcessor -> StreamProcessor -> Bool)
-> Eq StreamProcessor
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]
(Int -> ReadS StreamProcessor)
-> ReadS [StreamProcessor]
-> ReadPrec StreamProcessor
-> ReadPrec [StreamProcessor]
-> Read 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
(Int -> StreamProcessor -> ShowS)
-> (StreamProcessor -> String)
-> ([StreamProcessor] -> ShowS)
-> Show StreamProcessor
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. StreamProcessor -> Rep StreamProcessor x)
-> (forall x. Rep StreamProcessor x -> StreamProcessor)
-> Generic StreamProcessor
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:
--
-- 'status', 'streamProcessor_status' - Current status of the Amazon Rekognition stream processor.
--
-- 'name', 'streamProcessor_name' - Name of the Amazon Rekognition stream processor.
newStreamProcessor ::
  StreamProcessor
newStreamProcessor :: StreamProcessor
newStreamProcessor =
  StreamProcessor' :: Maybe StreamProcessorStatus -> Maybe Text -> StreamProcessor
StreamProcessor'
    { $sel:status:StreamProcessor' :: Maybe StreamProcessorStatus
status = Maybe StreamProcessorStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:name:StreamProcessor' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Current status of the Amazon Rekognition stream processor.
streamProcessor_status :: Lens.Lens' StreamProcessor (Prelude.Maybe StreamProcessorStatus)
streamProcessor_status :: (Maybe StreamProcessorStatus -> f (Maybe StreamProcessorStatus))
-> StreamProcessor -> f StreamProcessor
streamProcessor_status = (StreamProcessor -> Maybe StreamProcessorStatus)
-> (StreamProcessor
    -> Maybe StreamProcessorStatus -> StreamProcessor)
-> Lens
     StreamProcessor
     StreamProcessor
     (Maybe StreamProcessorStatus)
     (Maybe StreamProcessorStatus)
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)

-- | Name of the Amazon Rekognition stream processor.
streamProcessor_name :: Lens.Lens' StreamProcessor (Prelude.Maybe Prelude.Text)
streamProcessor_name :: (Maybe Text -> f (Maybe Text))
-> StreamProcessor -> f StreamProcessor
streamProcessor_name = (StreamProcessor -> Maybe Text)
-> (StreamProcessor -> Maybe Text -> StreamProcessor)
-> Lens StreamProcessor StreamProcessor (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON StreamProcessor where
  parseJSON :: Value -> Parser StreamProcessor
parseJSON =
    String
-> (Object -> Parser StreamProcessor)
-> Value
-> Parser StreamProcessor
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StreamProcessor"
      ( \Object
x ->
          Maybe StreamProcessorStatus -> Maybe Text -> StreamProcessor
StreamProcessor'
            (Maybe StreamProcessorStatus -> Maybe Text -> StreamProcessor)
-> Parser (Maybe StreamProcessorStatus)
-> Parser (Maybe Text -> StreamProcessor)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StreamProcessorStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe Text -> StreamProcessor)
-> Parser (Maybe Text) -> Parser StreamProcessor
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
      )

instance Prelude.Hashable StreamProcessor

instance Prelude.NFData StreamProcessor