{-# 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 #-}
module Amazonka.MediaConvert.Types.Deinterlacer where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.DeinterlaceAlgorithm
import Amazonka.MediaConvert.Types.DeinterlacerControl
import Amazonka.MediaConvert.Types.DeinterlacerMode
import qualified Amazonka.Prelude as Prelude
data Deinterlacer = Deinterlacer'
{
Deinterlacer -> Maybe DeinterlacerControl
control :: Prelude.Maybe DeinterlacerControl,
Deinterlacer -> Maybe DeinterlacerMode
mode :: Prelude.Maybe DeinterlacerMode,
Deinterlacer -> Maybe DeinterlaceAlgorithm
algorithm :: Prelude.Maybe DeinterlaceAlgorithm
}
deriving (Deinterlacer -> Deinterlacer -> Bool
(Deinterlacer -> Deinterlacer -> Bool)
-> (Deinterlacer -> Deinterlacer -> Bool) -> Eq Deinterlacer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Deinterlacer -> Deinterlacer -> Bool
$c/= :: Deinterlacer -> Deinterlacer -> Bool
== :: Deinterlacer -> Deinterlacer -> Bool
$c== :: Deinterlacer -> Deinterlacer -> Bool
Prelude.Eq, ReadPrec [Deinterlacer]
ReadPrec Deinterlacer
Int -> ReadS Deinterlacer
ReadS [Deinterlacer]
(Int -> ReadS Deinterlacer)
-> ReadS [Deinterlacer]
-> ReadPrec Deinterlacer
-> ReadPrec [Deinterlacer]
-> Read Deinterlacer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Deinterlacer]
$creadListPrec :: ReadPrec [Deinterlacer]
readPrec :: ReadPrec Deinterlacer
$creadPrec :: ReadPrec Deinterlacer
readList :: ReadS [Deinterlacer]
$creadList :: ReadS [Deinterlacer]
readsPrec :: Int -> ReadS Deinterlacer
$creadsPrec :: Int -> ReadS Deinterlacer
Prelude.Read, Int -> Deinterlacer -> ShowS
[Deinterlacer] -> ShowS
Deinterlacer -> String
(Int -> Deinterlacer -> ShowS)
-> (Deinterlacer -> String)
-> ([Deinterlacer] -> ShowS)
-> Show Deinterlacer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Deinterlacer] -> ShowS
$cshowList :: [Deinterlacer] -> ShowS
show :: Deinterlacer -> String
$cshow :: Deinterlacer -> String
showsPrec :: Int -> Deinterlacer -> ShowS
$cshowsPrec :: Int -> Deinterlacer -> ShowS
Prelude.Show, (forall x. Deinterlacer -> Rep Deinterlacer x)
-> (forall x. Rep Deinterlacer x -> Deinterlacer)
-> Generic Deinterlacer
forall x. Rep Deinterlacer x -> Deinterlacer
forall x. Deinterlacer -> Rep Deinterlacer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Deinterlacer x -> Deinterlacer
$cfrom :: forall x. Deinterlacer -> Rep Deinterlacer x
Prelude.Generic)
newDeinterlacer ::
Deinterlacer
newDeinterlacer :: Deinterlacer
newDeinterlacer =
Deinterlacer' :: Maybe DeinterlacerControl
-> Maybe DeinterlacerMode
-> Maybe DeinterlaceAlgorithm
-> Deinterlacer
Deinterlacer'
{ $sel:control:Deinterlacer' :: Maybe DeinterlacerControl
control = Maybe DeinterlacerControl
forall a. Maybe a
Prelude.Nothing,
$sel:mode:Deinterlacer' :: Maybe DeinterlacerMode
mode = Maybe DeinterlacerMode
forall a. Maybe a
Prelude.Nothing,
$sel:algorithm:Deinterlacer' :: Maybe DeinterlaceAlgorithm
algorithm = Maybe DeinterlaceAlgorithm
forall a. Maybe a
Prelude.Nothing
}
deinterlacer_control :: Lens.Lens' Deinterlacer (Prelude.Maybe DeinterlacerControl)
deinterlacer_control :: (Maybe DeinterlacerControl -> f (Maybe DeinterlacerControl))
-> Deinterlacer -> f Deinterlacer
deinterlacer_control = (Deinterlacer -> Maybe DeinterlacerControl)
-> (Deinterlacer -> Maybe DeinterlacerControl -> Deinterlacer)
-> Lens
Deinterlacer
Deinterlacer
(Maybe DeinterlacerControl)
(Maybe DeinterlacerControl)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deinterlacer' {Maybe DeinterlacerControl
control :: Maybe DeinterlacerControl
$sel:control:Deinterlacer' :: Deinterlacer -> Maybe DeinterlacerControl
control} -> Maybe DeinterlacerControl
control) (\s :: Deinterlacer
s@Deinterlacer' {} Maybe DeinterlacerControl
a -> Deinterlacer
s {$sel:control:Deinterlacer' :: Maybe DeinterlacerControl
control = Maybe DeinterlacerControl
a} :: Deinterlacer)
deinterlacer_mode :: Lens.Lens' Deinterlacer (Prelude.Maybe DeinterlacerMode)
deinterlacer_mode :: (Maybe DeinterlacerMode -> f (Maybe DeinterlacerMode))
-> Deinterlacer -> f Deinterlacer
deinterlacer_mode = (Deinterlacer -> Maybe DeinterlacerMode)
-> (Deinterlacer -> Maybe DeinterlacerMode -> Deinterlacer)
-> Lens
Deinterlacer
Deinterlacer
(Maybe DeinterlacerMode)
(Maybe DeinterlacerMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deinterlacer' {Maybe DeinterlacerMode
mode :: Maybe DeinterlacerMode
$sel:mode:Deinterlacer' :: Deinterlacer -> Maybe DeinterlacerMode
mode} -> Maybe DeinterlacerMode
mode) (\s :: Deinterlacer
s@Deinterlacer' {} Maybe DeinterlacerMode
a -> Deinterlacer
s {$sel:mode:Deinterlacer' :: Maybe DeinterlacerMode
mode = Maybe DeinterlacerMode
a} :: Deinterlacer)
deinterlacer_algorithm :: Lens.Lens' Deinterlacer (Prelude.Maybe DeinterlaceAlgorithm)
deinterlacer_algorithm :: (Maybe DeinterlaceAlgorithm -> f (Maybe DeinterlaceAlgorithm))
-> Deinterlacer -> f Deinterlacer
deinterlacer_algorithm = (Deinterlacer -> Maybe DeinterlaceAlgorithm)
-> (Deinterlacer -> Maybe DeinterlaceAlgorithm -> Deinterlacer)
-> Lens
Deinterlacer
Deinterlacer
(Maybe DeinterlaceAlgorithm)
(Maybe DeinterlaceAlgorithm)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deinterlacer' {Maybe DeinterlaceAlgorithm
algorithm :: Maybe DeinterlaceAlgorithm
$sel:algorithm:Deinterlacer' :: Deinterlacer -> Maybe DeinterlaceAlgorithm
algorithm} -> Maybe DeinterlaceAlgorithm
algorithm) (\s :: Deinterlacer
s@Deinterlacer' {} Maybe DeinterlaceAlgorithm
a -> Deinterlacer
s {$sel:algorithm:Deinterlacer' :: Maybe DeinterlaceAlgorithm
algorithm = Maybe DeinterlaceAlgorithm
a} :: Deinterlacer)
instance Core.FromJSON Deinterlacer where
parseJSON :: Value -> Parser Deinterlacer
parseJSON =
String
-> (Object -> Parser Deinterlacer) -> Value -> Parser Deinterlacer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Deinterlacer"
( \Object
x ->
Maybe DeinterlacerControl
-> Maybe DeinterlacerMode
-> Maybe DeinterlaceAlgorithm
-> Deinterlacer
Deinterlacer'
(Maybe DeinterlacerControl
-> Maybe DeinterlacerMode
-> Maybe DeinterlaceAlgorithm
-> Deinterlacer)
-> Parser (Maybe DeinterlacerControl)
-> Parser
(Maybe DeinterlacerMode
-> Maybe DeinterlaceAlgorithm -> Deinterlacer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DeinterlacerControl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"control")
Parser
(Maybe DeinterlacerMode
-> Maybe DeinterlaceAlgorithm -> Deinterlacer)
-> Parser (Maybe DeinterlacerMode)
-> Parser (Maybe DeinterlaceAlgorithm -> Deinterlacer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeinterlacerMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mode")
Parser (Maybe DeinterlaceAlgorithm -> Deinterlacer)
-> Parser (Maybe DeinterlaceAlgorithm) -> Parser Deinterlacer
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeinterlaceAlgorithm)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"algorithm")
)
instance Prelude.Hashable Deinterlacer
instance Prelude.NFData Deinterlacer
instance Core.ToJSON Deinterlacer where
toJSON :: Deinterlacer -> Value
toJSON Deinterlacer' {Maybe DeinterlaceAlgorithm
Maybe DeinterlacerControl
Maybe DeinterlacerMode
algorithm :: Maybe DeinterlaceAlgorithm
mode :: Maybe DeinterlacerMode
control :: Maybe DeinterlacerControl
$sel:algorithm:Deinterlacer' :: Deinterlacer -> Maybe DeinterlaceAlgorithm
$sel:mode:Deinterlacer' :: Deinterlacer -> Maybe DeinterlacerMode
$sel:control:Deinterlacer' :: Deinterlacer -> Maybe DeinterlacerControl
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"control" Text -> DeinterlacerControl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DeinterlacerControl -> Pair)
-> Maybe DeinterlacerControl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeinterlacerControl
control,
(Text
"mode" Text -> DeinterlacerMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DeinterlacerMode -> Pair) -> Maybe DeinterlacerMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeinterlacerMode
mode,
(Text
"algorithm" Text -> DeinterlaceAlgorithm -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DeinterlaceAlgorithm -> Pair)
-> Maybe DeinterlaceAlgorithm -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeinterlaceAlgorithm
algorithm
]
)