{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SlotTypeRegexConfiguration = SlotTypeRegexConfiguration'
{
SlotTypeRegexConfiguration -> Text
pattern' :: Prelude.Text
}
deriving (SlotTypeRegexConfiguration -> SlotTypeRegexConfiguration -> Bool
(SlotTypeRegexConfiguration -> SlotTypeRegexConfiguration -> Bool)
-> (SlotTypeRegexConfiguration
-> SlotTypeRegexConfiguration -> Bool)
-> Eq SlotTypeRegexConfiguration
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]
(Int -> ReadS SlotTypeRegexConfiguration)
-> ReadS [SlotTypeRegexConfiguration]
-> ReadPrec SlotTypeRegexConfiguration
-> ReadPrec [SlotTypeRegexConfiguration]
-> Read 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
(Int -> SlotTypeRegexConfiguration -> ShowS)
-> (SlotTypeRegexConfiguration -> String)
-> ([SlotTypeRegexConfiguration] -> ShowS)
-> Show SlotTypeRegexConfiguration
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.
SlotTypeRegexConfiguration -> Rep SlotTypeRegexConfiguration x)
-> (forall x.
Rep SlotTypeRegexConfiguration x -> SlotTypeRegexConfiguration)
-> Generic SlotTypeRegexConfiguration
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' :: Text -> SlotTypeRegexConfiguration
SlotTypeRegexConfiguration' {$sel:pattern':SlotTypeRegexConfiguration' :: Text
pattern' = Text
pPattern_}
slotTypeRegexConfiguration_pattern :: Lens.Lens' SlotTypeRegexConfiguration Prelude.Text
slotTypeRegexConfiguration_pattern :: (Text -> f Text)
-> SlotTypeRegexConfiguration -> f SlotTypeRegexConfiguration
slotTypeRegexConfiguration_pattern = (SlotTypeRegexConfiguration -> Text)
-> (SlotTypeRegexConfiguration
-> Text -> SlotTypeRegexConfiguration)
-> Lens
SlotTypeRegexConfiguration SlotTypeRegexConfiguration Text Text
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 Core.FromJSON SlotTypeRegexConfiguration where
parseJSON :: Value -> Parser SlotTypeRegexConfiguration
parseJSON =
String
-> (Object -> Parser SlotTypeRegexConfiguration)
-> Value
-> Parser SlotTypeRegexConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SlotTypeRegexConfiguration"
( \Object
x ->
Text -> SlotTypeRegexConfiguration
SlotTypeRegexConfiguration'
(Text -> SlotTypeRegexConfiguration)
-> Parser Text -> Parser SlotTypeRegexConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"pattern")
)
instance Prelude.Hashable SlotTypeRegexConfiguration
instance Prelude.NFData SlotTypeRegexConfiguration
instance Core.ToJSON SlotTypeRegexConfiguration where
toJSON :: SlotTypeRegexConfiguration -> Value
toJSON SlotTypeRegexConfiguration' {Text
pattern' :: Text
$sel:pattern':SlotTypeRegexConfiguration' :: SlotTypeRegexConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"pattern" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pattern')]
)