{-# 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.MediaConnect.Types.Encryption where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConnect.Types.Algorithm
import Amazonka.MediaConnect.Types.KeyType
import qualified Amazonka.Prelude as Prelude
data Encryption = Encryption'
{
Encryption -> Maybe Algorithm
algorithm :: Prelude.Maybe Algorithm,
Encryption -> Maybe Text
constantInitializationVector :: Prelude.Maybe Prelude.Text,
Encryption -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text,
Encryption -> Maybe KeyType
keyType :: Prelude.Maybe KeyType,
Encryption -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
Encryption -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
Encryption -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
Encryption -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
Encryption -> Text
roleArn :: Prelude.Text
}
deriving (Encryption -> Encryption -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Encryption -> Encryption -> Bool
$c/= :: Encryption -> Encryption -> Bool
== :: Encryption -> Encryption -> Bool
$c== :: Encryption -> Encryption -> Bool
Prelude.Eq, ReadPrec [Encryption]
ReadPrec Encryption
Int -> ReadS Encryption
ReadS [Encryption]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Encryption]
$creadListPrec :: ReadPrec [Encryption]
readPrec :: ReadPrec Encryption
$creadPrec :: ReadPrec Encryption
readList :: ReadS [Encryption]
$creadList :: ReadS [Encryption]
readsPrec :: Int -> ReadS Encryption
$creadsPrec :: Int -> ReadS Encryption
Prelude.Read, Int -> Encryption -> ShowS
[Encryption] -> ShowS
Encryption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Encryption] -> ShowS
$cshowList :: [Encryption] -> ShowS
show :: Encryption -> String
$cshow :: Encryption -> String
showsPrec :: Int -> Encryption -> ShowS
$cshowsPrec :: Int -> Encryption -> ShowS
Prelude.Show, forall x. Rep Encryption x -> Encryption
forall x. Encryption -> Rep Encryption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Encryption x -> Encryption
$cfrom :: forall x. Encryption -> Rep Encryption x
Prelude.Generic)
newEncryption ::
Prelude.Text ->
Encryption
newEncryption :: Text -> Encryption
newEncryption Text
pRoleArn_ =
Encryption'
{ $sel:algorithm:Encryption' :: Maybe Algorithm
algorithm = forall a. Maybe a
Prelude.Nothing,
$sel:constantInitializationVector:Encryption' :: Maybe Text
constantInitializationVector = forall a. Maybe a
Prelude.Nothing,
$sel:deviceId:Encryption' :: Maybe Text
deviceId = forall a. Maybe a
Prelude.Nothing,
$sel:keyType:Encryption' :: Maybe KeyType
keyType = forall a. Maybe a
Prelude.Nothing,
$sel:region:Encryption' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
$sel:resourceId:Encryption' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing,
$sel:secretArn:Encryption' :: Maybe Text
secretArn = forall a. Maybe a
Prelude.Nothing,
$sel:url:Encryption' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:Encryption' :: Text
roleArn = Text
pRoleArn_
}
encryption_algorithm :: Lens.Lens' Encryption (Prelude.Maybe Algorithm)
encryption_algorithm :: Lens' Encryption (Maybe Algorithm)
encryption_algorithm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe Algorithm
algorithm :: Maybe Algorithm
$sel:algorithm:Encryption' :: Encryption -> Maybe Algorithm
algorithm} -> Maybe Algorithm
algorithm) (\s :: Encryption
s@Encryption' {} Maybe Algorithm
a -> Encryption
s {$sel:algorithm:Encryption' :: Maybe Algorithm
algorithm = Maybe Algorithm
a} :: Encryption)
encryption_constantInitializationVector :: Lens.Lens' Encryption (Prelude.Maybe Prelude.Text)
encryption_constantInitializationVector :: Lens' Encryption (Maybe Text)
encryption_constantInitializationVector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe Text
constantInitializationVector :: Maybe Text
$sel:constantInitializationVector:Encryption' :: Encryption -> Maybe Text
constantInitializationVector} -> Maybe Text
constantInitializationVector) (\s :: Encryption
s@Encryption' {} Maybe Text
a -> Encryption
s {$sel:constantInitializationVector:Encryption' :: Maybe Text
constantInitializationVector = Maybe Text
a} :: Encryption)
encryption_deviceId :: Lens.Lens' Encryption (Prelude.Maybe Prelude.Text)
encryption_deviceId :: Lens' Encryption (Maybe Text)
encryption_deviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe Text
deviceId :: Maybe Text
$sel:deviceId:Encryption' :: Encryption -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: Encryption
s@Encryption' {} Maybe Text
a -> Encryption
s {$sel:deviceId:Encryption' :: Maybe Text
deviceId = Maybe Text
a} :: Encryption)
encryption_keyType :: Lens.Lens' Encryption (Prelude.Maybe KeyType)
encryption_keyType :: Lens' Encryption (Maybe KeyType)
encryption_keyType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe KeyType
keyType :: Maybe KeyType
$sel:keyType:Encryption' :: Encryption -> Maybe KeyType
keyType} -> Maybe KeyType
keyType) (\s :: Encryption
s@Encryption' {} Maybe KeyType
a -> Encryption
s {$sel:keyType:Encryption' :: Maybe KeyType
keyType = Maybe KeyType
a} :: Encryption)
encryption_region :: Lens.Lens' Encryption (Prelude.Maybe Prelude.Text)
encryption_region :: Lens' Encryption (Maybe Text)
encryption_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe Text
region :: Maybe Text
$sel:region:Encryption' :: Encryption -> Maybe Text
region} -> Maybe Text
region) (\s :: Encryption
s@Encryption' {} Maybe Text
a -> Encryption
s {$sel:region:Encryption' :: Maybe Text
region = Maybe Text
a} :: Encryption)
encryption_resourceId :: Lens.Lens' Encryption (Prelude.Maybe Prelude.Text)
encryption_resourceId :: Lens' Encryption (Maybe Text)
encryption_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:Encryption' :: Encryption -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: Encryption
s@Encryption' {} Maybe Text
a -> Encryption
s {$sel:resourceId:Encryption' :: Maybe Text
resourceId = Maybe Text
a} :: Encryption)
encryption_secretArn :: Lens.Lens' Encryption (Prelude.Maybe Prelude.Text)
encryption_secretArn :: Lens' Encryption (Maybe Text)
encryption_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:Encryption' :: Encryption -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: Encryption
s@Encryption' {} Maybe Text
a -> Encryption
s {$sel:secretArn:Encryption' :: Maybe Text
secretArn = Maybe Text
a} :: Encryption)
encryption_url :: Lens.Lens' Encryption (Prelude.Maybe Prelude.Text)
encryption_url :: Lens' Encryption (Maybe Text)
encryption_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Maybe Text
url :: Maybe Text
$sel:url:Encryption' :: Encryption -> Maybe Text
url} -> Maybe Text
url) (\s :: Encryption
s@Encryption' {} Maybe Text
a -> Encryption
s {$sel:url:Encryption' :: Maybe Text
url = Maybe Text
a} :: Encryption)
encryption_roleArn :: Lens.Lens' Encryption Prelude.Text
encryption_roleArn :: Lens' Encryption Text
encryption_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Encryption' {Text
roleArn :: Text
$sel:roleArn:Encryption' :: Encryption -> Text
roleArn} -> Text
roleArn) (\s :: Encryption
s@Encryption' {} Text
a -> Encryption
s {$sel:roleArn:Encryption' :: Text
roleArn = Text
a} :: Encryption)
instance Data.FromJSON Encryption where
parseJSON :: Value -> Parser Encryption
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Encryption"
( \Object
x ->
Maybe Algorithm
-> Maybe Text
-> Maybe Text
-> Maybe KeyType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Encryption
Encryption'
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
"algorithm")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"constantInitializationVector")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"deviceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"keyType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"region")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"secretArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"url")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"roleArn")
)
instance Prelude.Hashable Encryption where
hashWithSalt :: Int -> Encryption -> Int
hashWithSalt Int
_salt Encryption' {Maybe Text
Maybe Algorithm
Maybe KeyType
Text
roleArn :: Text
url :: Maybe Text
secretArn :: Maybe Text
resourceId :: Maybe Text
region :: Maybe Text
keyType :: Maybe KeyType
deviceId :: Maybe Text
constantInitializationVector :: Maybe Text
algorithm :: Maybe Algorithm
$sel:roleArn:Encryption' :: Encryption -> Text
$sel:url:Encryption' :: Encryption -> Maybe Text
$sel:secretArn:Encryption' :: Encryption -> Maybe Text
$sel:resourceId:Encryption' :: Encryption -> Maybe Text
$sel:region:Encryption' :: Encryption -> Maybe Text
$sel:keyType:Encryption' :: Encryption -> Maybe KeyType
$sel:deviceId:Encryption' :: Encryption -> Maybe Text
$sel:constantInitializationVector:Encryption' :: Encryption -> Maybe Text
$sel:algorithm:Encryption' :: Encryption -> Maybe Algorithm
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Algorithm
algorithm
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
constantInitializationVector
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe KeyType
keyType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secretArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
instance Prelude.NFData Encryption where
rnf :: Encryption -> ()
rnf Encryption' {Maybe Text
Maybe Algorithm
Maybe KeyType
Text
roleArn :: Text
url :: Maybe Text
secretArn :: Maybe Text
resourceId :: Maybe Text
region :: Maybe Text
keyType :: Maybe KeyType
deviceId :: Maybe Text
constantInitializationVector :: Maybe Text
algorithm :: Maybe Algorithm
$sel:roleArn:Encryption' :: Encryption -> Text
$sel:url:Encryption' :: Encryption -> Maybe Text
$sel:secretArn:Encryption' :: Encryption -> Maybe Text
$sel:resourceId:Encryption' :: Encryption -> Maybe Text
$sel:region:Encryption' :: Encryption -> Maybe Text
$sel:keyType:Encryption' :: Encryption -> Maybe KeyType
$sel:deviceId:Encryption' :: Encryption -> Maybe Text
$sel:constantInitializationVector:Encryption' :: Encryption -> Maybe Text
$sel:algorithm:Encryption' :: Encryption -> Maybe Algorithm
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Algorithm
algorithm
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
constantInitializationVector
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe KeyType
keyType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secretArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
instance Data.ToJSON Encryption where
toJSON :: Encryption -> Value
toJSON Encryption' {Maybe Text
Maybe Algorithm
Maybe KeyType
Text
roleArn :: Text
url :: Maybe Text
secretArn :: Maybe Text
resourceId :: Maybe Text
region :: Maybe Text
keyType :: Maybe KeyType
deviceId :: Maybe Text
constantInitializationVector :: Maybe Text
algorithm :: Maybe Algorithm
$sel:roleArn:Encryption' :: Encryption -> Text
$sel:url:Encryption' :: Encryption -> Maybe Text
$sel:secretArn:Encryption' :: Encryption -> Maybe Text
$sel:resourceId:Encryption' :: Encryption -> Maybe Text
$sel:region:Encryption' :: Encryption -> Maybe Text
$sel:keyType:Encryption' :: Encryption -> Maybe KeyType
$sel:deviceId:Encryption' :: Encryption -> Maybe Text
$sel:constantInitializationVector:Encryption' :: Encryption -> Maybe Text
$sel:algorithm:Encryption' :: Encryption -> Maybe Algorithm
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"algorithm" 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 Algorithm
algorithm,
(Key
"constantInitializationVector" 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 Text
constantInitializationVector,
(Key
"deviceId" 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 Text
deviceId,
(Key
"keyType" 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 KeyType
keyType,
(Key
"region" 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 Text
region,
(Key
"resourceId" 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 Text
resourceId,
(Key
"secretArn" 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 Text
secretArn,
(Key
"url" 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 Text
url,
forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
]
)