{-# 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.RegisteredUserDashboardEmbeddingConfiguration
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.QuickSight.Types.RegisteredUserDashboardEmbeddingConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the dashboard you want to embed.
--
-- /See:/ 'newRegisteredUserDashboardEmbeddingConfiguration' smart constructor.
data RegisteredUserDashboardEmbeddingConfiguration = RegisteredUserDashboardEmbeddingConfiguration'
  { -- | The dashboard ID for the dashboard that you want the user to see first.
    -- This ID is included in the output URL. When the URL in response is
    -- accessed, Amazon QuickSight renders this dashboard if the user has
    -- permissions to view it.
    --
    -- If the user does not have permission to view this dashboard, they see a
    -- permissions error message.
    RegisteredUserDashboardEmbeddingConfiguration -> Text
initialDashboardId :: Prelude.Text
  }
  deriving (RegisteredUserDashboardEmbeddingConfiguration
-> RegisteredUserDashboardEmbeddingConfiguration -> Bool
(RegisteredUserDashboardEmbeddingConfiguration
 -> RegisteredUserDashboardEmbeddingConfiguration -> Bool)
-> (RegisteredUserDashboardEmbeddingConfiguration
    -> RegisteredUserDashboardEmbeddingConfiguration -> Bool)
-> Eq RegisteredUserDashboardEmbeddingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisteredUserDashboardEmbeddingConfiguration
-> RegisteredUserDashboardEmbeddingConfiguration -> Bool
$c/= :: RegisteredUserDashboardEmbeddingConfiguration
-> RegisteredUserDashboardEmbeddingConfiguration -> Bool
== :: RegisteredUserDashboardEmbeddingConfiguration
-> RegisteredUserDashboardEmbeddingConfiguration -> Bool
$c== :: RegisteredUserDashboardEmbeddingConfiguration
-> RegisteredUserDashboardEmbeddingConfiguration -> Bool
Prelude.Eq, ReadPrec [RegisteredUserDashboardEmbeddingConfiguration]
ReadPrec RegisteredUserDashboardEmbeddingConfiguration
Int -> ReadS RegisteredUserDashboardEmbeddingConfiguration
ReadS [RegisteredUserDashboardEmbeddingConfiguration]
(Int -> ReadS RegisteredUserDashboardEmbeddingConfiguration)
-> ReadS [RegisteredUserDashboardEmbeddingConfiguration]
-> ReadPrec RegisteredUserDashboardEmbeddingConfiguration
-> ReadPrec [RegisteredUserDashboardEmbeddingConfiguration]
-> Read RegisteredUserDashboardEmbeddingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisteredUserDashboardEmbeddingConfiguration]
$creadListPrec :: ReadPrec [RegisteredUserDashboardEmbeddingConfiguration]
readPrec :: ReadPrec RegisteredUserDashboardEmbeddingConfiguration
$creadPrec :: ReadPrec RegisteredUserDashboardEmbeddingConfiguration
readList :: ReadS [RegisteredUserDashboardEmbeddingConfiguration]
$creadList :: ReadS [RegisteredUserDashboardEmbeddingConfiguration]
readsPrec :: Int -> ReadS RegisteredUserDashboardEmbeddingConfiguration
$creadsPrec :: Int -> ReadS RegisteredUserDashboardEmbeddingConfiguration
Prelude.Read, Int -> RegisteredUserDashboardEmbeddingConfiguration -> ShowS
[RegisteredUserDashboardEmbeddingConfiguration] -> ShowS
RegisteredUserDashboardEmbeddingConfiguration -> String
(Int -> RegisteredUserDashboardEmbeddingConfiguration -> ShowS)
-> (RegisteredUserDashboardEmbeddingConfiguration -> String)
-> ([RegisteredUserDashboardEmbeddingConfiguration] -> ShowS)
-> Show RegisteredUserDashboardEmbeddingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisteredUserDashboardEmbeddingConfiguration] -> ShowS
$cshowList :: [RegisteredUserDashboardEmbeddingConfiguration] -> ShowS
show :: RegisteredUserDashboardEmbeddingConfiguration -> String
$cshow :: RegisteredUserDashboardEmbeddingConfiguration -> String
showsPrec :: Int -> RegisteredUserDashboardEmbeddingConfiguration -> ShowS
$cshowsPrec :: Int -> RegisteredUserDashboardEmbeddingConfiguration -> ShowS
Prelude.Show, (forall x.
 RegisteredUserDashboardEmbeddingConfiguration
 -> Rep RegisteredUserDashboardEmbeddingConfiguration x)
