{-# 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.SheetDefinition
-- 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.SheetDefinition 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.FilterControl
import Amazonka.QuickSight.Types.Layout
import Amazonka.QuickSight.Types.ParameterControl
import Amazonka.QuickSight.Types.SheetContentType
import Amazonka.QuickSight.Types.SheetControlLayout
import Amazonka.QuickSight.Types.SheetTextBox
import Amazonka.QuickSight.Types.Visual

-- | A sheet is an object that contains a set of visuals that are viewed
-- together on one page in a paginated report. Every analysis and dashboard
-- must contain at least one sheet.
--
-- /See:/ 'newSheetDefinition' smart constructor.
data SheetDefinition = SheetDefinition'
  { -- | The layout content type of the sheet. Choose one of the following
    -- options:
    --
    -- -   @PAGINATED@: Creates a sheet for a paginated report.
    --
    -- -   @INTERACTIVE@: Creates a sheet for an interactive dashboard.
    SheetDefinition -> Maybe SheetContentType
contentType :: Prelude.Maybe SheetContentType,
    -- | A description of the sheet.
    SheetDefinition -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The list of filter controls that are on a sheet.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/quicksight/latest/user/filter-controls.html Adding filter controls to analysis sheets>
    -- in the /Amazon QuickSight User Guide/.
    SheetDefinition -> Maybe [FilterControl]
filterControls :: Prelude.Maybe [FilterControl],
    -- | Layouts define how the components of a sheet are arranged.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/quicksight/latest/user/types-of-layout.html Types of layout>
    -- in the /Amazon QuickSight User Guide/.
    SheetDefinition -> Maybe (NonEmpty Layout)
layouts :: Prelude.Maybe (Prelude.NonEmpty Layout),
    -- | The name of the sheet. This name is displayed on the sheet\'s tab in the
    -- Amazon QuickSight console.
    SheetDefinition -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The list of parameter controls that are on a sheet.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/quicksight/latest/user/parameters-controls.html Using a Control with a Parameter in Amazon QuickSight>
    -- in the /Amazon QuickSight User Guide/.
    SheetDefinition -> Maybe [ParameterControl]
parameterControls :: Prelude.Maybe [ParameterControl],
    -- | The control layouts of the sheet.
    SheetDefinition -> Maybe [SheetControlLayout]
sheetControlLayouts :: Prelude.Maybe [SheetControlLayout],
    -- | The text boxes that are on a sheet.
    SheetDefinition -> Maybe [SheetTextBox]
textBoxes :: Prelude.Maybe [SheetTextBox],
    -- | The title of the sheet.
    SheetDefinition -> Maybe Text
title :: Prelude.Maybe Prelude.Text,
    -- | A list of the visuals that are on a sheet. Visual placement is
    -- determined by the layout of the sheet.
    SheetDefinition -> Maybe [Visual]
visuals :: Prelude.Maybe [Visual],
    -- | The unique identifier of a sheet.
    SheetDefinition -> Text
sheetId :: Prelude.Text
  }
  deriving (SheetDefinition -> SheetDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SheetDefinition -> SheetDefinition -> Bool
$c/= :: SheetDefinition -> SheetDefinition -> Bool
== :: SheetDefinition -> SheetDefinition -> Bool
$c== :: SheetDefinition -> SheetDefinition -> Bool
Prelude.Eq, Int -> SheetDefinition -> ShowS
[SheetDefinition] -> ShowS
SheetDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SheetDefinition] -> ShowS
$cshowList :: [SheetDefinition] -> ShowS
show :: SheetDefinition -> String
$cshow :: SheetDefinition -> String
showsPrec :: Int -> SheetDefinition -> ShowS
$cshowsPrec :: Int -> SheetDefinition -> ShowS
Prelude.Show, forall x. Rep SheetDefinition x -> SheetDefinition
forall x. SheetDefinition -> Rep SheetDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SheetDefinition x -> SheetDefinition
$cfrom :: forall x. SheetDefinition -> Rep SheetDefinition x
Prelude.Generic)

