{-# 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.LexBotConfig where
import Amazonka.Connect.Types.LexBot
import Amazonka.Connect.Types.LexV2Bot
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LexBotConfig = LexBotConfig'
{ LexBotConfig -> Maybe LexBot
lexBot :: Prelude.Maybe LexBot,
LexBotConfig -> Maybe LexV2Bot
lexV2Bot :: Prelude.Maybe LexV2Bot
}
deriving (LexBotConfig -> LexBotConfig -> Bool
(LexBotConfig -> LexBotConfig -> Bool)
-> (LexBotConfig -> LexBotConfig -> Bool) -> Eq LexBotConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LexBotConfig -> LexBotConfig -> Bool
$c/= :: LexBotConfig -> LexBotConfig -> Bool
== :: LexBotConfig -> LexBotConfig -> Bool
$c== :: LexBotConfig -> LexBotConfig -> Bool
Prelude.Eq, ReadPrec [LexBotConfig]
ReadPrec LexBotConfig
Int -> ReadS LexBotConfig
ReadS [LexBotConfig]
(Int -> ReadS LexBotConfig)
-> ReadS [LexBotConfig]
-> ReadPrec LexBotConfig
-> ReadPrec [LexBotConfig]
-> Read LexBotConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LexBotConfig]
$creadListPrec :: ReadPrec [LexBotConfig]
readPrec :: ReadPrec LexBotConfig
$creadPrec :: ReadPrec LexBotConfig
readList :: ReadS [LexBotConfig]
$creadList :: ReadS [LexBotConfig]
readsPrec :: Int -> ReadS LexBotConfig
$creadsPrec :: Int -> ReadS LexBotConfig
Prelude.Read, Int -> LexBotConfig -> ShowS
[LexBotConfig] -> ShowS
LexBotConfig -> String
(Int -> LexBotConfig -> ShowS)
-> (LexBotConfig -> String)
-> ([LexBotConfig] -> ShowS)
-> Show LexBotConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LexBotConfig] -> ShowS
$cshowList :: [LexBotConfig] -> ShowS
show :: LexBotConfig -> String
$cshow :: LexBotConfig -> String
showsPrec :: Int -> LexBotConfig -> ShowS
$cshowsPrec :: Int -> LexBotConfig -> ShowS
Prelude.Show, (forall x. LexBotConfig -> Rep LexBotConfig x)
-> (forall x. Rep LexBotConfig x -> LexBotConfig)
-> Generic LexBotConfig
forall x. Rep LexBotConfig x -> LexBotConfig
forall x. LexBotConfig -> Rep LexBotConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LexBotConfig x -> LexBotConfig
$cfrom :: forall x. LexBotConfig -> Rep LexBotConfig x
Prelude.Generic)
newLexBotConfig ::
LexBotConfig
newLexBotConfig :: LexBotConfig
newLexBotConfig =
LexBotConfig' :: Maybe LexBot -> Maybe LexV2Bot -> LexBotConfig
LexBotConfig'
{ $sel:lexBot:LexBotConfig' :: Maybe LexBot
lexBot = Maybe LexBot
forall a. Maybe a
Prelude.Nothing,
$sel:lexV2Bot:LexBotConfig' :: Maybe LexV2Bot
lexV2Bot = Maybe LexV2Bot
forall a. Maybe a
Prelude.Nothing
}
lexBotConfig_lexBot :: Lens.Lens' LexBotConfig (Prelude.Maybe LexBot)
lexBotConfig_lexBot :: (Maybe LexBot -> f (Maybe LexBot))
-> LexBotConfig -> f LexBotConfig
lexBotConfig_lexBot = (LexBotConfig -> Maybe LexBot)
-> (LexBotConfig -> Maybe LexBot -> LexBotConfig)
-> Lens LexBotConfig LexBotConfig (Maybe LexBot) (Maybe LexBot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexBotConfig' {Maybe LexBot
lexBot :: Maybe LexBot
$sel:lexBot:LexBotConfig' :: LexBotConfig -> Maybe LexBot
lexBot} -> Maybe LexBot
lexBot) (\s :: LexBotConfig
s@LexBotConfig' {} Maybe LexBot
a -> LexBotConfig
s {$sel:lexBot:LexBotConfig' :: Maybe LexBot
lexBot = Maybe LexBot
a} :: LexBotConfig)
lexBotConfig_lexV2Bot :: Lens.Lens' LexBotConfig (Prelude.Maybe LexV2Bot)
lexBotConfig_lexV2Bot :: (Maybe LexV2Bot -> f (Maybe LexV2Bot))
-> LexBotConfig -> f LexBotConfig
lexBotConfig_lexV2Bot = (LexBotConfig -> Maybe LexV2Bot)
-> (LexBotConfig -> Maybe LexV2Bot -> LexBotConfig)
-> Lens LexBotConfig LexBotConfig (Maybe LexV2Bot) (Maybe LexV2Bot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexBotConfig' {Maybe LexV2Bot
lexV2Bot :: Maybe LexV2Bot
$sel:lexV2Bot:LexBotConfig' :: LexBotConfig -> Maybe LexV2Bot
lexV2Bot} -> Maybe LexV2Bot
lexV2Bot) (\s :: LexBotConfig
s@LexBotConfig' {} Maybe LexV2Bot
a -> LexBotConfig
s {$sel:lexV2Bot:LexBotConfig' :: Maybe LexV2Bot
lexV2Bot = Maybe LexV2Bot
a} :: LexBotConfig)
instance Core.FromJSON LexBotConfig where
parseJSON :: Value -> Parser LexBotConfig
parseJSON =
String
-> (Object -> Parser LexBotConfig) -> Value -> Parser LexBotConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LexBotConfig"
( \Object
x ->
Maybe LexBot -> Maybe LexV2Bot -> LexBotConfig
LexBotConfig'
(Maybe LexBot -> Maybe LexV2Bot -> LexBotConfig)
-> Parser (Maybe LexBot) -> Parser (Maybe LexV2Bot -> LexBotConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe LexBot)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LexBot")
Parser (Maybe LexV2Bot -> LexBotConfig)
-> Parser (Maybe LexV2Bot) -> Parser LexBotConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LexV2Bot)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LexV2Bot")
)
instance Prelude.Hashable LexBotConfig
instance Prelude.NFData LexBotConfig