{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.QuickSight.Types.DefaultFreeFormLayoutConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.DefaultFreeFormLayoutConfiguration 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

-- | The options that determine the default settings of a free-form layout
-- configuration.
--
-- /See:/ 'newDefaultFreeFormLayoutConfiguration' smart constructor.
data DefaultFreeFormLayoutConfiguration = DefaultFreeFormLayoutConfiguration'
  { -- | Determines the screen canvas size options for a free-form layout.
    DefaultFreeFormLayoutConfiguration
-> FreeFormLayoutCanvasSizeOptions
canvasSizeOptions :: FreeFormLayoutCanvasSizeOptions
  }
  deriving (DefaultFreeFormLayoutConfiguration
-> DefaultFreeFormLayoutConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefaultFreeFormLayoutConfiguration
-> DefaultFreeFormLayoutConfiguration -> Bool
$c/= :: DefaultFreeFormLayoutConfiguration
-> DefaultFreeFormLayoutConfiguration -> Bool
== :: DefaultFreeFormLayoutConfiguration
-> DefaultFreeFormLayoutConfiguration -> Bool
$c== :: DefaultFreeFormLayoutConfiguration
-> DefaultFreeFormLayoutConfiguration -> Bool
Prelude.Eq, ReadPrec [DefaultFreeFormLayoutConfiguration]
ReadPrec DefaultFreeFormLayoutConfiguration
Int -> ReadS DefaultFreeFormLayoutConfiguration
ReadS [DefaultFreeFormLayoutConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DefaultFreeFormLayoutConfiguration]
$creadListPrec :: ReadPrec [DefaultFreeFormLayoutConfiguration]
readPrec :: ReadPrec DefaultFreeFormLayoutConfiguration
$creadPrec :: ReadPrec DefaultFreeFormLayoutConfiguration
readList :: ReadS [DefaultFreeFormLayoutConfiguration]
$creadList :: ReadS [DefaultFreeFormLayoutConfiguration]
readsPrec :: Int -> ReadS DefaultFreeFormLayoutConfiguration
$creadsPrec :: Int -> ReadS DefaultFreeFormLayoutConfiguration
Prelude.Read, Int -> DefaultFreeFormLayoutConfiguration -> ShowS
[DefaultFreeFormLayoutConfiguration] -> ShowS
DefaultFreeFormLayoutConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DefaultFreeFormLayoutConfiguration] -> ShowS
$cshowList :: [DefaultFreeFormLayoutConfiguration] -> ShowS
show :: DefaultFreeFormLayoutConfiguration -> String
$cshow :: DefaultFreeFormLayoutConfiguration -> String
showsPrec :: Int -> DefaultFreeFormLayoutConfiguration -> ShowS
$cshowsPrec :: Int -> DefaultFreeFormLayoutConfiguration -> ShowS
Prelude.Show, forall x.
Rep DefaultFreeFormLayoutConfiguration x
-> DefaultFreeFormLayoutConfiguration
forall x.
DefaultFreeFormLayoutConfiguration
-> Rep DefaultFreeFormLayoutConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DefaultFreeFormLayoutConfiguration x
-> DefaultFreeFormLayoutConfiguration
$cfrom :: forall x.
DefaultFreeFormLayoutConfiguration
-> Rep DefaultFreeFormLayoutConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DefaultFreeFormLayoutConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'canvasSizeOptions', 'defaultFreeFormLayoutConfiguration_canvasSizeOptions' - Determines the screen canvas size options for a free-form layout.
newDefaultFreeFormLayoutConfiguration ::
  -- | 'canvasSizeOptions'
  FreeFormLayoutCanvasSizeOptions ->
  DefaultFreeFormLayoutConfiguration
newDefaultFreeFormLayoutConfiguration :: FreeFormLayoutCanvasSizeOptions
-> DefaultFreeFormLayoutConfiguration
newDefaultFreeFormLayoutConfiguration
  FreeFormLayoutCanvasSizeOptions
pCanvasSizeOptions_ =
    DefaultFreeFormLayoutConfiguration'
      { $sel:canvasSizeOptions:DefaultFreeFormLayoutConfiguration' :: FreeFormLayoutCanvasSizeOptions
canvasSizeOptions =
          FreeFormLayoutCanvasSizeOptions
pCanvasSizeOptions_
      }

-- | Determines the screen canvas size options for a free-form layout.
defaultFreeFormLayoutConfiguration_canvasSizeOptions :: Lens.Lens' DefaultFreeFormLayoutConfiguration FreeFormLayoutCanvasSizeOptions
defaultFreeFormLayoutConfiguration_canvasSizeOptions :: Lens'
  DefaultFreeFormLayoutConfiguration FreeFormLayoutCanvasSizeOptions
defaultFreeFormLayoutConfiguration_canvasSizeOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultFreeFormLayoutConfiguration' {FreeFormLayoutCanvasSizeOptions
canvasSizeOptions :: FreeFormLayoutCanvasSizeOptions
$sel:canvasSizeOptions:DefaultFreeFormLayoutConfiguration' :: DefaultFreeFormLayoutConfiguration
-> FreeFormLayoutCanvasSizeOptions
canvasSizeOptions} -> FreeFormLayoutCanvasSizeOptions
canvasSizeOptions) (\s :: DefaultFreeFormLayoutConfiguration
s@DefaultFreeFormLayoutConfiguration' {} FreeFormLayoutCanvasSizeOptions
a -> DefaultFreeFormLayoutConfiguration
s {$sel:canvasSizeOptions:DefaultFreeFormLayoutConfiguration' :: FreeFormLayoutCanvasSizeOptions
canvasSizeOptions = FreeFormLayoutCanvasSizeOptions
a} :: DefaultFreeFormLayoutConfiguration)

