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