{-# 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.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
data StreamProcessor = StreamProcessor'
{
StreamProcessor -> Maybe StreamProcessorStatus
status :: Prelude.Maybe StreamProcessorStatus,
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)
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
}
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)
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