{-# 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.SpekeKeyProvider where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SpekeKeyProvider = SpekeKeyProvider'
{
SpekeKeyProvider -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
SpekeKeyProvider -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
SpekeKeyProvider -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
SpekeKeyProvider -> Maybe [Text]
systemIds :: Prelude.Maybe [Prelude.Text]
}
deriving (SpekeKeyProvider -> SpekeKeyProvider -> Bool
(SpekeKeyProvider -> SpekeKeyProvider -> Bool)
-> (SpekeKeyProvider -> SpekeKeyProvider -> Bool)
-> Eq SpekeKeyProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SpekeKeyProvider -> SpekeKeyProvider -> Bool
$c/= :: SpekeKeyProvider -> SpekeKeyProvider -> Bool
== :: SpekeKeyProvider -> SpekeKeyProvider -> Bool
$c== :: SpekeKeyProvider -> SpekeKeyProvider -> Bool
Prelude.Eq, ReadPrec [SpekeKeyProvider]
ReadPrec SpekeKeyProvider
Int -> ReadS SpekeKeyProvider
ReadS [SpekeKeyProvider]
(Int -> ReadS SpekeKeyProvider)
-> ReadS [SpekeKeyProvider]
-> ReadPrec SpekeKeyProvider
-> ReadPrec [SpekeKeyProvider]
-> Read SpekeKeyProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SpekeKeyProvider]
$creadListPrec :: ReadPrec [SpekeKeyProvider]
readPrec :: ReadPrec SpekeKeyProvider
$creadPrec :: ReadPrec SpekeKeyProvider
readList :: ReadS [SpekeKeyProvider]
$creadList :: ReadS [SpekeKeyProvider]
readsPrec :: Int -> ReadS SpekeKeyProvider
$creadsPrec :: Int -> ReadS SpekeKeyProvider
Prelude.Read, Int -> SpekeKeyProvider -> ShowS
[SpekeKeyProvider] -> ShowS
SpekeKeyProvider -> String
(Int -> SpekeKeyProvider -> ShowS)
-> (SpekeKeyProvider -> String)
-> ([SpekeKeyProvider] -> ShowS)
-> Show SpekeKeyProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SpekeKeyProvider] -> ShowS
$cshowList :: [SpekeKeyProvider] -> ShowS
show :: SpekeKeyProvider -> String
$cshow :: SpekeKeyProvider -> String
showsPrec :: Int -> SpekeKeyProvider -> ShowS
$cshowsPrec :: Int -> SpekeKeyProvider -> ShowS
Prelude.Show, (forall x. SpekeKeyProvider -> Rep SpekeKeyProvider x)
-> (forall x. Rep SpekeKeyProvider x -> SpekeKeyProvider)
-> Generic SpekeKeyProvider
forall x. Rep SpekeKeyProvider x -> SpekeKeyProvider
forall x. SpekeKeyProvider -> Rep SpekeKeyProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SpekeKeyProvider x -> SpekeKeyProvider
$cfrom :: forall x. SpekeKeyProvider -> Rep SpekeKeyProvider x
Prelude.Generic)
newSpekeKeyProvider ::
SpekeKeyProvider
newSpekeKeyProvider :: SpekeKeyProvider
newSpekeKeyProvider =
SpekeKeyProvider' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe [Text] -> SpekeKeyProvider
SpekeKeyProvider'
{ $sel:resourceId:SpekeKeyProvider' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificateArn:SpekeKeyProvider' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:url:SpekeKeyProvider' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:systemIds:SpekeKeyProvider' :: Maybe [Text]
systemIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
spekeKeyProvider_resourceId :: Lens.Lens' SpekeKeyProvider (Prelude.Maybe Prelude.Text)
spekeKeyProvider_resourceId :: (Maybe Text -> f (Maybe Text))
-> SpekeKeyProvider -> f SpekeKeyProvider
spekeKeyProvider_resourceId = (SpekeKeyProvider -> Maybe Text)
-> (SpekeKeyProvider -> Maybe Text -> SpekeKeyProvider)
-> Lens SpekeKeyProvider SpekeKeyProvider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpekeKeyProvider' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: SpekeKeyProvider
s@SpekeKeyProvider' {} Maybe Text
a -> SpekeKeyProvider
s {$sel:resourceId:SpekeKeyProvider' :: Maybe Text
resourceId = Maybe Text
a} :: SpekeKeyProvider)
spekeKeyProvider_certificateArn :: Lens.Lens' SpekeKeyProvider (Prelude.Maybe Prelude.Text)
spekeKeyProvider_certificateArn :: (Maybe Text -> f (Maybe Text))
-> SpekeKeyProvider -> f SpekeKeyProvider
spekeKeyProvider_certificateArn = (SpekeKeyProvider -> Maybe Text)
-> (SpekeKeyProvider -> Maybe Text -> SpekeKeyProvider)
-> Lens SpekeKeyProvider SpekeKeyProvider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpekeKeyProvider' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: SpekeKeyProvider
s@SpekeKeyProvider' {} Maybe Text
a -> SpekeKeyProvider
s {$sel:certificateArn:SpekeKeyProvider' :: Maybe Text
certificateArn = Maybe Text
a} :: SpekeKeyProvider)
spekeKeyProvider_url :: Lens.Lens' SpekeKeyProvider (Prelude.Maybe Prelude.Text)
spekeKeyProvider_url :: (Maybe Text -> f (Maybe Text))
-> SpekeKeyProvider -> f SpekeKeyProvider
spekeKeyProvider_url = (SpekeKeyProvider -> Maybe Text)
-> (SpekeKeyProvider -> Maybe Text -> SpekeKeyProvider)
-> Lens SpekeKeyProvider SpekeKeyProvider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpekeKeyProvider' {Maybe Text
url :: Maybe Text
$sel:url:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe Text
url} -> Maybe Text
url) (\s :: SpekeKeyProvider
s@SpekeKeyProvider' {} Maybe Text
a -> SpekeKeyProvider
s {$sel:url:SpekeKeyProvider' :: Maybe Text
url = Maybe Text
a} :: SpekeKeyProvider)
spekeKeyProvider_systemIds :: Lens.Lens' SpekeKeyProvider (Prelude.Maybe [Prelude.Text])
spekeKeyProvider_systemIds :: (Maybe [Text] -> f (Maybe [Text]))
-> SpekeKeyProvider -> f SpekeKeyProvider
spekeKeyProvider_systemIds = (SpekeKeyProvider -> Maybe [Text])
-> (SpekeKeyProvider -> Maybe [Text] -> SpekeKeyProvider)
-> Lens
SpekeKeyProvider SpekeKeyProvider (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpekeKeyProvider' {Maybe [Text]
systemIds :: Maybe [Text]
$sel:systemIds:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe [Text]
systemIds} -> Maybe [Text]
systemIds) (\s :: SpekeKeyProvider
s@SpekeKeyProvider' {} Maybe [Text]
a -> SpekeKeyProvider
s {$sel:systemIds:SpekeKeyProvider' :: Maybe [Text]
systemIds = Maybe [Text]
a} :: SpekeKeyProvider) ((Maybe [Text] -> f (Maybe [Text]))
-> SpekeKeyProvider -> f SpekeKeyProvider)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SpekeKeyProvider
-> f SpekeKeyProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON SpekeKeyProvider where
parseJSON :: Value -> Parser SpekeKeyProvider
parseJSON =
String
-> (Object -> Parser SpekeKeyProvider)
-> Value
-> Parser SpekeKeyProvider
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SpekeKeyProvider"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe [Text] -> SpekeKeyProvider
SpekeKeyProvider'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe [Text] -> SpekeKeyProvider)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe [Text] -> SpekeKeyProvider)
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
"resourceId")
Parser
(Maybe Text -> Maybe Text -> Maybe [Text] -> SpekeKeyProvider)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Text] -> SpekeKeyProvider)
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
"certificateArn")
Parser (Maybe Text -> Maybe [Text] -> SpekeKeyProvider)
-> Parser (Maybe Text) -> Parser (Maybe [Text] -> SpekeKeyProvider)
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] -> SpekeKeyProvider)
-> Parser (Maybe [Text]) -> Parser SpekeKeyProvider
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"systemIds" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable SpekeKeyProvider
instance Prelude.NFData SpekeKeyProvider
instance Core.ToJSON SpekeKeyProvider where
toJSON :: SpekeKeyProvider -> Value
toJSON SpekeKeyProvider' {Maybe [Text]
Maybe Text
systemIds :: Maybe [Text]
url :: Maybe Text
certificateArn :: Maybe Text
resourceId :: Maybe Text
$sel:systemIds:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe [Text]
$sel:url:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe Text
$sel:certificateArn:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe Text
$sel:resourceId:SpekeKeyProvider' :: SpekeKeyProvider -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"resourceId" 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
resourceId,
(Text
"certificateArn" 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
certificateArn,
(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
"systemIds" 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]
systemIds
]
)