{-# 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.PhoneNumberQuickConnectConfig
-- 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.PhoneNumberQuickConnectConfig 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 a phone number for a quick connect.
--
-- /See:/ 'newPhoneNumberQuickConnectConfig' smart constructor.
data PhoneNumberQuickConnectConfig = PhoneNumberQuickConnectConfig'
  { -- | The phone number in E.164 format.
    PhoneNumberQuickConnectConfig -> Text
phoneNumber :: Prelude.Text
  }
  deriving (PhoneNumberQuickConnectConfig
-> PhoneNumberQuickConnectConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhoneNumberQuickConnectConfig
-> PhoneNumberQuickConnectConfig -> Bool
$c/= :: PhoneNumberQuickConnectConfig
-> PhoneNumberQuickConnectConfig -> Bool
== :: PhoneNumberQuickConnectConfig
-> PhoneNumberQuickConnectConfig -> Bool
$c== :: PhoneNumberQuickConnectConfig
-> PhoneNumberQuickConnectConfig -> Bool
Prelude.Eq, ReadPrec [PhoneNumberQuickConnectConfig]
ReadPrec PhoneNumberQuickConnectConfig
Int -> ReadS PhoneNumberQuickConnectConfig
ReadS [PhoneNumberQuickConnectConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhoneNumberQuickConnectConfig]
$creadListPrec :: ReadPrec [PhoneNumberQuickConnectConfig]
readPrec :: ReadPrec PhoneNumberQuickConnectConfig
$creadPrec :: ReadPrec PhoneNumberQuickConnectConfig
readList :: ReadS [PhoneNumberQuickConnectConfig]
$creadList :: ReadS [PhoneNumberQuickConnectConfig]
readsPrec :: Int -> ReadS PhoneNumberQuickConnectConfig
$creadsPrec :: Int -> ReadS PhoneNumberQuickConnectConfig
Prelude.Read, Int -> PhoneNumberQuickConnectConfig -> ShowS
[PhoneNumberQuickConnectConfig] -> ShowS
PhoneNumberQuickConnectConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhoneNumberQuickConnectConfig] -> ShowS
$cshowList :: [PhoneNumberQuickConnectConfig] -> ShowS
show :: PhoneNumberQuickConnectConfig -> String
$cshow :: PhoneNumberQuickConnectConfig -> String
showsPrec :: Int -> PhoneNumberQuickConnectConfig -> ShowS
$cshowsPrec :: Int -> PhoneNumberQuickConnectConfig -> ShowS
Prelude.Show, forall x.
Rep PhoneNumberQuickConnectConfig x
-> PhoneNumberQuickConnectConfig
forall x.
PhoneNumberQuickConnectConfig
-> Rep PhoneNumberQuickConnectConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PhoneNumberQuickConnectConfig x
-> PhoneNumberQuickConnectConfig
$cfrom :: forall x.
PhoneNumberQuickConnectConfig
-> Rep PhoneNumberQuickConnectConfig x
Prelude.Generic)

-- |
-- Create a value of 'PhoneNumberQuickConnectConfig' 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', 'phoneNumberQuickConnectConfig_phoneNumber' - The phone number in E.164 format.
newPhoneNumberQuickConnectConfig ::
  -- | 'phoneNumber'
  Prelude.Text ->
  PhoneNumberQuickConnectConfig
newPhoneNumberQuickConnectConfig :: Text -> PhoneNumberQuickConnectConfig
newPhoneNumberQuickConnectConfig Text
pPhoneNumber_ =
  PhoneNumberQuickConnectConfig'
    { $sel:phoneNumber:PhoneNumberQuickConnectConfig' :: Text
phoneNumber =
        Text
pPhoneNumber_
    }

-- | The phone number in E.164 format.
phoneNumberQuickConnectConfig_phoneNumber :: Lens.Lens' PhoneNumberQuickConnectConfig Prelude.Text
phoneNumberQuickConnectConfig_phoneNumber :: Lens' PhoneNumberQuickConnectConfig Text
phoneNumberQuickConnectConfig_phoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberQuickConnectConfig' {Text
phoneNumber :: Text
$sel:phoneNumber:PhoneNumberQuickConnectConfig' :: PhoneNumberQuickConnectConfig -> Text
phoneNumber} -> Text
phoneNumber) (\s :: PhoneNumberQuickConnectConfig
s@PhoneNumberQuickConnectConfig' {} Text
a -> PhoneNumberQuickConnectConfig
s {$sel:phoneNumber:PhoneNumberQuickConnectConfig' :: Text
phoneNumber = Text
a} :: PhoneNumberQuickConnectConfig)

instance Data.FromJSON PhoneNumberQuickConnectConfig where
  parseJSON :: Value -> Parser PhoneNumberQuickConnectConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PhoneNumberQuickConnectConfig"
      ( \Object
x ->
          Text -> PhoneNumberQuickConnectConfig
PhoneNumberQuickConnectConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PhoneNumber")
      )

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

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

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