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