{-# 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.XRay.Types.AnnotationValue where
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 AnnotationValue = AnnotationValue'
{
AnnotationValue -> Maybe Bool
booleanValue :: Prelude.Maybe Prelude.Bool,
AnnotationValue -> Maybe Double
numberValue :: Prelude.Maybe Prelude.Double,
AnnotationValue -> Maybe Text
stringValue :: Prelude.Maybe Prelude.Text
}
deriving (AnnotationValue -> AnnotationValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnnotationValue -> AnnotationValue -> Bool
$c/= :: AnnotationValue -> AnnotationValue -> Bool
== :: AnnotationValue -> AnnotationValue -> Bool
$c== :: AnnotationValue -> AnnotationValue -> Bool
Prelude.Eq, ReadPrec [AnnotationValue]
ReadPrec AnnotationValue
Int -> ReadS AnnotationValue
ReadS [AnnotationValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnnotationValue]
$creadListPrec :: ReadPrec [AnnotationValue]
readPrec :: ReadPrec AnnotationValue
$creadPrec :: ReadPrec AnnotationValue
readList :: ReadS [AnnotationValue]
$creadList :: ReadS [AnnotationValue]
readsPrec :: Int -> ReadS AnnotationValue
$creadsPrec :: Int -> ReadS AnnotationValue
Prelude.Read, Int -> AnnotationValue -> ShowS
[AnnotationValue] -> ShowS
AnnotationValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnnotationValue] -> ShowS
$cshowList :: [AnnotationValue] -> ShowS
show :: AnnotationValue -> String
$cshow :: AnnotationValue -> String
showsPrec :: Int -> AnnotationValue -> ShowS
$cshowsPrec :: Int -> AnnotationValue -> ShowS
Prelude.Show, forall x. Rep AnnotationValue x -> AnnotationValue
forall x. AnnotationValue -> Rep AnnotationValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnnotationValue x -> AnnotationValue
$cfrom :: forall x. AnnotationValue -> Rep AnnotationValue x
Prelude.Generic)
newAnnotationValue ::
AnnotationValue
newAnnotationValue :: AnnotationValue
newAnnotationValue =
AnnotationValue'
{ $sel:booleanValue:AnnotationValue' :: Maybe Bool
booleanValue = forall a. Maybe a
Prelude.Nothing,
$sel:numberValue:AnnotationValue' :: Maybe Double
numberValue = forall a. Maybe a
Prelude.Nothing,
$sel:stringValue:AnnotationValue' :: Maybe Text
stringValue = forall a. Maybe a
Prelude.Nothing
}
annotationValue_booleanValue :: Lens.Lens' AnnotationValue (Prelude.Maybe Prelude.Bool)
annotationValue_booleanValue :: Lens' AnnotationValue (Maybe Bool)
annotationValue_booleanValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnnotationValue' {Maybe Bool
booleanValue :: Maybe Bool
$sel:booleanValue:AnnotationValue' :: AnnotationValue -> Maybe Bool
booleanValue} -> Maybe Bool
booleanValue) (\s :: AnnotationValue
s@AnnotationValue' {} Maybe Bool
a -> AnnotationValue
s {$sel:booleanValue:AnnotationValue' :: Maybe Bool
booleanValue = Maybe Bool
a} :: AnnotationValue)
annotationValue_numberValue :: Lens.Lens' AnnotationValue (Prelude.Maybe Prelude.Double)
annotationValue_numberValue :: Lens' AnnotationValue (Maybe Double)
annotationValue_numberValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnnotationValue' {Maybe Double
numberValue :: Maybe Double
$sel:numberValue:AnnotationValue' :: AnnotationValue -> Maybe Double
numberValue} -> Maybe Double
numberValue) (\s :: AnnotationValue
s@AnnotationValue' {} Maybe Double
a -> AnnotationValue
s {$sel:numberValue:AnnotationValue' :: Maybe Double
numberValue = Maybe Double
a} :: AnnotationValue)
annotationValue_stringValue :: Lens.Lens' AnnotationValue (Prelude.Maybe Prelude.Text)
annotationValue_stringValue :: Lens' AnnotationValue (Maybe Text)
annotationValue_stringValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnnotationValue' {Maybe Text
stringValue :: Maybe Text
$sel:stringValue:AnnotationValue' :: AnnotationValue -> Maybe Text
stringValue} -> Maybe Text
stringValue) (\s :: AnnotationValue
s@AnnotationValue' {} Maybe Text
a -> AnnotationValue
s {$sel:stringValue:AnnotationValue' :: Maybe Text
stringValue = Maybe Text
a} :: AnnotationValue)
instance Data.FromJSON AnnotationValue where
parseJSON :: Value -> Parser AnnotationValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AnnotationValue"
( \Object
x ->
Maybe Bool -> Maybe Double -> Maybe Text -> AnnotationValue
AnnotationValue'
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
"BooleanValue")
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
"NumberValue")
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
"StringValue")
)
instance Prelude.Hashable AnnotationValue where
hashWithSalt :: Int -> AnnotationValue -> Int
hashWithSalt Int
_salt AnnotationValue' {Maybe Bool
Maybe Double
Maybe Text
stringValue :: Maybe Text
numberValue :: Maybe Double
booleanValue :: Maybe Bool
$sel:stringValue:AnnotationValue' :: AnnotationValue -> Maybe Text
$sel:numberValue:AnnotationValue' :: AnnotationValue -> Maybe Double
$sel:booleanValue:AnnotationValue' :: AnnotationValue -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
booleanValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
numberValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stringValue
instance Prelude.NFData AnnotationValue where
rnf :: AnnotationValue -> ()
rnf AnnotationValue' {Maybe Bool
Maybe Double
Maybe Text
stringValue :: Maybe Text
numberValue :: Maybe Double
booleanValue :: Maybe Bool
$sel:stringValue:AnnotationValue' :: AnnotationValue -> Maybe Text
$sel:numberValue:AnnotationValue' :: AnnotationValue -> Maybe Double
$sel:booleanValue:AnnotationValue' :: AnnotationValue -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
booleanValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
numberValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stringValue