{-# 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.StartTechnicalCueDetectionFilter
-- 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.StartTechnicalCueDetectionFilter where

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

-- | Filters for the technical segments returned by GetSegmentDetection. For
-- more information, see StartSegmentDetectionFilters.
--
-- /See:/ 'newStartTechnicalCueDetectionFilter' smart constructor.
data StartTechnicalCueDetectionFilter = StartTechnicalCueDetectionFilter'
  { -- | A filter that allows you to control the black frame detection by
    -- specifying the black levels and pixel coverage of black pixels in a
    -- frame. Videos can come from multiple sources, formats, and time periods,
    -- with different standards and varying noise levels for black frames that
    -- need to be accounted for.
    StartTechnicalCueDetectionFilter -> Maybe BlackFrame
blackFrame :: Prelude.Maybe BlackFrame,
    -- | Specifies the minimum confidence that Amazon Rekognition Video must have
    -- in order to return a detected segment. Confidence represents how certain
    -- Amazon Rekognition is that a segment is correctly identified. 0 is the
    -- lowest confidence. 100 is the highest confidence. Amazon Rekognition
    -- Video doesn\'t return any segments with a confidence level lower than
    -- this specified value.
    --
    -- If you don\'t specify @MinSegmentConfidence@, @GetSegmentDetection@
    -- returns segments with confidence values greater than or equal to 50
    -- percent.
    StartTechnicalCueDetectionFilter -> Maybe Double
minSegmentConfidence :: Prelude.Maybe Prelude.Double
  }
  deriving (StartTechnicalCueDetectionFilter
-> StartTechnicalCueDetectionFilter -> Bool
(StartTechnicalCueDetectionFilter
 -> StartTechnicalCueDetectionFilter -> Bool)
-> (StartTechnicalCueDetectionFilter
    -> StartTechnicalCueDetectionFilter -> Bool)
-> Eq StartTechnicalCueDetectionFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTechnicalCueDetectionFilter
-> StartTechnicalCueDetectionFilter -> Bool
$c/= :: StartTechnicalCueDetectionFilter
-> StartTechnicalCueDetectionFilter -> Bool
== :: StartTechnicalCueDetectionFilter
-> StartTechnicalCueDetectionFilter -> Bool
$c== :: StartTechnicalCueDetectionFilter
-> StartTechnicalCueDetectionFilter -> Bool
Prelude.Eq, ReadPrec [StartTechnicalCueDetectionFilter]
ReadPrec StartTechnicalCueDetectionFilter
Int -> ReadS StartTechnicalCueDetectionFilter
ReadS [StartTechnicalCueDetectionFilter]
(Int -> ReadS StartTechnicalCueDetectionFilter)
-> ReadS [StartTechnicalCueDetectionFilter]
-> ReadPrec StartTechnicalCueDetectionFilter
-> ReadPrec [StartTechnicalCueDetectionFilter]
-> Read StartTechnicalCueDetectionFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTechnicalCueDetectionFilter]
$creadListPrec :: ReadPrec [StartTechnicalCueDetectionFilter]
readPrec :: ReadPrec StartTechnicalCueDetectionFilter
$creadPrec :: ReadPrec StartTechnicalCueDetectionFilter
readList :: ReadS [StartTechnicalCueDetectionFilter]
$creadList :: ReadS [StartTechnicalCueDetectionFilter]
readsPrec :: Int -> ReadS StartTechnicalCueDetectionFilter
$creadsPrec :: Int -> ReadS StartTechnicalCueDetectionFilter
Prelude.Read, Int -> StartTechnicalCueDetectionFilter -> ShowS
[StartTechnicalCueDetectionFilter] -> ShowS
StartTechnicalCueDetectionFilter -> String
(Int -> StartTechnicalCueDetectionFilter -> ShowS)
-> (StartTechnicalCueDetectionFilter -> String)
-> ([StartTechnicalCueDetectionFilter] -> ShowS)
-> Show StartTechnicalCueDetectionFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTechnicalCueDetectionFilter] -> ShowS
$cshowList :: [StartTechnicalCueDetectionFilter] -> ShowS
show :: StartTechnicalCueDetectionFilter -> String
$cshow :: StartTechnicalCueDetectionFilter -> String
showsPrec :: Int -> StartTechnicalCueDetectionFilter -> ShowS
$cshowsPrec :: Int -> StartTechnicalCueDetectionFilter -> ShowS
Prelude.Show, (forall x.
 StartTechnicalCueDetectionFilter
 -> Rep StartTechnicalCueDetectionFilter x)
