{-# 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.ChimeSdkVoice.Types.Participant
-- 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.ChimeSdkVoice.Types.Participant 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

-- | /See:/ 'newParticipant' smart constructor.
data Participant = Participant'
  { Participant -> Maybe (Sensitive Text)
phoneNumber :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    Participant -> Maybe (Sensitive Text)
proxyPhoneNumber :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (Participant -> Participant -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Participant -> Participant -> Bool
$c/= :: Participant -> Participant -> Bool
== :: Participant -> Participant -> Bool
$c== :: Participant -> Participant -> Bool
Prelude.Eq, Int -> Participant -> ShowS
[Participant] -> ShowS
Participant -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Participant] -> ShowS
$cshowList :: [Participant] -> ShowS
show :: Participant -> String
$cshow :: Participant -> String
showsPrec :: Int -> Participant -> ShowS
$cshowsPrec :: Int -> Participant -> ShowS
Prelude.Show, forall x. Rep Participant x -> Participant
forall x. Participant -> Rep Participant x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Participant x -> Participant
$cfrom :: forall x. Participant -> Rep Participant x
Prelude.Generic)

-- |
-- Create a value of 'Participant' 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:
--
-- 'phoneNumber', 'participant_phoneNumber' - Undocumented member.
--
-- 'proxyPhoneNumber', 'participant_proxyPhoneNumber' - Undocumented member.
newParticipant ::
  Participant
newParticipant :: Participant
newParticipant =
  Participant'
    { $sel:phoneNumber:Participant' :: Maybe (Sensitive Text)
phoneNumber = forall a. Maybe a
Prelude.Nothing,
      $sel:proxyPhoneNumber:Participant' :: Maybe (Sensitive Text)
proxyPhoneNumber = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
participant_phoneNumber :: Lens.Lens' Participant (Prelude.Maybe Prelude.Text)
participant_phoneNumber :: Lens' Participant (Maybe Text)
participant_phoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Participant' {Maybe (Sensitive Text)
phoneNumber :: Maybe (Sensitive Text)
$sel:phoneNumber:Participant' :: Participant -> Maybe (Sensitive Text)
phoneNumber} -> Maybe (Sensitive Text)
phoneNumber) (\s :: Participant
s@Participant' {} Maybe (Sensitive Text)
a -> Participant
s {$sel:phoneNumber:Participant' :: Maybe (Sensitive Text)
phoneNumber = Maybe (Sensitive Text)
a} :: Participant) 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 a. Iso' (Sensitive a) a
Data._Sensitive

-- | Undocumented member.
participant_proxyPhoneNumber :: Lens.Lens' Participant (Prelude.Maybe Prelude.Text)
participant_proxyPhoneNumber :: Lens' Participant (Maybe Text)
participant_proxyPhoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Participant' {Maybe (Sensitive Text)
proxyPhoneNumber :: Maybe (Sensitive Text)
$sel:proxyPhoneNumber:Participant' :: Participant -> Maybe (Sensitive Text)
proxyPhoneNumber} -> Maybe (Sensitive Text)
proxyPhoneNumber) (\s :: Participant
s@Participant' {} Maybe (Sensitive Text)
a -> Participant
s {$sel:proxyPhoneNumber:Participant' :: Maybe (Sensitive Text)
proxyPhoneNumber = Maybe (Sensitive Text)
a} :: Participant) 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 a. Iso' (Sensitive a) a
Data._Sensitive

instance Data.FromJSON Participant where
  parseJSON :: Value -> Parser Participant
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Participant"
      ( \Object
x ->
          Maybe (Sensitive Text) -> Maybe (Sensitive Text) -> Participant
Participant'
            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
"PhoneNumber")
            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
"ProxyPhoneNumber")
      )

instance Prelude.Hashable Participant where
  hashWithSalt :: Int -> Participant -> Int
hashWithSalt Int
_salt Participant' {Maybe (Sensitive Text)
proxyPhoneNumber :: Maybe (Sensitive Text)
phoneNumber :: Maybe (Sensitive Text)
$sel:proxyPhoneNumber:Participant' :: Participant -> Maybe (Sensitive Text)
$sel:phoneNumber:Participant' :: Participant -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
phoneNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
proxyPhoneNumber

instance Prelude.NFData Participant where
  rnf :: Participant -> ()
rnf Participant' {Maybe (Sensitive Text)
proxyPhoneNumber :: Maybe (Sensitive Text)
phoneNumber :: Maybe (Sensitive Text)
$sel:proxyPhoneNumber:Participant' :: Participant -> Maybe (Sensitive Text)
$sel:phoneNumber:Participant' :: Participant -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
phoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
proxyPhoneNumber