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

-- | Association information about the knowledge base.
--
-- /See:/ 'newKnowledgeBaseAssociationData' smart constructor.
data KnowledgeBaseAssociationData = KnowledgeBaseAssociationData'
  { -- | The Amazon Resource Name (ARN) of the knowledge base.
    KnowledgeBaseAssociationData -> Maybe Text
knowledgeBaseArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the knowledge base.
    KnowledgeBaseAssociationData -> Maybe Text
knowledgeBaseId :: Prelude.Maybe Prelude.Text
  }
  deriving (KnowledgeBaseAssociationData
-> KnowledgeBaseAssociationData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KnowledgeBaseAssociationData
-> KnowledgeBaseAssociationData -> Bool
$c/= :: KnowledgeBaseAssociationData
-> KnowledgeBaseAssociationData -> Bool
== :: KnowledgeBaseAssociationData
-> KnowledgeBaseAssociationData -> Bool
$c== :: KnowledgeBaseAssociationData
-> KnowledgeBaseAssociationData -> Bool
Prelude.Eq, ReadPrec [KnowledgeBaseAssociationData]
ReadPrec KnowledgeBaseAssociationData
Int -> ReadS KnowledgeBaseAssociationData
ReadS [KnowledgeBaseAssociationData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KnowledgeBaseAssociationData]
$creadListPrec :: ReadPrec [KnowledgeBaseAssociationData]
readPrec :: ReadPrec KnowledgeBaseAssociationData
$creadPrec :: ReadPrec KnowledgeBaseAssociationData
readList :: ReadS [KnowledgeBaseAssociationData]
$creadList :: ReadS [KnowledgeBaseAssociationData]
readsPrec :: Int -> ReadS KnowledgeBaseAssociationData
$creadsPrec :: Int -> ReadS KnowledgeBaseAssociationData
Prelude.Read, Int -> KnowledgeBaseAssociationData -> ShowS
[KnowledgeBaseAssociationData] -> ShowS
KnowledgeBaseAssociationData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KnowledgeBaseAssociationData] -> ShowS
$cshowList :: [KnowledgeBaseAssociationData] -> ShowS
show :: KnowledgeBaseAssociationData -> String
$cshow :: KnowledgeBaseAssociationData -> String
showsPrec :: Int -> KnowledgeBaseAssociationData -> ShowS
$cshowsPrec :: Int -> KnowledgeBaseAssociationData -> ShowS
Prelude.Show, forall x.
Rep KnowledgeBaseAssociationData x -> KnowledgeBaseAssociationData
forall x.
KnowledgeBaseAssociationData -> Rep KnowledgeBaseAssociationData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KnowledgeBaseAssociationData x -> KnowledgeBaseAssociationData
$cfrom :: forall x.
KnowledgeBaseAssociationData -> Rep KnowledgeBaseAssociationData x
Prelude.Generic)

-- |
-- Create a value of 'KnowledgeBaseAssociationData' 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:
--
-- 'knowledgeBaseArn', 'knowledgeBaseAssociationData_knowledgeBaseArn' - The Amazon Resource Name (ARN) of the knowledge base.
--
-- 'knowledgeBaseId', 'knowledgeBaseAssociationData_knowledgeBaseId' - The identifier of the knowledge base.
newKnowledgeBaseAssociationData ::
  KnowledgeBaseAssociationData
newKnowledgeBaseAssociationData :: KnowledgeBaseAssociationData
newKnowledgeBaseAssociationData =
  KnowledgeBaseAssociationData'
    { $sel:knowledgeBaseArn:KnowledgeBaseAssociationData' :: Maybe Text
knowledgeBaseArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:knowledgeBaseId:KnowledgeBaseAssociationData' :: Maybe Text
knowledgeBaseId = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the knowledge base.
knowledgeBaseAssociationData_knowledgeBaseArn :: Lens.Lens' KnowledgeBaseAssociationData (Prelude.Maybe Prelude.Text)
knowledgeBaseAssociationData_knowledgeBaseArn :: Lens' KnowledgeBaseAssociationData (Maybe Text)
knowledgeBaseAssociationData_knowledgeBaseArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KnowledgeBaseAssociationData' {Maybe Text
knowledgeBaseArn :: Maybe Text
$sel:knowledgeBaseArn:KnowledgeBaseAssociationData' :: KnowledgeBaseAssociationData -> Maybe Text
knowledgeBaseArn} -> Maybe Text
knowledgeBaseArn) (\s :: KnowledgeBaseAssociationData
s@KnowledgeBaseAssociationData' {} Maybe Text
a -> KnowledgeBaseAssociationData
s {$sel:knowledgeBaseArn:KnowledgeBaseAssociationData' :: Maybe Text
knowledgeBaseArn = Maybe Text
a} :: KnowledgeBaseAssociationData)

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

instance Data.FromJSON KnowledgeBaseAssociationData where
  parseJSON :: Value -> Parser KnowledgeBaseAssociationData
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"KnowledgeBaseAssociationData"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> KnowledgeBaseAssociationData
KnowledgeBaseAssociationData'
            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
"knowledgeBaseArn")
            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
"knowledgeBaseId")
      )

instance
  Prelude.Hashable
    KnowledgeBaseAssociationData
  where
  hashWithSalt :: Int -> KnowledgeBaseAssociationData -> Int
hashWithSalt Int
_salt KnowledgeBaseAssociationData' {Maybe Text
knowledgeBaseId :: Maybe Text
knowledgeBaseArn :: Maybe Text
$sel:knowledgeBaseId:KnowledgeBaseAssociationData' :: KnowledgeBaseAssociationData -> Maybe Text
$sel:knowledgeBaseArn:KnowledgeBaseAssociationData' :: KnowledgeBaseAssociationData -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
knowledgeBaseArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
knowledgeBaseId

instance Prelude.NFData KnowledgeBaseAssociationData where
  rnf :: KnowledgeBaseAssociationData -> ()
rnf KnowledgeBaseAssociationData' {Maybe Text
knowledgeBaseId :: Maybe Text
knowledgeBaseArn :: Maybe Text
$sel:knowledgeBaseId:KnowledgeBaseAssociationData' :: KnowledgeBaseAssociationData -> Maybe Text
$sel:knowledgeBaseArn:KnowledgeBaseAssociationData' :: KnowledgeBaseAssociationData -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
knowledgeBaseArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
knowledgeBaseId