{-# 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.DecimalParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DecimalParameter = DecimalParameter'
{
DecimalParameter -> Text
name :: Prelude.Text,
DecimalParameter -> [Double]
values :: [Prelude.Double]
}
deriving (DecimalParameter -> DecimalParameter -> Bool
(DecimalParameter -> DecimalParameter -> Bool)
-> (DecimalParameter -> DecimalParameter -> Bool)
-> Eq DecimalParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecimalParameter -> DecimalParameter -> Bool
$c/= :: DecimalParameter -> DecimalParameter -> Bool
== :: DecimalParameter -> DecimalParameter -> Bool
$c== :: DecimalParameter -> DecimalParameter -> Bool
Prelude.Eq, ReadPrec [DecimalParameter]
ReadPrec DecimalParameter
Int -> ReadS DecimalParameter
ReadS [DecimalParameter]
(Int -> ReadS DecimalParameter)
-> ReadS [DecimalParameter]
-> ReadPrec DecimalParameter
-> ReadPrec [DecimalParameter]
-> Read DecimalParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DecimalParameter]
$creadListPrec :: ReadPrec [DecimalParameter]
readPrec :: ReadPrec DecimalParameter
$creadPrec :: ReadPrec DecimalParameter
readList :: ReadS [DecimalParameter]
$creadList :: ReadS [DecimalParameter]
readsPrec :: Int -> ReadS DecimalParameter
$creadsPrec :: Int -> ReadS DecimalParameter
Prelude.Read, Int -> DecimalParameter -> ShowS
[DecimalParameter] -> ShowS
DecimalParameter -> String
(Int -> DecimalParameter -> ShowS)
-> (DecimalParameter -> String)
-> ([DecimalParameter] -> ShowS)
-> Show DecimalParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecimalParameter] -> ShowS
$cshowList :: [DecimalParameter] -> ShowS
show :: DecimalParameter -> String
$cshow :: DecimalParameter -> String
showsPrec :: Int -> DecimalParameter -> ShowS
$cshowsPrec :: Int -> DecimalParameter -> ShowS
Prelude.Show, (forall x. DecimalParameter -> Rep DecimalParameter x)
-> (forall x. Rep DecimalParameter x -> DecimalParameter)
-> Generic DecimalParameter
forall x. Rep DecimalParameter x -> DecimalParameter
forall x. DecimalParameter -> Rep DecimalParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DecimalParameter x -> DecimalParameter
$cfrom :: forall x. DecimalParameter -> Rep DecimalParameter x
Prelude.Generic)
newDecimalParameter ::
Prelude.Text ->
DecimalParameter
newDecimalParameter :: Text -> DecimalParameter
newDecimalParameter Text
pName_ =
DecimalParameter' :: Text -> [Double] -> DecimalParameter
DecimalParameter'
{ $sel:name:DecimalParameter' :: Text
name = Text
pName_,
$sel:values:DecimalParameter' :: [Double]
values = [Double]
forall a. Monoid a => a
Prelude.mempty
}
decimalParameter_name :: Lens.Lens' DecimalParameter Prelude.Text
decimalParameter_name :: (Text -> f Text) -> DecimalParameter -> f DecimalParameter
decimalParameter_name = (DecimalParameter -> Text)
-> (DecimalParameter -> Text -> DecimalParameter)
-> Lens DecimalParameter DecimalParameter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecimalParameter' {Text
name :: Text
$sel:name:DecimalParameter' :: DecimalParameter -> Text
name} -> Text
name) (\s :: DecimalParameter
s@DecimalParameter' {} Text
a -> DecimalParameter
s {$sel:name:DecimalParameter' :: Text
name = Text
a} :: DecimalParameter)
decimalParameter_values :: Lens.Lens' DecimalParameter [Prelude.Double]
decimalParameter_values :: ([Double] -> f [Double]) -> DecimalParameter -> f DecimalParameter
decimalParameter_values = (DecimalParameter -> [Double])
-> (DecimalParameter -> [Double] -> DecimalParameter)
-> Lens DecimalParameter DecimalParameter [Double] [Double]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecimalParameter' {[Double]
values :: [Double]
$sel:values:DecimalParameter' :: DecimalParameter -> [Double]
values} -> [Double]
values) (\s :: DecimalParameter
s@DecimalParameter' {} [Double]
a -> DecimalParameter
s {$sel:values:DecimalParameter' :: [Double]
values = [Double]
a} :: DecimalParameter) (([Double] -> f [Double])
-> DecimalParameter -> f DecimalParameter)
-> (([Double] -> f [Double]) -> [Double] -> f [Double])
-> ([Double] -> f [Double])
-> DecimalParameter
-> f DecimalParameter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Double] -> f [Double]) -> [Double] -> f [Double]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable DecimalParameter
instance Prelude.NFData DecimalParameter
instance Core.ToJSON DecimalParameter where
toJSON :: DecimalParameter -> Value
toJSON DecimalParameter' {[Double]
Text
values :: [Double]
name :: Text
$sel:values:DecimalParameter' :: DecimalParameter -> [Double]
$sel:name:DecimalParameter' :: DecimalParameter -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Values" Text -> [Double] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Double]
values)
]
)