{-# 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.Note where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Note = Note'
{
Note -> Text
text :: Prelude.Text,
Note -> Text
updatedBy :: Prelude.Text,
Note -> Text
updatedAt :: Prelude.Text
}
deriving (Note -> Note -> Bool
(Note -> Note -> Bool) -> (Note -> Note -> Bool) -> Eq Note
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Note -> Note -> Bool
$c/= :: Note -> Note -> Bool
== :: Note -> Note -> Bool
$c== :: Note -> Note -> Bool
Prelude.Eq, ReadPrec [Note]
ReadPrec Note
Int -> ReadS Note
ReadS [Note]
(Int -> ReadS Note)
-> ReadS [Note] -> ReadPrec Note -> ReadPrec [Note] -> Read Note
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Note]
$creadListPrec :: ReadPrec [Note]
readPrec :: ReadPrec Note
$creadPrec :: ReadPrec Note
readList :: ReadS [Note]
$creadList :: ReadS [Note]
readsPrec :: Int -> ReadS Note
$creadsPrec :: Int -> ReadS Note
Prelude.Read, Int -> Note -> ShowS
[Note] -> ShowS
Note -> String
(Int -> Note -> ShowS)
-> (Note -> String) -> ([Note] -> ShowS) -> Show Note
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Note] -> ShowS
$cshowList :: [Note] -> ShowS
show :: Note -> String
$cshow :: Note -> String
showsPrec :: Int -> Note -> ShowS
$cshowsPrec :: Int -> Note -> ShowS
Prelude.Show, (forall x. Note -> Rep Note x)
-> (forall x. Rep Note x -> Note) -> Generic Note
forall x. Rep Note x -> Note
forall x. Note -> Rep Note x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Note x -> Note
$cfrom :: forall x. Note -> Rep Note x
Prelude.Generic)
newNote ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Note
newNote :: Text -> Text -> Text -> Note
newNote Text
pText_ Text
pUpdatedBy_ Text
pUpdatedAt_ =
Note' :: Text -> Text -> Text -> Note
Note'
{ $sel:text:Note' :: Text
text = Text
pText_,
$sel:updatedBy:Note' :: Text
updatedBy = Text
pUpdatedBy_,
$sel:updatedAt:Note' :: Text
updatedAt = Text
pUpdatedAt_
}
note_text :: Lens.Lens' Note Prelude.Text
note_text :: (Text -> f Text) -> Note -> f Note
note_text = (Note -> Text)
-> (Note -> Text -> Note) -> Lens Note Note Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Note' {Text
text :: Text
$sel:text:Note' :: Note -> Text
text} -> Text
text) (\s :: Note
s@Note' {} Text
a -> Note
s {$sel:text:Note' :: Text
text = Text
a} :: Note)
note_updatedBy :: Lens.Lens' Note Prelude.Text
note_updatedBy :: (Text -> f Text) -> Note -> f Note
note_updatedBy = (Note -> Text)
-> (Note -> Text -> Note) -> Lens Note Note Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Note' {Text
updatedBy :: Text
$sel:updatedBy:Note' :: Note -> Text
updatedBy} -> Text
updatedBy) (\s :: Note
s@Note' {} Text
a -> Note
s {$sel:updatedBy:Note' :: Text
updatedBy = Text
a} :: Note)
note_updatedAt :: Lens.Lens' Note Prelude.Text
note_updatedAt :: (Text -> f Text) -> Note -> f Note
note_updatedAt = (Note -> Text)
-> (Note -> Text -> Note) -> Lens Note Note Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Note' {Text
updatedAt :: Text
$sel:updatedAt:Note' :: Note -> Text
updatedAt} -> Text
updatedAt) (\s :: Note
s@Note' {} Text
a -> Note
s {$sel:updatedAt:Note' :: Text
updatedAt = Text
a} :: Note)
instance Core.FromJSON Note where
parseJSON :: Value -> Parser Note
parseJSON =
String -> (Object -> Parser Note) -> Value -> Parser Note
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Note"
( \Object
x ->
Text -> Text -> Text -> Note
Note'
(Text -> Text -> Text -> Note)
-> Parser Text -> Parser (Text -> Text -> Note)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Text")
Parser (Text -> Text -> Note)
-> Parser Text -> Parser (Text -> Note)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UpdatedBy")
Parser (Text -> Note) -> Parser Text -> Parser Note
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UpdatedAt")
)
instance Prelude.Hashable Note
instance Prelude.NFData Note
instance Core.ToJSON Note where
toJSON :: Note -> Value
toJSON Note' {Text
updatedAt :: Text
updatedBy :: Text
text :: Text
$sel:updatedAt:Note' :: Note -> Text
$sel:updatedBy:Note' :: Note -> Text
$sel:text:Note' :: Note -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Text" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
text),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UpdatedBy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
updatedBy),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UpdatedAt" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
updatedAt)
]
)