{-# 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.MediaConnect.Types.FmtpRequest
-- 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.MediaConnect.Types.FmtpRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.Colorimetry
import Amazonka.MediaConnect.Types.Range
import Amazonka.MediaConnect.Types.ScanMode
import Amazonka.MediaConnect.Types.Tcs
import qualified Amazonka.Prelude as Prelude

-- | The settings that you want to use to define the media stream.
--
-- /See:/ 'newFmtpRequest' smart constructor.
data FmtpRequest = FmtpRequest'
  { -- | The transfer characteristic system (TCS) that is used in the video.
    FmtpRequest -> Maybe Tcs
tcs :: Prelude.Maybe Tcs,
    -- | The frame rate for the video stream, in frames\/second. For example:
    -- 60000\/1001. If you specify a whole number, MediaConnect uses a ratio of
    -- N\/1. For example, if you specify 60, MediaConnect uses 60\/1 as the
    -- exactFramerate.
    FmtpRequest -> Maybe Text
exactFramerate :: Prelude.Maybe Prelude.Text,
    -- | The pixel aspect ratio (PAR) of the video.
    FmtpRequest -> Maybe Text
par :: Prelude.Maybe Prelude.Text,
    -- | The type of compression that was used to smooth the video’s appearance.
    FmtpRequest -> Maybe ScanMode
scanMode :: Prelude.Maybe ScanMode,
    -- | The encoding range of the video.
    FmtpRequest -> Maybe Range
range :: Prelude.Maybe Range,
    -- | The format of the audio channel.
    FmtpRequest -> Maybe Text
channelOrder :: Prelude.Maybe Prelude.Text,
    -- | The format that is used for the representation of color.
    FmtpRequest -> Maybe Colorimetry
colorimetry :: Prelude.Maybe Colorimetry
  }
  deriving (FmtpRequest -> FmtpRequest -> Bool
(FmtpRequest -> FmtpRequest -> Bool)
-> (FmtpRequest -> FmtpRequest -> Bool) -> Eq FmtpRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FmtpRequest -> FmtpRequest -> Bool
$c/= :: FmtpRequest -> FmtpRequest -> Bool
== :: FmtpRequest -> FmtpRequest -> Bool
$c== :: FmtpRequest -> FmtpRequest -> Bool
Prelude.Eq, ReadPrec [FmtpRequest]
ReadPrec FmtpRequest
Int -> ReadS FmtpRequest
ReadS [FmtpRequest]
(Int -> ReadS FmtpRequest)
-> ReadS [FmtpRequest]
-> ReadPrec FmtpRequest
-> ReadPrec [FmtpRequest]
-> Read FmtpRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FmtpRequest]
$creadListPrec :: ReadPrec [FmtpRequest]
readPrec :: ReadPrec FmtpRequest
$creadPrec :: ReadPrec FmtpRequest
readList :: ReadS [FmtpRequest]
$creadList :: ReadS [FmtpRequest]
readsPrec :: Int -> ReadS FmtpRequest
$creadsPrec :: Int -> ReadS FmtpRequest
Prelude.Read, Int -> FmtpRequest -> ShowS
[FmtpRequest] -> ShowS
FmtpRequest -> String
(Int -> FmtpRequest -> ShowS)
-> (FmtpRequest -> String)
-> ([FmtpRequest] -> ShowS)
-> Show FmtpRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FmtpRequest] -> ShowS
$cshowList :: [FmtpRequest] -> ShowS
show :: FmtpRequest -> String
$cshow :: FmtpRequest -> String
showsPrec :: Int -> FmtpRequest -> ShowS
$cshowsPrec :: Int -> FmtpRequest -> ShowS
Prelude.Show, (forall x. FmtpRequest -> Rep FmtpRequest x)
-> (forall x. Rep FmtpRequest x -> FmtpRequest)
-> Generic FmtpRequest
forall x. Rep FmtpRequest x -> FmtpRequest
forall x. FmtpRequest -> Rep FmtpRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FmtpRequest x -> FmtpRequest
$cfrom :: forall x. FmtpRequest -> Rep FmtpRequest x
Prelude.Generic)

