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