{-# 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.MediaLive.Types.InputDeviceConfigurableSettings
-- 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.MediaLive.Types.InputDeviceConfigurableSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.InputDeviceConfiguredInput
import qualified Amazonka.Prelude as Prelude

-- | Configurable settings for the input device.
--
-- /See:/ 'newInputDeviceConfigurableSettings' smart constructor.
data InputDeviceConfigurableSettings = InputDeviceConfigurableSettings'
  { -- | The input source that you want to use. If the device has a source
    -- connected to only one of its input ports, or if you don\'t care which
    -- source the device sends, specify Auto. If the device has sources
    -- connected to both its input ports, and you want to use a specific
    -- source, specify the source.
    InputDeviceConfigurableSettings -> Maybe InputDeviceConfiguredInput
configuredInput :: Prelude.Maybe InputDeviceConfiguredInput,
    -- | The Link device\'s buffer size (latency) in milliseconds (ms).
    InputDeviceConfigurableSettings -> Maybe Int
latencyMs :: Prelude.Maybe Prelude.Int,
    -- | The maximum bitrate in bits per second. Set a value here to throttle the
    -- bitrate of the source video.
    InputDeviceConfigurableSettings -> Maybe Int
maxBitrate :: Prelude.Maybe Prelude.Int
  }
  deriving (InputDeviceConfigurableSettings
-> InputDeviceConfigurableSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputDeviceConfigurableSettings
-> InputDeviceConfigurableSettings -> Bool
$c/= :: InputDeviceConfigurableSettings
-> InputDeviceConfigurableSettings -> Bool
== :: InputDeviceConfigurableSettings
-> InputDeviceConfigurableSettings -> Bool
$c== :: InputDeviceConfigurableSettings
-> InputDeviceConfigurableSettings -> Bool
Prelude.Eq, ReadPrec [InputDeviceConfigurableSettings]
ReadPrec InputDeviceConfigurableSettings
Int -> ReadS InputDeviceConfigurableSettings
ReadS [InputDeviceConfigurableSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputDeviceConfigurableSettings]
$creadListPrec :: ReadPrec [InputDeviceConfigurableSettings]
readPrec :: ReadPrec InputDeviceConfigurableSettings
$creadPrec :: ReadPrec InputDeviceConfigurableSettings
readList :: ReadS [InputDeviceConfigurableSettings]
$creadList :: ReadS [InputDeviceConfigurableSettings]
readsPrec :: Int -> ReadS InputDeviceConfigurableSettings
$creadsPrec :: Int -> ReadS InputDeviceConfigurableSettings
Prelude.Read, Int -> InputDeviceConfigurableSettings -> ShowS
[InputDeviceConfigurableSettings] -> ShowS
InputDeviceConfigurableSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputDeviceConfigurableSettings] -> ShowS
$cshowList :: [InputDeviceConfigurableSettings] -> ShowS
show :: InputDeviceConfigurableSettings -> String
$cshow :: InputDeviceConfigurableSettings -> String
showsPrec :: Int -> InputDeviceConfigurableSettings -> ShowS
$cshowsPrec :: Int -> InputDeviceConfigurableSettings -> ShowS
Prelude.Show, forall x.
Rep InputDeviceConfigurableSettings x
-> InputDeviceConfigurableSettings
forall x.
InputDeviceConfigurableSettings
-> Rep InputDeviceConfigurableSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InputDeviceConfigurableSettings x
-> InputDeviceConfigurableSettings
$cfrom :: forall x.
InputDeviceConfigurableSettings
-> Rep InputDeviceConfigurableSettings x
Prelude.Generic)

-- |
-- Create a value of 'InputDeviceConfigurableSettings' 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:
--
-- 'configuredInput', 'inputDeviceConfigurableSettings_configuredInput' - The input source that you want to use. If the device has a source
-- connected to only one of its input ports, or if you don\'t care which
-- source the device sends, specify Auto. If the device has sources
-- connected to both its input ports, and you want to use a specific
-- source, specify the source.
--
-- 'latencyMs', 'inputDeviceConfigurableSettings_latencyMs' - The Link device\'s buffer size (latency) in milliseconds (ms).
--
-- 'maxBitrate', 'inputDeviceConfigurableSettings_maxBitrate' - The maximum bitrate in bits per second. Set a value here to throttle the
-- bitrate of the source video.
newInputDeviceConfigurableSettings ::
  InputDeviceConfigurableSettings
newInputDeviceConfigurableSettings :: InputDeviceConfigurableSettings
newInputDeviceConfigurableSettings =
  InputDeviceConfigurableSettings'
    { $sel:configuredInput:InputDeviceConfigurableSettings' :: Maybe InputDeviceConfiguredInput
configuredInput =
        forall a. Maybe a
Prelude.Nothing,
      $sel:latencyMs:InputDeviceConfigurableSettings' :: Maybe Int
latencyMs = forall a. Maybe a
Prelude.Nothing,
      $sel:maxBitrate:InputDeviceConfigurableSettings' :: Maybe Int
maxBitrate = forall a. Maybe a
Prelude.Nothing
    }

