{-# 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.MediaTailor.Types.SecretsManagerAccessTokenConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SecretsManagerAccessTokenConfiguration = SecretsManagerAccessTokenConfiguration'
{
:: Prelude.Maybe Prelude.Text,
SecretsManagerAccessTokenConfiguration -> Maybe Text
secretStringKey :: Prelude.Maybe Prelude.Text,
SecretsManagerAccessTokenConfiguration -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text
}
deriving (SecretsManagerAccessTokenConfiguration
-> SecretsManagerAccessTokenConfiguration -> Bool
(SecretsManagerAccessTokenConfiguration
-> SecretsManagerAccessTokenConfiguration -> Bool)
-> (SecretsManagerAccessTokenConfiguration
-> SecretsManagerAccessTokenConfiguration -> Bool)
-> Eq SecretsManagerAccessTokenConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecretsManagerAccessTokenConfiguration
-> SecretsManagerAccessTokenConfiguration -> Bool
$c/= :: SecretsManagerAccessTokenConfiguration
-> SecretsManagerAccessTokenConfiguration -> Bool
== :: SecretsManagerAccessTokenConfiguration
-> SecretsManagerAccessTokenConfiguration -> Bool
$c== :: SecretsManagerAccessTokenConfiguration
-> SecretsManagerAccessTokenConfiguration -> Bool
Prelude.Eq, ReadPrec [SecretsManagerAccessTokenConfiguration]
ReadPrec SecretsManagerAccessTokenConfiguration
Int -> ReadS SecretsManagerAccessTokenConfiguration
ReadS [SecretsManagerAccessTokenConfiguration]
(Int -> ReadS SecretsManagerAccessTokenConfiguration)
-> ReadS [SecretsManagerAccessTokenConfiguration]
-> ReadPrec SecretsManagerAccessTokenConfiguration
-> ReadPrec [SecretsManagerAccessTokenConfiguration]
-> Read SecretsManagerAccessTokenConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecretsManagerAccessTokenConfiguration]
$creadListPrec :: ReadPrec [SecretsManagerAccessTokenConfiguration]
readPrec :: ReadPrec SecretsManagerAccessTokenConfiguration
$creadPrec :: ReadPrec SecretsManagerAccessTokenConfiguration
readList :: ReadS [SecretsManagerAccessTokenConfiguration]
$creadList :: ReadS [SecretsManagerAccessTokenConfiguration]
readsPrec :: Int -> ReadS SecretsManagerAccessTokenConfiguration
$creadsPrec :: Int -> ReadS SecretsManagerAccessTokenConfiguration
Prelude.Read, Int -> SecretsManagerAccessTokenConfiguration -> ShowS
[SecretsManagerAccessTokenConfiguration] -> ShowS
SecretsManagerAccessTokenConfiguration -> String
(Int -> SecretsManagerAccessTokenConfiguration -> ShowS)
-> (SecretsManagerAccessTokenConfiguration -> String)
-> ([SecretsManagerAccessTokenConfiguration] -> ShowS)
-> Show SecretsManagerAccessTokenConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecretsManagerAccessTokenConfiguration] -> ShowS
$cshowList :: [SecretsManagerAccessTokenConfiguration] -> ShowS
show :: SecretsManagerAccessTokenConfiguration -> String
$cshow :: SecretsManagerAccessTokenConfiguration -> String
showsPrec :: Int -> SecretsManagerAccessTokenConfiguration -> ShowS
$cshowsPrec :: Int -> SecretsManagerAccessTokenConfiguration -> ShowS
Prelude.Show, (forall x.
SecretsManagerAccessTokenConfiguration
-> Rep SecretsManagerAccessTokenConfiguration x)
-> (forall x.
Rep SecretsManagerAccessTokenConfiguration x
-> SecretsManagerAccessTokenConfiguration)
-> Generic SecretsManagerAccessTokenConfiguration
forall x.
Rep SecretsManagerAccessTokenConfiguration x
-> SecretsManagerAccessTokenConfiguration
forall x.
SecretsManagerAccessTokenConfiguration
-> Rep SecretsManagerAccessTokenConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SecretsManagerAccessTokenConfiguration x
-> SecretsManagerAccessTokenConfiguration
$cfrom :: forall x.
SecretsManagerAccessTokenConfiguration
-> Rep SecretsManagerAccessTokenConfiguration x
Prelude.Generic)
newSecretsManagerAccessTokenConfiguration ::
SecretsManagerAccessTokenConfiguration
newSecretsManagerAccessTokenConfiguration :: SecretsManagerAccessTokenConfiguration
newSecretsManagerAccessTokenConfiguration =
SecretsManagerAccessTokenConfiguration' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> SecretsManagerAccessTokenConfiguration
SecretsManagerAccessTokenConfiguration'
{ $sel:headerName:SecretsManagerAccessTokenConfiguration' :: Maybe Text
headerName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretStringKey:SecretsManagerAccessTokenConfiguration' :: Maybe Text
secretStringKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretArn:SecretsManagerAccessTokenConfiguration' :: Maybe Text
secretArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
secretsManagerAccessTokenConfiguration_headerName :: Lens.Lens' SecretsManagerAccessTokenConfiguration (Prelude.Maybe Prelude.Text)
= (SecretsManagerAccessTokenConfiguration -> Maybe Text)
-> (SecretsManagerAccessTokenConfiguration
-> Maybe Text -> SecretsManagerAccessTokenConfiguration)
-> Lens
SecretsManagerAccessTokenConfiguration
SecretsManagerAccessTokenConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretsManagerAccessTokenConfiguration' {Maybe Text
headerName :: Maybe Text
$sel:headerName:SecretsManagerAccessTokenConfiguration' :: SecretsManagerAccessTokenConfiguration -> Maybe Text
headerName} -> Maybe Text
headerName) (\s :: SecretsManagerAccessTokenConfiguration
s@SecretsManagerAccessTokenConfiguration' {} Maybe Text
a -> SecretsManagerAccessTokenConfiguration
s {$sel:headerName:SecretsManagerAccessTokenConfiguration' :: Maybe Text
headerName = Maybe Text
a} :: SecretsManagerAccessTokenConfiguration)
secretsManagerAccessTokenConfiguration_secretStringKey :: Lens.Lens' SecretsManagerAccessTokenConfiguration (Prelude.Maybe Prelude.Text)
secretsManagerAccessTokenConfiguration_secretStringKey :: (Maybe Text -> f (Maybe Text))
-> SecretsManagerAccessTokenConfiguration
-> f SecretsManagerAccessTokenConfiguration
secretsManagerAccessTokenConfiguration_secretStringKey = (SecretsManagerAccessTokenConfiguration -> Maybe Text)
-> (SecretsManagerAccessTokenConfiguration
-> Maybe Text -> SecretsManagerAccessTokenConfiguration)
-> Lens
SecretsManagerAccessTokenConfiguration
SecretsManagerAccessTokenConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretsManagerAccessTokenConfiguration' {Maybe Text
secretStringKey :: Maybe Text
$sel:secretStringKey:SecretsManagerAccessTokenConfiguration' :: SecretsManagerAccessTokenConfiguration -> Maybe Text
secretStringKey} -> Maybe Text
secretStringKey) (\s :: SecretsManagerAccessTokenConfiguration
s@SecretsManagerAccessTokenConfiguration' {} Maybe Text
a -> SecretsManagerAccessTokenConfiguration
s {$sel:secretStringKey:SecretsManagerAccessTokenConfiguration' :: Maybe Text
secretStringKey = Maybe Text
a} :: SecretsManagerAccessTokenConfiguration)
secretsManagerAccessTokenConfiguration_secretArn :: Lens.Lens' SecretsManagerAccessTokenConfiguration (Prelude.Maybe Prelude.Text)
secretsManagerAccessTokenConfiguration_secretArn :: (Maybe Text -> f (Maybe Text))
-> SecretsManagerAccessTokenConfiguration
-> f SecretsManagerAccessTokenConfiguration
secretsManagerAccessTokenConfiguration_secretArn = (SecretsManagerAccessTokenConfiguration -> Maybe Text)
-> (SecretsManagerAccessTokenConfiguration
-> Maybe Text -> SecretsManagerAccessTokenConfiguration)
-> Lens
SecretsManagerAccessTokenConfiguration
SecretsManagerAccessTokenConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecretsManagerAccessTokenConfiguration' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:SecretsManagerAccessTokenConfiguration' :: SecretsManagerAccessTokenConfiguration -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: SecretsManagerAccessTokenConfiguration
s@SecretsManagerAccessTokenConfiguration' {} Maybe Text
a -> SecretsManagerAccessTokenConfiguration
s {$sel:secretArn:SecretsManagerAccessTokenConfiguration' :: Maybe Text
secretArn = Maybe Text
a} :: SecretsManagerAccessTokenConfiguration)
instance
Core.FromJSON
SecretsManagerAccessTokenConfiguration
where
parseJSON :: Value -> Parser SecretsManagerAccessTokenConfiguration
parseJSON =
String
-> (Object -> Parser SecretsManagerAccessTokenConfiguration)
-> Value
-> Parser SecretsManagerAccessTokenConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SecretsManagerAccessTokenConfiguration"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> SecretsManagerAccessTokenConfiguration
SecretsManagerAccessTokenConfiguration'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> SecretsManagerAccessTokenConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> SecretsManagerAccessTokenConfiguration)
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
"HeaderName")
Parser
(Maybe Text
-> Maybe Text -> SecretsManagerAccessTokenConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SecretsManagerAccessTokenConfiguration)
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
"SecretStringKey")
Parser (Maybe Text -> SecretsManagerAccessTokenConfiguration)
-> Parser (Maybe Text)
-> Parser SecretsManagerAccessTokenConfiguration
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
"SecretArn")
)
instance
Prelude.Hashable
SecretsManagerAccessTokenConfiguration
instance
Prelude.NFData
SecretsManagerAccessTokenConfiguration
instance
Core.ToJSON
SecretsManagerAccessTokenConfiguration
where
toJSON :: SecretsManagerAccessTokenConfiguration -> Value
toJSON SecretsManagerAccessTokenConfiguration' {Maybe Text
secretArn :: Maybe Text
secretStringKey :: Maybe Text
headerName :: Maybe Text
$sel:secretArn:SecretsManagerAccessTokenConfiguration' :: SecretsManagerAccessTokenConfiguration -> Maybe Text
$sel:secretStringKey:SecretsManagerAccessTokenConfiguration' :: SecretsManagerAccessTokenConfiguration -> Maybe Text
$sel:headerName:SecretsManagerAccessTokenConfiguration' :: SecretsManagerAccessTokenConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"HeaderName" 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
headerName,
(Text
"SecretStringKey" 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
secretStringKey,
(Text
"SecretArn" 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
secretArn
]
)