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