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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Wisdom.Types.AssistantAssociationOutputData
import Amazonka.Wisdom.Types.AssociationType

-- | Information about the assistant association.
--
-- /See:/ 'newAssistantAssociationData' smart constructor.
data AssistantAssociationData = AssistantAssociationData'
  { -- | The tags used to organize, track, or control access for this resource.
    AssistantAssociationData -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the Wisdom assistant
    AssistantAssociationData -> Text
assistantArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the assistant association.
    AssistantAssociationData -> Text
assistantAssociationArn :: Prelude.Text,
    -- | The identifier of the assistant association.
    AssistantAssociationData -> Text
assistantAssociationId :: Prelude.Text,
    -- | The identifier of the Wisdom assistant.
    AssistantAssociationData -> Text
assistantId :: Prelude.Text,
    -- | A union type that currently has a single argument, the knowledge base
    -- ID.
    AssistantAssociationData -> AssistantAssociationOutputData
associationData :: AssistantAssociationOutputData,
    -- | The type of association.
    AssistantAssociationData -> AssociationType
associationType :: AssociationType
  }
  deriving (AssistantAssociationData -> AssistantAssociationData -> Bool
(AssistantAssociationData -> AssistantAssociationData -> Bool)
-> (AssistantAssociationData -> AssistantAssociationData -> Bool)
-> Eq AssistantAssociationData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssistantAssociationData -> AssistantAssociationData -> Bool
$c/= :: AssistantAssociationData -> AssistantAssociationData -> Bool
== :: AssistantAssociationData -> AssistantAssociationData -> Bool
$c== :: AssistantAssociationData -> AssistantAssociationData -> Bool
Prelude.Eq, ReadPrec [AssistantAssociationData]
ReadPrec AssistantAssociationData
Int -> ReadS AssistantAssociationData
ReadS [AssistantAssociationData]
(Int -> ReadS AssistantAssociationData)
-> ReadS [AssistantAssociationData]
-> ReadPrec AssistantAssociationData
-> ReadPrec [AssistantAssociationData]
-> Read AssistantAssociationData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssistantAssociationData]
$creadListPrec :: ReadPrec [AssistantAssociationData]
readPrec :: ReadPrec AssistantAssociationData
$creadPrec :: ReadPrec AssistantAssociationData
readList :: ReadS [AssistantAssociationData]
$creadList :: ReadS [AssistantAssociationData]
readsPrec :: Int -> ReadS AssistantAssociationData
$creadsPrec :: Int -> ReadS AssistantAssociationData
Prelude.Read, Int -> AssistantAssociationData -> ShowS
[AssistantAssociationData] -> ShowS
AssistantAssociationData -> String
(Int -> AssistantAssociationData -> ShowS)
-> (AssistantAssociationData -> String)
-> ([AssistantAssociationData] -> ShowS)
-> Show AssistantAssociationData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssistantAssociationData] -> ShowS
$cshowList :: [AssistantAssociationData] -> ShowS
show :: AssistantAssociationData -> String
$cshow :: AssistantAssociationData -> String
showsPrec :: Int -> AssistantAssociationData -> ShowS
$cshowsPrec :: Int -> AssistantAssociationData -> ShowS
Prelude.Show, (forall x.
 AssistantAssociationData -> Rep AssistantAssociationData x)
-> (forall x.
    Rep AssistantAssociationData x -> AssistantAssociationData)
-> Generic AssistantAssociationData
forall x.
Rep AssistantAssociationData x -> AssistantAssociationData
forall x.
AssistantAssociationData -> Rep AssistantAssociationData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssistantAssociationData x -> AssistantAssociationData
$cfrom :: forall x.
AssistantAssociationData -> Rep AssistantAssociationData x
Prelude.Generic)

