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

-- | 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
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]
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
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. 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' {$sel:id:InputDeviceRequest' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing}

-- | The unique ID for the device.
inputDeviceRequest_id :: Lens.Lens' InputDeviceRequest (Prelude.Maybe Prelude.Text)
inputDeviceRequest_id :: Lens' InputDeviceRequest (Maybe Text)
inputDeviceRequest_id = 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 where
  hashWithSalt :: Int -> InputDeviceRequest -> Int
hashWithSalt Int
_salt InputDeviceRequest' {Maybe Text
id :: Maybe Text
$sel:id:InputDeviceRequest' :: InputDeviceRequest -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id

instance Prelude.NFData InputDeviceRequest where
  rnf :: InputDeviceRequest -> ()
rnf InputDeviceRequest' {Maybe Text
id :: Maybe Text
$sel:id:InputDeviceRequest' :: InputDeviceRequest -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id

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