{-# 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.AlexaBusiness.Types.PSTNDialIn
-- 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.AlexaBusiness.Types.PSTNDialIn 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 information for public switched telephone network (PSTN)
-- conferencing.
--
-- /See:/ 'newPSTNDialIn' smart constructor.
data PSTNDialIn = PSTNDialIn'
  { -- | The zip code.
    PSTNDialIn -> Text
countryCode :: Prelude.Text,
    -- | The phone number to call to join the conference.
    PSTNDialIn -> Text
phoneNumber :: Prelude.Text,
    -- | The delay duration before Alexa enters the conference ID with dual-tone
    -- multi-frequency (DTMF). Each number on the dial pad corresponds to a
    -- DTMF tone, which is how we send data over the telephone network.
    PSTNDialIn -> Text
oneClickIdDelay :: Prelude.Text,
    -- | The delay duration before Alexa enters the conference pin with dual-tone
    -- multi-frequency (DTMF). Each number on the dial pad corresponds to a
    -- DTMF tone, which is how we send data over the telephone network.
    PSTNDialIn -> Text
oneClickPinDelay :: Prelude.Text
  }
  deriving (PSTNDialIn -> PSTNDialIn -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PSTNDialIn -> PSTNDialIn -> Bool
$c/= :: PSTNDialIn -> PSTNDialIn -> Bool
== :: PSTNDialIn -> PSTNDialIn -> Bool
$c== :: PSTNDialIn -> PSTNDialIn -> Bool
Prelude.Eq, ReadPrec [PSTNDialIn]
ReadPrec PSTNDialIn
Int -> ReadS PSTNDialIn
ReadS [PSTNDialIn]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PSTNDialIn]
$creadListPrec :: ReadPrec [PSTNDialIn]
readPrec :: ReadPrec PSTNDialIn
$creadPrec :: ReadPrec PSTNDialIn
readList :: ReadS [PSTNDialIn]
$creadList :: ReadS [PSTNDialIn]
readsPrec :: Int -> ReadS PSTNDialIn
$creadsPrec :: Int -> ReadS PSTNDialIn
Prelude.Read, Int -> PSTNDialIn -> ShowS
[PSTNDialIn] -> ShowS
PSTNDialIn -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PSTNDialIn] -> ShowS
$cshowList :: [PSTNDialIn] -> ShowS
show :: PSTNDialIn -> String
$cshow :: PSTNDialIn -> String
showsPrec :: Int -> PSTNDialIn -> ShowS
$cshowsPrec :: Int -> PSTNDialIn -> ShowS
Prelude.Show, forall x. Rep PSTNDialIn x -> PSTNDialIn
forall x. PSTNDialIn -> Rep PSTNDialIn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PSTNDialIn x -> PSTNDialIn
$cfrom :: forall x. PSTNDialIn -> Rep PSTNDialIn x
Prelude.Generic)

-- |
-- Create a value of 'PSTNDialIn' 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:
--
-- 'countryCode', 'pSTNDialIn_countryCode' - The zip code.
--
-- 'phoneNumber', 'pSTNDialIn_phoneNumber' - The phone number to call to join the conference.
--
-- 'oneClickIdDelay', 'pSTNDialIn_oneClickIdDelay' - The delay duration before Alexa enters the conference ID with dual-tone
-- multi-frequency (DTMF). Each number on the dial pad corresponds to a
-- DTMF tone, which is how we send data over the telephone network.
--
-- 'oneClickPinDelay', 'pSTNDialIn_oneClickPinDelay' - The delay duration before Alexa enters the conference pin with dual-tone
-- multi-frequency (DTMF). Each number on the dial pad corresponds to a
-- DTMF tone, which is how we send data over the telephone network.
newPSTNDialIn ::
  -- | 'countryCode'
  Prelude.Text ->
  -- | 'phoneNumber'
  Prelude.Text ->
  -- | 'oneClickIdDelay'
  Prelude.Text ->
  -- | 'oneClickPinDelay'
  Prelude.Text ->
  PSTNDialIn
newPSTNDialIn :: Text -> Text -> Text -> Text -> PSTNDialIn
newPSTNDialIn
  Text
pCountryCode_
  Text
pPhoneNumber_
  Text
pOneClickIdDelay_
  Text
