{-# 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-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.AssistantSummary 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
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
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]
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
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. 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'
      { $sel:description:AssistantSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:serverSideEncryptionConfiguration:AssistantSummary' :: Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:AssistantSummary' :: Maybe (HashMap Text Text)
tags = 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 :: Lens' AssistantSummary (Maybe Text)
assistantSummary_description = 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 :: Lens' AssistantSummary (Maybe ServerSideEncryptionConfiguration)
assistantSummary_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 :: Lens' AssistantSummary (Maybe (HashMap Text Text))
assistantSummary_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' AssistantSummary Text
assistantSummary_assistantArn = 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 :: Lens' AssistantSummary Text
assistantSummary_assistantId = 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 :: Lens' AssistantSummary Text
assistantSummary_name = 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 :: Lens' AssistantSummary AssistantStatus
assistantSummary_status = 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 :: Lens' AssistantSummary AssistantType
assistantSummary_type = 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 Data.FromJSON AssistantSummary where
  parseJSON :: Value -> Parser AssistantSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AssistantSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ServerSideEncryptionConfiguration
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> AssistantStatus
-> AssistantType
-> AssistantSummary
AssistantSummary'
            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
"description")
            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
"serverSideEncryptionConfiguration")
            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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"assistantArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"assistantId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"type")
      )

instance Prelude.Hashable AssistantSummary where
  hashWithSalt :: Int -> AssistantSummary -> Int
hashWithSalt Int
_salt AssistantSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe ServerSideEncryptionConfiguration
Text
AssistantStatus
AssistantType
type' :: AssistantType
status :: AssistantStatus
name :: Text
assistantId :: Text
assistantArn :: Text
tags :: Maybe (HashMap Text Text)
serverSideEncryptionConfiguration :: Maybe ServerSideEncryptionConfiguration
description :: Maybe Text
$sel:type':AssistantSummary' :: AssistantSummary -> AssistantType
$sel:status:AssistantSummary' :: AssistantSummary -> AssistantStatus
$sel:name:AssistantSummary' :: AssistantSummary -> Text
$sel:assistantId:AssistantSummary' :: AssistantSummary -> Text
$sel:assistantArn:AssistantSummary' :: AssistantSummary -> Text
$sel:tags:AssistantSummary' :: AssistantSummary -> Maybe (HashMap Text Text)
$sel:serverSideEncryptionConfiguration:AssistantSummary' :: AssistantSummary -> Maybe ServerSideEncryptionConfiguration
$sel:description:AssistantSummary' :: AssistantSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
assistantArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
assistantId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AssistantStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AssistantType
type'

instance Prelude.NFData AssistantSummary where
  rnf :: AssistantSummary -> ()
rnf AssistantSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe ServerSideEncryptionConfiguration
Text
AssistantStatus
AssistantType
type' :: AssistantType
status :: AssistantStatus
name :: Text
assistantId :: Text
assistantArn :: Text
tags :: Maybe (HashMap Text Text)
serverSideEncryptionConfiguration :: Maybe ServerSideEncryptionConfiguration
description :: Maybe Text
$sel:type':AssistantSummary' :: AssistantSummary -> AssistantType
$sel:status:AssistantSummary' :: AssistantSummary -> AssistantStatus
$sel:name:AssistantSummary' :: AssistantSummary -> Text
$sel:assistantId:AssistantSummary' :: AssistantSummary -> Text
$sel:assistantArn:AssistantSummary' :: AssistantSummary -> Text
$sel:tags:AssistantSummary' :: AssistantSummary -> Maybe (HashMap Text Text)
$sel:serverSideEncryptionConfiguration:AssistantSummary' :: AssistantSummary -> Maybe ServerSideEncryptionConfiguration
$sel:description:AssistantSummary' :: AssistantSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServerSideEncryptionConfiguration
serverSideEncryptionConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
assistantArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
assistantId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AssistantStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AssistantType
type'