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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ParticipantDetails -> ParticipantDetails -> Bool)
-> (ParticipantDetails -> ParticipantDetails -> Bool)
-> Eq ParticipantDetails
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]
(Int -> ReadS ParticipantDetails)
-> ReadS [ParticipantDetails]
-> ReadPrec ParticipantDetails
-> ReadPrec [ParticipantDetails]
-> Read 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
(Int -> ParticipantDetails -> ShowS)
-> (ParticipantDetails -> String)
-> ([ParticipantDetails] -> ShowS)
-> Show ParticipantDetails
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. ParticipantDetails -> Rep ParticipantDetails x)
-> (forall x. Rep ParticipantDetails x -> ParticipantDetails)
-> Generic ParticipantDetails
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' :: Text -> ParticipantDetails
ParticipantDetails' {$sel:displayName:ParticipantDetails' :: Text
displayName = Text
pDisplayName_}

-- | Display name of the participant.
participantDetails_displayName :: Lens.Lens' ParticipantDetails Prelude.Text
participantDetails_displayName :: (Text -> f Text) -> ParticipantDetails -> f ParticipantDetails
participantDetails_displayName = (ParticipantDetails -> Text)
-> (ParticipantDetails -> Text -> ParticipantDetails)
-> Lens ParticipantDetails ParticipantDetails Text Text
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

instance Prelude.NFData ParticipantDetails

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