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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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
(InputDeviceConfigurableSettings
 -> InputDeviceConfigurableSettings -> Bool)
-> (InputDeviceConfigurableSettings
    -> InputDeviceConfigurableSettings -> Bool)
-> Eq InputDeviceConfigurableSettings
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]
(Int -> ReadS InputDeviceConfigurableSettings)
-> ReadS [InputDeviceConfigurableSettings]
-> ReadPrec InputDeviceConfigurableSettings
-> ReadPrec [InputDeviceConfigurableSettings]
-> Read 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
(Int -> InputDeviceConfigurableSettings -> ShowS)
-> (InputDeviceConfigurableSettings -> String)
-> ([InputDeviceConfigurableSettings] -> ShowS)
-> Show InputDeviceConfigurableSettings
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.
 InputDeviceConfigurableSettings
 -> Rep InputDeviceConfigurableSettings x)
-> (forall x.
    Rep InputDeviceConfigurableSettings x
    -> InputDeviceConfigurableSettings)
-> Generic InputDeviceConfigurableSettings
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.
--
-- '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' :: Maybe InputDeviceConfiguredInput
-> Maybe Int -> InputDeviceConfigurableSettings
InputDeviceConfigurableSettings'
    { $sel:configuredInput:InputDeviceConfigurableSettings' :: Maybe InputDeviceConfiguredInput
configuredInput =
        Maybe InputDeviceConfiguredInput
forall a. Maybe a
Prelude.Nothing,
      $sel:maxBitrate:InputDeviceConfigurableSettings' :: Maybe Int
maxBitrate = Maybe Int
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 :: (Maybe InputDeviceConfiguredInput
 -> f (Maybe InputDeviceConfiguredInput))
-> InputDeviceConfigurableSettings
-> f InputDeviceConfigurableSettings
inputDeviceConfigurableSettings_configuredInput = (InputDeviceConfigurableSettings
 -> Maybe InputDeviceConfiguredInput)
-> (InputDeviceConfigurableSettings
    -> Maybe InputDeviceConfiguredInput
    -> InputDeviceConfigurableSettings)
-> Lens
     InputDeviceConfigurableSettings
     InputDeviceConfigurableSettings
     (Maybe InputDeviceConfiguredInput)
     (Maybe InputDeviceConfiguredInput)
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 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 :: (Maybe Int -> f (Maybe Int))
-> InputDeviceConfigurableSettings
-> f InputDeviceConfigurableSettings
inputDeviceConfigurableSettings_maxBitrate = (InputDeviceConfigurableSettings -> Maybe Int)
-> (InputDeviceConfigurableSettings
    -> Maybe Int -> InputDeviceConfigurableSettings)
-> Lens
     InputDeviceConfigurableSettings
     InputDeviceConfigurableSettings
     (Maybe Int)
     (Maybe Int)
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

instance
  Prelude.NFData
    InputDeviceConfigurableSettings

instance Core.ToJSON InputDeviceConfigurableSettings where
  toJSON :: InputDeviceConfigurableSettings -> Value
toJSON InputDeviceConfigurableSettings' {Maybe Int
Maybe InputDeviceConfiguredInput
maxBitrate :: Maybe Int
configuredInput :: Maybe InputDeviceConfiguredInput
$sel:maxBitrate:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe Int
$sel:configuredInput:InputDeviceConfigurableSettings' :: InputDeviceConfigurableSettings -> Maybe InputDeviceConfiguredInput
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"configuredInput" Text -> InputDeviceConfiguredInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (InputDeviceConfiguredInput -> Pair)
-> Maybe InputDeviceConfiguredInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputDeviceConfiguredInput
configuredInput,
            (Text
"maxBitrate" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxBitrate
          ]
      )