{-# 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-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.AlexaBusiness.Types.PSTNDialIn where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(PSTNDialIn -> PSTNDialIn -> Bool)
-> (PSTNDialIn -> PSTNDialIn -> Bool) -> Eq PSTNDialIn
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]
(Int -> ReadS PSTNDialIn)
-> ReadS [PSTNDialIn]
-> ReadPrec PSTNDialIn
-> ReadPrec [PSTNDialIn]
-> Read 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
(Int -> PSTNDialIn -> ShowS)
-> (PSTNDialIn -> String)
-> ([PSTNDialIn] -> ShowS)
-> Show PSTNDialIn
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. PSTNDialIn -> Rep PSTNDialIn x)
-> (forall x. Rep PSTNDialIn x -> PSTNDialIn) -> Generic PSTNDialIn
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' :: Text -> Text -> Text -> Text -> PSTNDialIn
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 :: (Text -> f Text) -> PSTNDialIn -> f PSTNDialIn
pSTNDialIn_countryCode = (PSTNDialIn -> Text)
-> (PSTNDialIn -> Text -> PSTNDialIn)
-> Lens PSTNDialIn PSTNDialIn Text Text
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 :: (Text -> f Text) -> PSTNDialIn -> f PSTNDialIn
pSTNDialIn_phoneNumber = (PSTNDialIn -> Text)
-> (PSTNDialIn -> Text -> PSTNDialIn)
-> Lens PSTNDialIn PSTNDialIn Text Text
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 :: (Text -> f Text) -> PSTNDialIn -> f PSTNDialIn
pSTNDialIn_oneClickIdDelay = (PSTNDialIn -> Text)
-> (PSTNDialIn -> Text -> PSTNDialIn)
-> Lens PSTNDialIn PSTNDialIn Text Text
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 :: (Text -> f Text) -> PSTNDialIn -> f PSTNDialIn
pSTNDialIn_oneClickPinDelay = (PSTNDialIn -> Text)
-> (PSTNDialIn -> Text -> PSTNDialIn)
-> Lens PSTNDialIn PSTNDialIn Text Text
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 Core.FromJSON PSTNDialIn where
  parseJSON :: Value -> Parser PSTNDialIn
parseJSON =
    String
-> (Object -> Parser PSTNDialIn) -> Value -> Parser PSTNDialIn
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PSTNDialIn"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> PSTNDialIn
PSTNDialIn'
            (Text -> Text -> Text -> Text -> PSTNDialIn)
-> Parser Text -> Parser (Text -> Text -> Text -> PSTNDialIn)
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
"CountryCode")
            Parser (Text -> Text -> Text -> PSTNDialIn)
-> Parser Text -> Parser (Text -> Text -> PSTNDialIn)
forall (f :: * -> *) a b. Applicative f => 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")
            Parser (Text -> Text -> PSTNDialIn)
-> Parser Text -> Parser (Text -> PSTNDialIn)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OneClickIdDelay")
            Parser (Text -> PSTNDialIn) -> Parser Text -> Parser PSTNDialIn
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OneClickPinDelay")
      )

instance Prelude.Hashable PSTNDialIn

instance Prelude.NFData PSTNDialIn

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CountryCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
countryCode),
            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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OneClickIdDelay" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
oneClickIdDelay),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OneClickPinDelay" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
oneClickPinDelay)
          ]
      )