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

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

-- | Information about the Q search bar embedding experience.
--
-- /See:/ 'newRegisteredUserQSearchBarEmbeddingConfiguration' smart constructor.
data RegisteredUserQSearchBarEmbeddingConfiguration = RegisteredUserQSearchBarEmbeddingConfiguration'
  { -- | The ID of the Q topic that you want to make the starting topic in the Q
    -- search bar. You can find a topic ID by navigating to the Topics pane in
    -- the Amazon QuickSight application and opening a topic. The ID is in the
    -- URL for the topic that you open.
    --
    -- If you don\'t specify an initial topic, a list of all shared topics is
    -- shown in the Q bar for your readers. When you select an initial topic,
    -- you can specify whether or not readers are allowed to select other
    -- topics from the available ones in the list.
    RegisteredUserQSearchBarEmbeddingConfiguration -> Maybe Text
initialTopicId :: Prelude.Maybe Prelude.Text
  }
  deriving (RegisteredUserQSearchBarEmbeddingConfiguration
-> RegisteredUserQSearchBarEmbeddingConfiguration -> Bool
(RegisteredUserQSearchBarEmbeddingConfiguration
 -> RegisteredUserQSearchBarEmbeddingConfiguration -> Bool)
-> (RegisteredUserQSearchBarEmbeddingConfiguration
    -> RegisteredUserQSearchBarEmbeddingConfiguration -> Bool)
-> Eq RegisteredUserQSearchBarEmbeddingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisteredUserQSearchBarEmbeddingConfiguration
-> RegisteredUserQSearchBarEmbeddingConfiguration -> Bool
$c/= :: RegisteredUserQSearchBarEmbeddingConfiguration
-> RegisteredUserQSearchBarEmbeddingConfiguration -> Bool
== :: RegisteredUserQSearchBarEmbeddingConfiguration
-> RegisteredUserQSearchBarEmbeddingConfiguration -> Bool
$c== :: RegisteredUserQSearchBarEmbeddingConfiguration
-> RegisteredUserQSearchBarEmbeddingConfiguration -> Bool
Prelude.Eq, ReadPrec [RegisteredUserQSearchBarEmbeddingConfiguration]
ReadPrec RegisteredUserQSearchBarEmbeddingConfiguration
Int -> ReadS RegisteredUserQSearchBarEmbeddingConfiguration
ReadS [RegisteredUserQSearchBarEmbeddingConfiguration]
(Int -> ReadS RegisteredUserQSearchBarEmbeddingConfiguration)
-> ReadS [RegisteredUserQSearchBarEmbeddingConfiguration]
-> ReadPrec RegisteredUserQSearchBarEmbeddingConfiguration
-> ReadPrec [RegisteredUserQSearchBarEmbeddingConfiguration]
-> Read RegisteredUserQSearchBarEmbeddingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisteredUserQSearchBarEmbeddingConfiguration]
$creadListPrec :: ReadPrec [RegisteredUserQSearchBarEmbeddingConfiguration]
readPrec :: ReadPrec RegisteredUserQSearchBarEmbeddingConfiguration
$creadPrec :: ReadPrec RegisteredUserQSearchBarEmbeddingConfiguration
readList :: ReadS [RegisteredUserQSearchBarEmbeddingConfiguration]
$creadList :: ReadS [RegisteredUserQSearchBarEmbeddingConfiguration]
readsPrec :: Int -> ReadS RegisteredUserQSearchBarEmbeddingConfiguration
$creadsPrec :: Int -> ReadS RegisteredUserQSearchBarEmbeddingConfiguration
Prelude.Read, Int -> RegisteredUserQSearchBarEmbeddingConfiguration -> ShowS
[RegisteredUserQSearchBarEmbeddingConfiguration] -> ShowS
RegisteredUserQSearchBarEmbeddingConfiguration -> String
(Int -> RegisteredUserQSearchBarEmbeddingConfiguration -> ShowS)
-> (RegisteredUserQSearchBarEmbeddingConfiguration -> String)
-> ([RegisteredUserQSearchBarEmbeddingConfiguration] -> ShowS)
-> Show RegisteredUserQSearchBarEmbeddingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisteredUserQSearchBarEmbeddingConfiguration] -> ShowS
$cshowList :: [RegisteredUserQSearchBarEmbeddingConfiguration] -> ShowS
show :: RegisteredUserQSearchBarEmbeddingConfiguration -> String
$cshow :: RegisteredUserQSearchBarEmbeddingConfiguration -> String
showsPrec :: Int -> RegisteredUserQSearchBarEmbeddingConfiguration -> ShowS
$cshowsPrec :: Int -> RegisteredUserQSearchBarEmbeddingConfiguration -> ShowS
Prelude.Show, (forall x.
 RegisteredUserQSearchBarEmbeddingConfiguration
 -> Rep RegisteredUserQSearchBarEmbeddingConfiguration x)
-> (forall x.
    Rep RegisteredUserQSearchBarEmbeddingConfiguration x
    -> RegisteredUserQSearchBarEmbeddingConfiguration)