-- |
-- Create a value of 'FmtpRequest' 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:
--
-- 'tcs', 'fmtpRequest_tcs' - The transfer characteristic system (TCS) that is used in the video.
--
-- 'exactFramerate', 'fmtpRequest_exactFramerate' - The frame rate for the video stream, in frames\/second. For example:
-- 60000\/1001. If you specify a whole number, MediaConnect uses a ratio of
-- N\/1. For example, if you specify 60, MediaConnect uses 60\/1 as the
-- exactFramerate.
--
-- 'par', 'fmtpRequest_par' - The pixel aspect ratio (PAR) of the video.
--
-- 'scanMode', 'fmtpRequest_scanMode' - The type of compression that was used to smooth the video’s appearance.
--
-- 'range', 'fmtpRequest_range' - The encoding range of the video.
--
-- 'channelOrder', 'fmtpRequest_channelOrder' - The format of the audio channel.
--
-- 'colorimetry', 'fmtpRequest_colorimetry' - The format that is used for the representation of color.
newFmtpRequest ::
  FmtpRequest
newFmtpRequest :: FmtpRequest
newFmtpRequest =
  FmtpRequest' :: Maybe Tcs
-> Maybe Text
-> Maybe Text
-> Maybe ScanMode
-> Maybe Range
-> Maybe Text
-> Maybe Colorimetry
-> FmtpRequest
FmtpRequest'
    { $sel:tcs:FmtpRequest' :: Maybe Tcs
tcs = Maybe Tcs
forall a. Maybe a
Prelude.Nothing,
      $sel:exactFramerate:FmtpRequest' :: Maybe Text
exactFramerate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:par:FmtpRequest' :: Maybe Text
par = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scanMode:FmtpRequest' :: Maybe ScanMode
scanMode = Maybe ScanMode
forall a. Maybe a
Prelude.Nothing,
      $sel:range:FmtpRequest' :: Maybe Range
range = Maybe Range
forall a. Maybe a
Prelude.Nothing,
      $sel:channelOrder:FmtpRequest' :: Maybe Text
channelOrder = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:colorimetry:FmtpRequest' :: Maybe Colorimetry
colorimetry = Maybe Colorimetry
forall a. Maybe a
Prelude.Nothing
    }

-- | The transfer characteristic system (TCS) that is used in the video.
fmtpRequest_tcs :: Lens.Lens' FmtpRequest (Prelude.Maybe Tcs)
fmtpRequest_tcs :: (Maybe Tcs -> f (Maybe Tcs)) -> FmtpRequest -> f FmtpRequest
fmtpRequest_tcs = (FmtpRequest -> Maybe Tcs)
-> (FmtpRequest -> Maybe Tcs -> FmtpRequest)
-> Lens FmtpRequest FmtpRequest (Maybe Tcs) (Maybe Tcs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FmtpRequest' {Maybe Tcs
tcs :: Maybe Tcs
$sel:tcs:FmtpRequest' :: FmtpRequest -> Maybe Tcs
tcs} -> Maybe Tcs
tcs) (\s :: FmtpRequest
s@FmtpRequest' {} Maybe Tcs
a -> FmtpRequest
s {$sel:tcs:FmtpRequest' :: Maybe Tcs
tcs = Maybe Tcs
a} :: FmtpRequest)

