{-# 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.AnonymousUserDashboardEmbeddingConfiguration
-- 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.AnonymousUserDashboardEmbeddingConfiguration where

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

-- | Information about the dashboard that you want to embed.
--
-- /See:/ 'newAnonymousUserDashboardEmbeddingConfiguration' smart constructor.
data AnonymousUserDashboardEmbeddingConfiguration = AnonymousUserDashboardEmbeddingConfiguration'
  { -- | 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.
    --
    -- The Amazon Resource Name (ARN) of this dashboard must be included in the
    -- @AuthorizedResourceArns@ parameter. Otherwise, the request will fail
    -- with @InvalidParameterValueException@.
    AnonymousUserDashboardEmbeddingConfiguration -> Text
initialDashboardId :: Prelude.Text
  }
  deriving (AnonymousUserDashboardEmbeddingConfiguration
-> AnonymousUserDashboardEmbeddingConfiguration -> Bool
(AnonymousUserDashboardEmbeddingConfiguration
 -> AnonymousUserDashboardEmbeddingConfiguration -> Bool)
-> (AnonymousUserDashboardEmbeddingConfiguration
    -> AnonymousUserDashboardEmbeddingConfiguration -> Bool)
-> Eq AnonymousUserDashboardEmbeddingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnonymousUserDashboardEmbeddingConfiguration
-> AnonymousUserDashboardEmbeddingConfiguration -> Bool
$c/= :: AnonymousUserDashboardEmbeddingConfiguration
-> AnonymousUserDashboardEmbeddingConfiguration -> Bool
== :: AnonymousUserDashboardEmbeddingConfiguration
-> AnonymousUserDashboardEmbeddingConfiguration -> Bool
$c== :: AnonymousUserDashboardEmbeddingConfiguration
-> AnonymousUserDashboardEmbeddingConfiguration -> Bool
Prelude.Eq, ReadPrec [AnonymousUserDashboardEmbeddingConfiguration]
ReadPrec AnonymousUserDashboardEmbeddingConfiguration
Int -> ReadS AnonymousUserDashboardEmbeddingConfiguration
ReadS [AnonymousUserDashboardEmbeddingConfiguration]
(Int -> ReadS AnonymousUserDashboardEmbeddingConfiguration)
-> ReadS [AnonymousUserDashboardEmbeddingConfiguration]
-> ReadPrec AnonymousUserDashboardEmbeddingConfiguration
-> ReadPrec [AnonymousUserDashboardEmbeddingConfiguration]
-> Read AnonymousUserDashboardEmbeddingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnonymousUserDashboardEmbeddingConfiguration]
$creadListPrec :: ReadPrec [AnonymousUserDashboardEmbeddingConfiguration]
readPrec :: ReadPrec AnonymousUserDashboardEmbeddingConfiguration
$creadPrec :: ReadPrec AnonymousUserDashboardEmbeddingConfiguration
readList :: ReadS [AnonymousUserDashboardEmbeddingConfiguration]
$creadList :: ReadS [AnonymousUserDashboardEmbeddingConfiguration]
readsPrec :: Int -> ReadS AnonymousUserDashboardEmbeddingConfiguration
$creadsPrec :: Int -> ReadS AnonymousUserDashboardEmbeddingConfiguration
Prelude.Read, Int -> AnonymousUserDashboardEmbeddingConfiguration -> ShowS
[AnonymousUserDashboardEmbeddingConfiguration] -> ShowS
AnonymousUserDashboardEmbeddingConfiguration -> String
(Int -> AnonymousUserDashboardEmbeddingConfiguration -> ShowS)
-> (AnonymousUserDashboardEmbeddingConfiguration -> String)
-> ([AnonymousUserDashboardEmbeddingConfiguration] -> ShowS)
-> Show AnonymousUserDashboardEmbeddingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnonymousUserDashboardEmbeddingConfiguration] -> ShowS
$cshowList :: [AnonymousUserDashboardEmbeddingConfiguration] -> ShowS
show :: AnonymousUserDashboardEmbeddingConfiguration -> String
$cshow :: AnonymousUserDashboardEmbeddingConfiguration -> String
showsPrec :: Int -> AnonymousUserDashboardEmbeddingConfiguration -> ShowS
$cshowsPrec :: Int -> AnonymousUserDashboardEmbeddingConfiguration -> ShowS
Prelude.Show, (forall x.
 AnonymousUserDashboardEmbeddingConfiguration
 -> Rep AnonymousUserDashboardEmbeddingConfiguration x)