pOneClickPinDelay_ =
    PSTNDialIn'
      { $sel:countryCode:PSTNDialIn' :: Text
countryCode = Text
pCountryCode_,
        $sel:phoneNumber:PSTNDialIn' :: Text
phoneNumber = Text
pPhoneNumber_,
        $sel:oneClickIdDelay:PSTNDialIn' :: Text
oneClickIdDelay = Text
pOneClickIdDelay_,
        $sel:oneClickPinDelay:PSTNDialIn' :: Text
oneClickPinDelay = Text
pOneClickPinDelay_
      }

-- | The zip code.
pSTNDialIn_countryCode :: Lens.Lens' PSTNDialIn Prelude.Text
pSTNDialIn_countryCode :: Lens' PSTNDialIn Text
pSTNDialIn_countryCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PSTNDialIn' {Text
countryCode :: Text
$sel:countryCode:PSTNDialIn' :: PSTNDialIn -> Text
countryCode} -> Text
countryCode) (\s :: PSTNDialIn
s@PSTNDialIn' {} Text
a -> PSTNDialIn
s {$sel:countryCode:PSTNDialIn' :: Text
countryCode = Text
a} :: PSTNDialIn)

-- | The phone number to call to join the conference.
pSTNDialIn_phoneNumber :: Lens.Lens' PSTNDialIn Prelude.Text
pSTNDialIn_phoneNumber :: Lens' PSTNDialIn Text
pSTNDialIn_phoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PSTNDialIn' {Text
phoneNumber :: Text
$sel:phoneNumber:PSTNDialIn' :: PSTNDialIn -> Text
phoneNumber} -> Text
phoneNumber) (\s :: PSTNDialIn
s@PSTNDialIn' {} Text
a -> PSTNDialIn
s {$sel:phoneNumber:PSTNDialIn' :: Text
phoneNumber = Text
a} :: PSTNDialIn)

-- | The delay duration before Alexa enters the conference ID with dual-tone
-- multi-frequency (DTMF). Each number on the dial pad corresponds to a
-- DTMF tone, which is how we send data over the telephone network.
pSTNDialIn_oneClickIdDelay :: Lens.Lens' PSTNDialIn Prelude.Text
pSTNDialIn_oneClickIdDelay :: Lens' PSTNDialIn Text
pSTNDialIn_oneClickIdDelay = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PSTNDialIn' {Text
oneClickIdDelay :: Text
$sel:oneClickIdDelay:PSTNDialIn' :: PSTNDialIn -> Text
oneClickIdDelay} -> Text
oneClickIdDelay) (\s :: PSTNDialIn
s@PSTNDialIn' {} Text
a -> PSTNDialIn
s {$sel:oneClickIdDelay:PSTNDialIn' :: Text
oneClickIdDelay = Text
a} :: PSTNDialIn)

-- | The delay duration before Alexa enters the conference pin with dual-tone
-- multi-frequency (DTMF). Each number on the dial pad corresponds to a
-- DTMF tone, which is how we send data over the telephone network.
pSTNDialIn_oneClickPinDelay :: Lens.Lens' PSTNDialIn Prelude.Text
pSTNDialIn_oneClickPinDelay :: Lens' PSTNDialIn Text
pSTNDialIn_oneClickPinDelay = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PSTNDialIn' {Text
oneClickPinDelay :: Text
$sel:oneClickPinDelay:PSTNDialIn' :: PSTNDialIn -> Text
oneClickPinDelay} -> Text
oneClickPinDelay) (\s :: PSTNDialIn
s@PSTNDialIn' {} Text
a -> PSTNDialIn
s {$sel:oneClickPinDelay:PSTNDialIn' :: Text
oneClickPinDelay = Text
a} :: PSTNDialIn)

instance Data.FromJSON PSTNDialIn where
  parseJSON :: Value -> Parser PSTNDialIn
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PSTNDialIn"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> PSTNDialIn
PSTNDialIn'
            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
"CountryCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"OneClickIdDelay")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OneClickPinDelay")
      )

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

instance Prelude.NFData PSTNDialIn where
  rnf :: PSTNDialIn -> ()
rnf PSTNDialIn' {Text
oneClickPinDelay :: Text
oneClickIdDelay :: Text
phoneNumber :: Text
countryCode :: Text
$sel:oneClickPinDelay:PSTNDialIn' :: PSTNDialIn -> Text
$sel:oneClickIdDelay:PSTNDialIn' :: PSTNDialIn -> Text
$sel:phoneNumber:PSTNDialIn' :: PSTNDialIn -> Text
$sel:countryCode:PSTNDialIn' :: PSTNDialIn -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
countryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
phoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
oneClickIdDelay
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
oneClickPinDelay

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