-> Generic RegisteredUserQSearchBarEmbeddingConfiguration
forall x.
Rep RegisteredUserQSearchBarEmbeddingConfiguration x
-> RegisteredUserQSearchBarEmbeddingConfiguration
forall x.
RegisteredUserQSearchBarEmbeddingConfiguration
-> Rep RegisteredUserQSearchBarEmbeddingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisteredUserQSearchBarEmbeddingConfiguration x
-> RegisteredUserQSearchBarEmbeddingConfiguration
$cfrom :: forall x.
RegisteredUserQSearchBarEmbeddingConfiguration
-> Rep RegisteredUserQSearchBarEmbeddingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'RegisteredUserQSearchBarEmbeddingConfiguration' 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:
--
-- 'initialTopicId', 'registeredUserQSearchBarEmbeddingConfiguration_initialTopicId' - The ID of the Q topic that you want to make the starting topic in the Q
-- search bar. You can find a topic ID by navigating to the Topics pane in
-- the Amazon QuickSight application and opening a topic. The ID is in the
-- URL for the topic that you open.
--
-- If you don\'t specify an initial topic, a list of all shared topics is
-- shown in the Q bar for your readers. When you select an initial topic,
-- you can specify whether or not readers are allowed to select other
-- topics from the available ones in the list.
newRegisteredUserQSearchBarEmbeddingConfiguration ::
  RegisteredUserQSearchBarEmbeddingConfiguration
newRegisteredUserQSearchBarEmbeddingConfiguration :: RegisteredUserQSearchBarEmbeddingConfiguration
newRegisteredUserQSearchBarEmbeddingConfiguration =
  RegisteredUserQSearchBarEmbeddingConfiguration' :: Maybe Text -> RegisteredUserQSearchBarEmbeddingConfiguration
RegisteredUserQSearchBarEmbeddingConfiguration'
    { $sel:initialTopicId:RegisteredUserQSearchBarEmbeddingConfiguration' :: Maybe Text
initialTopicId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Q topic that you want to make the starting topic in the Q
-- search bar. You can find a topic ID by navigating to the Topics pane in
-- the Amazon QuickSight application and opening a topic. The ID is in the
-- URL for the topic that you open.
--
-- If you don\'t specify an initial topic, a list of all shared topics is
-- shown in the Q bar for your readers. When you select an initial topic,
-- you can specify whether or not readers are allowed to select other
-- topics from the available ones in the list.
registeredUserQSearchBarEmbeddingConfiguration_initialTopicId :: Lens.Lens' RegisteredUserQSearchBarEmbeddingConfiguration (Prelude.Maybe Prelude.Text)
registeredUserQSearchBarEmbeddingConfiguration_initialTopicId :: (Maybe Text -> f (Maybe Text))
-> RegisteredUserQSearchBarEmbeddingConfiguration
-> f RegisteredUserQSearchBarEmbeddingConfiguration
registeredUserQSearchBarEmbeddingConfiguration_initialTopicId = (RegisteredUserQSearchBarEmbeddingConfiguration -> Maybe Text)
-> (RegisteredUserQSearchBarEmbeddingConfiguration
    -> Maybe Text -> RegisteredUserQSearchBarEmbeddingConfiguration)
-> Lens
     RegisteredUserQSearchBarEmbeddingConfiguration
     RegisteredUserQSearchBarEmbeddingConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisteredUserQSearchBarEmbeddingConfiguration' {Maybe Text
initialTopicId :: Maybe Text
$sel:initialTopicId:RegisteredUserQSearchBarEmbeddingConfiguration' :: RegisteredUserQSearchBarEmbeddingConfiguration -> Maybe Text
initialTopicId} -> Maybe Text
initialTopicId) (\s :: RegisteredUserQSearchBarEmbeddingConfiguration
s@RegisteredUserQSearchBarEmbeddingConfiguration' {} Maybe Text
a -> RegisteredUserQSearchBarEmbeddingConfiguration
s {$sel:initialTopicId:RegisteredUserQSearchBarEmbeddingConfiguration' :: Maybe Text
initialTopicId = Maybe Text
a} :: RegisteredUserQSearchBarEmbeddingConfiguration)

instance
  Prelude.Hashable
    RegisteredUserQSearchBarEmbeddingConfiguration

instance
  Prelude.NFData
    RegisteredUserQSearchBarEmbeddingConfiguration

instance
  Core.ToJSON
    RegisteredUserQSearchBarEmbeddingConfiguration
  where
  toJSON :: RegisteredUserQSearchBarEmbeddingConfiguration -> Value
toJSON
    RegisteredUserQSearchBarEmbeddingConfiguration' {Maybe Text
initialTopicId :: Maybe Text
$sel:initialTopicId:RegisteredUserQSearchBarEmbeddingConfiguration' :: RegisteredUserQSearchBarEmbeddingConfiguration -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"InitialTopicId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
initialTopicId
            ]
        )