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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 the identifier of the knowledge base.
    KnowledgeBaseAssociationData -> Maybe Text
knowledgeBaseId :: Prelude.Maybe Prelude.Text
  }
  deriving (KnowledgeBaseAssociationData
-> KnowledgeBaseAssociationData -> Bool
(KnowledgeBaseAssociationData
 -> KnowledgeBaseAssociationData -> Bool)
-> (KnowledgeBaseAssociationData
    -> KnowledgeBaseAssociationData -> Bool)
-> Eq KnowledgeBaseAssociationData
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]
(Int -> ReadS KnowledgeBaseAssociationData)
-> ReadS [KnowledgeBaseAssociationData]
-> ReadPrec KnowledgeBaseAssociationData
-> ReadPrec [KnowledgeBaseAssociationData]
-> Read 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
(Int -> KnowledgeBaseAssociationData -> ShowS)
-> (KnowledgeBaseAssociationData -> String)
-> ([KnowledgeBaseAssociationData] -> ShowS)
-> Show KnowledgeBaseAssociationData
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.
 KnowledgeBaseAssociationData -> Rep KnowledgeBaseAssociationData x)
-> (forall x.
    Rep KnowledgeBaseAssociationData x -> KnowledgeBaseAssociationData)
-> Generic KnowledgeBaseAssociationData
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 the identifier of the knowledge base.
newKnowledgeBaseAssociationData ::
  KnowledgeBaseAssociationData
newKnowledgeBaseAssociationData :: KnowledgeBaseAssociationData
newKnowledgeBaseAssociationData =
  KnowledgeBaseAssociationData' :: Maybe Text -> Maybe Text -> KnowledgeBaseAssociationData
KnowledgeBaseAssociationData'
    { $sel:knowledgeBaseArn:KnowledgeBaseAssociationData' :: Maybe Text
knowledgeBaseArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:knowledgeBaseId:KnowledgeBaseAssociationData' :: Maybe Text
knowledgeBaseId = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> KnowledgeBaseAssociationData -> f KnowledgeBaseAssociationData
knowledgeBaseAssociationData_knowledgeBaseArn = (KnowledgeBaseAssociationData -> Maybe Text)
-> (KnowledgeBaseAssociationData
    -> Maybe Text -> KnowledgeBaseAssociationData)
-> Lens
     KnowledgeBaseAssociationData
     KnowledgeBaseAssociationData
     (Maybe Text)
     (Maybe Text)
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 the identifier of the knowledge base.
knowledgeBaseAssociationData_knowledgeBaseId :: Lens.Lens' KnowledgeBaseAssociationData (Prelude.Maybe Prelude.Text)
knowledgeBaseAssociationData_knowledgeBaseId :: (Maybe Text -> f (Maybe Text))
-> KnowledgeBaseAssociationData -> f KnowledgeBaseAssociationData
knowledgeBaseAssociationData_knowledgeBaseId = (KnowledgeBaseAssociationData -> Maybe Text)
-> (KnowledgeBaseAssociationData
    -> Maybe Text -> KnowledgeBaseAssociationData)
-> Lens
     KnowledgeBaseAssociationData
     KnowledgeBaseAssociationData
     (Maybe Text)
     (Maybe Text)
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 Core.FromJSON KnowledgeBaseAssociationData where
  parseJSON :: Value -> Parser KnowledgeBaseAssociationData
parseJSON =
    String
-> (Object -> Parser KnowledgeBaseAssociationData)
-> Value
-> Parser KnowledgeBaseAssociationData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KnowledgeBaseAssociationData"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> KnowledgeBaseAssociationData
KnowledgeBaseAssociationData'
            (Maybe Text -> Maybe Text -> KnowledgeBaseAssociationData)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> KnowledgeBaseAssociationData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"knowledgeBaseArn")
            Parser (Maybe Text -> KnowledgeBaseAssociationData)
-> Parser (Maybe Text) -> Parser KnowledgeBaseAssociationData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"knowledgeBaseId")
      )

instance
  Prelude.Hashable
    KnowledgeBaseAssociationData

instance Prelude.NFData KnowledgeBaseAssociationData