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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Wisdom.Types.AssistantStatus
import Amazonka.Wisdom.Types.AssistantType
import Amazonka.Wisdom.Types.ServerSideEncryptionConfiguration

-- | The assistant data.
--
-- /See:/ 'newAssistantData' smart constructor.
data AssistantData = AssistantData'
  { -- | The description.
    AssistantData -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The KMS key used for encryption.
    AssistantData -> Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: Prelude.Maybe ServerSideEncryptionConfiguration,
    -- | The tags used to organize, track, or control access for this resource.
    AssistantData -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the Wisdom assistant
    AssistantData -> Text
assistantArn :: Prelude.Text,
    -- | The identifier of the Wisdom assistant.
    AssistantData -> Text
assistantId :: Prelude.Text,
    -- | The name.
    AssistantData -> Text
name :: Prelude.Text,
    -- | The status of the assistant.
    AssistantData -> AssistantStatus
status :: AssistantStatus,
    -- | The type of assistant.
    AssistantData -> AssistantType
type' :: AssistantType
  }
  deriving (AssistantData -> AssistantData -> Bool
(AssistantData -> AssistantData -> Bool)
-> (AssistantData -> AssistantData -> Bool) -> Eq AssistantData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssistantData -> AssistantData -> Bool
$c/= :: AssistantData -> AssistantData -> Bool
== :: AssistantData -> AssistantData -> Bool
$c== :: AssistantData -> AssistantData -> Bool
Prelude.Eq, ReadPrec [AssistantData]
ReadPrec AssistantData
Int -> ReadS AssistantData
ReadS [AssistantData]
(Int -> ReadS AssistantData)
-> ReadS [AssistantData]
-> ReadPrec AssistantData
-> ReadPrec [AssistantData]
-> Read AssistantData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssistantData]
$creadListPrec :: ReadPrec [AssistantData]
readPrec :: ReadPrec AssistantData
$creadPrec :: ReadPrec AssistantData
readList :: ReadS [AssistantData]
$creadList :: ReadS [AssistantData]
readsPrec :: Int -> ReadS AssistantData
$creadsPrec :: Int -> ReadS AssistantData
Prelude.Read, Int -> AssistantData -> ShowS
[AssistantData] -> ShowS
AssistantData -> String
(Int -> AssistantData -> ShowS)
-> (AssistantData -> String)
-> ([AssistantData] -> ShowS)
-> Show AssistantData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssistantData] -> ShowS
$cshowList :: [AssistantData] -> ShowS
show :: AssistantData -> String
$cshow :: AssistantData -> String
showsPrec :: Int -> AssistantData -> ShowS
$cshowsPrec :: Int -> AssistantData -> ShowS
Prelude.Show, (forall x. AssistantData -> Rep AssistantData x)
-> (forall x. Rep AssistantData x -> AssistantData)
-> Generic AssistantData
forall x. Rep AssistantData x -> AssistantData
forall x. AssistantData -> Rep AssistantData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssistantData x -> AssistantData
$cfrom :: forall x. AssistantData -> Rep AssistantData x
Prelude.Generic)

-- |
-- Create a value of 'AssistantData' 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:
--
-- 'description', 'assistantData_description' - The description.
--
-- 'serverSideEncryptionConfiguration', 'assistantData_serverSideEncryptionConfiguration' - The KMS key used for encryption.
--
-- 'tags', 'assistantData_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'assistantArn', 'assistantData_assistantArn' - The Amazon Resource Name (ARN) of the Wisdom assistant
--
-- 'assistantId', 'assistantData_assistantId' - The identifier of the Wisdom assistant.
--
-- 'name', 'assistantData_name' - The name.
--
-- 'status', 'assistantData_status' - The status of the assistant.
--
-- 'type'', 'assistantData_type' - The type of assistant.
newAssistantData ::
  -- | 'assistantArn'
  Prelude.Text ->
  -- | 'assistantId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'status'
  AssistantStatus ->
  -- | 'type''
  AssistantType ->
  AssistantData
newAssistantData :: Text
-> Text
-> Text
-> AssistantStatus
-> AssistantType
-> AssistantData
newAssistantData
  Text
pAssistantArn_
  Text
pAssistantId_
  Text
pName_
  AssistantStatus
pStatus_
  AssistantType
