{-# 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.Wisdom.Types.AssistantAssociationInputData
-- 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.Wisdom.Types.AssistantAssociationInputData where

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

-- | The data that is input into Wisdom as a result of the assistant
-- association.
--
-- /See:/ 'newAssistantAssociationInputData' smart constructor.
data AssistantAssociationInputData = AssistantAssociationInputData'
  { -- | The the identifier of the knowledge base.
    AssistantAssociationInputData -> Maybe Text
knowledgeBaseId :: Prelude.Maybe Prelude.Text
  }
  deriving (AssistantAssociationInputData
-> AssistantAssociationInputData -> Bool
(AssistantAssociationInputData
 -> AssistantAssociationInputData -> Bool)
-> (AssistantAssociationInputData
    -> AssistantAssociationInputData -> Bool)
-> Eq AssistantAssociationInputData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssistantAssociationInputData
-> AssistantAssociationInputData -> Bool
$c/= :: AssistantAssociationInputData
-> AssistantAssociationInputData -> Bool
== :: AssistantAssociationInputData
-> AssistantAssociationInputData -> Bool
$c== :: AssistantAssociationInputData
-> AssistantAssociationInputData -> Bool
Prelude.Eq, ReadPrec [AssistantAssociationInputData]
ReadPrec AssistantAssociationInputData
Int -> ReadS AssistantAssociationInputData
ReadS [AssistantAssociationInputData]
(Int -> ReadS AssistantAssociationInputData)
-> ReadS [AssistantAssociationInputData]
-> ReadPrec AssistantAssociationInputData
-> ReadPrec [AssistantAssociationInputData]
-> Read AssistantAssociationInputData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssistantAssociationInputData]
$creadListPrec :: ReadPrec [AssistantAssociationInputData]
readPrec :: ReadPrec AssistantAssociationInputData
$creadPrec :: ReadPrec AssistantAssociationInputData
readList :: ReadS [AssistantAssociationInputData]
$creadList :: ReadS [AssistantAssociationInputData]
readsPrec :: Int -> ReadS AssistantAssociationInputData
$creadsPrec :: Int -> ReadS AssistantAssociationInputData
Prelude.Read, Int -> AssistantAssociationInputData -> ShowS
[AssistantAssociationInputData] -> ShowS
AssistantAssociationInputData -> String
(Int -> AssistantAssociationInputData -> ShowS)
-> (AssistantAssociationInputData -> String)
-> ([AssistantAssociationInputData] -> ShowS)
-> Show AssistantAssociationInputData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssistantAssociationInputData] -> ShowS
$cshowList :: [AssistantAssociationInputData] -> ShowS
show :: AssistantAssociationInputData -> String
$cshow :: AssistantAssociationInputData -> String
showsPrec :: Int -> AssistantAssociationInputData -> ShowS
$cshowsPrec :: Int -> AssistantAssociationInputData -> ShowS
Prelude.Show, (forall x.
 AssistantAssociationInputData
 -> Rep AssistantAssociationInputData x)
-> (forall x.
    Rep AssistantAssociationInputData x
    -> AssistantAssociationInputData)
-> Generic AssistantAssociationInputData
forall x.
Rep AssistantAssociationInputData x
-> AssistantAssociationInputData
forall x.
AssistantAssociationInputData
-> Rep AssistantAssociationInputData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssistantAssociationInputData x
-> AssistantAssociationInputData
$cfrom :: forall x.
AssistantAssociationInputData
-> Rep AssistantAssociationInputData x
Prelude.Generic)

-- |
-- Create a value of 'AssistantAssociationInputData' 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:
--
-- 'knowledgeBaseId', 'assistantAssociationInputData_knowledgeBaseId' - The the identifier of the knowledge base.
newAssistantAssociationInputData ::
  AssistantAssociationInputData
newAssistantAssociationInputData :: AssistantAssociationInputData
newAssistantAssociationInputData =
  AssistantAssociationInputData' :: Maybe Text -> AssistantAssociationInputData
AssistantAssociationInputData'
    { $sel:knowledgeBaseId:AssistantAssociationInputData' :: Maybe Text
knowledgeBaseId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The the identifier of the knowledge base.
assistantAssociationInputData_knowledgeBaseId :: Lens.Lens' AssistantAssociationInputData (Prelude.Maybe Prelude.Text)
assistantAssociationInputData_knowledgeBaseId :: (Maybe Text -> f (Maybe Text))
-> AssistantAssociationInputData -> f AssistantAssociationInputData
assistantAssociationInputData_knowledgeBaseId = (AssistantAssociationInputData -> Maybe Text)
-> (AssistantAssociationInputData
    -> Maybe Text -> AssistantAssociationInputData)
-> Lens
     AssistantAssociationInputData
     AssistantAssociationInputData
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationInputData' {Maybe Text
knowledgeBaseId :: Maybe Text
$sel:knowledgeBaseId:AssistantAssociationInputData' :: AssistantAssociationInputData -> Maybe Text
knowledgeBaseId} -> Maybe Text
knowledgeBaseId) (\s :: AssistantAssociationInputData
s@AssistantAssociationInputData' {} Maybe Text
a -> AssistantAssociationInputData
s {$sel:knowledgeBaseId:AssistantAssociationInputData' :: Maybe Text
knowledgeBaseId = Maybe Text
a} :: AssistantAssociationInputData)

instance
  Prelude.Hashable
    AssistantAssociationInputData

instance Prelude.NFData AssistantAssociationInputData

instance Core.ToJSON AssistantAssociationInputData where
  toJSON :: AssistantAssociationInputData -> Value
toJSON AssistantAssociationInputData' {Maybe Text
knowledgeBaseId :: Maybe Text
$sel:knowledgeBaseId:AssistantAssociationInputData' :: AssistantAssociationInputData -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"knowledgeBaseId" 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
knowledgeBaseId
          ]
      )