-> (forall x.
    Rep StartTechnicalCueDetectionFilter x
    -> StartTechnicalCueDetectionFilter)
-> Generic StartTechnicalCueDetectionFilter
forall x.
Rep StartTechnicalCueDetectionFilter x
-> StartTechnicalCueDetectionFilter
forall x.
StartTechnicalCueDetectionFilter
-> Rep StartTechnicalCueDetectionFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartTechnicalCueDetectionFilter x
-> StartTechnicalCueDetectionFilter
$cfrom :: forall x.
StartTechnicalCueDetectionFilter
-> Rep StartTechnicalCueDetectionFilter x
Prelude.Generic)

-- |
-- Create a value of 'StartTechnicalCueDetectionFilter' 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:
--
-- 'blackFrame', 'startTechnicalCueDetectionFilter_blackFrame' - A filter that allows you to control the black frame detection by
-- specifying the black levels and pixel coverage of black pixels in a
-- frame. Videos can come from multiple sources, formats, and time periods,
-- with different standards and varying noise levels for black frames that
-- need to be accounted for.
--
-- 'minSegmentConfidence', 'startTechnicalCueDetectionFilter_minSegmentConfidence' - Specifies the minimum confidence that Amazon Rekognition Video must have
-- in order to return a detected segment. Confidence represents how certain
-- Amazon Rekognition is that a segment is correctly identified. 0 is the
-- lowest confidence. 100 is the highest confidence. Amazon Rekognition
-- Video doesn\'t return any segments with a confidence level lower than
-- this specified value.
--
-- If you don\'t specify @MinSegmentConfidence@, @GetSegmentDetection@
-- returns segments with confidence values greater than or equal to 50
-- percent.
newStartTechnicalCueDetectionFilter ::
  StartTechnicalCueDetectionFilter
newStartTechnicalCueDetectionFilter :: StartTechnicalCueDetectionFilter
newStartTechnicalCueDetectionFilter =
  StartTechnicalCueDetectionFilter' :: Maybe BlackFrame
-> Maybe Double -> StartTechnicalCueDetectionFilter
StartTechnicalCueDetectionFilter'
    { $sel:blackFrame:StartTechnicalCueDetectionFilter' :: Maybe BlackFrame
blackFrame =
        Maybe BlackFrame
forall a. Maybe a
Prelude.Nothing,
      $sel:minSegmentConfidence:StartTechnicalCueDetectionFilter' :: Maybe Double
minSegmentConfidence = Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | A filter that allows you to control the black frame detection by
-- specifying the black levels and pixel coverage of black pixels in a
-- frame. Videos can come from multiple sources, formats, and time periods,
-- with different standards and varying noise levels for black frames that
-- need to be accounted for.
startTechnicalCueDetectionFilter_blackFrame :: Lens.Lens' StartTechnicalCueDetectionFilter (Prelude.Maybe BlackFrame)
startTechnicalCueDetectionFilter_blackFrame :: (Maybe BlackFrame -> f (Maybe BlackFrame))
-> StartTechnicalCueDetectionFilter
-> f StartTechnicalCueDetectionFilter
startTechnicalCueDetectionFilter_blackFrame = (StartTechnicalCueDetectionFilter -> Maybe BlackFrame)
-> (StartTechnicalCueDetectionFilter
    -> Maybe BlackFrame -> StartTechnicalCueDetectionFilter)
-> Lens
     StartTechnicalCueDetectionFilter
     StartTechnicalCueDetectionFilter
     (Maybe BlackFrame)
     (Maybe BlackFrame)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTechnicalCueDetectionFilter' {Maybe BlackFrame
blackFrame :: Maybe BlackFrame
$sel:blackFrame:StartTechnicalCueDetectionFilter' :: StartTechnicalCueDetectionFilter -> Maybe BlackFrame
blackFrame} -> Maybe BlackFrame
blackFrame) (\s :: StartTechnicalCueDetectionFilter
s@StartTechnicalCueDetectionFilter' {} Maybe BlackFrame
a -> StartTechnicalCueDetectionFilter
s {$sel:blackFrame:StartTechnicalCueDetectionFilter' :: Maybe BlackFrame
blackFrame = Maybe BlackFrame
a} :: StartTechnicalCueDetectionFilter)

