{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Rekognition.Types.StartShotDetectionFilter where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:minSegmentConfidence:StartShotDetectionFilter' :: Maybe Double
minSegmentConfidence =
        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 :: Lens' StartShotDetectionFilter (Maybe Double)
startShotDetectionFilter_minSegmentConfidence = 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 where
  hashWithSalt :: Int -> StartShotDetectionFilter -> Int
hashWithSalt Int
_salt StartShotDetectionFilter' {Maybe Double
minSegmentConfidence :: Maybe Double
$sel:minSegmentConfidence:StartShotDetectionFilter' :: StartShotDetectionFilter -> Maybe Double
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
minSegmentConfidence

instance Prelude.NFData StartShotDetectionFilter where
  rnf :: StartShotDetectionFilter -> ()
rnf StartShotDetectionFilter' {Maybe Double
minSegmentConfidence :: Maybe Double
$sel:minSegmentConfidence:StartShotDetectionFilter' :: StartShotDetectionFilter -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
minSegmentConfidence

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