-- |
-- Create a value of 'AssistantAssociationData' 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:
--
-- 'tags', 'assistantAssociationData_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'assistantArn', 'assistantAssociationData_assistantArn' - The Amazon Resource Name (ARN) of the Wisdom assistant
--
-- 'assistantAssociationArn', 'assistantAssociationData_assistantAssociationArn' - The Amazon Resource Name (ARN) of the assistant association.
--
-- 'assistantAssociationId', 'assistantAssociationData_assistantAssociationId' - The identifier of the assistant association.
--
-- 'assistantId', 'assistantAssociationData_assistantId' - The identifier of the Wisdom assistant.
--
-- 'associationData', 'assistantAssociationData_associationData' - A union type that currently has a single argument, the knowledge base
-- ID.
--
-- 'associationType', 'assistantAssociationData_associationType' - The type of association.
newAssistantAssociationData ::
  -- | 'assistantArn'
  Prelude.Text ->
  -- | 'assistantAssociationArn'
  Prelude.Text ->
  -- | 'assistantAssociationId'
  Prelude.Text ->
  -- | 'assistantId'
  Prelude.Text ->
  -- | 'associationData'
  AssistantAssociationOutputData ->
  -- | 'associationType'
  AssociationType ->
  AssistantAssociationData
newAssistantAssociationData :: Text
-> Text
-> Text
-> Text
-> AssistantAssociationOutputData
-> AssociationType
-> AssistantAssociationData
newAssistantAssociationData
  Text
pAssistantArn_
  Text
pAssistantAssociationArn_
  Text
pAssistantAssociationId_
  Text
pAssistantId_
  AssistantAssociationOutputData
pAssociationData_
  AssociationType
pAssociationType_ =
    AssistantAssociationData' :: Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> Text
-> AssistantAssociationOutputData
-> AssociationType
-> AssistantAssociationData
AssistantAssociationData'
      { $sel:tags:AssistantAssociationData' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:assistantArn:AssistantAssociationData' :: Text
assistantArn = Text
pAssistantArn_,
        $sel:assistantAssociationArn:AssistantAssociationData' :: Text
assistantAssociationArn =
          Text
pAssistantAssociationArn_,
        $sel:assistantAssociationId:AssistantAssociationData' :: Text
assistantAssociationId = Text
pAssistantAssociationId_,
        $sel:assistantId:AssistantAssociationData' :: Text
assistantId = Text
pAssistantId_,
        $sel:associationData:AssistantAssociationData' :: AssistantAssociationOutputData
associationData = AssistantAssociationOutputData
pAssociationData_,
        $sel:associationType:AssistantAssociationData' :: AssociationType
associationType = AssociationType
pAssociationType_
      }

-- | The tags used to organize, track, or control access for this resource.
assistantAssociationData_tags :: Lens.Lens' AssistantAssociationData (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
assistantAssociationData_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssistantAssociationData -> f AssistantAssociationData
assistantAssociationData_tags = (AssistantAssociationData -> Maybe (HashMap Text Text))
-> (AssistantAssociationData
    -> Maybe (HashMap Text Text) -> AssistantAssociationData)
-> Lens
     AssistantAssociationData
     AssistantAssociationData
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationData' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AssistantAssociationData' :: AssistantAssociationData -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AssistantAssociationData
s@AssistantAssociationData' {} Maybe (HashMap Text Text)
a -> AssistantAssociationData
s {$sel:tags:AssistantAssociationData' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AssistantAssociationData) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AssistantAssociationData -> f AssistantAssociationData)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssistantAssociationData
-> f AssistantAssociationData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the Wisdom assistant
assistantAssociationData_assistantArn :: Lens.Lens' AssistantAssociationData Prelude.Text
assistantAssociationData_assistantArn :: (Text -> f Text)
-> AssistantAssociationData -> f AssistantAssociationData
assistantAssociationData_assistantArn = (AssistantAssociationData -> Text)
-> (AssistantAssociationData -> Text -> AssistantAssociationData)
-> Lens AssistantAssociationData AssistantAssociationData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationData' {Text
assistantArn :: Text
$sel:assistantArn:AssistantAssociationData' :: AssistantAssociationData -> Text
assistantArn} -> Text
assistantArn) (\s :: AssistantAssociationData
s@AssistantAssociationData' {} Text
a -> AssistantAssociationData
s {$sel:assistantArn:AssistantAssociationData' :: Text
assistantArn = Text
a} :: AssistantAssociationData)