-- | The frame rate for the video stream, in frames\/second. For example:
-- 60000\/1001. If you specify a whole number, MediaConnect uses a ratio of
-- N\/1. For example, if you specify 60, MediaConnect uses 60\/1 as the
-- exactFramerate.
fmtpRequest_exactFramerate :: Lens.Lens' FmtpRequest (Prelude.Maybe Prelude.Text)
fmtpRequest_exactFramerate :: (Maybe Text -> f (Maybe Text)) -> FmtpRequest -> f FmtpRequest
fmtpRequest_exactFramerate = (FmtpRequest -> Maybe Text)
-> (FmtpRequest -> Maybe Text -> FmtpRequest)
-> Lens FmtpRequest FmtpRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FmtpRequest' {Maybe Text
exactFramerate :: Maybe Text
$sel:exactFramerate:FmtpRequest' :: FmtpRequest -> Maybe Text
exactFramerate} -> Maybe Text
exactFramerate) (\s :: FmtpRequest
s@FmtpRequest' {} Maybe Text
a -> FmtpRequest
s {$sel:exactFramerate:FmtpRequest' :: Maybe Text
exactFramerate = Maybe Text
a} :: FmtpRequest)

-- | The pixel aspect ratio (PAR) of the video.
fmtpRequest_par :: Lens.Lens' FmtpRequest (Prelude.Maybe Prelude.Text)
fmtpRequest_par :: (Maybe Text -> f (Maybe Text)) -> FmtpRequest -> f FmtpRequest
fmtpRequest_par = (FmtpRequest -> Maybe Text)
-> (FmtpRequest -> Maybe Text -> FmtpRequest)
-> Lens FmtpRequest FmtpRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FmtpRequest' {Maybe Text
par :: Maybe Text
$sel:par:FmtpRequest' :: FmtpRequest -> Maybe Text
par} -> Maybe Text
par) (\s :: FmtpRequest
s@FmtpRequest' {} Maybe Text
a -> FmtpRequest
s {$sel:par:FmtpRequest' :: Maybe Text
par = Maybe Text
a} :: FmtpRequest)

-- | The type of compression that was used to smooth the video’s appearance.
fmtpRequest_scanMode :: Lens.Lens' FmtpRequest (Prelude.Maybe ScanMode)
fmtpRequest_scanMode :: (Maybe ScanMode -> f (Maybe ScanMode))
-> FmtpRequest -> f FmtpRequest
fmtpRequest_scanMode = (FmtpRequest -> Maybe ScanMode)
-> (FmtpRequest -> Maybe ScanMode -> FmtpRequest)
-> Lens FmtpRequest FmtpRequest (Maybe ScanMode) (Maybe ScanMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FmtpRequest' {Maybe ScanMode
scanMode :: Maybe ScanMode
$sel:scanMode:FmtpRequest' :: FmtpRequest -> Maybe ScanMode
scanMode} -> Maybe ScanMode
scanMode) (\s :: FmtpRequest
s@FmtpRequest' {} Maybe ScanMode
a -> FmtpRequest
s {$sel:scanMode:FmtpRequest' :: Maybe ScanMode
scanMode = Maybe ScanMode
a} :: FmtpRequest)

-- | The encoding range of the video.
fmtpRequest_range :: Lens.Lens' FmtpRequest (Prelude.Maybe Range)
fmtpRequest_range :: (Maybe Range -> f (Maybe Range)) -> FmtpRequest -> f FmtpRequest
fmtpRequest_range = (FmtpRequest -> Maybe Range)
-> (FmtpRequest -> Maybe Range -> FmtpRequest)
-> Lens FmtpRequest FmtpRequest (Maybe Range) (Maybe Range)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FmtpRequest' {Maybe Range
range :: Maybe Range
$sel:range:FmtpRequest' :: FmtpRequest -> Maybe Range
range} -> Maybe Range
range) (\s :: FmtpRequest
s@FmtpRequest' {} Maybe Range
a -> FmtpRequest
s {$sel:range:FmtpRequest' :: Maybe Range
range = Maybe Range
a} :: FmtpRequest)

