{-# 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.QuickConnectConfig where
import Amazonka.Connect.Types.PhoneNumberQuickConnectConfig
import Amazonka.Connect.Types.QueueQuickConnectConfig
import Amazonka.Connect.Types.QuickConnectType
import Amazonka.Connect.Types.UserQuickConnectConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data QuickConnectConfig = QuickConnectConfig'
{
QuickConnectConfig -> Maybe QueueQuickConnectConfig
queueConfig :: Prelude.Maybe QueueQuickConnectConfig,
QuickConnectConfig -> Maybe UserQuickConnectConfig
userConfig :: Prelude.Maybe UserQuickConnectConfig,
QuickConnectConfig -> Maybe PhoneNumberQuickConnectConfig
phoneConfig :: Prelude.Maybe PhoneNumberQuickConnectConfig,
QuickConnectConfig -> QuickConnectType
quickConnectType :: QuickConnectType
}
deriving (QuickConnectConfig -> QuickConnectConfig -> Bool
(QuickConnectConfig -> QuickConnectConfig -> Bool)
-> (QuickConnectConfig -> QuickConnectConfig -> Bool)
-> Eq QuickConnectConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QuickConnectConfig -> QuickConnectConfig -> Bool
$c/= :: QuickConnectConfig -> QuickConnectConfig -> Bool
== :: QuickConnectConfig -> QuickConnectConfig -> Bool
$c== :: QuickConnectConfig -> QuickConnectConfig -> Bool
Prelude.Eq, ReadPrec [QuickConnectConfig]
ReadPrec QuickConnectConfig
Int -> ReadS QuickConnectConfig
ReadS [QuickConnectConfig]
(Int -> ReadS QuickConnectConfig)
-> ReadS [QuickConnectConfig]
-> ReadPrec QuickConnectConfig
-> ReadPrec [QuickConnectConfig]
-> Read QuickConnectConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QuickConnectConfig]
$creadListPrec :: ReadPrec [QuickConnectConfig]
readPrec :: ReadPrec QuickConnectConfig
$creadPrec :: ReadPrec QuickConnectConfig
readList :: ReadS [QuickConnectConfig]
$creadList :: ReadS [QuickConnectConfig]
readsPrec :: Int -> ReadS QuickConnectConfig
$creadsPrec :: Int -> ReadS QuickConnectConfig
Prelude.Read, Int -> QuickConnectConfig -> ShowS
[QuickConnectConfig] -> ShowS
QuickConnectConfig -> String
(Int -> QuickConnectConfig -> ShowS)
-> (QuickConnectConfig -> String)
-> ([QuickConnectConfig] -> ShowS)
-> Show QuickConnectConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QuickConnectConfig] -> ShowS
$cshowList :: [QuickConnectConfig] -> ShowS
show :: QuickConnectConfig -> String
$cshow :: QuickConnectConfig -> String
showsPrec :: Int -> QuickConnectConfig -> ShowS
$cshowsPrec :: Int -> QuickConnectConfig -> ShowS
Prelude.Show, (forall x. QuickConnectConfig -> Rep QuickConnectConfig x)
-> (forall x. Rep QuickConnectConfig x -> QuickConnectConfig)
-> Generic QuickConnectConfig
forall x. Rep QuickConnectConfig x -> QuickConnectConfig
forall x. QuickConnectConfig -> Rep QuickConnectConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QuickConnectConfig x -> QuickConnectConfig
$cfrom :: forall x. QuickConnectConfig -> Rep QuickConnectConfig x
Prelude.Generic)
newQuickConnectConfig ::
QuickConnectType ->
QuickConnectConfig
newQuickConnectConfig :: QuickConnectType -> QuickConnectConfig
newQuickConnectConfig QuickConnectType
pQuickConnectType_ =
QuickConnectConfig' :: Maybe QueueQuickConnectConfig
-> Maybe UserQuickConnectConfig
-> Maybe PhoneNumberQuickConnectConfig
-> QuickConnectType
-> QuickConnectConfig
QuickConnectConfig'
{ $sel:queueConfig:QuickConnectConfig' :: Maybe QueueQuickConnectConfig
queueConfig = Maybe QueueQuickConnectConfig
forall a. Maybe a
Prelude.Nothing,
$sel:userConfig:QuickConnectConfig' :: Maybe UserQuickConnectConfig
userConfig = Maybe UserQuickConnectConfig
forall a. Maybe a
Prelude.Nothing,
$sel:phoneConfig:QuickConnectConfig' :: Maybe PhoneNumberQuickConnectConfig
phoneConfig = Maybe PhoneNumberQuickConnectConfig
forall a. Maybe a
Prelude.Nothing,
$sel:quickConnectType:QuickConnectConfig' :: QuickConnectType
quickConnectType = QuickConnectType
pQuickConnectType_
}
quickConnectConfig_queueConfig :: Lens.Lens' QuickConnectConfig (Prelude.Maybe QueueQuickConnectConfig)
quickConnectConfig_queueConfig :: (Maybe QueueQuickConnectConfig
-> f (Maybe QueueQuickConnectConfig))
-> QuickConnectConfig -> f QuickConnectConfig
quickConnectConfig_queueConfig = (QuickConnectConfig -> Maybe QueueQuickConnectConfig)
-> (QuickConnectConfig
-> Maybe QueueQuickConnectConfig -> QuickConnectConfig)
-> Lens
QuickConnectConfig
QuickConnectConfig
(Maybe QueueQuickConnectConfig)
(Maybe QueueQuickConnectConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnectConfig' {Maybe QueueQuickConnectConfig
queueConfig :: Maybe QueueQuickConnectConfig
$sel:queueConfig:QuickConnectConfig' :: QuickConnectConfig -> Maybe QueueQuickConnectConfig
queueConfig} -> Maybe QueueQuickConnectConfig
queueConfig) (\s :: QuickConnectConfig
s@QuickConnectConfig' {} Maybe QueueQuickConnectConfig
a -> QuickConnectConfig
s {$sel:queueConfig:QuickConnectConfig' :: Maybe QueueQuickConnectConfig
queueConfig = Maybe QueueQuickConnectConfig
a} :: QuickConnectConfig)
quickConnectConfig_userConfig :: Lens.Lens' QuickConnectConfig (Prelude.Maybe UserQuickConnectConfig)
quickConnectConfig_userConfig :: (Maybe UserQuickConnectConfig -> f (Maybe UserQuickConnectConfig))
-> QuickConnectConfig -> f QuickConnectConfig
quickConnectConfig_userConfig = (QuickConnectConfig -> Maybe UserQuickConnectConfig)
-> (QuickConnectConfig
-> Maybe UserQuickConnectConfig -> QuickConnectConfig)
-> Lens
QuickConnectConfig
QuickConnectConfig
(Maybe UserQuickConnectConfig)
(Maybe UserQuickConnectConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnectConfig' {Maybe UserQuickConnectConfig
userConfig :: Maybe UserQuickConnectConfig
$sel:userConfig:QuickConnectConfig' :: QuickConnectConfig -> Maybe UserQuickConnectConfig
userConfig} -> Maybe UserQuickConnectConfig
userConfig) (\s :: QuickConnectConfig
s@QuickConnectConfig' {} Maybe UserQuickConnectConfig
a -> QuickConnectConfig
s {$sel:userConfig:QuickConnectConfig' :: Maybe UserQuickConnectConfig
userConfig = Maybe UserQuickConnectConfig
a} :: QuickConnectConfig)
quickConnectConfig_phoneConfig :: Lens.Lens' QuickConnectConfig (Prelude.Maybe PhoneNumberQuickConnectConfig)
quickConnectConfig_phoneConfig :: (Maybe PhoneNumberQuickConnectConfig
-> f (Maybe PhoneNumberQuickConnectConfig))
-> QuickConnectConfig -> f QuickConnectConfig
quickConnectConfig_phoneConfig = (QuickConnectConfig -> Maybe PhoneNumberQuickConnectConfig)
-> (QuickConnectConfig
-> Maybe PhoneNumberQuickConnectConfig -> QuickConnectConfig)
-> Lens
QuickConnectConfig
QuickConnectConfig
(Maybe PhoneNumberQuickConnectConfig)
(Maybe PhoneNumberQuickConnectConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnectConfig' {Maybe PhoneNumberQuickConnectConfig
phoneConfig :: Maybe PhoneNumberQuickConnectConfig
$sel:phoneConfig:QuickConnectConfig' :: QuickConnectConfig -> Maybe PhoneNumberQuickConnectConfig
phoneConfig} -> Maybe PhoneNumberQuickConnectConfig
phoneConfig) (\s :: QuickConnectConfig
s@QuickConnectConfig' {} Maybe PhoneNumberQuickConnectConfig
a -> QuickConnectConfig
s {$sel:phoneConfig:QuickConnectConfig' :: Maybe PhoneNumberQuickConnectConfig
phoneConfig = Maybe PhoneNumberQuickConnectConfig
a} :: QuickConnectConfig)
quickConnectConfig_quickConnectType :: Lens.Lens' QuickConnectConfig QuickConnectType
quickConnectConfig_quickConnectType :: (QuickConnectType -> f QuickConnectType)
-> QuickConnectConfig -> f QuickConnectConfig
quickConnectConfig_quickConnectType = (QuickConnectConfig -> QuickConnectType)
-> (QuickConnectConfig -> QuickConnectType -> QuickConnectConfig)
-> Lens
QuickConnectConfig
QuickConnectConfig
QuickConnectType
QuickConnectType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuickConnectConfig' {QuickConnectType
quickConnectType :: QuickConnectType
$sel:quickConnectType:QuickConnectConfig' :: QuickConnectConfig -> QuickConnectType
quickConnectType} -> QuickConnectType
quickConnectType) (\s :: QuickConnectConfig
s@QuickConnectConfig' {} QuickConnectType
a -> QuickConnectConfig
s {$sel:quickConnectType:QuickConnectConfig' :: QuickConnectType
quickConnectType = QuickConnectType
a} :: QuickConnectConfig)
instance Core.FromJSON QuickConnectConfig where
parseJSON :: Value -> Parser QuickConnectConfig
parseJSON =
String
-> (Object -> Parser QuickConnectConfig)
-> Value
-> Parser QuickConnectConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"QuickConnectConfig"
( \Object
x ->
Maybe QueueQuickConnectConfig
-> Maybe UserQuickConnectConfig
-> Maybe PhoneNumberQuickConnectConfig
-> QuickConnectType
-> QuickConnectConfig
QuickConnectConfig'
(Maybe QueueQuickConnectConfig
-> Maybe UserQuickConnectConfig
-> Maybe PhoneNumberQuickConnectConfig
-> QuickConnectType
-> QuickConnectConfig)
-> Parser (Maybe QueueQuickConnectConfig)
-> Parser
(Maybe UserQuickConnectConfig
-> Maybe PhoneNumberQuickConnectConfig
-> QuickConnectType
-> QuickConnectConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe QueueQuickConnectConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QueueConfig")
Parser
(Maybe UserQuickConnectConfig
-> Maybe PhoneNumberQuickConnectConfig
-> QuickConnectType
-> QuickConnectConfig)
-> Parser (Maybe UserQuickConnectConfig)
-> Parser
(Maybe PhoneNumberQuickConnectConfig
-> QuickConnectType -> QuickConnectConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserQuickConnectConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserConfig")
Parser
(Maybe PhoneNumberQuickConnectConfig
-> QuickConnectType -> QuickConnectConfig)
-> Parser (Maybe PhoneNumberQuickConnectConfig)
-> Parser (QuickConnectType -> QuickConnectConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PhoneNumberQuickConnectConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PhoneConfig")
Parser (QuickConnectType -> QuickConnectConfig)
-> Parser QuickConnectType -> Parser QuickConnectConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser QuickConnectType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"QuickConnectType")
)
instance Prelude.Hashable QuickConnectConfig
instance Prelude.NFData QuickConnectConfig
instance Core.ToJSON QuickConnectConfig where
toJSON :: QuickConnectConfig -> Value
toJSON QuickConnectConfig' {Maybe PhoneNumberQuickConnectConfig
Maybe QueueQuickConnectConfig
Maybe UserQuickConnectConfig
QuickConnectType
quickConnectType :: QuickConnectType
phoneConfig :: Maybe PhoneNumberQuickConnectConfig
userConfig :: Maybe UserQuickConnectConfig
queueConfig :: Maybe QueueQuickConnectConfig
$sel:quickConnectType:QuickConnectConfig' :: QuickConnectConfig -> QuickConnectType
$sel:phoneConfig:QuickConnectConfig' :: QuickConnectConfig -> Maybe PhoneNumberQuickConnectConfig
$sel:userConfig:QuickConnectConfig' :: QuickConnectConfig -> Maybe UserQuickConnectConfig
$sel:queueConfig:QuickConnectConfig' :: QuickConnectConfig -> Maybe QueueQuickConnectConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"QueueConfig" Text -> QueueQuickConnectConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (QueueQuickConnectConfig -> Pair)
-> Maybe QueueQuickConnectConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe QueueQuickConnectConfig
queueConfig,
(Text
"UserConfig" Text -> UserQuickConnectConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (UserQuickConnectConfig -> Pair)
-> Maybe UserQuickConnectConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserQuickConnectConfig
userConfig,
(Text
"PhoneConfig" Text -> PhoneNumberQuickConnectConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PhoneNumberQuickConnectConfig -> Pair)
-> Maybe PhoneNumberQuickConnectConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PhoneNumberQuickConnectConfig
phoneConfig,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"QuickConnectType" Text -> QuickConnectType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= QuickConnectType
quickConnectType)
]
)