-- | The Amazon Resource Name (ARN) of the assistant association.
assistantAssociationData_assistantAssociationArn :: Lens.Lens' AssistantAssociationData Prelude.Text
assistantAssociationData_assistantAssociationArn :: (Text -> f Text)
-> AssistantAssociationData -> f AssistantAssociationData
assistantAssociationData_assistantAssociationArn = (AssistantAssociationData -> Text)
-> (AssistantAssociationData -> Text -> AssistantAssociationData)
-> Lens AssistantAssociationData AssistantAssociationData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationData' {Text
assistantAssociationArn :: Text
$sel:assistantAssociationArn:AssistantAssociationData' :: AssistantAssociationData -> Text
assistantAssociationArn} -> Text
assistantAssociationArn) (\s :: AssistantAssociationData
s@AssistantAssociationData' {} Text
a -> AssistantAssociationData
s {$sel:assistantAssociationArn:AssistantAssociationData' :: Text
assistantAssociationArn = Text
a} :: AssistantAssociationData)

-- | The identifier of the assistant association.
assistantAssociationData_assistantAssociationId :: Lens.Lens' AssistantAssociationData Prelude.Text
assistantAssociationData_assistantAssociationId :: (Text -> f Text)
-> AssistantAssociationData -> f AssistantAssociationData
assistantAssociationData_assistantAssociationId = (AssistantAssociationData -> Text)
-> (AssistantAssociationData -> Text -> AssistantAssociationData)
-> Lens AssistantAssociationData AssistantAssociationData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationData' {Text
assistantAssociationId :: Text
$sel:assistantAssociationId:AssistantAssociationData' :: AssistantAssociationData -> Text
assistantAssociationId} -> Text
assistantAssociationId) (\s :: AssistantAssociationData
s@AssistantAssociationData' {} Text
a -> AssistantAssociationData
s {$sel:assistantAssociationId:AssistantAssociationData' :: Text
assistantAssociationId = Text
a} :: AssistantAssociationData)

-- | The identifier of the Wisdom assistant.
assistantAssociationData_assistantId :: Lens.Lens' AssistantAssociationData Prelude.Text
assistantAssociationData_assistantId :: (Text -> f Text)
-> AssistantAssociationData -> f AssistantAssociationData
assistantAssociationData_assistantId = (AssistantAssociationData -> Text)
-> (AssistantAssociationData -> Text -> AssistantAssociationData)
-> Lens AssistantAssociationData AssistantAssociationData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationData' {Text
assistantId :: Text
$sel:assistantId:AssistantAssociationData' :: AssistantAssociationData -> Text
assistantId} -> Text
assistantId) (\s :: AssistantAssociationData
s@AssistantAssociationData' {} Text
a -> AssistantAssociationData
s {$sel:assistantId:AssistantAssociationData' :: Text
assistantId = Text
a} :: AssistantAssociationData)

-- | A union type that currently has a single argument, the knowledge base
-- ID.
assistantAssociationData_associationData :: Lens.Lens' AssistantAssociationData AssistantAssociationOutputData
assistantAssociationData_associationData :: (AssistantAssociationOutputData
 -> f AssistantAssociationOutputData)
-> AssistantAssociationData -> f AssistantAssociationData
assistantAssociationData_associationData = (AssistantAssociationData -> AssistantAssociationOutputData)
-> (AssistantAssociationData
    -> AssistantAssociationOutputData -> AssistantAssociationData)
