{-# 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.StreamProcessingStopSelector
-- 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.StreamProcessingStopSelector 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

-- | Specifies when to stop processing the stream. You can specify a maximum
-- amount of time to process the video.
--
-- /See:/ 'newStreamProcessingStopSelector' smart constructor.
data StreamProcessingStopSelector = StreamProcessingStopSelector'
  { -- | Specifies the maximum amount of time in seconds that you want the stream
    -- to be processed. The largest amount of time is 2 minutes. The default is
    -- 10 seconds.
    StreamProcessingStopSelector -> Maybe Natural
maxDurationInSeconds :: Prelude.Maybe Prelude.Natural
  }
  deriving (StreamProcessingStopSelector
-> StreamProcessingStopSelector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamProcessingStopSelector
-> StreamProcessingStopSelector -> Bool
$c/= :: StreamProcessingStopSelector
-> StreamProcessingStopSelector -> Bool
== :: StreamProcessingStopSelector
-> StreamProcessingStopSelector -> Bool
$c== :: StreamProcessingStopSelector
-> StreamProcessingStopSelector -> Bool
Prelude.Eq, ReadPrec [StreamProcessingStopSelector]
ReadPrec StreamProcessingStopSelector
Int -> ReadS StreamProcessingStopSelector
ReadS [StreamProcessingStopSelector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamProcessingStopSelector]
$creadListPrec :: ReadPrec [StreamProcessingStopSelector]
readPrec :: ReadPrec StreamProcessingStopSelector
$creadPrec :: ReadPrec StreamProcessingStopSelector
readList :: ReadS [StreamProcessingStopSelector]
$creadList :: ReadS [StreamProcessingStopSelector]
readsPrec :: Int -> ReadS StreamProcessingStopSelector
$creadsPrec :: Int -> ReadS StreamProcessingStopSelector
Prelude.Read, Int -> StreamProcessingStopSelector -> ShowS
[StreamProcessingStopSelector] -> ShowS
StreamProcessingStopSelector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamProcessingStopSelector] -> ShowS
$cshowList :: [StreamProcessingStopSelector] -> ShowS
show :: StreamProcessingStopSelector -> String
$cshow :: StreamProcessingStopSelector -> String
showsPrec :: Int -> StreamProcessingStopSelector -> ShowS
$cshowsPrec :: Int -> StreamProcessingStopSelector -> ShowS
Prelude.Show, forall x.
Rep StreamProcessingStopSelector x -> StreamProcessingStopSelector
forall x.
StreamProcessingStopSelector -> Rep StreamProcessingStopSelector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StreamProcessingStopSelector x -> StreamProcessingStopSelector
$cfrom :: forall x.
StreamProcessingStopSelector -> Rep StreamProcessingStopSelector x
Prelude.Generic)

-- |
-- Create a value of 'StreamProcessingStopSelector' 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:
--
-- 'maxDurationInSeconds', 'streamProcessingStopSelector_maxDurationInSeconds' - Specifies the maximum amount of time in seconds that you want the stream
-- to be processed. The largest amount of time is 2 minutes. The default is
-- 10 seconds.
newStreamProcessingStopSelector ::
  StreamProcessingStopSelector
newStreamProcessingStopSelector :: StreamProcessingStopSelector
newStreamProcessingStopSelector =
  StreamProcessingStopSelector'
    { $sel:maxDurationInSeconds:StreamProcessingStopSelector' :: Maybe Natural
maxDurationInSeconds =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the maximum amount of time in seconds that you want the stream
-- to be processed. The largest amount of time is 2 minutes. The default is
-- 10 seconds.
streamProcessingStopSelector_maxDurationInSeconds :: Lens.Lens' StreamProcessingStopSelector (Prelude.Maybe Prelude.Natural)
streamProcessingStopSelector_maxDurationInSeconds :: Lens' StreamProcessingStopSelector (Maybe Natural)
streamProcessingStopSelector_maxDurationInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamProcessingStopSelector' {Maybe Natural
maxDurationInSeconds :: Maybe Natural
$sel:maxDurationInSeconds:StreamProcessingStopSelector' :: StreamProcessingStopSelector -> Maybe Natural
maxDurationInSeconds} -> Maybe Natural
maxDurationInSeconds) (\s :: StreamProcessingStopSelector
s@StreamProcessingStopSelector' {} Maybe Natural
a -> StreamProcessingStopSelector
s {$sel:maxDurationInSeconds:StreamProcessingStopSelector' :: Maybe Natural
maxDurationInSeconds = Maybe Natural
a} :: StreamProcessingStopSelector)

instance
  Prelude.Hashable
    StreamProcessingStopSelector
  where
  hashWithSalt :: Int -> StreamProcessingStopSelector -> Int
hashWithSalt Int
_salt StreamProcessingStopSelector' {Maybe Natural
maxDurationInSeconds :: Maybe Natural
$sel:maxDurationInSeconds:StreamProcessingStopSelector' :: StreamProcessingStopSelector -> Maybe Natural
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxDurationInSeconds

instance Prelude.NFData StreamProcessingStopSelector where
  rnf :: StreamProcessingStopSelector -> ()
rnf StreamProcessingStopSelector' {Maybe Natural
maxDurationInSeconds :: Maybe Natural
$sel:maxDurationInSeconds:StreamProcessingStopSelector' :: StreamProcessingStopSelector -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxDurationInSeconds

instance Data.ToJSON StreamProcessingStopSelector where
  toJSON :: StreamProcessingStopSelector -> Value
toJSON StreamProcessingStopSelector' {Maybe Natural
maxDurationInSeconds :: Maybe Natural
$sel:maxDurationInSeconds:StreamProcessingStopSelector' :: StreamProcessingStopSelector -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxDurationInSeconds" 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 Natural
maxDurationInSeconds
          ]
      )