pType_ =
    AssistantData' :: Maybe Text
-> Maybe ServerSideEncryptionConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> AssistantStatus
-> AssistantType
-> AssistantData
AssistantData'
      { $sel:description:AssistantData' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:serverSideEncryptionConfiguration:AssistantData' :: Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = Maybe ServerSideEncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:AssistantData' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:assistantArn:AssistantData' :: Text
assistantArn = Text
pAssistantArn_,
        $sel:assistantId:AssistantData' :: Text
assistantId = Text
pAssistantId_,
        $sel:name:AssistantData' :: Text
name = Text
pName_,
        $sel:status:AssistantData' :: AssistantStatus
status = AssistantStatus
pStatus_,
        $sel:type':AssistantData' :: AssistantType
type' = AssistantType
pType_
      }

-- | The description.
assistantData_description :: Lens.Lens' AssistantData (Prelude.Maybe Prelude.Text)
assistantData_description :: (Maybe Text -> f (Maybe Text)) -> AssistantData -> f AssistantData
assistantData_description = (AssistantData -> Maybe Text)
-> (AssistantData -> Maybe Text -> AssistantData)
-> Lens AssistantData AssistantData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantData' {Maybe Text
description :: Maybe Text
$sel:description:AssistantData' :: AssistantData -> Maybe Text
description} -> Maybe Text
description) (\s :: AssistantData
s@AssistantData' {} Maybe Text
a -> AssistantData
s {$sel:description:AssistantData' :: Maybe Text
description = Maybe Text
a} :: AssistantData)

-- | The KMS key used for encryption.
assistantData_serverSideEncryptionConfiguration :: Lens.Lens' AssistantData (Prelude.Maybe ServerSideEncryptionConfiguration)
assistantData_serverSideEncryptionConfiguration :: (Maybe ServerSideEncryptionConfiguration
 -> f (Maybe ServerSideEncryptionConfiguration))
-> AssistantData -> f AssistantData
assistantData_serverSideEncryptionConfiguration = (AssistantData -> Maybe ServerSideEncryptionConfiguration)
-> (AssistantData
    -> Maybe ServerSideEncryptionConfiguration -> AssistantData)
-> Lens
     AssistantData
     AssistantData
     (Maybe ServerSideEncryptionConfiguration)
     (Maybe ServerSideEncryptionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantData' {Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration :: Maybe ServerSideEncryptionConfiguration
$sel:serverSideEncryptionConfiguration:AssistantData' :: AssistantData -> Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration} -> Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration) (\s :: AssistantData
s@AssistantData' {} Maybe ServerSideEncryptionConfiguration
a -> AssistantData
s {$sel:serverSideEncryptionConfiguration:AssistantData' :: Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = Maybe ServerSideEncryptionConfiguration
a} :: AssistantData)

-- | The tags used to organize, track, or control access for this resource.
assistantData_tags :: Lens.Lens' AssistantData (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
assistantData_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssistantData -> f AssistantData
assistantData_tags = (AssistantData -> Maybe (HashMap Text Text))
-> (AssistantData -> Maybe (HashMap Text Text) -> AssistantData)
-> Lens
     AssistantData
     AssistantData
     (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 (\AssistantData' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AssistantData' :: AssistantData -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AssistantData
s@AssistantData' {} Maybe (HashMap Text Text)
a -> AssistantData
s {$sel:tags:AssistantData' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AssistantData) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AssistantData -> f AssistantData)
-> ((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)))
-> AssistantData
-> f AssistantData
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
assistantData_assistantArn :: Lens.Lens' AssistantData Prelude.Text
assistantData_assistantArn :: (Text -> f Text) -> AssistantData -> f AssistantData
assistantData_assistantArn = (AssistantData -> Text)
-> (AssistantData -> Text -> AssistantData)
-> Lens AssistantData AssistantData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantData' {Text
assistantArn :: Text
$sel:assistantArn:AssistantData' :: AssistantData -> Text
assistantArn} -> Text
assistantArn) (\s :: AssistantData
s@AssistantData' {} Text
a -> AssistantData
s {$sel:assistantArn:AssistantData' :: Text
assistantArn = Text
a} :: AssistantData)

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

