{-# 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.CustomValuesConfiguration 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.CustomParameterValues
data CustomValuesConfiguration = CustomValuesConfiguration'
{
CustomValuesConfiguration -> Maybe Bool
includeNullValue :: Prelude.Maybe Prelude.Bool,
CustomValuesConfiguration -> CustomParameterValues
customValues :: CustomParameterValues
}
deriving (CustomValuesConfiguration -> CustomValuesConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomValuesConfiguration -> CustomValuesConfiguration -> Bool
$c/= :: CustomValuesConfiguration -> CustomValuesConfiguration -> Bool
== :: CustomValuesConfiguration -> CustomValuesConfiguration -> Bool
$c== :: CustomValuesConfiguration -> CustomValuesConfiguration -> Bool
Prelude.Eq, Int -> CustomValuesConfiguration -> ShowS
[CustomValuesConfiguration] -> ShowS
CustomValuesConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomValuesConfiguration] -> ShowS
$cshowList :: [CustomValuesConfiguration] -> ShowS
show :: CustomValuesConfiguration -> String
$cshow :: CustomValuesConfiguration -> String
showsPrec :: Int -> CustomValuesConfiguration -> ShowS
$cshowsPrec :: Int -> CustomValuesConfiguration -> ShowS
Prelude.Show, forall x.
Rep CustomValuesConfiguration x -> CustomValuesConfiguration
forall x.
CustomValuesConfiguration -> Rep CustomValuesConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomValuesConfiguration x -> CustomValuesConfiguration
$cfrom :: forall x.
CustomValuesConfiguration -> Rep CustomValuesConfiguration x
Prelude.Generic)
newCustomValuesConfiguration ::
CustomParameterValues ->
CustomValuesConfiguration
newCustomValuesConfiguration :: CustomParameterValues -> CustomValuesConfiguration
newCustomValuesConfiguration CustomParameterValues
pCustomValues_ =
CustomValuesConfiguration'
{ $sel:includeNullValue:CustomValuesConfiguration' :: Maybe Bool
includeNullValue =
forall a. Maybe a
Prelude.Nothing,
$sel:customValues:CustomValuesConfiguration' :: CustomParameterValues
customValues = CustomParameterValues
pCustomValues_
}
customValuesConfiguration_includeNullValue :: Lens.Lens' CustomValuesConfiguration (Prelude.Maybe Prelude.Bool)
customValuesConfiguration_includeNullValue :: Lens' CustomValuesConfiguration (Maybe Bool)
customValuesConfiguration_includeNullValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomValuesConfiguration' {Maybe Bool
includeNullValue :: Maybe Bool
$sel:includeNullValue:CustomValuesConfiguration' :: CustomValuesConfiguration -> Maybe Bool
includeNullValue} -> Maybe Bool
includeNullValue) (\s :: CustomValuesConfiguration
s@CustomValuesConfiguration' {} Maybe Bool
a -> CustomValuesConfiguration
s {$sel:includeNullValue:CustomValuesConfiguration' :: Maybe Bool
includeNullValue = Maybe Bool
a} :: CustomValuesConfiguration)
customValuesConfiguration_customValues :: Lens.Lens' CustomValuesConfiguration CustomParameterValues
customValuesConfiguration_customValues :: Lens' CustomValuesConfiguration CustomParameterValues
customValuesConfiguration_customValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomValuesConfiguration' {CustomParameterValues
customValues :: CustomParameterValues
$sel:customValues:CustomValuesConfiguration' :: CustomValuesConfiguration -> CustomParameterValues
customValues} -> CustomParameterValues
customValues) (\s :: CustomValuesConfiguration
s@CustomValuesConfiguration' {} CustomParameterValues
a -> CustomValuesConfiguration
s {$sel:customValues:CustomValuesConfiguration' :: CustomParameterValues
customValues = CustomParameterValues
a} :: CustomValuesConfiguration)
instance Data.FromJSON CustomValuesConfiguration where
parseJSON :: Value -> Parser CustomValuesConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CustomValuesConfiguration"
( \Object
x ->
Maybe Bool -> CustomParameterValues -> CustomValuesConfiguration
CustomValuesConfiguration'
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
"IncludeNullValue")
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
"CustomValues")
)
instance Prelude.Hashable CustomValuesConfiguration where
hashWithSalt :: Int -> CustomValuesConfiguration -> Int
hashWithSalt Int
_salt CustomValuesConfiguration' {Maybe Bool
CustomParameterValues
customValues :: CustomParameterValues
includeNullValue :: Maybe Bool
$sel:customValues:CustomValuesConfiguration' :: CustomValuesConfiguration -> CustomParameterValues
$sel:includeNullValue:CustomValuesConfiguration' :: CustomValuesConfiguration -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeNullValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CustomParameterValues
customValues
instance Prelude.NFData CustomValuesConfiguration where
rnf :: CustomValuesConfiguration -> ()
rnf CustomValuesConfiguration' {Maybe Bool
CustomParameterValues
customValues :: CustomParameterValues
includeNullValue :: Maybe Bool
$sel:customValues:CustomValuesConfiguration' :: CustomValuesConfiguration -> CustomParameterValues
$sel:includeNullValue:CustomValuesConfiguration' :: CustomValuesConfiguration -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeNullValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CustomParameterValues
customValues
instance Data.ToJSON CustomValuesConfiguration where
toJSON :: CustomValuesConfiguration -> Value
toJSON CustomValuesConfiguration' {Maybe Bool
CustomParameterValues
customValues :: CustomParameterValues
includeNullValue :: Maybe Bool
$sel:customValues:CustomValuesConfiguration' :: CustomValuesConfiguration -> CustomParameterValues
$sel:includeNullValue:CustomValuesConfiguration' :: CustomValuesConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"IncludeNullValue" 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 Bool
includeNullValue,
forall a. a -> Maybe a
Prelude.Just (Key
"CustomValues" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= CustomParameterValues
customValues)
]
)