-- | Specifies the minimum confidence that Amazon Rekognition Video must have
-- in order to return a detected segment. Confidence represents how certain
-- Amazon Rekognition is that a segment is correctly identified. 0 is the
-- lowest confidence. 100 is the highest confidence. Amazon Rekognition
-- Video doesn\'t return any segments with a confidence level lower than
-- this specified value.
--
-- If you don\'t specify @MinSegmentConfidence@, @GetSegmentDetection@
-- returns segments with confidence values greater than or equal to 50
-- percent.
startTechnicalCueDetectionFilter_minSegmentConfidence :: Lens.Lens' StartTechnicalCueDetectionFilter (Prelude.Maybe Prelude.Double)
startTechnicalCueDetectionFilter_minSegmentConfidence :: (Maybe Double -> f (Maybe Double))
-> StartTechnicalCueDetectionFilter
-> f StartTechnicalCueDetectionFilter
startTechnicalCueDetectionFilter_minSegmentConfidence = (StartTechnicalCueDetectionFilter -> Maybe Double)
-> (StartTechnicalCueDetectionFilter
    -> Maybe Double -> StartTechnicalCueDetectionFilter)
-> Lens
     StartTechnicalCueDetectionFilter
     StartTechnicalCueDetectionFilter
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTechnicalCueDetectionFilter' {Maybe Double
minSegmentConfidence :: Maybe Double
$sel:minSegmentConfidence:StartTechnicalCueDetectionFilter' :: StartTechnicalCueDetectionFilter -> Maybe Double
minSegmentConfidence} -> Maybe Double
minSegmentConfidence) (\s :: StartTechnicalCueDetectionFilter
s@StartTechnicalCueDetectionFilter' {} Maybe Double
a -> StartTechnicalCueDetectionFilter
s {$sel:minSegmentConfidence:StartTechnicalCueDetectionFilter' :: Maybe Double
minSegmentConfidence = Maybe Double
a} :: StartTechnicalCueDetectionFilter)

instance
  Prelude.Hashable
    StartTechnicalCueDetectionFilter

instance
  Prelude.NFData
    StartTechnicalCueDetectionFilter

instance Core.ToJSON StartTechnicalCueDetectionFilter where
  toJSON :: StartTechnicalCueDetectionFilter -> Value
toJSON StartTechnicalCueDetectionFilter' {Maybe Double
Maybe BlackFrame
minSegmentConfidence :: Maybe Double
blackFrame :: Maybe BlackFrame
$sel:minSegmentConfidence:StartTechnicalCueDetectionFilter' :: StartTechnicalCueDetectionFilter -> Maybe Double
$sel:blackFrame:StartTechnicalCueDetectionFilter' :: StartTechnicalCueDetectionFilter -> Maybe BlackFrame
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"BlackFrame" Text -> BlackFrame -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BlackFrame -> Pair) -> Maybe BlackFrame -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BlackFrame
blackFrame,
            (Text
"MinSegmentConfidence" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
minSegmentConfidence
          ]
      )