{-# 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.Glue.Types.CustomEntityType 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 CustomEntityType = CustomEntityType'
{
CustomEntityType -> Maybe (NonEmpty Text)
contextWords :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
CustomEntityType -> Text
name :: Prelude.Text,
CustomEntityType -> Text
regexString :: Prelude.Text
}
deriving (CustomEntityType -> CustomEntityType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomEntityType -> CustomEntityType -> Bool
$c/= :: CustomEntityType -> CustomEntityType -> Bool
== :: CustomEntityType -> CustomEntityType -> Bool
$c== :: CustomEntityType -> CustomEntityType -> Bool
Prelude.Eq, ReadPrec [CustomEntityType]
ReadPrec CustomEntityType
Int -> ReadS CustomEntityType
ReadS [CustomEntityType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomEntityType]
$creadListPrec :: ReadPrec [CustomEntityType]
readPrec :: ReadPrec CustomEntityType
$creadPrec :: ReadPrec CustomEntityType
readList :: ReadS [CustomEntityType]
$creadList :: ReadS [CustomEntityType]
readsPrec :: Int -> ReadS CustomEntityType
$creadsPrec :: Int -> ReadS CustomEntityType
Prelude.Read, Int -> CustomEntityType -> ShowS
[CustomEntityType] -> ShowS
CustomEntityType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomEntityType] -> ShowS
$cshowList :: [CustomEntityType] -> ShowS
show :: CustomEntityType -> String
$cshow :: CustomEntityType -> String
showsPrec :: Int -> CustomEntityType -> ShowS
$cshowsPrec :: Int -> CustomEntityType -> ShowS
Prelude.Show, forall x. Rep CustomEntityType x -> CustomEntityType
forall x. CustomEntityType -> Rep CustomEntityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomEntityType x -> CustomEntityType
$cfrom :: forall x. CustomEntityType -> Rep CustomEntityType x
Prelude.Generic)
newCustomEntityType ::
Prelude.Text ->
Prelude.Text ->
CustomEntityType
newCustomEntityType :: Text -> Text -> CustomEntityType
newCustomEntityType Text
pName_ Text
pRegexString_ =
CustomEntityType'
{ $sel:contextWords:CustomEntityType' :: Maybe (NonEmpty Text)
contextWords = forall a. Maybe a
Prelude.Nothing,
$sel:name:CustomEntityType' :: Text
name = Text
pName_,
$sel:regexString:CustomEntityType' :: Text
regexString = Text
pRegexString_
}
customEntityType_contextWords :: Lens.Lens' CustomEntityType (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
customEntityType_contextWords :: Lens' CustomEntityType (Maybe (NonEmpty Text))
customEntityType_contextWords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomEntityType' {Maybe (NonEmpty Text)
contextWords :: Maybe (NonEmpty Text)
$sel:contextWords:CustomEntityType' :: CustomEntityType -> Maybe (NonEmpty Text)
contextWords} -> Maybe (NonEmpty Text)
contextWords) (\s :: CustomEntityType
s@CustomEntityType' {} Maybe (NonEmpty Text)
a -> CustomEntityType
s {$sel:contextWords:CustomEntityType' :: Maybe (NonEmpty Text)
contextWords = Maybe (NonEmpty Text)
a} :: CustomEntityType) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
customEntityType_name :: Lens.Lens' CustomEntityType Prelude.Text
customEntityType_name :: Lens' CustomEntityType Text
customEntityType_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomEntityType' {Text
name :: Text
$sel:name:CustomEntityType' :: CustomEntityType -> Text
name} -> Text
name) (\s :: CustomEntityType
s@CustomEntityType' {} Text
a -> CustomEntityType
s {$sel:name:CustomEntityType' :: Text
name = Text
a} :: CustomEntityType)
customEntityType_regexString :: Lens.Lens' CustomEntityType Prelude.Text
customEntityType_regexString :: Lens' CustomEntityType Text
customEntityType_regexString = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomEntityType' {Text
regexString :: Text
$sel:regexString:CustomEntityType' :: CustomEntityType -> Text
regexString} -> Text
regexString) (\s :: CustomEntityType
s@CustomEntityType' {} Text
a -> CustomEntityType
s {$sel:regexString:CustomEntityType' :: Text
regexString = Text
a} :: CustomEntityType)
instance Data.FromJSON CustomEntityType where
parseJSON :: Value -> Parser CustomEntityType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CustomEntityType"
( \Object
x ->
Maybe (NonEmpty Text) -> Text -> Text -> CustomEntityType
CustomEntityType'
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
"ContextWords")
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
"Name")
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
"RegexString")
)
instance Prelude.Hashable CustomEntityType where
hashWithSalt :: Int -> CustomEntityType -> Int
hashWithSalt Int
_salt CustomEntityType' {Maybe (NonEmpty Text)
Text
regexString :: Text
name :: Text
contextWords :: Maybe (NonEmpty Text)
$sel:regexString:CustomEntityType' :: CustomEntityType -> Text
$sel:name:CustomEntityType' :: CustomEntityType -> Text
$sel:contextWords:CustomEntityType' :: CustomEntityType -> Maybe (NonEmpty Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
contextWords
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
regexString
instance Prelude.NFData CustomEntityType where
rnf :: CustomEntityType -> ()
rnf CustomEntityType' {Maybe (NonEmpty Text)
Text
regexString :: Text
name :: Text
contextWords :: Maybe (NonEmpty Text)
$sel:regexString:CustomEntityType' :: CustomEntityType -> Text
$sel:name:CustomEntityType' :: CustomEntityType -> Text
$sel:contextWords:CustomEntityType' :: CustomEntityType -> Maybe (NonEmpty Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
contextWords
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
regexString