-- | The name.
assistantData_name :: Lens.Lens' AssistantData Prelude.Text
assistantData_name :: (Text -> f Text) -> AssistantData -> f AssistantData
assistantData_name = (AssistantData -> Text)
-> (AssistantData -> Text -> AssistantData)
-> Lens AssistantData AssistantData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantData' {Text
name :: Text
$sel:name:AssistantData' :: AssistantData -> Text
name} -> Text
name) (\s :: AssistantData
s@AssistantData' {} Text
a -> AssistantData
s {$sel:name:AssistantData' :: Text
name = Text
a} :: AssistantData)

-- | The status of the assistant.
assistantData_status :: Lens.Lens' AssistantData AssistantStatus
assistantData_status :: (AssistantStatus -> f AssistantStatus)
-> AssistantData -> f AssistantData
assistantData_status = (AssistantData -> AssistantStatus)
-> (AssistantData -> AssistantStatus -> AssistantData)
-> Lens AssistantData AssistantData AssistantStatus AssistantStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantData' {AssistantStatus
status :: AssistantStatus
$sel:status:AssistantData' :: AssistantData -> AssistantStatus
status} -> AssistantStatus
status) (\s :: AssistantData
s@AssistantData' {} AssistantStatus
a -> AssistantData
s {$sel:status:AssistantData' :: AssistantStatus
status = AssistantStatus
a} :: AssistantData)

-- | The type of assistant.
assistantData_type :: Lens.Lens' AssistantData AssistantType
assistantData_type :: (AssistantType -> f AssistantType)
-> AssistantData -> f AssistantData
assistantData_type = (AssistantData -> AssistantType)
-> (AssistantData -> AssistantType -> AssistantData)
-> Lens AssistantData AssistantData AssistantType AssistantType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantData' {AssistantType
type' :: AssistantType
$sel:type':AssistantData' :: AssistantData -> AssistantType
type'} -> AssistantType
type') (\s :: AssistantData
s@AssistantData' {} AssistantType
a -> AssistantData
s {$sel:type':AssistantData' :: AssistantType
type' = AssistantType
a} :: AssistantData)

instance Core.FromJSON AssistantData where
  parseJSON :: Value -> Parser AssistantData
parseJSON =
    String
-> (Object -> Parser AssistantData)
-> Value
-> Parser AssistantData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssistantData"
      ( \Object
x ->
          Maybe Text
-> Maybe ServerSideEncryptionConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> AssistantStatus
-> AssistantType
-> AssistantData
AssistantData'
            (Maybe Text
 -> Maybe ServerSideEncryptionConfiguration
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> AssistantStatus
 -> AssistantType
 -> AssistantData)
-> Parser (Maybe Text)
-> Parser
     (Maybe ServerSideEncryptionConfiguration
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> AssistantStatus
      -> AssistantType
      -> AssistantData)
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
"description")
            Parser
  (Maybe ServerSideEncryptionConfiguration
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> AssistantStatus
   -> AssistantType
   -> AssistantData)
-> Parser (Maybe ServerSideEncryptionConfiguration)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> AssistantStatus
      -> AssistantType
      -> AssistantData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServerSideEncryptionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serverSideEncryptionConfiguration")
            Parser
  (Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> AssistantStatus
   -> AssistantType
   -> AssistantData)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text
      -> Text
      -> Text
      -> AssistantStatus
      -> AssistantType
      -> AssistantData)
forall (f :: * -> *) a b. Applicative f => 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
   -> AssistantStatus
   -> AssistantType
   -> AssistantData)
-> Parser Text
-> Parser
     (Text -> Text -> AssistantStatus -> AssistantType -> AssistantData)
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 -> AssistantStatus -> AssistantType -> AssistantData)
-> Parser Text
-> Parser
     (Text -> AssistantStatus -> AssistantType -> AssistantData)
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 (Text -> AssistantStatus -> AssistantType -> AssistantData)
-> Parser Text
-> Parser (AssistantStatus -> AssistantType -> AssistantData)
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
"name")
            Parser (AssistantStatus -> AssistantType -> AssistantData)
-> Parser AssistantStatus
-> Parser (AssistantType -> AssistantData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssistantStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
            Parser (AssistantType -> AssistantData)
-> Parser AssistantType -> Parser AssistantData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssistantType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type")
      )

instance Prelude.Hashable AssistantData

instance Prelude.NFData AssistantData