{-# 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 #-}
module Amazonka.AlexaBusiness.Types.PSTNDialIn where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PSTNDialIn = PSTNDialIn'
{
PSTNDialIn -> Text
countryCode :: Prelude.Text,
PSTNDialIn -> Text
phoneNumber :: Prelude.Text,
PSTNDialIn -> Text
oneClickIdDelay :: Prelude.Text,
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)
newPSTNDialIn ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
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_
}
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)
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)
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)
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)
]
)