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

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

-- | Information about the type of a segment requested in a call to
-- StartSegmentDetection. An array of @SegmentTypeInfo@ objects is returned
-- by the response from GetSegmentDetection.
--
-- /See:/ 'newSegmentTypeInfo' smart constructor.
data SegmentTypeInfo = SegmentTypeInfo'
  { -- | The version of the model used to detect segments.
    SegmentTypeInfo -> Maybe Text
modelVersion :: Prelude.Maybe Prelude.Text,
    -- | The type of a segment (technical cue or shot detection).
    SegmentTypeInfo -> Maybe SegmentType
type' :: Prelude.Maybe SegmentType
  }
  deriving (SegmentTypeInfo -> SegmentTypeInfo -> Bool
(SegmentTypeInfo -> SegmentTypeInfo -> Bool)
-> (SegmentTypeInfo -> SegmentTypeInfo -> Bool)
-> Eq SegmentTypeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
$c/= :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
== :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
$c== :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
Prelude.Eq, ReadPrec [SegmentTypeInfo]
ReadPrec SegmentTypeInfo
Int -> ReadS SegmentTypeInfo
ReadS [SegmentTypeInfo]
(Int -> ReadS SegmentTypeInfo)
-> ReadS [SegmentTypeInfo]
-> ReadPrec SegmentTypeInfo
-> ReadPrec [SegmentTypeInfo]
-> Read SegmentTypeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SegmentTypeInfo]
$creadListPrec :: ReadPrec [SegmentTypeInfo]
readPrec :: ReadPrec SegmentTypeInfo
$creadPrec :: ReadPrec SegmentTypeInfo
readList :: ReadS [SegmentTypeInfo]
$creadList :: ReadS [SegmentTypeInfo]
readsPrec :: Int -> ReadS SegmentTypeInfo
$creadsPrec :: Int -> ReadS SegmentTypeInfo
Prelude.Read, Int -> SegmentTypeInfo -> ShowS
[SegmentTypeInfo] -> ShowS
SegmentTypeInfo -> String
(Int -> SegmentTypeInfo -> ShowS)
-> (SegmentTypeInfo -> String)
-> ([SegmentTypeInfo] -> ShowS)
-> Show SegmentTypeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SegmentTypeInfo] -> ShowS
$cshowList :: [SegmentTypeInfo] -> ShowS
show :: SegmentTypeInfo -> String
$cshow :: SegmentTypeInfo -> String
showsPrec :: Int -> SegmentTypeInfo -> ShowS
$cshowsPrec :: Int -> SegmentTypeInfo -> ShowS
Prelude.Show, (forall x. SegmentTypeInfo -> Rep SegmentTypeInfo x)
-> (forall x. Rep SegmentTypeInfo x -> SegmentTypeInfo)
-> Generic SegmentTypeInfo
forall x. Rep SegmentTypeInfo x -> SegmentTypeInfo
forall x. SegmentTypeInfo -> Rep SegmentTypeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SegmentTypeInfo x -> SegmentTypeInfo
$cfrom :: forall x. SegmentTypeInfo -> Rep SegmentTypeInfo x
Prelude.Generic)

-- |
-- Create a value of 'SegmentTypeInfo' 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:
--
-- 'modelVersion', 'segmentTypeInfo_modelVersion' - The version of the model used to detect segments.
--
-- 'type'', 'segmentTypeInfo_type' - The type of a segment (technical cue or shot detection).
newSegmentTypeInfo ::
  SegmentTypeInfo
newSegmentTypeInfo :: SegmentTypeInfo
newSegmentTypeInfo =
  SegmentTypeInfo' :: Maybe Text -> Maybe SegmentType -> SegmentTypeInfo
SegmentTypeInfo'
    { $sel:modelVersion:SegmentTypeInfo' :: Maybe Text
modelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':SegmentTypeInfo' :: Maybe SegmentType
type' = Maybe SegmentType
forall a. Maybe a
Prelude.Nothing
    }

-- | The version of the model used to detect segments.
segmentTypeInfo_modelVersion :: Lens.Lens' SegmentTypeInfo (Prelude.Maybe Prelude.Text)
segmentTypeInfo_modelVersion :: (Maybe Text -> f (Maybe Text))
-> SegmentTypeInfo -> f SegmentTypeInfo
segmentTypeInfo_modelVersion = (SegmentTypeInfo -> Maybe Text)
-> (SegmentTypeInfo -> Maybe Text -> SegmentTypeInfo)
-> Lens SegmentTypeInfo SegmentTypeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentTypeInfo' {Maybe Text
modelVersion :: Maybe Text
$sel:modelVersion:SegmentTypeInfo' :: SegmentTypeInfo -> Maybe Text
modelVersion} -> Maybe Text
modelVersion) (\s :: SegmentTypeInfo
s@SegmentTypeInfo' {} Maybe Text
a -> SegmentTypeInfo
s {$sel:modelVersion:SegmentTypeInfo' :: Maybe Text
modelVersion = Maybe Text
a} :: SegmentTypeInfo)

-- | The type of a segment (technical cue or shot detection).
segmentTypeInfo_type :: Lens.Lens' SegmentTypeInfo (Prelude.Maybe SegmentType)
segmentTypeInfo_type :: (Maybe SegmentType -> f (Maybe SegmentType))
-> SegmentTypeInfo -> f SegmentTypeInfo
segmentTypeInfo_type = (SegmentTypeInfo -> Maybe SegmentType)
-> (SegmentTypeInfo -> Maybe SegmentType -> SegmentTypeInfo)
-> Lens
     SegmentTypeInfo
     SegmentTypeInfo
     (Maybe SegmentType)
     (Maybe SegmentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentTypeInfo' {Maybe SegmentType
type' :: Maybe SegmentType
$sel:type':SegmentTypeInfo' :: SegmentTypeInfo -> Maybe SegmentType
type'} -> Maybe SegmentType
type') (\s :: SegmentTypeInfo
s@SegmentTypeInfo' {} Maybe SegmentType
a -> SegmentTypeInfo
s {$sel:type':SegmentTypeInfo' :: Maybe SegmentType
type' = Maybe SegmentType
a} :: SegmentTypeInfo)

instance Core.FromJSON SegmentTypeInfo where
  parseJSON :: Value -> Parser SegmentTypeInfo
parseJSON =
    String
-> (Object -> Parser SegmentTypeInfo)
-> Value
-> Parser SegmentTypeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SegmentTypeInfo"
      ( \Object
x ->
          Maybe Text -> Maybe SegmentType -> SegmentTypeInfo
SegmentTypeInfo'
            (Maybe Text -> Maybe SegmentType -> SegmentTypeInfo)
-> Parser (Maybe Text)
-> Parser (Maybe SegmentType -> SegmentTypeInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ModelVersion")
            Parser (Maybe SegmentType -> SegmentTypeInfo)
-> Parser (Maybe SegmentType) -> Parser SegmentTypeInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SegmentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable SegmentTypeInfo

instance Prelude.NFData SegmentTypeInfo