{-# 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.TableSideBorderOptions
-- 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.TableSideBorderOptions 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.TableBorderOptions

-- | The side border options for a table.
--
-- /See:/ 'newTableSideBorderOptions' smart constructor.
data TableSideBorderOptions = TableSideBorderOptions'
  { -- | The table border options of the bottom border.
    TableSideBorderOptions -> Maybe TableBorderOptions
bottom :: Prelude.Maybe TableBorderOptions,
    -- | The table border options of the inner horizontal border.
    TableSideBorderOptions -> Maybe TableBorderOptions
innerHorizontal :: Prelude.Maybe TableBorderOptions,
    -- | The table border options of the inner vertical border.
    TableSideBorderOptions -> Maybe TableBorderOptions
innerVertical :: Prelude.Maybe TableBorderOptions,
    -- | The table border options of the left border.
    TableSideBorderOptions -> Maybe TableBorderOptions
left :: Prelude.Maybe TableBorderOptions,
    -- | The table border options of the right border.
    TableSideBorderOptions -> Maybe TableBorderOptions
right :: Prelude.Maybe TableBorderOptions,
    -- | The table border options of the top border.
    TableSideBorderOptions -> Maybe TableBorderOptions
top :: Prelude.Maybe TableBorderOptions
  }
  deriving (TableSideBorderOptions -> TableSideBorderOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableSideBorderOptions -> TableSideBorderOptions -> Bool
$c/= :: TableSideBorderOptions -> TableSideBorderOptions -> Bool
== :: TableSideBorderOptions -> TableSideBorderOptions -> Bool
$c== :: TableSideBorderOptions -> TableSideBorderOptions -> Bool
Prelude.Eq, ReadPrec [TableSideBorderOptions]
ReadPrec TableSideBorderOptions
Int -> ReadS TableSideBorderOptions
ReadS [TableSideBorderOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableSideBorderOptions]
$creadListPrec :: ReadPrec [TableSideBorderOptions]
readPrec :: ReadPrec TableSideBorderOptions
$creadPrec :: ReadPrec TableSideBorderOptions
readList :: ReadS [TableSideBorderOptions]
$creadList :: ReadS [TableSideBorderOptions]
readsPrec :: Int -> ReadS TableSideBorderOptions
$creadsPrec :: Int -> ReadS TableSideBorderOptions
Prelude.Read, Int -> TableSideBorderOptions -> ShowS
[TableSideBorderOptions] -> ShowS
TableSideBorderOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableSideBorderOptions] -> ShowS
$cshowList :: [TableSideBorderOptions] -> ShowS
show :: TableSideBorderOptions -> String
$cshow :: TableSideBorderOptions -> String
showsPrec :: Int -> TableSideBorderOptions -> ShowS
$cshowsPrec :: Int -> TableSideBorderOptions -> ShowS
Prelude.Show, forall x. Rep TableSideBorderOptions x -> TableSideBorderOptions
forall x. TableSideBorderOptions -> Rep TableSideBorderOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableSideBorderOptions x -> TableSideBorderOptions
$cfrom :: forall x. TableSideBorderOptions -> Rep TableSideBorderOptions x
Prelude.Generic)

-- |
-- Create a value of 'TableSideBorderOptions' 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:
--
-- 'bottom', 'tableSideBorderOptions_bottom' - The table border options of the bottom border.
--
-- 'innerHorizontal', 'tableSideBorderOptions_innerHorizontal' - The table border options of the inner horizontal border.
--
-- 'innerVertical', 'tableSideBorderOptions_innerVertical' - The table border options of the inner vertical border.
--
-- 'left', 'tableSideBorderOptions_left' - The table border options of the left border.
--
-- 'right', 'tableSideBorderOptions_right' - The table border options of the right border.
--
-- 'top', 'tableSideBorderOptions_top' - The table border options of the top border.
newTableSideBorderOptions ::
  TableSideBorderOptions
