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