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