{-# 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.FilledMapShapeConditionalFormatting 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.ShapeConditionalFormat
data FilledMapShapeConditionalFormatting = FilledMapShapeConditionalFormatting'
{
FilledMapShapeConditionalFormatting -> Maybe ShapeConditionalFormat
format :: Prelude.Maybe ShapeConditionalFormat,
FilledMapShapeConditionalFormatting -> Text
fieldId :: Prelude.Text
}
deriving (FilledMapShapeConditionalFormatting
-> FilledMapShapeConditionalFormatting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FilledMapShapeConditionalFormatting
-> FilledMapShapeConditionalFormatting -> Bool
$c/= :: FilledMapShapeConditionalFormatting
-> FilledMapShapeConditionalFormatting -> Bool
== :: FilledMapShapeConditionalFormatting
-> FilledMapShapeConditionalFormatting -> Bool
$c== :: FilledMapShapeConditionalFormatting
-> FilledMapShapeConditionalFormatting -> Bool
Prelude.Eq, Int -> FilledMapShapeConditionalFormatting -> ShowS
[FilledMapShapeConditionalFormatting] -> ShowS
FilledMapShapeConditionalFormatting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FilledMapShapeConditionalFormatting] -> ShowS
$cshowList :: [FilledMapShapeConditionalFormatting] -> ShowS
show :: FilledMapShapeConditionalFormatting -> String
$cshow :: FilledMapShapeConditionalFormatting -> String
showsPrec :: Int -> FilledMapShapeConditionalFormatting -> ShowS
$cshowsPrec :: Int -> FilledMapShapeConditionalFormatting -> ShowS
Prelude.Show, forall x.
Rep FilledMapShapeConditionalFormatting x
-> FilledMapShapeConditionalFormatting
forall x.
FilledMapShapeConditionalFormatting
-> Rep FilledMapShapeConditionalFormatting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FilledMapShapeConditionalFormatting x
-> FilledMapShapeConditionalFormatting
$cfrom :: forall x.
FilledMapShapeConditionalFormatting
-> Rep FilledMapShapeConditionalFormatting x
Prelude.Generic)
newFilledMapShapeConditionalFormatting ::
Prelude.Text ->
FilledMapShapeConditionalFormatting
newFilledMapShapeConditionalFormatting :: Text -> FilledMapShapeConditionalFormatting
newFilledMapShapeConditionalFormatting Text
pFieldId_ =
FilledMapShapeConditionalFormatting'
{ $sel:format:FilledMapShapeConditionalFormatting' :: Maybe ShapeConditionalFormat
format =
forall a. Maybe a
Prelude.Nothing,
$sel:fieldId:FilledMapShapeConditionalFormatting' :: Text
fieldId = Text
pFieldId_
}
filledMapShapeConditionalFormatting_format :: Lens.Lens' FilledMapShapeConditionalFormatting (Prelude.Maybe ShapeConditionalFormat)
filledMapShapeConditionalFormatting_format :: Lens'
FilledMapShapeConditionalFormatting (Maybe ShapeConditionalFormat)
filledMapShapeConditionalFormatting_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapShapeConditionalFormatting' {Maybe ShapeConditionalFormat
format :: Maybe ShapeConditionalFormat
$sel:format:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Maybe ShapeConditionalFormat
format} -> Maybe ShapeConditionalFormat
format) (\s :: FilledMapShapeConditionalFormatting
s@FilledMapShapeConditionalFormatting' {} Maybe ShapeConditionalFormat
a -> FilledMapShapeConditionalFormatting
s {$sel:format:FilledMapShapeConditionalFormatting' :: Maybe ShapeConditionalFormat
format = Maybe ShapeConditionalFormat
a} :: FilledMapShapeConditionalFormatting)
filledMapShapeConditionalFormatting_fieldId :: Lens.Lens' FilledMapShapeConditionalFormatting Prelude.Text
filledMapShapeConditionalFormatting_fieldId :: Lens' FilledMapShapeConditionalFormatting Text
filledMapShapeConditionalFormatting_fieldId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilledMapShapeConditionalFormatting' {Text
fieldId :: Text
$sel:fieldId:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Text
fieldId} -> Text
fieldId) (\s :: FilledMapShapeConditionalFormatting
s@FilledMapShapeConditionalFormatting' {} Text
a -> FilledMapShapeConditionalFormatting
s {$sel:fieldId:FilledMapShapeConditionalFormatting' :: Text
fieldId = Text
a} :: FilledMapShapeConditionalFormatting)
instance
Data.FromJSON
FilledMapShapeConditionalFormatting
where
parseJSON :: Value -> Parser FilledMapShapeConditionalFormatting
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FilledMapShapeConditionalFormatting"
( \Object
x ->
Maybe ShapeConditionalFormat
-> Text -> FilledMapShapeConditionalFormatting
FilledMapShapeConditionalFormatting'
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
"Format")
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
"FieldId")
)
instance
Prelude.Hashable
FilledMapShapeConditionalFormatting
where
hashWithSalt :: Int -> FilledMapShapeConditionalFormatting -> Int
hashWithSalt
Int
_salt
FilledMapShapeConditionalFormatting' {Maybe ShapeConditionalFormat
Text
fieldId :: Text
format :: Maybe ShapeConditionalFormat
$sel:fieldId:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Text
$sel:format:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Maybe ShapeConditionalFormat
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ShapeConditionalFormat
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fieldId
instance
Prelude.NFData
FilledMapShapeConditionalFormatting
where
rnf :: FilledMapShapeConditionalFormatting -> ()
rnf FilledMapShapeConditionalFormatting' {Maybe ShapeConditionalFormat
Text
fieldId :: Text
format :: Maybe ShapeConditionalFormat
$sel:fieldId:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Text
$sel:format:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Maybe ShapeConditionalFormat
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ShapeConditionalFormat
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fieldId
instance
Data.ToJSON
FilledMapShapeConditionalFormatting
where
toJSON :: FilledMapShapeConditionalFormatting -> Value
toJSON FilledMapShapeConditionalFormatting' {Maybe ShapeConditionalFormat
Text
fieldId :: Text
format :: Maybe ShapeConditionalFormat
$sel:fieldId:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Text
$sel:format:FilledMapShapeConditionalFormatting' :: FilledMapShapeConditionalFormatting -> Maybe ShapeConditionalFormat
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Format" 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 ShapeConditionalFormat
format,
forall a. a -> Maybe a
Prelude.Just (Key
"FieldId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fieldId)
]
)