-> (forall x.
    Rep RegisteredUserDashboardEmbeddingConfiguration x
    -> RegisteredUserDashboardEmbeddingConfiguration)
-> Generic RegisteredUserDashboardEmbeddingConfiguration
forall x.
Rep RegisteredUserDashboardEmbeddingConfiguration x
-> RegisteredUserDashboardEmbeddingConfiguration
forall x.
RegisteredUserDashboardEmbeddingConfiguration
-> Rep RegisteredUserDashboardEmbeddingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisteredUserDashboardEmbeddingConfiguration x
-> RegisteredUserDashboardEmbeddingConfiguration
$cfrom :: forall x.
RegisteredUserDashboardEmbeddingConfiguration
-> Rep RegisteredUserDashboardEmbeddingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'RegisteredUserDashboardEmbeddingConfiguration' 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:
--
-- 'initialDashboardId', 'registeredUserDashboardEmbeddingConfiguration_initialDashboardId' - The dashboard ID for the dashboard that you want the user to see first.
-- This ID is included in the output URL. When the URL in response is
-- accessed, Amazon QuickSight renders this dashboard if the user has
-- permissions to view it.
--
-- If the user does not have permission to view this dashboard, they see a
-- permissions error message.
newRegisteredUserDashboardEmbeddingConfiguration ::
  -- | 'initialDashboardId'
  Prelude.Text ->
  RegisteredUserDashboardEmbeddingConfiguration
newRegisteredUserDashboardEmbeddingConfiguration :: Text -> RegisteredUserDashboardEmbeddingConfiguration
newRegisteredUserDashboardEmbeddingConfiguration
  Text
pInitialDashboardId_ =
    RegisteredUserDashboardEmbeddingConfiguration' :: Text -> RegisteredUserDashboardEmbeddingConfiguration
RegisteredUserDashboardEmbeddingConfiguration'
      { $sel:initialDashboardId:RegisteredUserDashboardEmbeddingConfiguration' :: Text
initialDashboardId =
          Text
pInitialDashboardId_
      }

-- | The dashboard ID for the dashboard that you want the user to see first.
-- This ID is included in the output URL. When the URL in response is
-- accessed, Amazon QuickSight renders this dashboard if the user has
-- permissions to view it.
--
-- If the user does not have permission to view this dashboard, they see a
-- permissions error message.
registeredUserDashboardEmbeddingConfiguration_initialDashboardId :: Lens.Lens' RegisteredUserDashboardEmbeddingConfiguration Prelude.Text
registeredUserDashboardEmbeddingConfiguration_initialDashboardId :: (Text -> f Text)
-> RegisteredUserDashboardEmbeddingConfiguration
-> f RegisteredUserDashboardEmbeddingConfiguration
registeredUserDashboardEmbeddingConfiguration_initialDashboardId = (RegisteredUserDashboardEmbeddingConfiguration -> Text)
-> (RegisteredUserDashboardEmbeddingConfiguration
    -> Text -> RegisteredUserDashboardEmbeddingConfiguration)
-> Lens
     RegisteredUserDashboardEmbeddingConfiguration
     RegisteredUserDashboardEmbeddingConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisteredUserDashboardEmbeddingConfiguration' {Text
initialDashboardId :: Text
$sel:initialDashboardId:RegisteredUserDashboardEmbeddingConfiguration' :: RegisteredUserDashboardEmbeddingConfiguration -> Text
initialDashboardId} -> Text
initialDashboardId) (\s :: RegisteredUserDashboardEmbeddingConfiguration
s@RegisteredUserDashboardEmbeddingConfiguration' {} Text
a -> RegisteredUserDashboardEmbeddingConfiguration
s {$sel:initialDashboardId:RegisteredUserDashboardEmbeddingConfiguration' :: Text
initialDashboardId = Text
a} :: RegisteredUserDashboardEmbeddingConfiguration)

instance
  Prelude.Hashable
    RegisteredUserDashboardEmbeddingConfiguration

instance
  Prelude.NFData
    RegisteredUserDashboardEmbeddingConfiguration

instance
  Core.ToJSON
    RegisteredUserDashboardEmbeddingConfiguration
  where
  toJSON :: RegisteredUserDashboardEmbeddingConfiguration -> Value
toJSON
    RegisteredUserDashboardEmbeddingConfiguration' {Text
initialDashboardId :: Text
$sel:initialDashboardId:RegisteredUserDashboardEmbeddingConfiguration' :: RegisteredUserDashboardEmbeddingConfiguration -> Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                (Text
"InitialDashboardId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
initialDashboardId)
            ]
        )