{-# 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-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.PhoneNumberQuickConnectConfig where

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

-- | The phone number in E.164 format.
phoneNumberQuickConnectConfig_phoneNumber :: Lens.Lens' PhoneNumberQuickConnectConfig Prelude.Text
phoneNumberQuickConnectConfig_phoneNumber :: (Text -> f Text)
-> PhoneNumberQuickConnectConfig -> f PhoneNumberQuickConnectConfig
phoneNumberQuickConnectConfig_phoneNumber = (PhoneNumberQuickConnectConfig -> Text)
-> (PhoneNumberQuickConnectConfig
    -> Text -> PhoneNumberQuickConnectConfig)
-> Lens
     PhoneNumberQuickConnectConfig
     PhoneNumberQuickConnectConfig
     Text
     Text
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 Core.FromJSON PhoneNumberQuickConnectConfig where
  parseJSON :: Value -> Parser PhoneNumberQuickConnectConfig
parseJSON =
    String
-> (Object -> Parser PhoneNumberQuickConnectConfig)
-> Value
-> Parser PhoneNumberQuickConnectConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PhoneNumberQuickConnectConfig"
      ( \Object
x ->
          Text -> PhoneNumberQuickConnectConfig
PhoneNumberQuickConnectConfig'
            (Text -> PhoneNumberQuickConnectConfig)
-> Parser Text -> Parser PhoneNumberQuickConnectConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"PhoneNumber")
      )

instance
  Prelude.Hashable
    PhoneNumberQuickConnectConfig

instance Prelude.NFData PhoneNumberQuickConnectConfig

instance Core.ToJSON PhoneNumberQuickConnectConfig where
  toJSON :: PhoneNumberQuickConnectConfig -> Value
toJSON PhoneNumberQuickConnectConfig' {Text
phoneNumber :: Text
$sel:phoneNumber:PhoneNumberQuickConnectConfig' :: PhoneNumberQuickConnectConfig -> 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
"PhoneNumber" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
phoneNumber)]
      )