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

-- | The customer\'s details.
--
-- /See:/ 'newParticipantDetails' smart constructor.
data ParticipantDetails = ParticipantDetails'
  { -- | Display name of the participant.
    ParticipantDetails -> Text
displayName :: Prelude.Text
  }
  deriving (ParticipantDetails -> ParticipantDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParticipantDetails -> ParticipantDetails -> Bool
$c/= :: ParticipantDetails -> ParticipantDetails -> Bool
== :: ParticipantDetails -> ParticipantDetails -> Bool
$c== :: ParticipantDetails -> ParticipantDetails -> Bool
Prelude.Eq, ReadPrec [ParticipantDetails]
ReadPrec ParticipantDetails
Int -> ReadS ParticipantDetails
ReadS [ParticipantDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParticipantDetails]
$creadListPrec :: ReadPrec [ParticipantDetails]
readPrec :: ReadPrec ParticipantDetails
$creadPrec :: ReadPrec ParticipantDetails
readList :: ReadS [ParticipantDetails]
$creadList :: ReadS [ParticipantDetails]
readsPrec :: Int -> ReadS ParticipantDetails
$creadsPrec :: Int -> ReadS ParticipantDetails
Prelude.Read, Int -> ParticipantDetails -> ShowS
[ParticipantDetails] -> ShowS
ParticipantDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParticipantDetails] -> ShowS
$cshowList :: [ParticipantDetails] -> ShowS
show :: ParticipantDetails -> String
$cshow :: ParticipantDetails -> String
showsPrec :: Int -> ParticipantDetails -> ShowS
$cshowsPrec :: Int -> ParticipantDetails -> ShowS
Prelude.Show, forall x. Rep ParticipantDetails x -> ParticipantDetails
forall x. ParticipantDetails -> Rep ParticipantDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParticipantDetails x -> ParticipantDetails
$cfrom :: forall x. ParticipantDetails -> Rep ParticipantDetails x
Prelude.Generic)

-- |
-- Create a value of 'ParticipantDetails' 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:
--
-- 'displayName', 'participantDetails_displayName' - Display name of the participant.
newParticipantDetails ::
  -- | 'displayName'
  Prelude.Text ->
  ParticipantDetails
newParticipantDetails :: Text -> ParticipantDetails
newParticipantDetails Text
pDisplayName_ =
  ParticipantDetails' {$sel:displayName:ParticipantDetails' :: Text
displayName = Text
pDisplayName_}

-- | Display name of the participant.
participantDetails_displayName :: Lens.Lens' ParticipantDetails Prelude.Text
participantDetails_displayName :: Lens' ParticipantDetails Text
participantDetails_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipantDetails' {Text
displayName :: Text
$sel:displayName:ParticipantDetails' :: ParticipantDetails -> Text
displayName} -> Text
displayName) (\s :: ParticipantDetails
s@ParticipantDetails' {} Text
a -> ParticipantDetails
s {$sel:displayName:ParticipantDetails' :: Text
displayName = Text
a} :: ParticipantDetails)

instance Prelude.Hashable ParticipantDetails where
  hashWithSalt :: Int -> ParticipantDetails -> Int
hashWithSalt Int
_salt ParticipantDetails' {Text
displayName :: Text
$sel:displayName:ParticipantDetails' :: ParticipantDetails -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
displayName

instance Prelude.NFData ParticipantDetails where
  rnf :: ParticipantDetails -> ()
rnf ParticipantDetails' {Text
displayName :: Text
$sel:displayName:ParticipantDetails' :: ParticipantDetails -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
displayName

instance Data.ToJSON ParticipantDetails where
  toJSON :: ParticipantDetails -> Value
toJSON ParticipantDetails' {Text
displayName :: Text
$sel:displayName:ParticipantDetails' :: ParticipantDetails -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"DisplayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
displayName)]
      )