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