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