newTableSideBorderOptions :: TableSideBorderOptions
newTableSideBorderOptions =
  TableSideBorderOptions'
    { $sel:bottom:TableSideBorderOptions' :: Maybe TableBorderOptions
bottom = forall a. Maybe a
Prelude.Nothing,
      $sel:innerHorizontal:TableSideBorderOptions' :: Maybe TableBorderOptions
innerHorizontal = forall a. Maybe a
Prelude.Nothing,
      $sel:innerVertical:TableSideBorderOptions' :: Maybe TableBorderOptions
innerVertical = forall a. Maybe a
Prelude.Nothing,
      $sel:left:TableSideBorderOptions' :: Maybe TableBorderOptions
left = forall a. Maybe a
Prelude.Nothing,
      $sel:right:TableSideBorderOptions' :: Maybe TableBorderOptions
right = forall a. Maybe a
Prelude.Nothing,
      $sel:top:TableSideBorderOptions' :: Maybe TableBorderOptions
top = forall a. Maybe a
Prelude.Nothing
    }

-- | The table border options of the bottom border.
tableSideBorderOptions_bottom :: Lens.Lens' TableSideBorderOptions (Prelude.Maybe TableBorderOptions)
tableSideBorderOptions_bottom :: Lens' TableSideBorderOptions (Maybe TableBorderOptions)
tableSideBorderOptions_bottom = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableSideBorderOptions' {Maybe TableBorderOptions
bottom :: Maybe TableBorderOptions
$sel:bottom:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
bottom} -> Maybe TableBorderOptions
bottom) (\s :: TableSideBorderOptions
s@TableSideBorderOptions' {} Maybe TableBorderOptions
a -> TableSideBorderOptions
s {$sel:bottom:TableSideBorderOptions' :: Maybe TableBorderOptions
bottom = Maybe TableBorderOptions
a} :: TableSideBorderOptions)

-- | The table border options of the inner horizontal border.
tableSideBorderOptions_innerHorizontal :: Lens.Lens' TableSideBorderOptions (Prelude.Maybe TableBorderOptions)
tableSideBorderOptions_innerHorizontal :: Lens' TableSideBorderOptions (Maybe TableBorderOptions)
tableSideBorderOptions_innerHorizontal = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableSideBorderOptions' {Maybe TableBorderOptions
innerHorizontal :: Maybe TableBorderOptions
$sel:innerHorizontal:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
innerHorizontal} -> Maybe TableBorderOptions
innerHorizontal) (\s :: TableSideBorderOptions
s@TableSideBorderOptions' {} Maybe TableBorderOptions
a -> TableSideBorderOptions
s {$sel:innerHorizontal:TableSideBorderOptions' :: Maybe TableBorderOptions
innerHorizontal = Maybe TableBorderOptions
a} :: TableSideBorderOptions)

-- | The table border options of the inner vertical border.
tableSideBorderOptions_innerVertical :: Lens.Lens' TableSideBorderOptions (Prelude.Maybe TableBorderOptions)
tableSideBorderOptions_innerVertical :: Lens' TableSideBorderOptions (Maybe TableBorderOptions)
tableSideBorderOptions_innerVertical = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableSideBorderOptions' {Maybe TableBorderOptions
innerVertical :: Maybe TableBorderOptions
$sel:innerVertical:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
innerVertical} -> Maybe TableBorderOptions
innerVertical) (\s :: TableSideBorderOptions
s@TableSideBorderOptions' {} Maybe TableBorderOptions
a -> TableSideBorderOptions
s {$sel:innerVertical:TableSideBorderOptions' :: Maybe TableBorderOptions
innerVertical = Maybe TableBorderOptions
a} :: TableSideBorderOptions)

-- | The table border options of the left border.
tableSideBorderOptions_left :: Lens.Lens' TableSideBorderOptions (Prelude.Maybe TableBorderOptions)
tableSideBorderOptions_left :: Lens' TableSideBorderOptions (Maybe TableBorderOptions)
tableSideBorderOptions_left = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableSideBorderOptions' {Maybe TableBorderOptions
left :: Maybe TableBorderOptions
$sel:left:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
left} -> Maybe TableBorderOptions
left) (\s :: TableSideBorderOptions
s@TableSideBorderOptions' {} Maybe TableBorderOptions
a -> TableSideBorderOptions
s {$sel:left:TableSideBorderOptions' :: Maybe TableBorderOptions
left = Maybe TableBorderOptions
a} :: TableSideBorderOptions)

-- | The table border options of the right border.
tableSideBorderOptions_right :: Lens.Lens' TableSideBorderOptions (Prelude.Maybe TableBorderOptions)
tableSideBorderOptions_right :: Lens' TableSideBorderOptions (Maybe TableBorderOptions)
tableSideBorderOptions_right = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableSideBorderOptions' {Maybe TableBorderOptions
right :: Maybe TableBorderOptions
$sel:right:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
right} -> Maybe TableBorderOptions
right) (\s :: TableSideBorderOptions
s@TableSideBorderOptions' {} Maybe TableBorderOptions
a -> TableSideBorderOptions
s {$sel:right:TableSideBorderOptions' :: Maybe TableBorderOptions
right = Maybe TableBorderOptions
a} :: TableSideBorderOptions)

