{-# 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.HoneyCode.Types.DataItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.HoneyCode.Types.Format
import qualified Amazonka.Prelude as Prelude
data DataItem = DataItem'
{
DataItem -> Maybe Text
formattedValue :: Prelude.Maybe Prelude.Text,
DataItem -> Maybe Format
overrideFormat :: Prelude.Maybe Format,
DataItem -> Maybe Text
rawValue :: Prelude.Maybe Prelude.Text
}
deriving (DataItem -> DataItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataItem -> DataItem -> Bool
$c/= :: DataItem -> DataItem -> Bool
== :: DataItem -> DataItem -> Bool
$c== :: DataItem -> DataItem -> Bool
Prelude.Eq, Int -> DataItem -> ShowS
[DataItem] -> ShowS
DataItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataItem] -> ShowS
$cshowList :: [DataItem] -> ShowS
show :: DataItem -> String
$cshow :: DataItem -> String
showsPrec :: Int -> DataItem -> ShowS
$cshowsPrec :: Int -> DataItem -> ShowS
Prelude.Show, forall x. Rep DataItem x -> DataItem
forall x. DataItem -> Rep DataItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataItem x -> DataItem
$cfrom :: forall x. DataItem -> Rep DataItem x
Prelude.Generic)
newDataItem ::
DataItem
newDataItem :: DataItem
newDataItem =
DataItem'
{ $sel:formattedValue:DataItem' :: Maybe Text
formattedValue = forall a. Maybe a
Prelude.Nothing,
$sel:overrideFormat:DataItem' :: Maybe Format
overrideFormat = forall a. Maybe a
Prelude.Nothing,
$sel:rawValue:DataItem' :: Maybe Text
rawValue = forall a. Maybe a
Prelude.Nothing
}
dataItem_formattedValue :: Lens.Lens' DataItem (Prelude.Maybe Prelude.Text)
dataItem_formattedValue :: Lens' DataItem (Maybe Text)
dataItem_formattedValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataItem' {Maybe Text
formattedValue :: Maybe Text
$sel:formattedValue:DataItem' :: DataItem -> Maybe Text
formattedValue} -> Maybe Text
formattedValue) (\s :: DataItem
s@DataItem' {} Maybe Text
a -> DataItem
s {$sel:formattedValue:DataItem' :: Maybe Text
formattedValue = Maybe Text
a} :: DataItem)
dataItem_overrideFormat :: Lens.Lens' DataItem (Prelude.Maybe Format)
dataItem_overrideFormat :: Lens' DataItem (Maybe Format)
dataItem_overrideFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataItem' {Maybe Format
overrideFormat :: Maybe Format
$sel:overrideFormat:DataItem' :: DataItem -> Maybe Format
overrideFormat} -> Maybe Format
overrideFormat) (\s :: DataItem
s@DataItem' {} Maybe Format
a -> DataItem
s {$sel:overrideFormat:DataItem' :: Maybe Format
overrideFormat = Maybe Format
a} :: DataItem)
dataItem_rawValue :: Lens.Lens' DataItem (Prelude.Maybe Prelude.Text)
dataItem_rawValue :: Lens' DataItem (Maybe Text)
dataItem_rawValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataItem' {Maybe Text
rawValue :: Maybe Text
$sel:rawValue:DataItem' :: DataItem -> Maybe Text
rawValue} -> Maybe Text
rawValue) (\s :: DataItem
s@DataItem' {} Maybe Text
a -> DataItem
s {$sel:rawValue:DataItem' :: Maybe Text
rawValue = Maybe Text
a} :: DataItem)
instance Data.FromJSON DataItem where
parseJSON :: Value -> Parser DataItem
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DataItem"
( \Object
x ->
Maybe Text -> Maybe Format -> Maybe Text -> DataItem
DataItem'
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
"formattedValue")
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
"overrideFormat")
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
"rawValue")
)
instance Prelude.Hashable DataItem where
hashWithSalt :: Int -> DataItem -> Int
hashWithSalt Int
_salt DataItem' {Maybe Text
Maybe Format
rawValue :: Maybe Text
overrideFormat :: Maybe Format
formattedValue :: Maybe Text
$sel:rawValue:DataItem' :: DataItem -> Maybe Text
$sel:overrideFormat:DataItem' :: DataItem -> Maybe Format
$sel:formattedValue:DataItem' :: DataItem -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
formattedValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Format
overrideFormat
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rawValue
instance Prelude.NFData DataItem where
rnf :: DataItem -> ()
rnf DataItem' {Maybe Text
Maybe Format
rawValue :: Maybe Text
overrideFormat :: Maybe Format
formattedValue :: Maybe Text
$sel:rawValue:DataItem' :: DataItem -> Maybe Text
$sel:overrideFormat:DataItem' :: DataItem -> Maybe Format
$sel:formattedValue:DataItem' :: DataItem -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
formattedValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Format
overrideFormat
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rawValue