{-# 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.Comprehend.Types.EntityTypesListItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EntityTypesListItem = EntityTypesListItem'
{
EntityTypesListItem -> Text
type' :: Prelude.Text
}
deriving (EntityTypesListItem -> EntityTypesListItem -> Bool
(EntityTypesListItem -> EntityTypesListItem -> Bool)
-> (EntityTypesListItem -> EntityTypesListItem -> Bool)
-> Eq EntityTypesListItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityTypesListItem -> EntityTypesListItem -> Bool
$c/= :: EntityTypesListItem -> EntityTypesListItem -> Bool
== :: EntityTypesListItem -> EntityTypesListItem -> Bool
$c== :: EntityTypesListItem -> EntityTypesListItem -> Bool
Prelude.Eq, ReadPrec [EntityTypesListItem]
ReadPrec EntityTypesListItem
Int -> ReadS EntityTypesListItem
ReadS [EntityTypesListItem]
(Int -> ReadS EntityTypesListItem)
-> ReadS [EntityTypesListItem]
-> ReadPrec EntityTypesListItem
-> ReadPrec [EntityTypesListItem]
-> Read EntityTypesListItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityTypesListItem]
$creadListPrec :: ReadPrec [EntityTypesListItem]
readPrec :: ReadPrec EntityTypesListItem
$creadPrec :: ReadPrec EntityTypesListItem
readList :: ReadS [EntityTypesListItem]
$creadList :: ReadS [EntityTypesListItem]
readsPrec :: Int -> ReadS EntityTypesListItem
$creadsPrec :: Int -> ReadS EntityTypesListItem
Prelude.Read, Int -> EntityTypesListItem -> ShowS
[EntityTypesListItem] -> ShowS
EntityTypesListItem -> String
(Int -> EntityTypesListItem -> ShowS)
-> (EntityTypesListItem -> String)
-> ([EntityTypesListItem] -> ShowS)
-> Show EntityTypesListItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityTypesListItem] -> ShowS
$cshowList :: [EntityTypesListItem] -> ShowS
show :: EntityTypesListItem -> String
$cshow :: EntityTypesListItem -> String
showsPrec :: Int -> EntityTypesListItem -> ShowS
$cshowsPrec :: Int -> EntityTypesListItem -> ShowS
Prelude.Show, (forall x. EntityTypesListItem -> Rep EntityTypesListItem x)
-> (forall x. Rep EntityTypesListItem x -> EntityTypesListItem)
-> Generic EntityTypesListItem
forall x. Rep EntityTypesListItem x -> EntityTypesListItem
forall x. EntityTypesListItem -> Rep EntityTypesListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EntityTypesListItem x -> EntityTypesListItem
$cfrom :: forall x. EntityTypesListItem -> Rep EntityTypesListItem x
Prelude.Generic)
newEntityTypesListItem ::
Prelude.Text ->
EntityTypesListItem
newEntityTypesListItem :: Text -> EntityTypesListItem
newEntityTypesListItem Text
pType_ =
EntityTypesListItem' :: Text -> EntityTypesListItem
EntityTypesListItem' {$sel:type':EntityTypesListItem' :: Text
type' = Text
pType_}
entityTypesListItem_type :: Lens.Lens' EntityTypesListItem Prelude.Text
entityTypesListItem_type :: (Text -> f Text) -> EntityTypesListItem -> f EntityTypesListItem
entityTypesListItem_type = (EntityTypesListItem -> Text)
-> (EntityTypesListItem -> Text -> EntityTypesListItem)
-> Lens EntityTypesListItem EntityTypesListItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityTypesListItem' {Text
type' :: Text
$sel:type':EntityTypesListItem' :: EntityTypesListItem -> Text
type'} -> Text
type') (\s :: EntityTypesListItem
s@EntityTypesListItem' {} Text
a -> EntityTypesListItem
s {$sel:type':EntityTypesListItem' :: Text
type' = Text
a} :: EntityTypesListItem)
instance Core.FromJSON EntityTypesListItem where
parseJSON :: Value -> Parser EntityTypesListItem
parseJSON =
String
-> (Object -> Parser EntityTypesListItem)
-> Value
-> Parser EntityTypesListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EntityTypesListItem"
( \Object
x ->
Text -> EntityTypesListItem
EntityTypesListItem' (Text -> EntityTypesListItem)
-> Parser Text -> Parser EntityTypesListItem
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
"Type")
)
instance Prelude.Hashable EntityTypesListItem
instance Prelude.NFData EntityTypesListItem
instance Core.ToJSON EntityTypesListItem where
toJSON :: EntityTypesListItem -> Value
toJSON EntityTypesListItem' {Text
type' :: Text
$sel:type':EntityTypesListItem' :: EntityTypesListItem -> 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
"Type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
type')]
)