-- |
-- Create a value of 'SheetDefinition' 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:
--
-- 'contentType', 'sheetDefinition_contentType' - The layout content type of the sheet. Choose one of the following
-- options:
--
-- -   @PAGINATED@: Creates a sheet for a paginated report.
--
-- -   @INTERACTIVE@: Creates a sheet for an interactive dashboard.
--
-- 'description', 'sheetDefinition_description' - A description of the sheet.
--
-- 'filterControls', 'sheetDefinition_filterControls' - The list of filter controls that are on a sheet.
--
-- For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/filter-controls.html Adding filter controls to analysis sheets>
-- in the /Amazon QuickSight User Guide/.
--
-- 'layouts', 'sheetDefinition_layouts' - Layouts define how the components of a sheet are arranged.
--
-- For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/types-of-layout.html Types of layout>
-- in the /Amazon QuickSight User Guide/.
--
-- 'name', 'sheetDefinition_name' - The name of the sheet. This name is displayed on the sheet\'s tab in the
-- Amazon QuickSight console.
--
-- 'parameterControls', 'sheetDefinition_parameterControls' - The list of parameter controls that are on a sheet.
--
-- For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/parameters-controls.html Using a Control with a Parameter in Amazon QuickSight>
-- in the /Amazon QuickSight User Guide/.
--
-- 'sheetControlLayouts', 'sheetDefinition_sheetControlLayouts' - The control layouts of the sheet.
--
-- 'textBoxes', 'sheetDefinition_textBoxes' - The text boxes that are on a sheet.
--
-- 'title', 'sheetDefinition_title' - The title of the sheet.
--
-- 'visuals', 'sheetDefinition_visuals' - A list of the visuals that are on a sheet. Visual placement is
-- determined by the layout of the sheet.
--
-- 'sheetId', 'sheetDefinition_sheetId' - The unique identifier of a sheet.
newSheetDefinition ::
  -- | 'sheetId'
  Prelude.Text ->
  SheetDefinition
newSheetDefinition :: Text -> SheetDefinition
newSheetDefinition Text
pSheetId_ =
  SheetDefinition'
    { $sel:contentType:SheetDefinition' :: Maybe SheetContentType
contentType = forall a. Maybe a
Prelude.Nothing,
      $sel:description:SheetDefinition' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:filterControls:SheetDefinition' :: Maybe [FilterControl]
filterControls = forall a. Maybe a
Prelude.Nothing,
      $sel:layouts:SheetDefinition' :: Maybe (NonEmpty Layout)
layouts = forall a. Maybe a
Prelude.Nothing,
      $sel:name:SheetDefinition' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterControls:SheetDefinition' :: Maybe [ParameterControl]
parameterControls = forall a. Maybe a
Prelude.Nothing,
      $sel:sheetControlLayouts:SheetDefinition' :: Maybe [SheetControlLayout]
sheetControlLayouts = forall a. Maybe a
Prelude.Nothing,
      $sel:textBoxes:SheetDefinition' :: Maybe [SheetTextBox]
textBoxes = forall a. Maybe a
Prelude.Nothing,
      $sel:title:SheetDefinition' :: Maybe Text
title = forall a. Maybe a
Prelude.Nothing,
      $sel:visuals:SheetDefinition' :: Maybe [Visual]
visuals = forall a. Maybe a
Prelude.Nothing,
      $sel:sheetId:SheetDefinition' :: Text
sheetId = Text
pSheetId_
    }

-- | The layout content type of the sheet. Choose one of the following
-- options:
--
-- -   @PAGINATED@: Creates a sheet for a paginated report.
--
-- -   @INTERACTIVE@: Creates a sheet for an interactive dashboard.
sheetDefinition_contentType :: Lens.Lens' SheetDefinition (Prelude.Maybe SheetContentType)
sheetDefinition_contentType :: Lens' SheetDefinition (Maybe SheetContentType)
sheetDefinition_contentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe SheetContentType
contentType :: Maybe SheetContentType
$sel:contentType:SheetDefinition' :: SheetDefinition -> Maybe SheetContentType
contentType} -> Maybe SheetContentType
contentType) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe SheetContentType
a -> SheetDefinition
s {$sel:contentType:SheetDefinition' :: Maybe SheetContentType
contentType = Maybe SheetContentType
a} :: SheetDefinition)

-- | A description of the sheet.
sheetDefinition_description :: Lens.Lens' SheetDefinition (Prelude.Maybe Prelude.Text)
sheetDefinition_description :: Lens' SheetDefinition (Maybe Text)
sheetDefinition_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe Text
description :: Maybe Text
$sel:description:SheetDefinition' :: SheetDefinition -> Maybe Text
description} -> Maybe Text
description) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe Text
a -> SheetDefinition
s {$sel:description:SheetDefinition' :: Maybe Text
description = Maybe Text
a} :: SheetDefinition)

