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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Filters for the shot detection segments returned by
-- @GetSegmentDetection@. For more information, see
-- StartSegmentDetectionFilters.
--
-- /See:/ 'newStartShotDetectionFilter' smart constructor.
data StartShotDetectionFilter = StartShotDetectionFilter'
  { -- | 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@, the @GetSegmentDetection@
    -- returns segments with confidence values greater than or equal to 50
    -- percent.
    StartShotDetectionFilter -> Maybe Double
minSegmentConfidence :: Prelude.Maybe Prelude.Double
  }
  deriving (StartShotDetectionFilter -> StartShotDetectionFilter -> Bool
(StartShotDetectionFilter -> StartShotDetectionFilter -> Bool)
-> (StartShotDetectionFilter -> StartShotDetectionFilter -> Bool)
-> Eq StartShotDetectionFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartShotDetectionFilter -> StartShotDetectionFilter -> Bool
$c/= :: StartShotDetectionFilter -> StartShotDetectionFilter -> Bool
== :: StartShotDetectionFilter -> StartShotDetectionFilter -> Bool
$c== :: StartShotDetectionFilter -> StartShotDetectionFilter -> Bool
Prelude.Eq, ReadPrec [StartShotDetectionFilter]
ReadPrec StartShotDetectionFilter
Int -> ReadS StartShotDetectionFilter
ReadS [StartShotDetectionFilter]
(Int -> ReadS StartShotDetectionFilter)
-> ReadS [StartShotDetectionFilter]
-> ReadPrec StartShotDetectionFilter
-> ReadPrec [StartShotDetectionFilter]
-> Read StartShotDetectionFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartShotDetectionFilter]
$creadListPrec :: ReadPrec [StartShotDetectionFilter]
readPrec :: ReadPrec StartShotDetectionFilter
$creadPrec :: ReadPrec StartShotDetectionFilter
readList :: ReadS [StartShotDetectionFilter]
$creadList :: ReadS [StartShotDetectionFilter]
readsPrec :: Int -> ReadS StartShotDetectionFilter
$creadsPrec :: Int -> ReadS StartShotDetectionFilter
Prelude.Read, Int -> StartShotDetectionFilter -> ShowS
[StartShotDetectionFilter] -> ShowS
StartShotDetectionFilter -> String
(Int -> StartShotDetectionFilter -> ShowS)
-> (StartShotDetectionFilter -> String)
-> ([StartShotDetectionFilter] -> ShowS)
-> Show StartShotDetectionFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartShotDetectionFilter] -> ShowS
$cshowList :: [StartShotDetectionFilter] -> ShowS
show :: StartShotDetectionFilter -> String
$cshow :: StartShotDetectionFilter -> String
showsPrec :: Int -> StartShotDetectionFilter -> ShowS
$cshowsPrec :: Int -> StartShotDetectionFilter -> ShowS
Prelude.Show, (forall x.
 StartShotDetectionFilter -> Rep StartShotDetectionFilter x)
-> (forall x.
    Rep StartShotDetectionFilter x -> StartShotDetectionFilter)
-> Generic StartShotDetectionFilter
forall x.
Rep StartShotDetectionFilter x -> StartShotDetectionFilter
forall x.
StartShotDetectionFilter -> Rep StartShotDetectionFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartShotDetectionFilter x -> StartShotDetectionFilter
$cfrom :: forall x.
StartShotDetectionFilter -> Rep StartShotDetectionFilter x
Prelude.Generic)

-- |
-- Create a value of 'StartShotDetectionFilter' 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:
--
-- 'minSegmentConfidence', 'startShotDetectionFilter_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@, the @GetSegmentDetection@
-- returns segments with confidence values greater than or equal to 50
-- percent.
newStartShotDetectionFilter ::
  StartShotDetectionFilter
newStartShotDetectionFilter :: StartShotDetectionFilter
newStartShotDetectionFilter =
  StartShotDetectionFilter' :: Maybe Double -> StartShotDetectionFilter
StartShotDetectionFilter'
    { $sel:minSegmentConfidence:StartShotDetectionFilter' :: Maybe Double
minSegmentConfidence =
        Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | 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@, the @GetSegmentDetection@
-- returns segments with confidence values greater than or equal to 50
-- percent.
startShotDetectionFilter_minSegmentConfidence :: Lens.Lens' StartShotDetectionFilter (Prelude.Maybe Prelude.Double)
startShotDetectionFilter_minSegmentConfidence :: (Maybe Double -> f (Maybe Double))
-> StartShotDetectionFilter -> f StartShotDetectionFilter
startShotDetectionFilter_minSegmentConfidence = (StartShotDetectionFilter -> Maybe Double)
-> (StartShotDetectionFilter
    -> Maybe Double -> StartShotDetectionFilter)
-> Lens
     StartShotDetectionFilter
     StartShotDetectionFilter
     (Maybe Double)
     (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartShotDetectionFilter' {Maybe Double
minSegmentConfidence :: Maybe Double
$sel:minSegmentConfidence:StartShotDetectionFilter' :: StartShotDetectionFilter -> Maybe Double
minSegmentConfidence} -> Maybe Double
minSegmentConfidence) (\s :: StartShotDetectionFilter
s@StartShotDetectionFilter' {} Maybe Double
a -> StartShotDetectionFilter
s {$sel:minSegmentConfidence:StartShotDetectionFilter' :: Maybe Double
minSegmentConfidence = Maybe Double
a} :: StartShotDetectionFilter)

instance Prelude.Hashable StartShotDetectionFilter

instance Prelude.NFData StartShotDetectionFilter

instance Core.ToJSON StartShotDetectionFilter where
  toJSON :: StartShotDetectionFilter -> Value
toJSON StartShotDetectionFilter' {Maybe Double
minSegmentConfidence :: Maybe Double
$sel:minSegmentConfidence:StartShotDetectionFilter' :: StartShotDetectionFilter -> Maybe Double
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
          ]
      )