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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(TechnicalCueSegment -> TechnicalCueSegment -> Bool)
-> (TechnicalCueSegment -> TechnicalCueSegment -> Bool)
-> Eq TechnicalCueSegment
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]
(Int -> ReadS TechnicalCueSegment)
-> ReadS [TechnicalCueSegment]
-> ReadPrec TechnicalCueSegment
-> ReadPrec [TechnicalCueSegment]
-> Read 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
(Int -> TechnicalCueSegment -> ShowS)
-> (TechnicalCueSegment -> String)
-> ([TechnicalCueSegment] -> ShowS)
-> Show TechnicalCueSegment
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. TechnicalCueSegment -> Rep TechnicalCueSegment x)
-> (forall x. Rep TechnicalCueSegment x -> TechnicalCueSegment)
-> Generic TechnicalCueSegment
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' :: Maybe Double -> Maybe TechnicalCueType -> TechnicalCueSegment
TechnicalCueSegment'
    { $sel:confidence:TechnicalCueSegment' :: Maybe Double
confidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:type':TechnicalCueSegment' :: Maybe TechnicalCueType
type' = Maybe TechnicalCueType
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 :: (Maybe Double -> f (Maybe Double))
-> TechnicalCueSegment -> f TechnicalCueSegment
technicalCueSegment_confidence = (TechnicalCueSegment -> Maybe Double)
-> (TechnicalCueSegment -> Maybe Double -> TechnicalCueSegment)
-> Lens
     TechnicalCueSegment
     TechnicalCueSegment
     (Maybe Double)
     (Maybe Double)
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 :: (Maybe TechnicalCueType -> f (Maybe TechnicalCueType))
-> TechnicalCueSegment -> f TechnicalCueSegment
technicalCueSegment_type = (TechnicalCueSegment -> Maybe TechnicalCueType)
-> (TechnicalCueSegment
    -> Maybe TechnicalCueType -> TechnicalCueSegment)
-> Lens
     TechnicalCueSegment
     TechnicalCueSegment
     (Maybe TechnicalCueType)
     (Maybe TechnicalCueType)
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 Core.FromJSON TechnicalCueSegment where
  parseJSON :: Value -> Parser TechnicalCueSegment
parseJSON =
    String
-> (Object -> Parser TechnicalCueSegment)
-> Value
-> Parser TechnicalCueSegment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TechnicalCueSegment"
      ( \Object
x ->
          Maybe Double -> Maybe TechnicalCueType -> TechnicalCueSegment
TechnicalCueSegment'
            (Maybe Double -> Maybe TechnicalCueType -> TechnicalCueSegment)
-> Parser (Maybe Double)
-> Parser (Maybe TechnicalCueType -> TechnicalCueSegment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Confidence")
            Parser (Maybe TechnicalCueType -> TechnicalCueSegment)
-> Parser (Maybe TechnicalCueType) -> Parser TechnicalCueSegment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TechnicalCueType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable TechnicalCueSegment

instance Prelude.NFData TechnicalCueSegment