{-# 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.AssistantSummary
-- 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.AssistantSummary 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

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

-- |
-- Create a value of 'AssistantSummary' 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', 'assistantSummary_description' - The description of the assistant.
--
-- 'serverSideEncryptionConfiguration', 'assistantSummary_serverSideEncryptionConfiguration' - The KMS key used for encryption.
--
-- 'tags', 'assistantSummary_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'assistantArn', 'assistantSummary_assistantArn' - The Amazon Resource Name (ARN) of the Wisdom assistant
--
-- 'assistantId', 'assistantSummary_assistantId' - The identifier of the Wisdom assistant.
--
-- 'name', 'assistantSummary_name' - The name of the assistant.
--
-- 'status', 'assistantSummary_status' - The status of the assistant.
--
-- 'type'', 'assistantSummary_type' - The type of the assistant.
newAssistantSummary ::
  -- | 'assistantArn'
  Prelude.Text ->
  -- | 'assistantId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'status'
  AssistantStatus ->
  -- | 'type''
  AssistantType ->
  AssistantSummary
newAssistantSummary :: Text
-> Text
-> Text
-> AssistantStatus
-> AssistantType
-> AssistantSummary
newAssistantSummary
  Text
pAssistantArn_
  Text
pAssistantId_
  Text
pName_
  AssistantStatus
pStatus_
  AssistantType
pType_ =
    AssistantSummary' :: Maybe Text
-> Maybe ServerSideEncryptionConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> AssistantStatus
-> AssistantType
-> AssistantSummary
AssistantSummary'
      { $sel:description:AssistantSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:serverSideEncryptionConfiguration:AssistantSummary' :: Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = Maybe ServerSideEncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:AssistantSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:assistantArn:AssistantSummary' :: Text
assistantArn = Text
pAssistantArn_,
        $sel:assistantId:AssistantSummary' :: Text
assistantId = Text
pAssistantId_,
        $sel:name:AssistantSummary' :: Text
name = Text
pName_,
        $sel:status:AssistantSummary' :: AssistantStatus
status = AssistantStatus
pStatus_,
        $sel:type':AssistantSummary' :: AssistantType
type' = AssistantType
pType_
      }

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

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

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

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

-- | The name of the assistant.
assistantSummary_name :: Lens.Lens' AssistantSummary Prelude.Text
assistantSummary_name :: (Text -> f Text) -> AssistantSummary -> f AssistantSummary
assistantSummary_name = (AssistantSummary -> Text)
-> (AssistantSummary -> Text -> AssistantSummary)
-> Lens AssistantSummary AssistantSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssistantSummary' {Text
name :: Text
$sel:name:AssistantSummary' :: AssistantSummary -> Text
name} -> Text
name) (\s :: AssistantSummary
s@AssistantSummary' {} Text
a -> AssistantSummary
s {$sel:name:AssistantSummary' :: Text
name = Text
a} :: AssistantSummary)

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

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

instance Core.FromJSON AssistantSummary where
  parseJSON :: Value -> Parser AssistantSummary
parseJSON =
    String
-> (Object -> Parser AssistantSummary)
-> Value
-> Parser AssistantSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssistantSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ServerSideEncryptionConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> AssistantStatus
-> AssistantType
-> AssistantSummary
AssistantSummary'
            (Maybe Text
 -> Maybe ServerSideEncryptionConfiguration
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> AssistantStatus
 -> AssistantType
 -> AssistantSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ServerSideEncryptionConfiguration
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> AssistantStatus
      -> AssistantType
      -> AssistantSummary)
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
   -> AssistantSummary)
-> Parser (Maybe ServerSideEncryptionConfiguration)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> AssistantStatus
      -> AssistantType
      -> AssistantSummary)
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
   -> AssistantSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text
      -> Text
      -> Text
      -> AssistantStatus
      -> AssistantType
      -> AssistantSummary)
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
   -> AssistantSummary)
-> Parser Text
-> Parser
     (Text
      -> Text -> AssistantStatus -> AssistantType -> AssistantSummary)
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 -> AssistantSummary)
-> Parser Text
-> Parser
     (Text -> AssistantStatus -> AssistantType -> AssistantSummary)
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 -> AssistantSummary)
-> Parser Text
-> Parser (AssistantStatus -> AssistantType -> AssistantSummary)
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 -> AssistantSummary)
-> Parser AssistantStatus
-> Parser (AssistantType -> AssistantSummary)
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 -> AssistantSummary)
-> Parser AssistantType -> Parser AssistantSummary
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 AssistantSummary

instance Prelude.NFData AssistantSummary