{-# 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.MediaPackage.Types.Authorization where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Authorization = Authorization'
{
Authorization -> Text
secretsRoleArn :: Prelude.Text,
Authorization -> Text
cdnIdentifierSecret :: Prelude.Text
}
deriving (Authorization -> Authorization -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Authorization -> Authorization -> Bool
$c/= :: Authorization -> Authorization -> Bool
== :: Authorization -> Authorization -> Bool
$c== :: Authorization -> Authorization -> Bool
Prelude.Eq, ReadPrec [Authorization]
ReadPrec Authorization
Int -> ReadS Authorization
ReadS [Authorization]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Authorization]
$creadListPrec :: ReadPrec [Authorization]
readPrec :: ReadPrec Authorization
$creadPrec :: ReadPrec Authorization
readList :: ReadS [Authorization]
$creadList :: ReadS [Authorization]
readsPrec :: Int -> ReadS Authorization
$creadsPrec :: Int -> ReadS Authorization
Prelude.Read, Int -> Authorization -> ShowS
[Authorization] -> ShowS
Authorization -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Authorization] -> ShowS
$cshowList :: [Authorization] -> ShowS
show :: Authorization -> String
$cshow :: Authorization -> String
showsPrec :: Int -> Authorization -> ShowS
$cshowsPrec :: Int -> Authorization -> ShowS
Prelude.Show, forall x. Rep Authorization x -> Authorization
forall x. Authorization -> Rep Authorization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Authorization x -> Authorization
$cfrom :: forall x. Authorization -> Rep Authorization x
Prelude.Generic)
newAuthorization ::
Prelude.Text ->
Prelude.Text ->
Authorization
newAuthorization :: Text -> Text -> Authorization
newAuthorization
Text
pSecretsRoleArn_
Text
pCdnIdentifierSecret_ =
Authorization'
{ $sel:secretsRoleArn:Authorization' :: Text
secretsRoleArn = Text
pSecretsRoleArn_,
$sel:cdnIdentifierSecret:Authorization' :: Text
cdnIdentifierSecret = Text
pCdnIdentifierSecret_
}
authorization_secretsRoleArn :: Lens.Lens' Authorization Prelude.Text
authorization_secretsRoleArn :: Lens' Authorization Text
authorization_secretsRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Authorization' {Text
secretsRoleArn :: Text
$sel:secretsRoleArn:Authorization' :: Authorization -> Text
secretsRoleArn} -> Text
secretsRoleArn) (\s :: Authorization
s@Authorization' {} Text
a -> Authorization
s {$sel:secretsRoleArn:Authorization' :: Text
secretsRoleArn = Text
a} :: Authorization)
authorization_cdnIdentifierSecret :: Lens.Lens' Authorization Prelude.Text
authorization_cdnIdentifierSecret :: Lens' Authorization Text
authorization_cdnIdentifierSecret = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Authorization' {Text
cdnIdentifierSecret :: Text
$sel:cdnIdentifierSecret:Authorization' :: Authorization -> Text
cdnIdentifierSecret} -> Text
cdnIdentifierSecret) (\s :: Authorization
s@Authorization' {} Text
a -> Authorization
s {$sel:cdnIdentifierSecret:Authorization' :: Text
cdnIdentifierSecret = Text
a} :: Authorization)
instance Data.FromJSON Authorization where
parseJSON :: Value -> Parser Authorization
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Authorization"
( \Object
x ->
Text -> Text -> Authorization
Authorization'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"secretsRoleArn")
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
"cdnIdentifierSecret")
)
instance Prelude.Hashable Authorization where
hashWithSalt :: Int -> Authorization -> Int
hashWithSalt Int
_salt Authorization' {Text
cdnIdentifierSecret :: Text
secretsRoleArn :: Text
$sel:cdnIdentifierSecret:Authorization' :: Authorization -> Text
$sel:secretsRoleArn:Authorization' :: Authorization -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secretsRoleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cdnIdentifierSecret
instance Prelude.NFData Authorization where
rnf :: Authorization -> ()
rnf Authorization' {Text
cdnIdentifierSecret :: Text
secretsRoleArn :: Text
$sel:cdnIdentifierSecret:Authorization' :: Authorization -> Text
$sel:secretsRoleArn:Authorization' :: Authorization -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
secretsRoleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cdnIdentifierSecret
instance Data.ToJSON Authorization where
toJSON :: Authorization -> Value
toJSON Authorization' {Text
cdnIdentifierSecret :: Text
secretsRoleArn :: Text
$sel:cdnIdentifierSecret:Authorization' :: Authorization -> Text
$sel:secretsRoleArn:Authorization' :: Authorization -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"secretsRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretsRoleArn),
forall a. a -> Maybe a
Prelude.Just
(Key
"cdnIdentifierSecret" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
cdnIdentifierSecret)
]
)