-- | The list of filter controls that are on a sheet.
--
-- For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/filter-controls.html Adding filter controls to analysis sheets>
-- in the /Amazon QuickSight User Guide/.
sheetDefinition_filterControls :: Lens.Lens' SheetDefinition (Prelude.Maybe [FilterControl])
sheetDefinition_filterControls :: Lens' SheetDefinition (Maybe [FilterControl])
sheetDefinition_filterControls = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe [FilterControl]
filterControls :: Maybe [FilterControl]
$sel:filterControls:SheetDefinition' :: SheetDefinition -> Maybe [FilterControl]
filterControls} -> Maybe [FilterControl]
filterControls) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe [FilterControl]
a -> SheetDefinition
s {$sel:filterControls:SheetDefinition' :: Maybe [FilterControl]
filterControls = Maybe [FilterControl]
a} :: SheetDefinition) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Layouts define how the components of a sheet are arranged.
--
-- For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/types-of-layout.html Types of layout>
-- in the /Amazon QuickSight User Guide/.
sheetDefinition_layouts :: Lens.Lens' SheetDefinition (Prelude.Maybe (Prelude.NonEmpty Layout))
sheetDefinition_layouts :: Lens' SheetDefinition (Maybe (NonEmpty Layout))
sheetDefinition_layouts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe (NonEmpty Layout)
layouts :: Maybe (NonEmpty Layout)
$sel:layouts:SheetDefinition' :: SheetDefinition -> Maybe (NonEmpty Layout)
layouts} -> Maybe (NonEmpty Layout)
layouts) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe (NonEmpty Layout)
a -> SheetDefinition
s {$sel:layouts:SheetDefinition' :: Maybe (NonEmpty Layout)
layouts = Maybe (NonEmpty Layout)
a} :: SheetDefinition) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the sheet. This name is displayed on the sheet\'s tab in the
-- Amazon QuickSight console.
sheetDefinition_name :: Lens.Lens' SheetDefinition (Prelude.Maybe Prelude.Text)
sheetDefinition_name :: Lens' SheetDefinition (Maybe Text)
sheetDefinition_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe Text
name :: Maybe Text
$sel:name:SheetDefinition' :: SheetDefinition -> Maybe Text
name} -> Maybe Text
name) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe Text
a -> SheetDefinition
s {$sel:name:SheetDefinition' :: Maybe Text
name = Maybe Text
a} :: SheetDefinition)

-- | The list of parameter controls that are on a sheet.
--
-- For more information, see
-- <https://docs.aws.amazon.com/quicksight/latest/user/parameters-controls.html Using a Control with a Parameter in Amazon QuickSight>
-- in the /Amazon QuickSight User Guide/.
sheetDefinition_parameterControls :: Lens.Lens' SheetDefinition (Prelude.Maybe [ParameterControl])
sheetDefinition_parameterControls :: Lens' SheetDefinition (Maybe [ParameterControl])
sheetDefinition_parameterControls = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe [ParameterControl]
parameterControls :: Maybe [ParameterControl]
$sel:parameterControls:SheetDefinition' :: SheetDefinition -> Maybe [ParameterControl]
parameterControls} -> Maybe [ParameterControl]
parameterControls) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe [ParameterControl]
a -> SheetDefinition
s {$sel:parameterControls:SheetDefinition' :: Maybe [ParameterControl]
parameterControls = Maybe [ParameterControl]
a} :: SheetDefinition) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The control layouts of the sheet.
sheetDefinition_sheetControlLayouts :: Lens.Lens' SheetDefinition (Prelude.Maybe [SheetControlLayout])
sheetDefinition_sheetControlLayouts :: Lens' SheetDefinition (Maybe [SheetControlLayout])
sheetDefinition_sheetControlLayouts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe [SheetControlLayout]
sheetControlLayouts :: Maybe [SheetControlLayout]
$sel:sheetControlLayouts:SheetDefinition' :: SheetDefinition -> Maybe [SheetControlLayout]
sheetControlLayouts} -> Maybe [SheetControlLayout]
sheetControlLayouts) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe [SheetControlLayout]
a -> SheetDefinition
s {$sel:sheetControlLayouts:SheetDefinition' :: Maybe [SheetControlLayout]
sheetControlLayouts = Maybe [SheetControlLayout]
a} :: SheetDefinition) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The text boxes that are on a sheet.
sheetDefinition_textBoxes :: Lens.Lens' SheetDefinition (Prelude.Maybe [SheetTextBox])
sheetDefinition_textBoxes :: Lens' SheetDefinition (Maybe [SheetTextBox])
sheetDefinition_textBoxes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe [SheetTextBox]
textBoxes :: Maybe [SheetTextBox]
$sel:textBoxes:SheetDefinition' :: SheetDefinition -> Maybe [SheetTextBox]
textBoxes} -> Maybe [SheetTextBox]
textBoxes) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe [SheetTextBox]
a -> SheetDefinition
s {$sel:textBoxes:SheetDefinition' :: Maybe [SheetTextBox]
textBoxes = Maybe [SheetTextBox]
a} :: SheetDefinition) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The title of the sheet.
sheetDefinition_title :: Lens.Lens' SheetDefinition (Prelude.Maybe Prelude.Text)
sheetDefinition_title :: Lens' SheetDefinition (Maybe Text)
sheetDefinition_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe Text
title :: Maybe Text
$sel:title:SheetDefinition' :: SheetDefinition -> Maybe Text
title} -> Maybe Text
title) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe Text
a -> SheetDefinition
s {$sel:title:SheetDefinition' :: Maybe Text
title = Maybe Text
a} :: SheetDefinition)

