{-# 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.LexModels.Types.SlotTypeRegexConfiguration where
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 SlotTypeRegexConfiguration = SlotTypeRegexConfiguration'
{
SlotTypeRegexConfiguration -> Text
pattern' :: Prelude.Text
}
deriving (SlotTypeRegexConfiguration -> SlotTypeRegexConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlotTypeRegexConfiguration -> SlotTypeRegexConfiguration -> Bool
$c/= :: SlotTypeRegexConfiguration -> SlotTypeRegexConfiguration -> Bool
== :: SlotTypeRegexConfiguration -> SlotTypeRegexConfiguration -> Bool
$c== :: SlotTypeRegexConfiguration -> SlotTypeRegexConfiguration -> Bool
Prelude.Eq, ReadPrec [SlotTypeRegexConfiguration]
ReadPrec SlotTypeRegexConfiguration
Int -> ReadS SlotTypeRegexConfiguration
ReadS [SlotTypeRegexConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlotTypeRegexConfiguration]
$creadListPrec :: ReadPrec [SlotTypeRegexConfiguration]
readPrec :: ReadPrec SlotTypeRegexConfiguration
$creadPrec :: ReadPrec SlotTypeRegexConfiguration
readList :: ReadS [SlotTypeRegexConfiguration]
$creadList :: ReadS [SlotTypeRegexConfiguration]
readsPrec :: Int -> ReadS SlotTypeRegexConfiguration
$creadsPrec :: Int -> ReadS SlotTypeRegexConfiguration
Prelude.Read, Int -> SlotTypeRegexConfiguration -> ShowS
[SlotTypeRegexConfiguration] -> ShowS
SlotTypeRegexConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlotTypeRegexConfiguration] -> ShowS
$cshowList :: [SlotTypeRegexConfiguration] -> ShowS
show :: SlotTypeRegexConfiguration -> String
$cshow :: SlotTypeRegexConfiguration -> String
showsPrec :: Int -> SlotTypeRegexConfiguration -> ShowS
$cshowsPrec :: Int -> SlotTypeRegexConfiguration -> ShowS
Prelude.Show, forall x.
Rep SlotTypeRegexConfiguration x -> SlotTypeRegexConfiguration
forall x.
SlotTypeRegexConfiguration -> Rep SlotTypeRegexConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SlotTypeRegexConfiguration x -> SlotTypeRegexConfiguration
$cfrom :: forall x.
SlotTypeRegexConfiguration -> Rep SlotTypeRegexConfiguration x
Prelude.Generic)
newSlotTypeRegexConfiguration ::
Prelude.Text ->
SlotTypeRegexConfiguration
newSlotTypeRegexConfiguration :: Text -> SlotTypeRegexConfiguration
newSlotTypeRegexConfiguration Text
pPattern_ =
SlotTypeRegexConfiguration' {$sel:pattern':SlotTypeRegexConfiguration' :: Text
pattern' = Text
pPattern_}
slotTypeRegexConfiguration_pattern :: Lens.Lens' SlotTypeRegexConfiguration Prelude.Text
slotTypeRegexConfiguration_pattern :: Lens' SlotTypeRegexConfiguration Text
slotTypeRegexConfiguration_pattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeRegexConfiguration' {Text
pattern' :: Text
$sel:pattern':SlotTypeRegexConfiguration' :: SlotTypeRegexConfiguration -> Text
pattern'} -> Text
pattern') (\s :: SlotTypeRegexConfiguration
s@SlotTypeRegexConfiguration' {} Text
a -> SlotTypeRegexConfiguration
s {$sel:pattern':SlotTypeRegexConfiguration' :: Text
pattern' = Text
a} :: SlotTypeRegexConfiguration)
instance Data.FromJSON SlotTypeRegexConfiguration where
parseJSON :: Value -> Parser SlotTypeRegexConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SlotTypeRegexConfiguration"
( \Object
x ->
Text -> SlotTypeRegexConfiguration
SlotTypeRegexConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"pattern")
)
instance Prelude.Hashable SlotTypeRegexConfiguration where
hashWithSalt :: Int -> SlotTypeRegexConfiguration -> Int
hashWithSalt Int
_salt SlotTypeRegexConfiguration' {Text
pattern' :: Text
$sel:pattern':SlotTypeRegexConfiguration' :: SlotTypeRegexConfiguration -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pattern'
instance Prelude.NFData SlotTypeRegexConfiguration where
rnf :: SlotTypeRegexConfiguration -> ()
rnf SlotTypeRegexConfiguration' {Text
pattern' :: Text
$sel:pattern':SlotTypeRegexConfiguration' :: SlotTypeRegexConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
pattern'
instance Data.ToJSON SlotTypeRegexConfiguration where
toJSON :: SlotTypeRegexConfiguration -> Value
toJSON SlotTypeRegexConfiguration' {Text
pattern' :: Text
$sel:pattern':SlotTypeRegexConfiguration' :: SlotTypeRegexConfiguration -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"pattern" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
pattern')]
)