{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:staticKeySettings:KeyProviderSettings' :: Maybe StaticKeySettings
staticKeySettings =
forall a. Maybe a
Prelude.Nothing
}
keyProviderSettings_staticKeySettings :: Lens.Lens' KeyProviderSettings (Prelude.Maybe StaticKeySettings)
keyProviderSettings_staticKeySettings :: Lens' KeyProviderSettings (Maybe StaticKeySettings)
keyProviderSettings_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 Data.FromJSON KeyProviderSettings where
parseJSON :: Value -> Parser KeyProviderSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"KeyProviderSettings"
( \Object
x ->
Maybe StaticKeySettings -> KeyProviderSettings
KeyProviderSettings'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"staticKeySettings")
)
instance Prelude.Hashable KeyProviderSettings where
hashWithSalt :: Int -> KeyProviderSettings -> Int
hashWithSalt Int
_salt KeyProviderSettings' {Maybe StaticKeySettings
staticKeySettings :: Maybe StaticKeySettings
$sel:staticKeySettings:KeyProviderSettings' :: KeyProviderSettings -> Maybe StaticKeySettings
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StaticKeySettings
staticKeySettings
instance Prelude.NFData KeyProviderSettings where
rnf :: KeyProviderSettings -> ()
rnf KeyProviderSettings' {Maybe StaticKeySettings
staticKeySettings :: Maybe StaticKeySettings
$sel:staticKeySettings:KeyProviderSettings' :: KeyProviderSettings -> Maybe StaticKeySettings
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe StaticKeySettings
staticKeySettings
instance Data.ToJSON KeyProviderSettings where
toJSON :: KeyProviderSettings -> Value
toJSON KeyProviderSettings' {Maybe StaticKeySettings
staticKeySettings :: Maybe StaticKeySettings
$sel:staticKeySettings:KeyProviderSettings' :: KeyProviderSettings -> Maybe StaticKeySettings
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"staticKeySettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StaticKeySettings
staticKeySettings
]
)