{-# 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.IntegerParameterDeclaration 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
import Amazonka.QuickSight.Types.IntegerDefaultValues
import Amazonka.QuickSight.Types.IntegerValueWhenUnsetConfiguration
import Amazonka.QuickSight.Types.ParameterValueType
data IntegerParameterDeclaration = IntegerParameterDeclaration'
{
IntegerParameterDeclaration -> Maybe IntegerDefaultValues
defaultValues :: Prelude.Maybe IntegerDefaultValues,
IntegerParameterDeclaration
-> Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset :: Prelude.Maybe IntegerValueWhenUnsetConfiguration,
IntegerParameterDeclaration -> ParameterValueType
parameterValueType :: ParameterValueType,
IntegerParameterDeclaration -> Text
name :: Prelude.Text
}
deriving (IntegerParameterDeclaration -> IntegerParameterDeclaration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntegerParameterDeclaration -> IntegerParameterDeclaration -> Bool
$c/= :: IntegerParameterDeclaration -> IntegerParameterDeclaration -> Bool
== :: IntegerParameterDeclaration -> IntegerParameterDeclaration -> Bool
$c== :: IntegerParameterDeclaration -> IntegerParameterDeclaration -> Bool
Prelude.Eq, Int -> IntegerParameterDeclaration -> ShowS
[IntegerParameterDeclaration] -> ShowS
IntegerParameterDeclaration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntegerParameterDeclaration] -> ShowS
$cshowList :: [IntegerParameterDeclaration] -> ShowS
show :: IntegerParameterDeclaration -> String
$cshow :: IntegerParameterDeclaration -> String
showsPrec :: Int -> IntegerParameterDeclaration -> ShowS
$cshowsPrec :: Int -> IntegerParameterDeclaration -> ShowS
Prelude.Show, forall x.
Rep IntegerParameterDeclaration x -> IntegerParameterDeclaration
forall x.
IntegerParameterDeclaration -> Rep IntegerParameterDeclaration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IntegerParameterDeclaration x -> IntegerParameterDeclaration
$cfrom :: forall x.
IntegerParameterDeclaration -> Rep IntegerParameterDeclaration x
Prelude.Generic)
newIntegerParameterDeclaration ::
ParameterValueType ->
Prelude.Text ->
IntegerParameterDeclaration
newIntegerParameterDeclaration :: ParameterValueType -> Text -> IntegerParameterDeclaration
newIntegerParameterDeclaration
ParameterValueType
pParameterValueType_
Text
pName_ =
IntegerParameterDeclaration'
{ $sel:defaultValues:IntegerParameterDeclaration' :: Maybe IntegerDefaultValues
defaultValues =
forall a. Maybe a
Prelude.Nothing,
$sel:valueWhenUnset:IntegerParameterDeclaration' :: Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset = forall a. Maybe a
Prelude.Nothing,
$sel:parameterValueType:IntegerParameterDeclaration' :: ParameterValueType
parameterValueType = ParameterValueType
pParameterValueType_,
$sel:name:IntegerParameterDeclaration' :: Text
name = Text
pName_
}
integerParameterDeclaration_defaultValues :: Lens.Lens' IntegerParameterDeclaration (Prelude.Maybe IntegerDefaultValues)
integerParameterDeclaration_defaultValues :: Lens' IntegerParameterDeclaration (Maybe IntegerDefaultValues)
integerParameterDeclaration_defaultValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntegerParameterDeclaration' {Maybe IntegerDefaultValues
defaultValues :: Maybe IntegerDefaultValues
$sel:defaultValues:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Maybe IntegerDefaultValues
defaultValues} -> Maybe IntegerDefaultValues
defaultValues) (\s :: IntegerParameterDeclaration
s@IntegerParameterDeclaration' {} Maybe IntegerDefaultValues
a -> IntegerParameterDeclaration
s {$sel:defaultValues:IntegerParameterDeclaration' :: Maybe IntegerDefaultValues
defaultValues = Maybe IntegerDefaultValues
a} :: IntegerParameterDeclaration)
integerParameterDeclaration_valueWhenUnset :: Lens.Lens' IntegerParameterDeclaration (Prelude.Maybe IntegerValueWhenUnsetConfiguration)
integerParameterDeclaration_valueWhenUnset :: Lens'
IntegerParameterDeclaration
(Maybe IntegerValueWhenUnsetConfiguration)
integerParameterDeclaration_valueWhenUnset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntegerParameterDeclaration' {Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset :: Maybe IntegerValueWhenUnsetConfiguration
$sel:valueWhenUnset:IntegerParameterDeclaration' :: IntegerParameterDeclaration
-> Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset} -> Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset) (\s :: IntegerParameterDeclaration
s@IntegerParameterDeclaration' {} Maybe IntegerValueWhenUnsetConfiguration
a -> IntegerParameterDeclaration
s {$sel:valueWhenUnset:IntegerParameterDeclaration' :: Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset = Maybe IntegerValueWhenUnsetConfiguration
a} :: IntegerParameterDeclaration)
integerParameterDeclaration_parameterValueType :: Lens.Lens' IntegerParameterDeclaration ParameterValueType
integerParameterDeclaration_parameterValueType :: Lens' IntegerParameterDeclaration ParameterValueType
integerParameterDeclaration_parameterValueType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntegerParameterDeclaration' {ParameterValueType
parameterValueType :: ParameterValueType
$sel:parameterValueType:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> ParameterValueType
parameterValueType} -> ParameterValueType
parameterValueType) (\s :: IntegerParameterDeclaration
s@IntegerParameterDeclaration' {} ParameterValueType
a -> IntegerParameterDeclaration
s {$sel:parameterValueType:IntegerParameterDeclaration' :: ParameterValueType
parameterValueType = ParameterValueType
a} :: IntegerParameterDeclaration)
integerParameterDeclaration_name :: Lens.Lens' IntegerParameterDeclaration Prelude.Text
integerParameterDeclaration_name :: Lens' IntegerParameterDeclaration Text
integerParameterDeclaration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntegerParameterDeclaration' {Text
name :: Text
$sel:name:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Text
name} -> Text
name) (\s :: IntegerParameterDeclaration
s@IntegerParameterDeclaration' {} Text
a -> IntegerParameterDeclaration
s {$sel:name:IntegerParameterDeclaration' :: Text
name = Text
a} :: IntegerParameterDeclaration)
instance Data.FromJSON IntegerParameterDeclaration where
parseJSON :: Value -> Parser IntegerParameterDeclaration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IntegerParameterDeclaration"
( \Object
x ->
Maybe IntegerDefaultValues
-> Maybe IntegerValueWhenUnsetConfiguration
-> ParameterValueType
-> Text
-> IntegerParameterDeclaration
IntegerParameterDeclaration'
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
"DefaultValues")
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
"ValueWhenUnset")
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
"ParameterValueType")
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
"Name")
)
instance Prelude.Hashable IntegerParameterDeclaration where
hashWithSalt :: Int -> IntegerParameterDeclaration -> Int
hashWithSalt Int
_salt IntegerParameterDeclaration' {Maybe IntegerDefaultValues
Maybe IntegerValueWhenUnsetConfiguration
Text
ParameterValueType
name :: Text
parameterValueType :: ParameterValueType
valueWhenUnset :: Maybe IntegerValueWhenUnsetConfiguration
defaultValues :: Maybe IntegerDefaultValues
$sel:name:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Text
$sel:parameterValueType:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> ParameterValueType
$sel:valueWhenUnset:IntegerParameterDeclaration' :: IntegerParameterDeclaration
-> Maybe IntegerValueWhenUnsetConfiguration
$sel:defaultValues:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Maybe IntegerDefaultValues
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IntegerDefaultValues
defaultValues
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ParameterValueType
parameterValueType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData IntegerParameterDeclaration where
rnf :: IntegerParameterDeclaration -> ()
rnf IntegerParameterDeclaration' {Maybe IntegerDefaultValues
Maybe IntegerValueWhenUnsetConfiguration
Text
ParameterValueType
name :: Text
parameterValueType :: ParameterValueType
valueWhenUnset :: Maybe IntegerValueWhenUnsetConfiguration
defaultValues :: Maybe IntegerDefaultValues
$sel:name:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Text
$sel:parameterValueType:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> ParameterValueType
$sel:valueWhenUnset:IntegerParameterDeclaration' :: IntegerParameterDeclaration
-> Maybe IntegerValueWhenUnsetConfiguration
$sel:defaultValues:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Maybe IntegerDefaultValues
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe IntegerDefaultValues
defaultValues
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ParameterValueType
parameterValueType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToJSON IntegerParameterDeclaration where
toJSON :: IntegerParameterDeclaration -> Value
toJSON IntegerParameterDeclaration' {Maybe IntegerDefaultValues
Maybe IntegerValueWhenUnsetConfiguration
Text
ParameterValueType
name :: Text
parameterValueType :: ParameterValueType
valueWhenUnset :: Maybe IntegerValueWhenUnsetConfiguration
defaultValues :: Maybe IntegerDefaultValues
$sel:name:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Text
$sel:parameterValueType:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> ParameterValueType
$sel:valueWhenUnset:IntegerParameterDeclaration' :: IntegerParameterDeclaration
-> Maybe IntegerValueWhenUnsetConfiguration
$sel:defaultValues:IntegerParameterDeclaration' :: IntegerParameterDeclaration -> Maybe IntegerDefaultValues
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DefaultValues" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IntegerDefaultValues
defaultValues,
(Key
"ValueWhenUnset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IntegerValueWhenUnsetConfiguration
valueWhenUnset,
forall a. a -> Maybe a
Prelude.Just
(Key
"ParameterValueType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ParameterValueType
parameterValueType),
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)