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