-- | A list of the visuals that are on a sheet. Visual placement is
-- determined by the layout of the sheet.
sheetDefinition_visuals :: Lens.Lens' SheetDefinition (Prelude.Maybe [Visual])
sheetDefinition_visuals :: Lens' SheetDefinition (Maybe [Visual])
sheetDefinition_visuals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Maybe [Visual]
visuals :: Maybe [Visual]
$sel:visuals:SheetDefinition' :: SheetDefinition -> Maybe [Visual]
visuals} -> Maybe [Visual]
visuals) (\s :: SheetDefinition
s@SheetDefinition' {} Maybe [Visual]
a -> SheetDefinition
s {$sel:visuals:SheetDefinition' :: Maybe [Visual]
visuals = Maybe [Visual]
a} :: SheetDefinition) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier of a sheet.
sheetDefinition_sheetId :: Lens.Lens' SheetDefinition Prelude.Text
sheetDefinition_sheetId :: Lens' SheetDefinition Text
sheetDefinition_sheetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SheetDefinition' {Text
sheetId :: Text
$sel:sheetId:SheetDefinition' :: SheetDefinition -> Text
sheetId} -> Text
sheetId) (\s :: SheetDefinition
s@SheetDefinition' {} Text
a -> SheetDefinition
s {$sel:sheetId:SheetDefinition' :: Text
sheetId = Text
a} :: SheetDefinition)

instance Data.FromJSON SheetDefinition where
  parseJSON :: Value -> Parser SheetDefinition
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SheetDefinition"
      ( \Object
x ->
          Maybe SheetContentType
-> Maybe Text
-> Maybe [FilterControl]
-> Maybe (NonEmpty Layout)
-> Maybe Text
-> Maybe [ParameterControl]
-> Maybe [SheetControlLayout]
-> Maybe [SheetTextBox]
-> Maybe Text
-> Maybe [Visual]
-> Text
-> SheetDefinition
SheetDefinition'
            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
"ContentType")
            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
"Description")
            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
"FilterControls" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"Layouts")
            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
"Name")
            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
"ParameterControls"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"SheetControlLayouts"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"TextBoxes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"Title")
            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
"Visuals" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SheetId")
      )

instance Prelude.Hashable SheetDefinition where
  hashWithSalt :: Int -> SheetDefinition -> Int
hashWithSalt Int
_salt SheetDefinition' {Maybe [SheetControlLayout]
Maybe [SheetTextBox]
Maybe [ParameterControl]
Maybe [FilterControl]
Maybe [Visual]
Maybe (NonEmpty Layout)
Maybe Text
Maybe SheetContentType
Text
sheetId :: Text
visuals :: Maybe [Visual]
title :: Maybe Text
textBoxes :: Maybe [SheetTextBox]
sheetControlLayouts :: Maybe [SheetControlLayout]
parameterControls :: Maybe [ParameterControl]
name :: Maybe Text
layouts :: Maybe (NonEmpty Layout)
filterControls :: Maybe [FilterControl]
description :: Maybe Text
contentType :: Maybe SheetContentType
$sel:sheetId:SheetDefinition' :: SheetDefinition -> Text
$sel:visuals:SheetDefinition' :: SheetDefinition -> Maybe [Visual]
$sel:title:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:textBoxes:SheetDefinition' :: SheetDefinition -> Maybe [SheetTextBox]
$sel:sheetControlLayouts:SheetDefinition' :: SheetDefinition -> Maybe [SheetControlLayout]
$sel:parameterControls:SheetDefinition' :: SheetDefinition -> Maybe [ParameterControl]
$sel:name:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:layouts:SheetDefinition' :: SheetDefinition -> Maybe (NonEmpty Layout)
$sel:filterControls:SheetDefinition' :: SheetDefinition -> Maybe [FilterControl]
$sel:description:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:contentType:SheetDefinition' :: SheetDefinition -> Maybe SheetContentType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SheetContentType
contentType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [FilterControl]
filterControls
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Layout)
layouts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ParameterControl]
parameterControls
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SheetControlLayout]
sheetControlLayouts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SheetTextBox]
textBoxes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
title
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Visual]
visuals
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sheetId

