{-# 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.Layout 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.LayoutConfiguration
data Layout = Layout'
{
Layout -> LayoutConfiguration
configuration :: LayoutConfiguration
}
deriving (Layout -> Layout -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Layout -> Layout -> Bool
$c/= :: Layout -> Layout -> Bool
== :: Layout -> Layout -> Bool
$c== :: Layout -> Layout -> Bool
Prelude.Eq, Int -> Layout -> ShowS
[Layout] -> ShowS
Layout -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Layout] -> ShowS
$cshowList :: [Layout] -> ShowS
show :: Layout -> String
$cshow :: Layout -> String
showsPrec :: Int -> Layout -> ShowS
$cshowsPrec :: Int -> Layout -> ShowS
Prelude.Show, forall x. Rep Layout x -> Layout
forall x. Layout -> Rep Layout x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Layout x -> Layout
$cfrom :: forall x. Layout -> Rep Layout x
Prelude.Generic)
newLayout ::
LayoutConfiguration ->
Layout
newLayout :: LayoutConfiguration -> Layout
newLayout LayoutConfiguration
pConfiguration_ =
Layout' {$sel:configuration:Layout' :: LayoutConfiguration
configuration = LayoutConfiguration
pConfiguration_}
layout_configuration :: Lens.Lens' Layout LayoutConfiguration
layout_configuration :: Lens' Layout LayoutConfiguration
layout_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Layout' {LayoutConfiguration
configuration :: LayoutConfiguration
$sel:configuration:Layout' :: Layout -> LayoutConfiguration
configuration} -> LayoutConfiguration
configuration) (\s :: Layout
s@Layout' {} LayoutConfiguration
a -> Layout
s {$sel:configuration:Layout' :: LayoutConfiguration
configuration = LayoutConfiguration
a} :: Layout)
instance Data.FromJSON Layout where
parseJSON :: Value -> Parser Layout
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Layout"
( \Object
x ->
LayoutConfiguration -> Layout
Layout' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Configuration")
)
instance Prelude.Hashable Layout where
hashWithSalt :: Int -> Layout -> Int
hashWithSalt Int
_salt Layout' {LayoutConfiguration
configuration :: LayoutConfiguration
$sel:configuration:Layout' :: Layout -> LayoutConfiguration
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LayoutConfiguration
configuration
instance Prelude.NFData Layout where
rnf :: Layout -> ()
rnf Layout' {LayoutConfiguration
configuration :: LayoutConfiguration
$sel:configuration:Layout' :: Layout -> LayoutConfiguration
..} = forall a. NFData a => a -> ()
Prelude.rnf LayoutConfiguration
configuration
instance Data.ToJSON Layout where
toJSON :: Layout -> Value
toJSON Layout' {LayoutConfiguration
configuration :: LayoutConfiguration
$sel:configuration:Layout' :: Layout -> LayoutConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"Configuration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LayoutConfiguration
configuration)
]
)