-- | The input source that you want to use. If the device has a source
-- connected to only one of its input ports, or if you don\'t care which
-- source the device sends, specify Auto. If the device has sources
-- connected to both its input ports, and you want to use a specific
-- source, specify the source.
inputDeviceConfigurableSettings_configuredInput :: Lens.Lens' InputDeviceConfigurableSettings (Prelude.Maybe InputDeviceConfiguredInput)
inputDeviceConfigurableSettings_configuredInput :: Lens'
  InputDeviceConfigurableSettings (Maybe InputDeviceConfiguredInput)
inputDeviceConfigurableSettings_configuredInput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDeviceConfigurableSettings' {Maybe InputDeviceConfiguredInput
configuredInput :: Maybe InputDeviceConfiguredInput
$sel:configuredInput:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe InputDeviceConfiguredInput
configuredInput} -> Maybe InputDeviceConfiguredInput
configuredInput) (\s :: InputDeviceConfigurableSettings
s@InputDeviceConfigurableSettings' {} Maybe InputDeviceConfiguredInput
a -> InputDeviceConfigurableSettings
s {$sel:configuredInput:InputDeviceConfigurableSettings' :: Maybe InputDeviceConfiguredInput
configuredInput = Maybe InputDeviceConfiguredInput
a} :: InputDeviceConfigurableSettings)

-- | The Link device\'s buffer size (latency) in milliseconds (ms).
inputDeviceConfigurableSettings_latencyMs :: Lens.Lens' InputDeviceConfigurableSettings (Prelude.Maybe Prelude.Int)
inputDeviceConfigurableSettings_latencyMs :: Lens' InputDeviceConfigurableSettings (Maybe Int)
inputDeviceConfigurableSettings_latencyMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDeviceConfigurableSettings' {Maybe Int
latencyMs :: Maybe Int
$sel:latencyMs:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
latencyMs} -> Maybe Int
latencyMs) (\s :: InputDeviceConfigurableSettings
s@InputDeviceConfigurableSettings' {} Maybe Int
a -> InputDeviceConfigurableSettings
s {$sel:latencyMs:InputDeviceConfigurableSettings' :: Maybe Int
latencyMs = Maybe Int
a} :: InputDeviceConfigurableSettings)

-- | The maximum bitrate in bits per second. Set a value here to throttle the
-- bitrate of the source video.
inputDeviceConfigurableSettings_maxBitrate :: Lens.Lens' InputDeviceConfigurableSettings (Prelude.Maybe Prelude.Int)
inputDeviceConfigurableSettings_maxBitrate :: Lens' InputDeviceConfigurableSettings (Maybe Int)
inputDeviceConfigurableSettings_maxBitrate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDeviceConfigurableSettings' {Maybe Int
maxBitrate :: Maybe Int
$sel:maxBitrate:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
maxBitrate} -> Maybe Int
maxBitrate) (\s :: InputDeviceConfigurableSettings
s@InputDeviceConfigurableSettings' {} Maybe Int
a -> InputDeviceConfigurableSettings
s {$sel:maxBitrate:InputDeviceConfigurableSettings' :: Maybe Int
maxBitrate = Maybe Int
a} :: InputDeviceConfigurableSettings)

instance
  Prelude.Hashable
    InputDeviceConfigurableSettings
  where
  hashWithSalt :: Int -> InputDeviceConfigurableSettings -> Int
hashWithSalt
    Int
_salt
    InputDeviceConfigurableSettings' {Maybe Int
Maybe InputDeviceConfiguredInput
maxBitrate :: Maybe Int
latencyMs :: Maybe Int
configuredInput :: Maybe InputDeviceConfiguredInput
$sel:maxBitrate:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
$sel:latencyMs:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
$sel:configuredInput:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe InputDeviceConfiguredInput
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputDeviceConfiguredInput
configuredInput
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
latencyMs
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxBitrate

instance
  Prelude.NFData
    InputDeviceConfigurableSettings
  where
  rnf :: InputDeviceConfigurableSettings -> ()
rnf InputDeviceConfigurableSettings' {Maybe Int
Maybe InputDeviceConfiguredInput
maxBitrate :: Maybe Int
latencyMs :: Maybe Int
configuredInput :: Maybe InputDeviceConfiguredInput
$sel:maxBitrate:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
$sel:latencyMs:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
$sel:configuredInput:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe InputDeviceConfiguredInput
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe InputDeviceConfiguredInput
configuredInput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
latencyMs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxBitrate

instance Data.ToJSON InputDeviceConfigurableSettings where
  toJSON :: InputDeviceConfigurableSettings -> Value
toJSON InputDeviceConfigurableSettings' {Maybe Int
Maybe InputDeviceConfiguredInput
maxBitrate :: Maybe Int
latencyMs :: Maybe Int
configuredInput :: Maybe InputDeviceConfiguredInput
$sel:maxBitrate:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
$sel:latencyMs:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
$sel:configuredInput:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe InputDeviceConfiguredInput
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"configuredInput" 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 InputDeviceConfiguredInput
configuredInput,
            (Key
"latencyMs" 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 Int
latencyMs,
            (Key
"maxBitrate" 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 Int
maxBitrate
          ]
      )