instance Prelude.NFData SheetDefinition where
  rnf :: SheetDefinition -> ()
rnf SheetDefinition' {Maybe [SheetControlLayout]
Maybe [SheetTextBox]
Maybe [ParameterControl]
Maybe [FilterControl]
Maybe [Visual]
Maybe (NonEmpty Layout)
Maybe Text
Maybe SheetContentType
Text
sheetId :: Text
visuals :: Maybe [Visual]
title :: Maybe Text
textBoxes :: Maybe [SheetTextBox]
sheetControlLayouts :: Maybe [SheetControlLayout]
parameterControls :: Maybe [ParameterControl]
name :: Maybe Text
layouts :: Maybe (NonEmpty Layout)
filterControls :: Maybe [FilterControl]
description :: Maybe Text
contentType :: Maybe SheetContentType
$sel:sheetId:SheetDefinition' :: SheetDefinition -> Text
$sel:visuals:SheetDefinition' :: SheetDefinition -> Maybe [Visual]
$sel:title:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:textBoxes:SheetDefinition' :: SheetDefinition -> Maybe [SheetTextBox]
$sel:sheetControlLayouts:SheetDefinition' :: SheetDefinition -> Maybe [SheetControlLayout]
$sel:parameterControls:SheetDefinition' :: SheetDefinition -> Maybe [ParameterControl]
$sel:name:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:layouts:SheetDefinition' :: SheetDefinition -> Maybe (NonEmpty Layout)
$sel:filterControls:SheetDefinition' :: SheetDefinition -> Maybe [FilterControl]
$sel:description:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:contentType:SheetDefinition' :: SheetDefinition -> Maybe SheetContentType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SheetContentType
contentType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [FilterControl]
filterControls
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Layout)
layouts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ParameterControl]
parameterControls
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SheetControlLayout]
sheetControlLayouts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SheetTextBox]
textBoxes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
title
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Visual]
visuals
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sheetId

instance Data.ToJSON SheetDefinition where
  toJSON :: SheetDefinition -> Value
toJSON SheetDefinition' {Maybe [SheetControlLayout]
Maybe [SheetTextBox]
Maybe [ParameterControl]
Maybe [FilterControl]
Maybe [Visual]
Maybe (NonEmpty Layout)
Maybe Text
Maybe SheetContentType
Text
sheetId :: Text
visuals :: Maybe [Visual]
title :: Maybe Text
textBoxes :: Maybe [SheetTextBox]
sheetControlLayouts :: Maybe [SheetControlLayout]
parameterControls :: Maybe [ParameterControl]
name :: Maybe Text
layouts :: Maybe (NonEmpty Layout)
filterControls :: Maybe [FilterControl]
description :: Maybe Text
contentType :: Maybe SheetContentType
$sel:sheetId:SheetDefinition' :: SheetDefinition -> Text
$sel:visuals:SheetDefinition' :: SheetDefinition -> Maybe [Visual]
$sel:title:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:textBoxes:SheetDefinition' :: SheetDefinition -> Maybe [SheetTextBox]
$sel:sheetControlLayouts:SheetDefinition' :: SheetDefinition -> Maybe [SheetControlLayout]
$sel:parameterControls:SheetDefinition' :: SheetDefinition -> Maybe [ParameterControl]
$sel:name:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:layouts:SheetDefinition' :: SheetDefinition -> Maybe (NonEmpty Layout)
$sel:filterControls:SheetDefinition' :: SheetDefinition -> Maybe [FilterControl]
$sel:description:SheetDefinition' :: SheetDefinition -> Maybe Text
$sel:contentType:SheetDefinition' :: SheetDefinition -> Maybe SheetContentType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ContentType" 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 SheetContentType
contentType,
            (Key
"Description" 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 Text
description,
            (Key
"FilterControls" 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 [FilterControl]
filterControls,
            (Key
"Layouts" 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 (NonEmpty Layout)
layouts,
            (Key
"Name" 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 Text
name,
            (Key
"ParameterControls" 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 [ParameterControl]
parameterControls,
            (Key
"SheetControlLayouts" 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 [SheetControlLayout]
sheetControlLayouts,
            (Key
"TextBoxes" 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 [SheetTextBox]
textBoxes,
            (Key
"Title" 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 Text
title,
            (Key
"Visuals" 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 [Visual]
visuals,
            forall a. a -> Maybe a
Prelude.Just (Key
"SheetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sheetId)
          ]
      )