{-# 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.Connect.Types.UserPhoneConfig where
import Amazonka.Connect.Types.PhoneType
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
data UserPhoneConfig = UserPhoneConfig'
{
UserPhoneConfig -> Maybe Natural
afterContactWorkTimeLimit :: Prelude.Maybe Prelude.Natural,
UserPhoneConfig -> Maybe Bool
autoAccept :: Prelude.Maybe Prelude.Bool,
UserPhoneConfig -> Maybe Text
deskPhoneNumber :: Prelude.Maybe Prelude.Text,
UserPhoneConfig -> PhoneType
phoneType :: PhoneType
}
deriving (UserPhoneConfig -> UserPhoneConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserPhoneConfig -> UserPhoneConfig -> Bool
$c/= :: UserPhoneConfig -> UserPhoneConfig -> Bool
== :: UserPhoneConfig -> UserPhoneConfig -> Bool
$c== :: UserPhoneConfig -> UserPhoneConfig -> Bool
Prelude.Eq, ReadPrec [UserPhoneConfig]
ReadPrec UserPhoneConfig
Int -> ReadS UserPhoneConfig
ReadS [UserPhoneConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserPhoneConfig]
$creadListPrec :: ReadPrec [UserPhoneConfig]
readPrec :: ReadPrec UserPhoneConfig
$creadPrec :: ReadPrec UserPhoneConfig
readList :: ReadS [UserPhoneConfig]
$creadList :: ReadS [UserPhoneConfig]
readsPrec :: Int -> ReadS UserPhoneConfig
$creadsPrec :: Int -> ReadS UserPhoneConfig
Prelude.Read, Int -> UserPhoneConfig -> ShowS
[UserPhoneConfig] -> ShowS
UserPhoneConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserPhoneConfig] -> ShowS
$cshowList :: [UserPhoneConfig] -> ShowS
show :: UserPhoneConfig -> String
$cshow :: UserPhoneConfig -> String
showsPrec :: Int -> UserPhoneConfig -> ShowS
$cshowsPrec :: Int -> UserPhoneConfig -> ShowS
Prelude.Show, forall x. Rep UserPhoneConfig x -> UserPhoneConfig
forall x. UserPhoneConfig -> Rep UserPhoneConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserPhoneConfig x -> UserPhoneConfig
$cfrom :: forall x. UserPhoneConfig -> Rep UserPhoneConfig x
Prelude.Generic)
newUserPhoneConfig ::
PhoneType ->
UserPhoneConfig
newUserPhoneConfig :: PhoneType -> UserPhoneConfig
newUserPhoneConfig PhoneType
pPhoneType_ =
UserPhoneConfig'
{ $sel:afterContactWorkTimeLimit:UserPhoneConfig' :: Maybe Natural
afterContactWorkTimeLimit =
forall a. Maybe a
Prelude.Nothing,
$sel:autoAccept:UserPhoneConfig' :: Maybe Bool
autoAccept = forall a. Maybe a
Prelude.Nothing,
$sel:deskPhoneNumber:UserPhoneConfig' :: Maybe Text
deskPhoneNumber = forall a. Maybe a
Prelude.Nothing,
$sel:phoneType:UserPhoneConfig' :: PhoneType
phoneType = PhoneType
pPhoneType_
}
userPhoneConfig_afterContactWorkTimeLimit :: Lens.Lens' UserPhoneConfig (Prelude.Maybe Prelude.Natural)
userPhoneConfig_afterContactWorkTimeLimit :: Lens' UserPhoneConfig (Maybe Natural)
userPhoneConfig_afterContactWorkTimeLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPhoneConfig' {Maybe Natural
afterContactWorkTimeLimit :: Maybe Natural
$sel:afterContactWorkTimeLimit:UserPhoneConfig' :: UserPhoneConfig -> Maybe Natural
afterContactWorkTimeLimit} -> Maybe Natural
afterContactWorkTimeLimit) (\s :: UserPhoneConfig
s@UserPhoneConfig' {} Maybe Natural
a -> UserPhoneConfig
s {$sel:afterContactWorkTimeLimit:UserPhoneConfig' :: Maybe Natural
afterContactWorkTimeLimit = Maybe Natural
a} :: UserPhoneConfig)
userPhoneConfig_autoAccept :: Lens.Lens' UserPhoneConfig (Prelude.Maybe Prelude.Bool)
userPhoneConfig_autoAccept :: Lens' UserPhoneConfig (Maybe Bool)
userPhoneConfig_autoAccept = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPhoneConfig' {Maybe Bool
autoAccept :: Maybe Bool
$sel:autoAccept:UserPhoneConfig' :: UserPhoneConfig -> Maybe Bool
autoAccept} -> Maybe Bool
autoAccept) (\s :: UserPhoneConfig
s@UserPhoneConfig' {} Maybe Bool
a -> UserPhoneConfig
s {$sel:autoAccept:UserPhoneConfig' :: Maybe Bool
autoAccept = Maybe Bool
a} :: UserPhoneConfig)
userPhoneConfig_deskPhoneNumber :: Lens.Lens' UserPhoneConfig (Prelude.Maybe Prelude.Text)
userPhoneConfig_deskPhoneNumber :: Lens' UserPhoneConfig (Maybe Text)
userPhoneConfig_deskPhoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPhoneConfig' {Maybe Text
deskPhoneNumber :: Maybe Text
$sel:deskPhoneNumber:UserPhoneConfig' :: UserPhoneConfig -> Maybe Text
deskPhoneNumber} -> Maybe Text
deskPhoneNumber) (\s :: UserPhoneConfig
s@UserPhoneConfig' {} Maybe Text
a -> UserPhoneConfig
s {$sel:deskPhoneNumber:UserPhoneConfig' :: Maybe Text
deskPhoneNumber = Maybe Text
a} :: UserPhoneConfig)
userPhoneConfig_phoneType :: Lens.Lens' UserPhoneConfig PhoneType
userPhoneConfig_phoneType :: Lens' UserPhoneConfig PhoneType
userPhoneConfig_phoneType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPhoneConfig' {PhoneType
phoneType :: PhoneType
$sel:phoneType:UserPhoneConfig' :: UserPhoneConfig -> PhoneType
phoneType} -> PhoneType
phoneType) (\s :: UserPhoneConfig
s@UserPhoneConfig' {} PhoneType
a -> UserPhoneConfig
s {$sel:phoneType:UserPhoneConfig' :: PhoneType
phoneType = PhoneType
a} :: UserPhoneConfig)
instance Data.FromJSON UserPhoneConfig where
parseJSON :: Value -> Parser UserPhoneConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UserPhoneConfig"
( \Object
x ->
Maybe Natural
-> Maybe Bool -> Maybe Text -> PhoneType -> UserPhoneConfig
UserPhoneConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AfterContactWorkTimeLimit")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AutoAccept")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeskPhoneNumber")
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
"PhoneType")
)
instance Prelude.Hashable UserPhoneConfig where
hashWithSalt :: Int -> UserPhoneConfig -> Int
hashWithSalt Int
_salt UserPhoneConfig' {Maybe Bool
Maybe Natural
Maybe Text
PhoneType
phoneType :: PhoneType
deskPhoneNumber :: Maybe Text
autoAccept :: Maybe Bool
afterContactWorkTimeLimit :: Maybe Natural
$sel:phoneType:UserPhoneConfig' :: UserPhoneConfig -> PhoneType
$sel:deskPhoneNumber:UserPhoneConfig' :: UserPhoneConfig -> Maybe Text
$sel:autoAccept:UserPhoneConfig' :: UserPhoneConfig -> Maybe Bool
$sel:afterContactWorkTimeLimit:UserPhoneConfig' :: UserPhoneConfig -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
afterContactWorkTimeLimit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoAccept
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deskPhoneNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PhoneType
phoneType
instance Prelude.NFData UserPhoneConfig where
rnf :: UserPhoneConfig -> ()
rnf UserPhoneConfig' {Maybe Bool
Maybe Natural
Maybe Text
PhoneType
phoneType :: PhoneType
deskPhoneNumber :: Maybe Text
autoAccept :: Maybe Bool
afterContactWorkTimeLimit :: Maybe Natural
$sel:phoneType:UserPhoneConfig' :: UserPhoneConfig -> PhoneType
$sel:deskPhoneNumber:UserPhoneConfig' :: UserPhoneConfig -> Maybe Text
$sel:autoAccept:UserPhoneConfig' :: UserPhoneConfig -> Maybe Bool
$sel:afterContactWorkTimeLimit:UserPhoneConfig' :: UserPhoneConfig -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
afterContactWorkTimeLimit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoAccept
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deskPhoneNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PhoneType
phoneType
instance Data.ToJSON UserPhoneConfig where
toJSON :: UserPhoneConfig -> Value
toJSON UserPhoneConfig' {Maybe Bool
Maybe Natural
Maybe Text
PhoneType
phoneType :: PhoneType
deskPhoneNumber :: Maybe Text
autoAccept :: Maybe Bool
afterContactWorkTimeLimit :: Maybe Natural
$sel:phoneType:UserPhoneConfig' :: UserPhoneConfig -> PhoneType
$sel:deskPhoneNumber:UserPhoneConfig' :: UserPhoneConfig -> Maybe Text
$sel:autoAccept:UserPhoneConfig' :: UserPhoneConfig -> Maybe Bool
$sel:afterContactWorkTimeLimit:UserPhoneConfig' :: UserPhoneConfig -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AfterContactWorkTimeLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
afterContactWorkTimeLimit,
(Key
"AutoAccept" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
autoAccept,
(Key
"DeskPhoneNumber" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deskPhoneNumber,
forall a. a -> Maybe a
Prelude.Just (Key
"PhoneType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= PhoneType
phoneType)
]
)