{-# 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.RdsDbSnapshotConfiguration where
import Amazonka.AccessAnalyzer.Types.RdsDbSnapshotAttributeValue
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 RdsDbSnapshotConfiguration = RdsDbSnapshotConfiguration'
{
RdsDbSnapshotConfiguration
-> Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text RdsDbSnapshotAttributeValue),
RdsDbSnapshotConfiguration -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text
}
deriving (RdsDbSnapshotConfiguration -> RdsDbSnapshotConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RdsDbSnapshotConfiguration -> RdsDbSnapshotConfiguration -> Bool
$c/= :: RdsDbSnapshotConfiguration -> RdsDbSnapshotConfiguration -> Bool
== :: RdsDbSnapshotConfiguration -> RdsDbSnapshotConfiguration -> Bool
$c== :: RdsDbSnapshotConfiguration -> RdsDbSnapshotConfiguration -> Bool
Prelude.Eq, ReadPrec [RdsDbSnapshotConfiguration]
ReadPrec RdsDbSnapshotConfiguration
Int -> ReadS RdsDbSnapshotConfiguration
ReadS [RdsDbSnapshotConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RdsDbSnapshotConfiguration]
$creadListPrec :: ReadPrec [RdsDbSnapshotConfiguration]
readPrec :: ReadPrec RdsDbSnapshotConfiguration
$creadPrec :: ReadPrec RdsDbSnapshotConfiguration
readList :: ReadS [RdsDbSnapshotConfiguration]
$creadList :: ReadS [RdsDbSnapshotConfiguration]
readsPrec :: Int -> ReadS RdsDbSnapshotConfiguration
$creadsPrec :: Int -> ReadS RdsDbSnapshotConfiguration
Prelude.Read, Int -> RdsDbSnapshotConfiguration -> ShowS
[RdsDbSnapshotConfiguration] -> ShowS
RdsDbSnapshotConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RdsDbSnapshotConfiguration] -> ShowS
$cshowList :: [RdsDbSnapshotConfiguration] -> ShowS
show :: RdsDbSnapshotConfiguration -> String
$cshow :: RdsDbSnapshotConfiguration -> String
showsPrec :: Int -> RdsDbSnapshotConfiguration -> ShowS
$cshowsPrec :: Int -> RdsDbSnapshotConfiguration -> ShowS
Prelude.Show, forall x.
Rep RdsDbSnapshotConfiguration x -> RdsDbSnapshotConfiguration
forall x.
RdsDbSnapshotConfiguration -> Rep RdsDbSnapshotConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RdsDbSnapshotConfiguration x -> RdsDbSnapshotConfiguration
$cfrom :: forall x.
RdsDbSnapshotConfiguration -> Rep RdsDbSnapshotConfiguration x
Prelude.Generic)
newRdsDbSnapshotConfiguration ::
RdsDbSnapshotConfiguration
newRdsDbSnapshotConfiguration :: RdsDbSnapshotConfiguration
newRdsDbSnapshotConfiguration =
RdsDbSnapshotConfiguration'
{ $sel:attributes:RdsDbSnapshotConfiguration' :: Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes =
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:RdsDbSnapshotConfiguration' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing
}
rdsDbSnapshotConfiguration_attributes :: Lens.Lens' RdsDbSnapshotConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text RdsDbSnapshotAttributeValue))
rdsDbSnapshotConfiguration_attributes :: Lens'
RdsDbSnapshotConfiguration
(Maybe (HashMap Text RdsDbSnapshotAttributeValue))
rdsDbSnapshotConfiguration_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RdsDbSnapshotConfiguration' {Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes :: Maybe (HashMap Text RdsDbSnapshotAttributeValue)
$sel:attributes:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration
-> Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes} -> Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes) (\s :: RdsDbSnapshotConfiguration
s@RdsDbSnapshotConfiguration' {} Maybe (HashMap Text RdsDbSnapshotAttributeValue)
a -> RdsDbSnapshotConfiguration
s {$sel:attributes:RdsDbSnapshotConfiguration' :: Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes = Maybe (HashMap Text RdsDbSnapshotAttributeValue)
a} :: RdsDbSnapshotConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
rdsDbSnapshotConfiguration_kmsKeyId :: Lens.Lens' RdsDbSnapshotConfiguration (Prelude.Maybe Prelude.Text)
rdsDbSnapshotConfiguration_kmsKeyId :: Lens' RdsDbSnapshotConfiguration (Maybe Text)
rdsDbSnapshotConfiguration_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RdsDbSnapshotConfiguration' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: RdsDbSnapshotConfiguration
s@RdsDbSnapshotConfiguration' {} Maybe Text
a -> RdsDbSnapshotConfiguration
s {$sel:kmsKeyId:RdsDbSnapshotConfiguration' :: Maybe Text
kmsKeyId = Maybe Text
a} :: RdsDbSnapshotConfiguration)
instance Data.FromJSON RdsDbSnapshotConfiguration where
parseJSON :: Value -> Parser RdsDbSnapshotConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RdsDbSnapshotConfiguration"
( \Object
x ->
Maybe (HashMap Text RdsDbSnapshotAttributeValue)
-> Maybe Text -> RdsDbSnapshotConfiguration
RdsDbSnapshotConfiguration'
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
"attributes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"kmsKeyId")
)
instance Prelude.Hashable RdsDbSnapshotConfiguration where
hashWithSalt :: Int -> RdsDbSnapshotConfiguration -> Int
hashWithSalt Int
_salt RdsDbSnapshotConfiguration' {Maybe Text
Maybe (HashMap Text RdsDbSnapshotAttributeValue)
kmsKeyId :: Maybe Text
attributes :: Maybe (HashMap Text RdsDbSnapshotAttributeValue)
$sel:kmsKeyId:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration -> Maybe Text
$sel:attributes:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration
-> Maybe (HashMap Text RdsDbSnapshotAttributeValue)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
instance Prelude.NFData RdsDbSnapshotConfiguration where
rnf :: RdsDbSnapshotConfiguration -> ()
rnf RdsDbSnapshotConfiguration' {Maybe Text
Maybe (HashMap Text RdsDbSnapshotAttributeValue)
kmsKeyId :: Maybe Text
attributes :: Maybe (HashMap Text RdsDbSnapshotAttributeValue)
$sel:kmsKeyId:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration -> Maybe Text
$sel:attributes:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration
-> Maybe (HashMap Text RdsDbSnapshotAttributeValue)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text RdsDbSnapshotAttributeValue)
attributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
instance Data.ToJSON RdsDbSnapshotConfiguration where
toJSON :: RdsDbSnapshotConfiguration -> Value
toJSON RdsDbSnapshotConfiguration' {Maybe Text
Maybe (HashMap Text RdsDbSnapshotAttributeValue)
kmsKeyId :: Maybe Text
attributes :: Maybe (HashMap Text RdsDbSnapshotAttributeValue)
$sel:kmsKeyId:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration -> Maybe Text
$sel:attributes:RdsDbSnapshotConfiguration' :: RdsDbSnapshotConfiguration
-> Maybe (HashMap Text RdsDbSnapshotAttributeValue)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"attributes" 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 (HashMap Text RdsDbSnapshotAttributeValue)
attributes,
(Key
"kmsKeyId" 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
kmsKeyId
]
)