{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AnnotationValue = AnnotationValue'
{
AnnotationValue -> Maybe Double
numberValue :: Prelude.Maybe Prelude.Double,
AnnotationValue -> Maybe Text
stringValue :: Prelude.Maybe Prelude.Text,
AnnotationValue -> Maybe Bool
booleanValue :: Prelude.Maybe Prelude.Bool
}
deriving (AnnotationValue -> AnnotationValue -> Bool
(AnnotationValue -> AnnotationValue -> Bool)
-> (AnnotationValue -> AnnotationValue -> Bool)
-> Eq AnnotationValue
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]
(Int -> ReadS AnnotationValue)
-> ReadS [AnnotationValue]
-> ReadPrec AnnotationValue
-> ReadPrec [AnnotationValue]
-> Read 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
(Int -> AnnotationValue -> ShowS)
-> (AnnotationValue -> String)
-> ([AnnotationValue] -> ShowS)
-> Show AnnotationValue
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. AnnotationValue -> Rep AnnotationValue x)
-> (forall x. Rep AnnotationValue x -> AnnotationValue)
-> Generic AnnotationValue
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' :: Maybe Double -> Maybe Text -> Maybe Bool -> AnnotationValue
AnnotationValue'
{ $sel:numberValue:AnnotationValue' :: Maybe Double
numberValue = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:stringValue:AnnotationValue' :: Maybe Text
stringValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:booleanValue:AnnotationValue' :: Maybe Bool
booleanValue = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
annotationValue_numberValue :: Lens.Lens' AnnotationValue (Prelude.Maybe Prelude.Double)
annotationValue_numberValue :: (Maybe Double -> f (Maybe Double))
-> AnnotationValue -> f AnnotationValue
annotationValue_numberValue = (AnnotationValue -> Maybe Double)
-> (AnnotationValue -> Maybe Double -> AnnotationValue)
-> Lens
AnnotationValue AnnotationValue (Maybe Double) (Maybe Double)
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 :: (Maybe Text -> f (Maybe Text))
-> AnnotationValue -> f AnnotationValue
annotationValue_stringValue = (AnnotationValue -> Maybe Text)
-> (AnnotationValue -> Maybe Text -> AnnotationValue)
-> Lens AnnotationValue AnnotationValue (Maybe Text) (Maybe Text)
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)
annotationValue_booleanValue :: Lens.Lens' AnnotationValue (Prelude.Maybe Prelude.Bool)
annotationValue_booleanValue :: (Maybe Bool -> f (Maybe Bool))
-> AnnotationValue -> f AnnotationValue
annotationValue_booleanValue = (AnnotationValue -> Maybe Bool)
-> (AnnotationValue -> Maybe Bool -> AnnotationValue)
-> Lens AnnotationValue AnnotationValue (Maybe Bool) (Maybe Bool)
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)
instance Core.FromJSON AnnotationValue where
parseJSON :: Value -> Parser AnnotationValue
parseJSON =
String
-> (Object -> Parser AnnotationValue)
-> Value
-> Parser AnnotationValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AnnotationValue"
( \Object
x ->
Maybe Double -> Maybe Text -> Maybe Bool -> AnnotationValue
AnnotationValue'
(Maybe Double -> Maybe Text -> Maybe Bool -> AnnotationValue)
-> Parser (Maybe Double)
-> Parser (Maybe Text -> Maybe Bool -> AnnotationValue)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberValue")
Parser (Maybe Text -> Maybe Bool -> AnnotationValue)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> AnnotationValue)
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
"StringValue")
Parser (Maybe Bool -> AnnotationValue)
-> Parser (Maybe Bool) -> Parser AnnotationValue
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BooleanValue")
)
instance Prelude.Hashable AnnotationValue
instance Prelude.NFData AnnotationValue