{-# 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.QuickSight.Types.DataPathValue 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 DataPathValue = DataPathValue'
{
DataPathValue -> Text
fieldId :: Prelude.Text,
DataPathValue -> Sensitive Text
fieldValue :: Data.Sensitive Prelude.Text
}
deriving (DataPathValue -> DataPathValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataPathValue -> DataPathValue -> Bool
$c/= :: DataPathValue -> DataPathValue -> Bool
== :: DataPathValue -> DataPathValue -> Bool
$c== :: DataPathValue -> DataPathValue -> Bool
Prelude.Eq, Int -> DataPathValue -> ShowS
[DataPathValue] -> ShowS
DataPathValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataPathValue] -> ShowS
$cshowList :: [DataPathValue] -> ShowS
show :: DataPathValue -> String
$cshow :: DataPathValue -> String
showsPrec :: Int -> DataPathValue -> ShowS
$cshowsPrec :: Int -> DataPathValue -> ShowS
Prelude.Show, forall x. Rep DataPathValue x -> DataPathValue
forall x. DataPathValue -> Rep DataPathValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataPathValue x -> DataPathValue
$cfrom :: forall x. DataPathValue -> Rep DataPathValue x
Prelude.Generic)
newDataPathValue ::
Prelude.Text ->
Prelude.Text ->
DataPathValue
newDataPathValue :: Text -> Text -> DataPathValue
newDataPathValue Text
pFieldId_ Text
pFieldValue_ =
DataPathValue'
{ $sel:fieldId:DataPathValue' :: Text
fieldId = Text
pFieldId_,
$sel:fieldValue:DataPathValue' :: Sensitive Text
fieldValue = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pFieldValue_
}
dataPathValue_fieldId :: Lens.Lens' DataPathValue Prelude.Text
dataPathValue_fieldId :: Lens' DataPathValue Text
dataPathValue_fieldId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataPathValue' {Text
fieldId :: Text
$sel:fieldId:DataPathValue' :: DataPathValue -> Text
fieldId} -> Text
fieldId) (\s :: DataPathValue
s@DataPathValue' {} Text
a -> DataPathValue
s {$sel:fieldId:DataPathValue' :: Text
fieldId = Text
a} :: DataPathValue)
dataPathValue_fieldValue :: Lens.Lens' DataPathValue Prelude.Text
dataPathValue_fieldValue :: Lens' DataPathValue Text
dataPathValue_fieldValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataPathValue' {Sensitive Text
fieldValue :: Sensitive Text
$sel:fieldValue:DataPathValue' :: DataPathValue -> Sensitive Text
fieldValue} -> Sensitive Text
fieldValue) (\s :: DataPathValue
s@DataPathValue' {} Sensitive Text
a -> DataPathValue
s {$sel:fieldValue:DataPathValue' :: Sensitive Text
fieldValue = Sensitive Text
a} :: DataPathValue) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON DataPathValue where
parseJSON :: Value -> Parser DataPathValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DataPathValue"
( \Object
x ->
Text -> Sensitive Text -> DataPathValue
DataPathValue'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FieldId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FieldValue")
)
instance Prelude.Hashable DataPathValue where
hashWithSalt :: Int -> DataPathValue -> Int
hashWithSalt Int
_salt DataPathValue' {Text
Sensitive Text
fieldValue :: Sensitive Text
fieldId :: Text
$sel:fieldValue:DataPathValue' :: DataPathValue -> Sensitive Text
$sel:fieldId:DataPathValue' :: DataPathValue -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fieldId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
fieldValue
instance Prelude.NFData DataPathValue where
rnf :: DataPathValue -> ()
rnf DataPathValue' {Text
Sensitive Text
fieldValue :: Sensitive Text
fieldId :: Text
$sel:fieldValue:DataPathValue' :: DataPathValue -> Sensitive Text
$sel:fieldId:DataPathValue' :: DataPathValue -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
fieldId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
fieldValue
instance Data.ToJSON DataPathValue where
toJSON :: DataPathValue -> Value
toJSON DataPathValue' {Text
Sensitive Text
fieldValue :: Sensitive Text
fieldId :: Text
$sel:fieldValue:DataPathValue' :: DataPathValue -> Sensitive Text
$sel:fieldId:DataPathValue' :: DataPathValue -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"FieldId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fieldId),
forall a. a -> Maybe a
Prelude.Just (Key
"FieldValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
fieldValue)
]
)