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