-> Lens
     AssistantAssociationData
     AssistantAssociationData
     AssistantAssociationOutputData
     AssistantAssociationOutputData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationData' {AssistantAssociationOutputData
associationData :: AssistantAssociationOutputData
$sel:associationData:AssistantAssociationData' :: AssistantAssociationData -> AssistantAssociationOutputData
associationData} -> AssistantAssociationOutputData
associationData) (\s :: AssistantAssociationData
s@AssistantAssociationData' {} AssistantAssociationOutputData
a -> AssistantAssociationData
s {$sel:associationData:AssistantAssociationData' :: AssistantAssociationOutputData
associationData = AssistantAssociationOutputData
a} :: AssistantAssociationData)

-- | The type of association.
assistantAssociationData_associationType :: Lens.Lens' AssistantAssociationData AssociationType
assistantAssociationData_associationType :: (AssociationType -> f AssociationType)
-> AssistantAssociationData -> f AssistantAssociationData
assistantAssociationData_associationType = (AssistantAssociationData -> AssociationType)
-> (AssistantAssociationData
    -> AssociationType -> AssistantAssociationData)
-> Lens
     AssistantAssociationData
     AssistantAssociationData
     AssociationType
     AssociationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantAssociationData' {AssociationType
associationType :: AssociationType
$sel:associationType:AssistantAssociationData' :: AssistantAssociationData -> AssociationType
associationType} -> AssociationType
associationType) (\s :: AssistantAssociationData
s@AssistantAssociationData' {} AssociationType
a -> AssistantAssociationData
s {$sel:associationType:AssistantAssociationData' :: AssociationType
associationType = AssociationType
a} :: AssistantAssociationData)

instance Core.FromJSON AssistantAssociationData where
  parseJSON :: Value -> Parser AssistantAssociationData
parseJSON =
    String
-> (Object -> Parser AssistantAssociationData)
-> Value
-> Parser AssistantAssociationData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssistantAssociationData"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> Text
-> AssistantAssociationOutputData
-> AssociationType
-> AssistantAssociationData
AssistantAssociationData'
            (Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> Text
 -> AssistantAssociationOutputData
 -> AssociationType
 -> AssistantAssociationData)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text
      -> Text
      -> Text
      -> Text
      -> AssistantAssociationOutputData
      -> AssociationType
      -> AssistantAssociationData)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Text
   -> Text
   -> Text
   -> Text
   -> AssistantAssociationOutputData
   -> AssociationType
   -> AssistantAssociationData)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> Text
      -> AssistantAssociationOutputData
      -> AssociationType
      -> AssistantAssociationData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assistantArn")
            Parser
  (Text
   -> Text
   -> Text
   -> AssistantAssociationOutputData
   -> AssociationType
   -> AssistantAssociationData)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> AssistantAssociationOutputData
      -> AssociationType
      -> AssistantAssociationData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assistantAssociationArn")
            Parser
  (Text
   -> Text
   -> AssistantAssociationOutputData
   -> AssociationType
   -> AssistantAssociationData)
-> Parser Text
-> Parser
     (Text
      -> AssistantAssociationOutputData
      -> AssociationType
      -> AssistantAssociationData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assistantAssociationId")
            Parser
  (Text
   -> AssistantAssociationOutputData
   -> AssociationType
   -> AssistantAssociationData)
-> Parser Text
-> Parser
     (AssistantAssociationOutputData
      -> AssociationType -> AssistantAssociationData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assistantId")
            Parser
  (AssistantAssociationOutputData
   -> AssociationType -> AssistantAssociationData)
-> Parser AssistantAssociationOutputData
-> Parser (AssociationType -> AssistantAssociationData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssistantAssociationOutputData
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"associationData")
            Parser (AssociationType -> AssistantAssociationData)
-> Parser AssociationType -> Parser AssistantAssociationData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssociationType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"associationType")
      )

instance Prelude.Hashable AssistantAssociationData

instance Prelude.NFData AssistantAssociationData