{-# 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.CdiInputSpecification
-- 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.CdiInputSpecification 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.CdiInputResolution
import qualified Amazonka.Prelude as Prelude

-- | Placeholder documentation for CdiInputSpecification
--
-- /See:/ 'newCdiInputSpecification' smart constructor.
data CdiInputSpecification = CdiInputSpecification'
  { -- | Maximum CDI input resolution
    CdiInputSpecification -> Maybe CdiInputResolution
resolution :: Prelude.Maybe CdiInputResolution
  }
  deriving (CdiInputSpecification -> CdiInputSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CdiInputSpecification -> CdiInputSpecification -> Bool
$c/= :: CdiInputSpecification -> CdiInputSpecification -> Bool
== :: CdiInputSpecification -> CdiInputSpecification -> Bool
$c== :: CdiInputSpecification -> CdiInputSpecification -> Bool
Prelude.Eq, ReadPrec [CdiInputSpecification]
ReadPrec CdiInputSpecification
Int -> ReadS CdiInputSpecification
ReadS [CdiInputSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CdiInputSpecification]
$creadListPrec :: ReadPrec [CdiInputSpecification]
readPrec :: ReadPrec CdiInputSpecification
$creadPrec :: ReadPrec CdiInputSpecification
readList :: ReadS [CdiInputSpecification]
$creadList :: ReadS [CdiInputSpecification]
readsPrec :: Int -> ReadS CdiInputSpecification
$creadsPrec :: Int -> ReadS CdiInputSpecification
Prelude.Read, Int -> CdiInputSpecification -> ShowS
[CdiInputSpecification] -> ShowS
CdiInputSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CdiInputSpecification] -> ShowS
$cshowList :: [CdiInputSpecification] -> ShowS
show :: CdiInputSpecification -> String
$cshow :: CdiInputSpecification -> String
showsPrec :: Int -> CdiInputSpecification -> ShowS
$cshowsPrec :: Int -> CdiInputSpecification -> ShowS
Prelude.Show, forall x. Rep CdiInputSpecification x -> CdiInputSpecification
forall x. CdiInputSpecification -> Rep CdiInputSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CdiInputSpecification x -> CdiInputSpecification
$cfrom :: forall x. CdiInputSpecification -> Rep CdiInputSpecification x
Prelude.Generic)

-- |
-- Create a value of 'CdiInputSpecification' 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:
--
-- 'resolution', 'cdiInputSpecification_resolution' - Maximum CDI input resolution
newCdiInputSpecification ::
  CdiInputSpecification
newCdiInputSpecification :: CdiInputSpecification
newCdiInputSpecification =
  CdiInputSpecification'
    { $sel:resolution:CdiInputSpecification' :: Maybe CdiInputResolution
resolution =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Maximum CDI input resolution
cdiInputSpecification_resolution :: Lens.Lens' CdiInputSpecification (Prelude.Maybe CdiInputResolution)
cdiInputSpecification_resolution :: Lens' CdiInputSpecification (Maybe CdiInputResolution)
cdiInputSpecification_resolution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CdiInputSpecification' {Maybe CdiInputResolution
resolution :: Maybe CdiInputResolution
$sel:resolution:CdiInputSpecification' :: CdiInputSpecification -> Maybe CdiInputResolution
resolution} -> Maybe CdiInputResolution
resolution) (\s :: CdiInputSpecification
s@CdiInputSpecification' {} Maybe CdiInputResolution
a -> CdiInputSpecification
s {$sel:resolution:CdiInputSpecification' :: Maybe CdiInputResolution
resolution = Maybe CdiInputResolution
a} :: CdiInputSpecification)

instance Data.FromJSON CdiInputSpecification where
  parseJSON :: Value -> Parser CdiInputSpecification
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CdiInputSpecification"
      ( \Object
x ->
          Maybe CdiInputResolution -> CdiInputSpecification
CdiInputSpecification'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resolution")
      )

instance Prelude.Hashable CdiInputSpecification where
  hashWithSalt :: Int -> CdiInputSpecification -> Int
hashWithSalt Int
_salt CdiInputSpecification' {Maybe CdiInputResolution
resolution :: Maybe CdiInputResolution
$sel:resolution:CdiInputSpecification' :: CdiInputSpecification -> Maybe CdiInputResolution
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CdiInputResolution
resolution

instance Prelude.NFData CdiInputSpecification where
  rnf :: CdiInputSpecification -> ()
rnf CdiInputSpecification' {Maybe CdiInputResolution
resolution :: Maybe CdiInputResolution
$sel:resolution:CdiInputSpecification' :: CdiInputSpecification -> Maybe CdiInputResolution
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CdiInputResolution
resolution

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