{-# 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.LexV2Models.Types.BotAliasLocaleSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.CodeHookSpecification
import qualified Amazonka.Prelude as Prelude
data BotAliasLocaleSettings = BotAliasLocaleSettings'
{
BotAliasLocaleSettings -> Maybe CodeHookSpecification
codeHookSpecification :: Prelude.Maybe CodeHookSpecification,
BotAliasLocaleSettings -> Bool
enabled :: Prelude.Bool
}
deriving (BotAliasLocaleSettings -> BotAliasLocaleSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotAliasLocaleSettings -> BotAliasLocaleSettings -> Bool
$c/= :: BotAliasLocaleSettings -> BotAliasLocaleSettings -> Bool
== :: BotAliasLocaleSettings -> BotAliasLocaleSettings -> Bool
$c== :: BotAliasLocaleSettings -> BotAliasLocaleSettings -> Bool
Prelude.Eq, ReadPrec [BotAliasLocaleSettings]
ReadPrec BotAliasLocaleSettings
Int -> ReadS BotAliasLocaleSettings
ReadS [BotAliasLocaleSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotAliasLocaleSettings]
$creadListPrec :: ReadPrec [BotAliasLocaleSettings]
readPrec :: ReadPrec BotAliasLocaleSettings
$creadPrec :: ReadPrec BotAliasLocaleSettings
readList :: ReadS [BotAliasLocaleSettings]
$creadList :: ReadS [BotAliasLocaleSettings]
readsPrec :: Int -> ReadS BotAliasLocaleSettings
$creadsPrec :: Int -> ReadS BotAliasLocaleSettings
Prelude.Read, Int -> BotAliasLocaleSettings -> ShowS
[BotAliasLocaleSettings] -> ShowS
BotAliasLocaleSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotAliasLocaleSettings] -> ShowS
$cshowList :: [BotAliasLocaleSettings] -> ShowS
show :: BotAliasLocaleSettings -> String
$cshow :: BotAliasLocaleSettings -> String
showsPrec :: Int -> BotAliasLocaleSettings -> ShowS
$cshowsPrec :: Int -> BotAliasLocaleSettings -> ShowS
Prelude.Show, forall x. Rep BotAliasLocaleSettings x -> BotAliasLocaleSettings
forall x. BotAliasLocaleSettings -> Rep BotAliasLocaleSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotAliasLocaleSettings x -> BotAliasLocaleSettings
$cfrom :: forall x. BotAliasLocaleSettings -> Rep BotAliasLocaleSettings x
Prelude.Generic)
newBotAliasLocaleSettings ::
Prelude.Bool ->
BotAliasLocaleSettings
newBotAliasLocaleSettings :: Bool -> BotAliasLocaleSettings
newBotAliasLocaleSettings Bool
pEnabled_ =
BotAliasLocaleSettings'
{ $sel:codeHookSpecification:BotAliasLocaleSettings' :: Maybe CodeHookSpecification
codeHookSpecification =
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:BotAliasLocaleSettings' :: Bool
enabled = Bool
pEnabled_
}
botAliasLocaleSettings_codeHookSpecification :: Lens.Lens' BotAliasLocaleSettings (Prelude.Maybe CodeHookSpecification)
botAliasLocaleSettings_codeHookSpecification :: Lens' BotAliasLocaleSettings (Maybe CodeHookSpecification)
botAliasLocaleSettings_codeHookSpecification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasLocaleSettings' {Maybe CodeHookSpecification
codeHookSpecification :: Maybe CodeHookSpecification
$sel:codeHookSpecification:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Maybe CodeHookSpecification
codeHookSpecification} -> Maybe CodeHookSpecification
codeHookSpecification) (\s :: BotAliasLocaleSettings
s@BotAliasLocaleSettings' {} Maybe CodeHookSpecification
a -> BotAliasLocaleSettings
s {$sel:codeHookSpecification:BotAliasLocaleSettings' :: Maybe CodeHookSpecification
codeHookSpecification = Maybe CodeHookSpecification
a} :: BotAliasLocaleSettings)
botAliasLocaleSettings_enabled :: Lens.Lens' BotAliasLocaleSettings Prelude.Bool
botAliasLocaleSettings_enabled :: Lens' BotAliasLocaleSettings Bool
botAliasLocaleSettings_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotAliasLocaleSettings' {Bool
enabled :: Bool
$sel:enabled:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Bool
enabled} -> Bool
enabled) (\s :: BotAliasLocaleSettings
s@BotAliasLocaleSettings' {} Bool
a -> BotAliasLocaleSettings
s {$sel:enabled:BotAliasLocaleSettings' :: Bool
enabled = Bool
a} :: BotAliasLocaleSettings)
instance Data.FromJSON BotAliasLocaleSettings where
parseJSON :: Value -> Parser BotAliasLocaleSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BotAliasLocaleSettings"
( \Object
x ->
Maybe CodeHookSpecification -> Bool -> BotAliasLocaleSettings
BotAliasLocaleSettings'
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
"codeHookSpecification")
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
"enabled")
)
instance Prelude.Hashable BotAliasLocaleSettings where
hashWithSalt :: Int -> BotAliasLocaleSettings -> Int
hashWithSalt Int
_salt BotAliasLocaleSettings' {Bool
Maybe CodeHookSpecification
enabled :: Bool
codeHookSpecification :: Maybe CodeHookSpecification
$sel:enabled:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Bool
$sel:codeHookSpecification:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Maybe CodeHookSpecification
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CodeHookSpecification
codeHookSpecification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
instance Prelude.NFData BotAliasLocaleSettings where
rnf :: BotAliasLocaleSettings -> ()
rnf BotAliasLocaleSettings' {Bool
Maybe CodeHookSpecification
enabled :: Bool
codeHookSpecification :: Maybe CodeHookSpecification
$sel:enabled:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Bool
$sel:codeHookSpecification:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Maybe CodeHookSpecification
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CodeHookSpecification
codeHookSpecification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
instance Data.ToJSON BotAliasLocaleSettings where
toJSON :: BotAliasLocaleSettings -> Value
toJSON BotAliasLocaleSettings' {Bool
Maybe CodeHookSpecification
enabled :: Bool
codeHookSpecification :: Maybe CodeHookSpecification
$sel:enabled:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Bool
$sel:codeHookSpecification:BotAliasLocaleSettings' :: BotAliasLocaleSettings -> Maybe CodeHookSpecification
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"codeHookSpecification" 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 CodeHookSpecification
codeHookSpecification,
forall a. a -> Maybe a
Prelude.Just (Key
"enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enabled)
]
)