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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Settings for an input device.
--
-- /See:/ 'newInputDeviceRequest' smart constructor.
data InputDeviceRequest = InputDeviceRequest'
  { -- | The unique ID for the device.
    InputDeviceRequest -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (InputDeviceRequest -> InputDeviceRequest -> Bool
(InputDeviceRequest -> InputDeviceRequest -> Bool)
-> (InputDeviceRequest -> InputDeviceRequest -> Bool)
-> Eq InputDeviceRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputDeviceRequest -> InputDeviceRequest -> Bool
$c/= :: InputDeviceRequest -> InputDeviceRequest -> Bool
== :: InputDeviceRequest -> InputDeviceRequest -> Bool
$c== :: InputDeviceRequest -> InputDeviceRequest -> Bool
Prelude.Eq, ReadPrec [InputDeviceRequest]
ReadPrec InputDeviceRequest
Int -> ReadS InputDeviceRequest
ReadS [InputDeviceRequest]
(Int -> ReadS InputDeviceRequest)
-> ReadS [InputDeviceRequest]
-> ReadPrec InputDeviceRequest
-> ReadPrec [InputDeviceRequest]
-> Read InputDeviceRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputDeviceRequest]
$creadListPrec :: ReadPrec [InputDeviceRequest]
readPrec :: ReadPrec InputDeviceRequest
$creadPrec :: ReadPrec InputDeviceRequest
readList :: ReadS [InputDeviceRequest]
$creadList :: ReadS [InputDeviceRequest]
readsPrec :: Int -> ReadS InputDeviceRequest
$creadsPrec :: Int -> ReadS InputDeviceRequest
Prelude.Read, Int -> InputDeviceRequest -> ShowS
[InputDeviceRequest] -> ShowS
InputDeviceRequest -> String
(Int -> InputDeviceRequest -> ShowS)
-> (InputDeviceRequest -> String)
-> ([InputDeviceRequest] -> ShowS)
-> Show InputDeviceRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputDeviceRequest] -> ShowS
$cshowList :: [InputDeviceRequest] -> ShowS
show :: InputDeviceRequest -> String
$cshow :: InputDeviceRequest -> String
showsPrec :: Int -> InputDeviceRequest -> ShowS
$cshowsPrec :: Int -> InputDeviceRequest -> ShowS
Prelude.Show, (forall x. InputDeviceRequest -> Rep InputDeviceRequest x)
-> (forall x. Rep InputDeviceRequest x -> InputDeviceRequest)
-> Generic InputDeviceRequest
forall x. Rep InputDeviceRequest x -> InputDeviceRequest
forall x. InputDeviceRequest -> Rep InputDeviceRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputDeviceRequest x -> InputDeviceRequest
$cfrom :: forall x. InputDeviceRequest -> Rep InputDeviceRequest x
Prelude.Generic)

-- |
-- Create a value of 'InputDeviceRequest' 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:
--
-- 'id', 'inputDeviceRequest_id' - The unique ID for the device.
newInputDeviceRequest ::
  InputDeviceRequest
newInputDeviceRequest :: InputDeviceRequest
newInputDeviceRequest =
  InputDeviceRequest' :: Maybe Text -> InputDeviceRequest
InputDeviceRequest' {$sel:id:InputDeviceRequest' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The unique ID for the device.
inputDeviceRequest_id :: Lens.Lens' InputDeviceRequest (Prelude.Maybe Prelude.Text)
inputDeviceRequest_id :: (Maybe Text -> f (Maybe Text))
-> InputDeviceRequest -> f InputDeviceRequest
inputDeviceRequest_id = (InputDeviceRequest -> Maybe Text)
-> (InputDeviceRequest -> Maybe Text -> InputDeviceRequest)
-> Lens
     InputDeviceRequest InputDeviceRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDeviceRequest' {Maybe Text
id :: Maybe Text
$sel:id:InputDeviceRequest' :: InputDeviceRequest -> Maybe Text
id} -> Maybe Text
id) (\s :: InputDeviceRequest
s@InputDeviceRequest' {} Maybe Text
a -> InputDeviceRequest
s {$sel:id:InputDeviceRequest' :: Maybe Text
id = Maybe Text
a} :: InputDeviceRequest)

instance Prelude.Hashable InputDeviceRequest

instance Prelude.NFData InputDeviceRequest

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