-- | The table border options of the top border.
tableSideBorderOptions_top :: Lens.Lens' TableSideBorderOptions (Prelude.Maybe TableBorderOptions)
tableSideBorderOptions_top :: Lens' TableSideBorderOptions (Maybe TableBorderOptions)
tableSideBorderOptions_top = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableSideBorderOptions' {Maybe TableBorderOptions
top :: Maybe TableBorderOptions
$sel:top:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
top} -> Maybe TableBorderOptions
top) (\s :: TableSideBorderOptions
s@TableSideBorderOptions' {} Maybe TableBorderOptions
a -> TableSideBorderOptions
s {$sel:top:TableSideBorderOptions' :: Maybe TableBorderOptions
top = Maybe TableBorderOptions
a} :: TableSideBorderOptions)

instance Data.FromJSON TableSideBorderOptions where
  parseJSON :: Value -> Parser TableSideBorderOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TableSideBorderOptions"
      ( \Object
x ->
          Maybe TableBorderOptions
-> Maybe TableBorderOptions
-> Maybe TableBorderOptions
-> Maybe TableBorderOptions
-> Maybe TableBorderOptions
-> Maybe TableBorderOptions
-> TableSideBorderOptions
TableSideBorderOptions'
            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
"Bottom")
            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
"InnerHorizontal")
            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
"InnerVertical")
            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
"Left")
            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
"Right")
            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
"Top")
      )

instance Prelude.Hashable TableSideBorderOptions where
  hashWithSalt :: Int -> TableSideBorderOptions -> Int
hashWithSalt Int
_salt TableSideBorderOptions' {Maybe TableBorderOptions
top :: Maybe TableBorderOptions
right :: Maybe TableBorderOptions
left :: Maybe TableBorderOptions
innerVertical :: Maybe TableBorderOptions
innerHorizontal :: Maybe TableBorderOptions
bottom :: Maybe TableBorderOptions
$sel:top:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:right:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:left:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:innerVertical:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:innerHorizontal:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:bottom:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableBorderOptions
bottom
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableBorderOptions
innerHorizontal
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableBorderOptions
innerVertical
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableBorderOptions
left
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableBorderOptions
right
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TableBorderOptions
top

instance Prelude.NFData TableSideBorderOptions where
  rnf :: TableSideBorderOptions -> ()
rnf TableSideBorderOptions' {Maybe TableBorderOptions
top :: Maybe TableBorderOptions
right :: Maybe TableBorderOptions
left :: Maybe TableBorderOptions
innerVertical :: Maybe TableBorderOptions
innerHorizontal :: Maybe TableBorderOptions
bottom :: Maybe TableBorderOptions
$sel:top:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:right:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:left:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:innerVertical:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:innerHorizontal:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:bottom:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe TableBorderOptions
bottom
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableBorderOptions
innerHorizontal
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableBorderOptions
innerVertical
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableBorderOptions
left
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableBorderOptions
right
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TableBorderOptions
top

instance Data.ToJSON TableSideBorderOptions where
  toJSON :: TableSideBorderOptions -> Value
toJSON TableSideBorderOptions' {Maybe TableBorderOptions
top :: Maybe TableBorderOptions
right :: Maybe TableBorderOptions
left :: Maybe TableBorderOptions
innerVertical :: Maybe TableBorderOptions
innerHorizontal :: Maybe TableBorderOptions
bottom :: Maybe TableBorderOptions
$sel:top:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:right:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:left:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:innerVertical:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:innerHorizontal:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
$sel:bottom:TableSideBorderOptions' :: TableSideBorderOptions -> Maybe TableBorderOptions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Bottom" 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 TableBorderOptions
bottom,
            (Key
"InnerHorizontal" 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 TableBorderOptions
innerHorizontal,
            (Key
"InnerVertical" 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 TableBorderOptions
innerVertical,
            (Key
"Left" 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 TableBorderOptions
left,
            (Key
"Right" 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 TableBorderOptions
right,
            (Key
"Top" 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 TableBorderOptions
top
          ]
      )