-- | The format of the audio channel.
fmtpRequest_channelOrder :: Lens.Lens' FmtpRequest (Prelude.Maybe Prelude.Text)
fmtpRequest_channelOrder :: (Maybe Text -> f (Maybe Text)) -> FmtpRequest -> f FmtpRequest
fmtpRequest_channelOrder = (FmtpRequest -> Maybe Text)
-> (FmtpRequest -> Maybe Text -> FmtpRequest)
-> Lens FmtpRequest FmtpRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FmtpRequest' {Maybe Text
channelOrder :: Maybe Text
$sel:channelOrder:FmtpRequest' :: FmtpRequest -> Maybe Text
channelOrder} -> Maybe Text
channelOrder) (\s :: FmtpRequest
s@FmtpRequest' {} Maybe Text
a -> FmtpRequest
s {$sel:channelOrder:FmtpRequest' :: Maybe Text
channelOrder = Maybe Text
a} :: FmtpRequest)

-- | The format that is used for the representation of color.
fmtpRequest_colorimetry :: Lens.Lens' FmtpRequest (Prelude.Maybe Colorimetry)
fmtpRequest_colorimetry :: (Maybe Colorimetry -> f (Maybe Colorimetry))
-> FmtpRequest -> f FmtpRequest
fmtpRequest_colorimetry = (FmtpRequest -> Maybe Colorimetry)
-> (FmtpRequest -> Maybe Colorimetry -> FmtpRequest)
-> Lens
     FmtpRequest FmtpRequest (Maybe Colorimetry) (Maybe Colorimetry)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FmtpRequest' {Maybe Colorimetry
colorimetry :: Maybe Colorimetry
$sel:colorimetry:FmtpRequest' :: FmtpRequest -> Maybe Colorimetry
colorimetry} -> Maybe Colorimetry
colorimetry) (\s :: FmtpRequest
s@FmtpRequest' {} Maybe Colorimetry
a -> FmtpRequest
s {$sel:colorimetry:FmtpRequest' :: Maybe Colorimetry
colorimetry = Maybe Colorimetry
a} :: FmtpRequest)

instance Prelude.Hashable FmtpRequest

instance Prelude.NFData FmtpRequest

instance Core.ToJSON FmtpRequest where
  toJSON :: FmtpRequest -> Value
toJSON FmtpRequest' {Maybe Text
Maybe Colorimetry
Maybe Range
Maybe ScanMode
Maybe Tcs
colorimetry :: Maybe Colorimetry
channelOrder :: Maybe Text
range :: Maybe Range
scanMode :: Maybe ScanMode
par :: Maybe Text
exactFramerate :: Maybe Text
tcs :: Maybe Tcs
$sel:colorimetry:FmtpRequest' :: FmtpRequest -> Maybe Colorimetry
$sel:channelOrder:FmtpRequest' :: FmtpRequest -> Maybe Text
$sel:range:FmtpRequest' :: FmtpRequest -> Maybe Range
$sel:scanMode:FmtpRequest' :: FmtpRequest -> Maybe ScanMode
$sel:par:FmtpRequest' :: FmtpRequest -> Maybe Text
$sel:exactFramerate:FmtpRequest' :: FmtpRequest -> Maybe Text
$sel:tcs:FmtpRequest' :: FmtpRequest -> Maybe Tcs
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tcs" Text -> Tcs -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Tcs -> Pair) -> Maybe Tcs -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Tcs
tcs,
            (Text
"exactFramerate" 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
exactFramerate,
            (Text
"par" 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
par,
            (Text
"scanMode" Text -> ScanMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ScanMode -> Pair) -> Maybe ScanMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScanMode
scanMode,
            (Text
"range" Text -> Range -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Range -> Pair) -> Maybe Range -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Range
range,
            (Text
"channelOrder" 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
channelOrder,
            (Text
"colorimetry" Text -> Colorimetry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Colorimetry -> Pair) -> Maybe Colorimetry -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Colorimetry
colorimetry
          ]
      )