-> (forall x.
    Rep AnonymousUserDashboardEmbeddingConfiguration x
    -> AnonymousUserDashboardEmbeddingConfiguration)
-> Generic AnonymousUserDashboardEmbeddingConfiguration
forall x.
Rep AnonymousUserDashboardEmbeddingConfiguration x
-> AnonymousUserDashboardEmbeddingConfiguration
forall x.
AnonymousUserDashboardEmbeddingConfiguration
-> Rep AnonymousUserDashboardEmbeddingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AnonymousUserDashboardEmbeddingConfiguration x
-> AnonymousUserDashboardEmbeddingConfiguration
$cfrom :: forall x.
AnonymousUserDashboardEmbeddingConfiguration
-> Rep AnonymousUserDashboardEmbeddingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AnonymousUserDashboardEmbeddingConfiguration' 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', 'anonymousUserDashboardEmbeddingConfiguration_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.
--
-- The Amazon Resource Name (ARN) of this dashboard must be included in the
-- @AuthorizedResourceArns@ parameter. Otherwise, the request will fail
-- with @InvalidParameterValueException@.
newAnonymousUserDashboardEmbeddingConfiguration ::
  -- | 'initialDashboardId'
  Prelude.Text ->
  AnonymousUserDashboardEmbeddingConfiguration
newAnonymousUserDashboardEmbeddingConfiguration :: Text -> AnonymousUserDashboardEmbeddingConfiguration
newAnonymousUserDashboardEmbeddingConfiguration
  Text
pInitialDashboardId_ =
    AnonymousUserDashboardEmbeddingConfiguration' :: Text -> AnonymousUserDashboardEmbeddingConfiguration
AnonymousUserDashboardEmbeddingConfiguration'
      { $sel:initialDashboardId:AnonymousUserDashboardEmbeddingConfiguration' :: 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.
--
-- The Amazon Resource Name (ARN) of this dashboard must be included in the
-- @AuthorizedResourceArns@ parameter. Otherwise, the request will fail
-- with @InvalidParameterValueException@.
anonymousUserDashboardEmbeddingConfiguration_initialDashboardId :: Lens.Lens' AnonymousUserDashboardEmbeddingConfiguration Prelude.Text
anonymousUserDashboardEmbeddingConfiguration_initialDashboardId :: (Text -> f Text)
-> AnonymousUserDashboardEmbeddingConfiguration
-> f AnonymousUserDashboardEmbeddingConfiguration
anonymousUserDashboardEmbeddingConfiguration_initialDashboardId = (AnonymousUserDashboardEmbeddingConfiguration -> Text)
-> (AnonymousUserDashboardEmbeddingConfiguration
    -> Text -> AnonymousUserDashboardEmbeddingConfiguration)
-> Lens
     AnonymousUserDashboardEmbeddingConfiguration
     AnonymousUserDashboardEmbeddingConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnonymousUserDashboardEmbeddingConfiguration' {Text
initialDashboardId :: Text
$sel:initialDashboardId:AnonymousUserDashboardEmbeddingConfiguration' :: AnonymousUserDashboardEmbeddingConfiguration -> Text
initialDashboardId} -> Text
initialDashboardId) (\s :: AnonymousUserDashboardEmbeddingConfiguration
s@AnonymousUserDashboardEmbeddingConfiguration' {} Text
a -> AnonymousUserDashboardEmbeddingConfiguration
s {$sel:initialDashboardId:AnonymousUserDashboardEmbeddingConfiguration' :: Text
initialDashboardId = Text
a} :: AnonymousUserDashboardEmbeddingConfiguration)

instance
  Prelude.Hashable
    AnonymousUserDashboardEmbeddingConfiguration

instance
  Prelude.NFData
    AnonymousUserDashboardEmbeddingConfiguration

instance
  Core.ToJSON
    AnonymousUserDashboardEmbeddingConfiguration
  where
  toJSON :: AnonymousUserDashboardEmbeddingConfiguration -> Value
toJSON
    AnonymousUserDashboardEmbeddingConfiguration' {Text
initialDashboardId :: Text
$sel:initialDashboardId:AnonymousUserDashboardEmbeddingConfiguration' :: AnonymousUserDashboardEmbeddingConfiguration -> 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)
            ]
        )