{-# 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.TechnicalCueSegment
-- 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.TechnicalCueSegment 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
import Amazonka.Rekognition.Types.TechnicalCueType

-- | Information about a technical cue segment. For more information, see
-- SegmentDetection.
--
-- /See:/ 'newTechnicalCueSegment' smart constructor.
data TechnicalCueSegment = TechnicalCueSegment'
  { -- | The confidence that Amazon Rekognition Video has in the accuracy of the
    -- detected segment.
    TechnicalCueSegment -> Maybe Double
confidence :: Prelude.Maybe Prelude.Double,
    -- | The type of the technical cue.
    TechnicalCueSegment -> Maybe TechnicalCueType
type' :: Prelude.Maybe TechnicalCueType
  }
  deriving (TechnicalCueSegment -> TechnicalCueSegment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TechnicalCueSegment -> TechnicalCueSegment -> Bool
$c/= :: TechnicalCueSegment -> TechnicalCueSegment -> Bool
== :: TechnicalCueSegment -> TechnicalCueSegment -> Bool
$c== :: TechnicalCueSegment -> TechnicalCueSegment -> Bool
Prelude.Eq, ReadPrec [TechnicalCueSegment]
ReadPrec TechnicalCueSegment
Int -> ReadS TechnicalCueSegment
ReadS [TechnicalCueSegment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TechnicalCueSegment]
$creadListPrec :: ReadPrec [TechnicalCueSegment]
readPrec :: ReadPrec TechnicalCueSegment
$creadPrec :: ReadPrec TechnicalCueSegment
readList :: ReadS [TechnicalCueSegment]
$creadList :: ReadS [TechnicalCueSegment]
readsPrec :: Int -> ReadS TechnicalCueSegment
$creadsPrec :: Int -> ReadS TechnicalCueSegment
Prelude.Read, Int -> TechnicalCueSegment -> ShowS
[TechnicalCueSegment] -> ShowS
TechnicalCueSegment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TechnicalCueSegment] -> ShowS
$cshowList :: [TechnicalCueSegment] -> ShowS
show :: TechnicalCueSegment -> String
$cshow :: TechnicalCueSegment -> String
showsPrec :: Int -> TechnicalCueSegment -> ShowS
$cshowsPrec :: Int -> TechnicalCueSegment -> ShowS
Prelude.Show, forall x. Rep TechnicalCueSegment x -> TechnicalCueSegment
forall x. TechnicalCueSegment -> Rep TechnicalCueSegment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TechnicalCueSegment x -> TechnicalCueSegment
$cfrom :: forall x. TechnicalCueSegment -> Rep TechnicalCueSegment x
Prelude.Generic)

-- |
-- Create a value of 'TechnicalCueSegment' 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:
--
-- 'confidence', 'technicalCueSegment_confidence' - The confidence that Amazon Rekognition Video has in the accuracy of the
-- detected segment.
--
-- 'type'', 'technicalCueSegment_type' - The type of the technical cue.
newTechnicalCueSegment ::
  TechnicalCueSegment
newTechnicalCueSegment :: TechnicalCueSegment
newTechnicalCueSegment =
  TechnicalCueSegment'
    { $sel:confidence:TechnicalCueSegment' :: Maybe Double
confidence = forall a. Maybe a
Prelude.Nothing,
      $sel:type':TechnicalCueSegment' :: Maybe TechnicalCueType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The confidence that Amazon Rekognition Video has in the accuracy of the
-- detected segment.
technicalCueSegment_confidence :: Lens.Lens' TechnicalCueSegment (Prelude.Maybe Prelude.Double)
technicalCueSegment_confidence :: Lens' TechnicalCueSegment (Maybe Double)
technicalCueSegment_confidence = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TechnicalCueSegment' {Maybe Double
confidence :: Maybe Double
$sel:confidence:TechnicalCueSegment' :: TechnicalCueSegment -> Maybe Double
confidence} -> Maybe Double
confidence) (\s :: TechnicalCueSegment
s@TechnicalCueSegment' {} Maybe Double
a -> TechnicalCueSegment
s {$sel:confidence:TechnicalCueSegment' :: Maybe Double
confidence = Maybe Double
a} :: TechnicalCueSegment)

-- | The type of the technical cue.
technicalCueSegment_type :: Lens.Lens' TechnicalCueSegment (Prelude.Maybe TechnicalCueType)
technicalCueSegment_type :: Lens' TechnicalCueSegment (Maybe TechnicalCueType)
technicalCueSegment_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TechnicalCueSegment' {Maybe TechnicalCueType
type' :: Maybe TechnicalCueType
$sel:type':TechnicalCueSegment' :: TechnicalCueSegment -> Maybe TechnicalCueType
type'} -> Maybe TechnicalCueType
type') (\s :: TechnicalCueSegment
s@TechnicalCueSegment' {} Maybe TechnicalCueType
a -> TechnicalCueSegment
s {$sel:type':TechnicalCueSegment' :: Maybe TechnicalCueType
type' = Maybe TechnicalCueType
a} :: TechnicalCueSegment)

instance Data.FromJSON TechnicalCueSegment where
  parseJSON :: Value -> Parser TechnicalCueSegment
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TechnicalCueSegment"
      ( \Object
x ->
          Maybe Double -> Maybe TechnicalCueType -> TechnicalCueSegment
TechnicalCueSegment'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Confidence")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
      )

instance Prelude.Hashable TechnicalCueSegment where
  hashWithSalt :: Int -> TechnicalCueSegment -> Int
hashWithSalt Int
_salt TechnicalCueSegment' {Maybe Double
Maybe TechnicalCueType
type' :: Maybe TechnicalCueType
confidence :: Maybe Double
$sel:type':TechnicalCueSegment' :: TechnicalCueSegment -> Maybe TechnicalCueType
$sel:confidence:TechnicalCueSegment' :: TechnicalCueSegment -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
confidence
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TechnicalCueType
type'

instance Prelude.NFData TechnicalCueSegment where
  rnf :: TechnicalCueSegment -> ()
rnf TechnicalCueSegment' {Maybe Double
Maybe TechnicalCueType
type' :: Maybe TechnicalCueType
confidence :: Maybe Double
$sel:type':TechnicalCueSegment' :: TechnicalCueSegment -> Maybe TechnicalCueType
$sel:confidence:TechnicalCueSegment' :: TechnicalCueSegment -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
confidence
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TechnicalCueType
type'