{-# 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.TableCellImageSizingConfiguration
-- 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.TableCellImageSizingConfiguration 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.TableCellImageScalingConfiguration

-- | The sizing options for the table image configuration.
--
-- /See:/ 'newTableCellImageSizingConfiguration' smart constructor.
data TableCellImageSizingConfiguration = TableCellImageSizingConfiguration'
  { -- | The cell scaling configuration of the sizing options for the table image
    -- configuration.
    TableCellImageSizingConfiguration
-> Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration :: Prelude.Maybe TableCellImageScalingConfiguration
  }
  deriving (TableCellImageSizingConfiguration
-> TableCellImageSizingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableCellImageSizingConfiguration
-> TableCellImageSizingConfiguration -> Bool
$c/= :: TableCellImageSizingConfiguration
-> TableCellImageSizingConfiguration -> Bool
== :: TableCellImageSizingConfiguration
-> TableCellImageSizingConfiguration -> Bool
$c== :: TableCellImageSizingConfiguration
-> TableCellImageSizingConfiguration -> Bool
Prelude.Eq, ReadPrec [TableCellImageSizingConfiguration]
ReadPrec TableCellImageSizingConfiguration
Int -> ReadS TableCellImageSizingConfiguration
ReadS [TableCellImageSizingConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableCellImageSizingConfiguration]
$creadListPrec :: ReadPrec [TableCellImageSizingConfiguration]
readPrec :: ReadPrec TableCellImageSizingConfiguration
$creadPrec :: ReadPrec TableCellImageSizingConfiguration
readList :: ReadS [TableCellImageSizingConfiguration]
$creadList :: ReadS [TableCellImageSizingConfiguration]
readsPrec :: Int -> ReadS TableCellImageSizingConfiguration
$creadsPrec :: Int -> ReadS TableCellImageSizingConfiguration
Prelude.Read, Int -> TableCellImageSizingConfiguration -> ShowS
[TableCellImageSizingConfiguration] -> ShowS
TableCellImageSizingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableCellImageSizingConfiguration] -> ShowS
$cshowList :: [TableCellImageSizingConfiguration] -> ShowS
show :: TableCellImageSizingConfiguration -> String
$cshow :: TableCellImageSizingConfiguration -> String
showsPrec :: Int -> TableCellImageSizingConfiguration -> ShowS
$cshowsPrec :: Int -> TableCellImageSizingConfiguration -> ShowS
Prelude.Show, forall x.
Rep TableCellImageSizingConfiguration x
-> TableCellImageSizingConfiguration
forall x.
TableCellImageSizingConfiguration
-> Rep TableCellImageSizingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TableCellImageSizingConfiguration x
-> TableCellImageSizingConfiguration
$cfrom :: forall x.
TableCellImageSizingConfiguration
-> Rep TableCellImageSizingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'TableCellImageSizingConfiguration' 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:
--
-- 'tableCellImageScalingConfiguration', 'tableCellImageSizingConfiguration_tableCellImageScalingConfiguration' - The cell scaling configuration of the sizing options for the table image
-- configuration.
newTableCellImageSizingConfiguration ::
  TableCellImageSizingConfiguration
newTableCellImageSizingConfiguration :: TableCellImageSizingConfiguration
newTableCellImageSizingConfiguration =
  TableCellImageSizingConfiguration'
    { $sel:tableCellImageScalingConfiguration:TableCellImageSizingConfiguration' :: Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The cell scaling configuration of the sizing options for the table image
-- configuration.
tableCellImageSizingConfiguration_tableCellImageScalingConfiguration :: Lens.Lens' TableCellImageSizingConfiguration (Prelude.Maybe TableCellImageScalingConfiguration)
tableCellImageSizingConfiguration_tableCellImageScalingConfiguration :: Lens'
  TableCellImageSizingConfiguration
  (Maybe TableCellImageScalingConfiguration)
tableCellImageSizingConfiguration_tableCellImageScalingConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableCellImageSizingConfiguration' {Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration :: Maybe TableCellImageScalingConfiguration
$sel:tableCellImageScalingConfiguration:TableCellImageSizingConfiguration' :: TableCellImageSizingConfiguration
-> Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration} -> Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration) (\s :: TableCellImageSizingConfiguration
s@TableCellImageSizingConfiguration' {} Maybe TableCellImageScalingConfiguration
a -> TableCellImageSizingConfiguration
s {$sel:tableCellImageScalingConfiguration:TableCellImageSizingConfiguration' :: Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration = Maybe TableCellImageScalingConfiguration
a} :: TableCellImageSizingConfiguration)

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

instance
  Prelude.Hashable
    TableCellImageSizingConfiguration
  where
  hashWithSalt :: Int -> TableCellImageSizingConfiguration -> Int
hashWithSalt
    Int
_salt
    TableCellImageSizingConfiguration' {Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration :: Maybe TableCellImageScalingConfiguration
$sel:tableCellImageScalingConfiguration:TableCellImageSizingConfiguration' :: TableCellImageSizingConfiguration
-> Maybe TableCellImageScalingConfiguration
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration

instance
  Prelude.NFData
    TableCellImageSizingConfiguration
  where
  rnf :: TableCellImageSizingConfiguration -> ()
rnf TableCellImageSizingConfiguration' {Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration :: Maybe TableCellImageScalingConfiguration
$sel:tableCellImageScalingConfiguration:TableCellImageSizingConfiguration' :: TableCellImageSizingConfiguration
-> Maybe TableCellImageScalingConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration

instance
  Data.ToJSON
    TableCellImageSizingConfiguration
  where
  toJSON :: TableCellImageSizingConfiguration -> Value
toJSON TableCellImageSizingConfiguration' {Maybe TableCellImageScalingConfiguration
tableCellImageScalingConfiguration :: Maybe TableCellImageScalingConfiguration
$sel:tableCellImageScalingConfiguration:TableCellImageSizingConfiguration' :: TableCellImageSizingConfiguration
-> Maybe TableCellImageScalingConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"TableCellImageScalingConfiguration" 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 TableCellImageScalingConfiguration
tableCellImageScalingConfiguration
          ]
      )