{-# 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.FreeFormLayoutConfiguration 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.FreeFormLayoutCanvasSizeOptions
import Amazonka.QuickSight.Types.FreeFormLayoutElement
data FreeFormLayoutConfiguration = FreeFormLayoutConfiguration'
{ FreeFormLayoutConfiguration
-> Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions :: Prelude.Maybe FreeFormLayoutCanvasSizeOptions,
FreeFormLayoutConfiguration -> [FreeFormLayoutElement]
elements :: [FreeFormLayoutElement]
}
deriving (FreeFormLayoutConfiguration -> FreeFormLayoutConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FreeFormLayoutConfiguration -> FreeFormLayoutConfiguration -> Bool
$c/= :: FreeFormLayoutConfiguration -> FreeFormLayoutConfiguration -> Bool
== :: FreeFormLayoutConfiguration -> FreeFormLayoutConfiguration -> Bool
$c== :: FreeFormLayoutConfiguration -> FreeFormLayoutConfiguration -> Bool
Prelude.Eq, Int -> FreeFormLayoutConfiguration -> ShowS
[FreeFormLayoutConfiguration] -> ShowS
FreeFormLayoutConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FreeFormLayoutConfiguration] -> ShowS
$cshowList :: [FreeFormLayoutConfiguration] -> ShowS
show :: FreeFormLayoutConfiguration -> String
$cshow :: FreeFormLayoutConfiguration -> String
showsPrec :: Int -> FreeFormLayoutConfiguration -> ShowS
$cshowsPrec :: Int -> FreeFormLayoutConfiguration -> ShowS
Prelude.Show, forall x.
Rep FreeFormLayoutConfiguration x -> FreeFormLayoutConfiguration
forall x.
FreeFormLayoutConfiguration -> Rep FreeFormLayoutConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FreeFormLayoutConfiguration x -> FreeFormLayoutConfiguration
$cfrom :: forall x.
FreeFormLayoutConfiguration -> Rep FreeFormLayoutConfiguration x
Prelude.Generic)
newFreeFormLayoutConfiguration ::
FreeFormLayoutConfiguration
newFreeFormLayoutConfiguration :: FreeFormLayoutConfiguration
newFreeFormLayoutConfiguration =
FreeFormLayoutConfiguration'
{ $sel:canvasSizeOptions:FreeFormLayoutConfiguration' :: Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions =
forall a. Maybe a
Prelude.Nothing,
$sel:elements:FreeFormLayoutConfiguration' :: [FreeFormLayoutElement]
elements = forall a. Monoid a => a
Prelude.mempty
}
freeFormLayoutConfiguration_canvasSizeOptions :: Lens.Lens' FreeFormLayoutConfiguration (Prelude.Maybe FreeFormLayoutCanvasSizeOptions)
freeFormLayoutConfiguration_canvasSizeOptions :: Lens'
FreeFormLayoutConfiguration (Maybe FreeFormLayoutCanvasSizeOptions)
freeFormLayoutConfiguration_canvasSizeOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FreeFormLayoutConfiguration' {Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions :: Maybe FreeFormLayoutCanvasSizeOptions
$sel:canvasSizeOptions:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration
-> Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions} -> Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions) (\s :: FreeFormLayoutConfiguration
s@FreeFormLayoutConfiguration' {} Maybe FreeFormLayoutCanvasSizeOptions
a -> FreeFormLayoutConfiguration
s {$sel:canvasSizeOptions:FreeFormLayoutConfiguration' :: Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions = Maybe FreeFormLayoutCanvasSizeOptions
a} :: FreeFormLayoutConfiguration)
freeFormLayoutConfiguration_elements :: Lens.Lens' FreeFormLayoutConfiguration [FreeFormLayoutElement]
freeFormLayoutConfiguration_elements :: Lens' FreeFormLayoutConfiguration [FreeFormLayoutElement]
freeFormLayoutConfiguration_elements = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FreeFormLayoutConfiguration' {[FreeFormLayoutElement]
elements :: [FreeFormLayoutElement]
$sel:elements:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration -> [FreeFormLayoutElement]
elements} -> [FreeFormLayoutElement]
elements) (\s :: FreeFormLayoutConfiguration
s@FreeFormLayoutConfiguration' {} [FreeFormLayoutElement]
a -> FreeFormLayoutConfiguration
s {$sel:elements:FreeFormLayoutConfiguration' :: [FreeFormLayoutElement]
elements = [FreeFormLayoutElement]
a} :: FreeFormLayoutConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON FreeFormLayoutConfiguration where
parseJSON :: Value -> Parser FreeFormLayoutConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FreeFormLayoutConfiguration"
( \Object
x ->
Maybe FreeFormLayoutCanvasSizeOptions
-> [FreeFormLayoutElement] -> FreeFormLayoutConfiguration
FreeFormLayoutConfiguration'
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
"CanvasSizeOptions")
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
"Elements" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable FreeFormLayoutConfiguration where
hashWithSalt :: Int -> FreeFormLayoutConfiguration -> Int
hashWithSalt Int
_salt FreeFormLayoutConfiguration' {[FreeFormLayoutElement]
Maybe FreeFormLayoutCanvasSizeOptions
elements :: [FreeFormLayoutElement]
canvasSizeOptions :: Maybe FreeFormLayoutCanvasSizeOptions
$sel:elements:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration -> [FreeFormLayoutElement]
$sel:canvasSizeOptions:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration
-> Maybe FreeFormLayoutCanvasSizeOptions
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [FreeFormLayoutElement]
elements
instance Prelude.NFData FreeFormLayoutConfiguration where
rnf :: FreeFormLayoutConfiguration -> ()
rnf FreeFormLayoutConfiguration' {[FreeFormLayoutElement]
Maybe FreeFormLayoutCanvasSizeOptions
elements :: [FreeFormLayoutElement]
canvasSizeOptions :: Maybe FreeFormLayoutCanvasSizeOptions
$sel:elements:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration -> [FreeFormLayoutElement]
$sel:canvasSizeOptions:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration
-> Maybe FreeFormLayoutCanvasSizeOptions
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FreeFormLayoutCanvasSizeOptions
canvasSizeOptions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [FreeFormLayoutElement]
elements
instance Data.ToJSON FreeFormLayoutConfiguration where
toJSON :: FreeFormLayoutConfiguration -> Value
toJSON FreeFormLayoutConfiguration' {[FreeFormLayoutElement]
Maybe FreeFormLayoutCanvasSizeOptions
elements :: [FreeFormLayoutElement]
canvasSizeOptions :: Maybe FreeFormLayoutCanvasSizeOptions
$sel:elements:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration -> [FreeFormLayoutElement]
$sel:canvasSizeOptions:FreeFormLayoutConfiguration' :: FreeFormLayoutConfiguration
-> Maybe FreeFormLayoutCanvasSizeOptions
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CanvasSizeOptions" 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 FreeFormLayoutCanvasSizeOptions
canvasSizeOptions,
forall a. a -> Maybe a
Prelude.Just (Key
"Elements" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [FreeFormLayoutElement]
elements)
]
)