instance
  Data.FromJSON
    DefaultFreeFormLayoutConfiguration
  where
  parseJSON :: Value -> Parser DefaultFreeFormLayoutConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DefaultFreeFormLayoutConfiguration"
      ( \Object
x ->
          FreeFormLayoutCanvasSizeOptions
-> DefaultFreeFormLayoutConfiguration
DefaultFreeFormLayoutConfiguration'
            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
"CanvasSizeOptions")
      )

instance
  Prelude.Hashable
    DefaultFreeFormLayoutConfiguration
  where
  hashWithSalt :: Int -> DefaultFreeFormLayoutConfiguration -> Int
hashWithSalt
    Int
_salt
    DefaultFreeFormLayoutConfiguration' {FreeFormLayoutCanvasSizeOptions
canvasSizeOptions :: FreeFormLayoutCanvasSizeOptions
$sel:canvasSizeOptions:DefaultFreeFormLayoutConfiguration' :: DefaultFreeFormLayoutConfiguration
-> FreeFormLayoutCanvasSizeOptions
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FreeFormLayoutCanvasSizeOptions
canvasSizeOptions

instance
  Prelude.NFData
    DefaultFreeFormLayoutConfiguration
  where
  rnf :: DefaultFreeFormLayoutConfiguration -> ()
rnf DefaultFreeFormLayoutConfiguration' {FreeFormLayoutCanvasSizeOptions
canvasSizeOptions :: FreeFormLayoutCanvasSizeOptions
$sel:canvasSizeOptions:DefaultFreeFormLayoutConfiguration' :: DefaultFreeFormLayoutConfiguration
-> FreeFormLayoutCanvasSizeOptions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf FreeFormLayoutCanvasSizeOptions
canvasSizeOptions

instance
  Data.ToJSON
    DefaultFreeFormLayoutConfiguration
  where
  toJSON :: DefaultFreeFormLayoutConfiguration -> Value
toJSON DefaultFreeFormLayoutConfiguration' {FreeFormLayoutCanvasSizeOptions
canvasSizeOptions :: FreeFormLayoutCanvasSizeOptions
$sel:canvasSizeOptions:DefaultFreeFormLayoutConfiguration' :: DefaultFreeFormLayoutConfiguration
-> FreeFormLayoutCanvasSizeOptions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"CanvasSizeOptions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FreeFormLayoutCanvasSizeOptions
canvasSizeOptions)
          ]
      )