{-# 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.Connect.Types.PromptSummary
-- 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.Connect.Types.PromptSummary 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

-- | Contains information about the prompt.
--
-- /See:/ 'newPromptSummary' smart constructor.
data PromptSummary = PromptSummary'
  { -- | The Amazon Resource Name (ARN) of the prompt.
    PromptSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the prompt.
    PromptSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the prompt.
    PromptSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (PromptSummary -> PromptSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PromptSummary -> PromptSummary -> Bool
$c/= :: PromptSummary -> PromptSummary -> Bool
== :: PromptSummary -> PromptSummary -> Bool
$c== :: PromptSummary -> PromptSummary -> Bool
Prelude.Eq, ReadPrec [PromptSummary]
ReadPrec PromptSummary
Int -> ReadS PromptSummary
ReadS [PromptSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PromptSummary]
$creadListPrec :: ReadPrec [PromptSummary]
readPrec :: ReadPrec PromptSummary
$creadPrec :: ReadPrec PromptSummary
readList :: ReadS [PromptSummary]
$creadList :: ReadS [PromptSummary]
readsPrec :: Int -> ReadS PromptSummary
$creadsPrec :: Int -> ReadS PromptSummary
Prelude.Read, Int -> PromptSummary -> ShowS
[PromptSummary] -> ShowS
PromptSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PromptSummary] -> ShowS
$cshowList :: [PromptSummary] -> ShowS
show :: PromptSummary -> String
$cshow :: PromptSummary -> String
showsPrec :: Int -> PromptSummary -> ShowS
$cshowsPrec :: Int -> PromptSummary -> ShowS
Prelude.Show, forall x. Rep PromptSummary x -> PromptSummary
forall x. PromptSummary -> Rep PromptSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PromptSummary x -> PromptSummary
$cfrom :: forall x. PromptSummary -> Rep PromptSummary x
Prelude.Generic)

-- |
-- Create a value of 'PromptSummary' 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:
--
-- 'arn', 'promptSummary_arn' - The Amazon Resource Name (ARN) of the prompt.
--
-- 'id', 'promptSummary_id' - The identifier of the prompt.
--
-- 'name', 'promptSummary_name' - The name of the prompt.
newPromptSummary ::
  PromptSummary
newPromptSummary :: PromptSummary
newPromptSummary =
  PromptSummary'
    { $sel:arn:PromptSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:PromptSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:PromptSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the prompt.
promptSummary_arn :: Lens.Lens' PromptSummary (Prelude.Maybe Prelude.Text)
promptSummary_arn :: Lens' PromptSummary (Maybe Text)
promptSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PromptSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:PromptSummary' :: PromptSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PromptSummary
s@PromptSummary' {} Maybe Text
a -> PromptSummary
s {$sel:arn:PromptSummary' :: Maybe Text
arn = Maybe Text
a} :: PromptSummary)

-- | The identifier of the prompt.
promptSummary_id :: Lens.Lens' PromptSummary (Prelude.Maybe Prelude.Text)
promptSummary_id :: Lens' PromptSummary (Maybe Text)
promptSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PromptSummary' {Maybe Text
id :: Maybe Text
$sel:id:PromptSummary' :: PromptSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: PromptSummary
s@PromptSummary' {} Maybe Text
a -> PromptSummary
s {$sel:id:PromptSummary' :: Maybe Text
id = Maybe Text
a} :: PromptSummary)

-- | The name of the prompt.
promptSummary_name :: Lens.Lens' PromptSummary (Prelude.Maybe Prelude.Text)
promptSummary_name :: Lens' PromptSummary (Maybe Text)
promptSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PromptSummary' {Maybe Text
name :: Maybe Text
$sel:name:PromptSummary' :: PromptSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: PromptSummary
s@PromptSummary' {} Maybe Text
a -> PromptSummary
s {$sel:name:PromptSummary' :: Maybe Text
name = Maybe Text
a} :: PromptSummary)

instance Data.FromJSON PromptSummary where
  parseJSON :: Value -> Parser PromptSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PromptSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> PromptSummary
PromptSummary'
            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
"Arn")
            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
"Id")
            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
"Name")
      )

instance Prelude.Hashable PromptSummary where
  hashWithSalt :: Int -> PromptSummary -> Int
hashWithSalt Int
_salt PromptSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:PromptSummary' :: PromptSummary -> Maybe Text
$sel:id:PromptSummary' :: PromptSummary -> Maybe Text
$sel:arn:PromptSummary' :: PromptSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData PromptSummary where
  rnf :: PromptSummary -> ()
rnf PromptSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:PromptSummary' :: PromptSummary -> Maybe Text
$sel:id:PromptSummary' :: PromptSummary -> Maybe Text
$sel:arn:PromptSummary' :: PromptSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name