{-# 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.BatchDetectSyntaxItemResult where
import Amazonka.Comprehend.Types.SyntaxToken
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchDetectSyntaxItemResult = BatchDetectSyntaxItemResult'
{
BatchDetectSyntaxItemResult -> Maybe Int
index :: Prelude.Maybe Prelude.Int,
BatchDetectSyntaxItemResult -> Maybe [SyntaxToken]
syntaxTokens :: Prelude.Maybe [SyntaxToken]
}
deriving (BatchDetectSyntaxItemResult -> BatchDetectSyntaxItemResult -> Bool
(BatchDetectSyntaxItemResult
-> BatchDetectSyntaxItemResult -> Bool)
-> (BatchDetectSyntaxItemResult
-> BatchDetectSyntaxItemResult -> Bool)
-> Eq BatchDetectSyntaxItemResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetectSyntaxItemResult -> BatchDetectSyntaxItemResult -> Bool
$c/= :: BatchDetectSyntaxItemResult -> BatchDetectSyntaxItemResult -> Bool
== :: BatchDetectSyntaxItemResult -> BatchDetectSyntaxItemResult -> Bool
$c== :: BatchDetectSyntaxItemResult -> BatchDetectSyntaxItemResult -> Bool
Prelude.Eq, ReadPrec [BatchDetectSyntaxItemResult]
ReadPrec BatchDetectSyntaxItemResult
Int -> ReadS BatchDetectSyntaxItemResult
ReadS [BatchDetectSyntaxItemResult]
(Int -> ReadS BatchDetectSyntaxItemResult)
-> ReadS [BatchDetectSyntaxItemResult]
-> ReadPrec BatchDetectSyntaxItemResult
-> ReadPrec [BatchDetectSyntaxItemResult]
-> Read BatchDetectSyntaxItemResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDetectSyntaxItemResult]
$creadListPrec :: ReadPrec [BatchDetectSyntaxItemResult]
readPrec :: ReadPrec BatchDetectSyntaxItemResult
$creadPrec :: ReadPrec BatchDetectSyntaxItemResult
readList :: ReadS [BatchDetectSyntaxItemResult]
$creadList :: ReadS [BatchDetectSyntaxItemResult]
readsPrec :: Int -> ReadS BatchDetectSyntaxItemResult
$creadsPrec :: Int -> ReadS BatchDetectSyntaxItemResult
Prelude.Read, Int -> BatchDetectSyntaxItemResult -> ShowS
[BatchDetectSyntaxItemResult] -> ShowS
BatchDetectSyntaxItemResult -> String
(Int -> BatchDetectSyntaxItemResult -> ShowS)
-> (BatchDetectSyntaxItemResult -> String)
-> ([BatchDetectSyntaxItemResult] -> ShowS)
-> Show BatchDetectSyntaxItemResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetectSyntaxItemResult] -> ShowS
$cshowList :: [BatchDetectSyntaxItemResult] -> ShowS
show :: BatchDetectSyntaxItemResult -> String
$cshow :: BatchDetectSyntaxItemResult -> String
showsPrec :: Int -> BatchDetectSyntaxItemResult -> ShowS
$cshowsPrec :: Int -> BatchDetectSyntaxItemResult -> ShowS
Prelude.Show, (forall x.
BatchDetectSyntaxItemResult -> Rep BatchDetectSyntaxItemResult x)
-> (forall x.
Rep BatchDetectSyntaxItemResult x -> BatchDetectSyntaxItemResult)
-> Generic BatchDetectSyntaxItemResult
forall x.
Rep BatchDetectSyntaxItemResult x -> BatchDetectSyntaxItemResult
forall x.
BatchDetectSyntaxItemResult -> Rep BatchDetectSyntaxItemResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDetectSyntaxItemResult x -> BatchDetectSyntaxItemResult
$cfrom :: forall x.
BatchDetectSyntaxItemResult -> Rep BatchDetectSyntaxItemResult x
Prelude.Generic)
newBatchDetectSyntaxItemResult ::
BatchDetectSyntaxItemResult
newBatchDetectSyntaxItemResult :: BatchDetectSyntaxItemResult
newBatchDetectSyntaxItemResult =
BatchDetectSyntaxItemResult' :: Maybe Int -> Maybe [SyntaxToken] -> BatchDetectSyntaxItemResult
BatchDetectSyntaxItemResult'
{ $sel:index:BatchDetectSyntaxItemResult' :: Maybe Int
index =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:syntaxTokens:BatchDetectSyntaxItemResult' :: Maybe [SyntaxToken]
syntaxTokens = Maybe [SyntaxToken]
forall a. Maybe a
Prelude.Nothing
}
batchDetectSyntaxItemResult_index :: Lens.Lens' BatchDetectSyntaxItemResult (Prelude.Maybe Prelude.Int)
batchDetectSyntaxItemResult_index :: (Maybe Int -> f (Maybe Int))
-> BatchDetectSyntaxItemResult -> f BatchDetectSyntaxItemResult
batchDetectSyntaxItemResult_index = (BatchDetectSyntaxItemResult -> Maybe Int)
-> (BatchDetectSyntaxItemResult
-> Maybe Int -> BatchDetectSyntaxItemResult)
-> Lens
BatchDetectSyntaxItemResult
BatchDetectSyntaxItemResult
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectSyntaxItemResult' {Maybe Int
index :: Maybe Int
$sel:index:BatchDetectSyntaxItemResult' :: BatchDetectSyntaxItemResult -> Maybe Int
index} -> Maybe Int
index) (\s :: BatchDetectSyntaxItemResult
s@BatchDetectSyntaxItemResult' {} Maybe Int
a -> BatchDetectSyntaxItemResult
s {$sel:index:BatchDetectSyntaxItemResult' :: Maybe Int
index = Maybe Int
a} :: BatchDetectSyntaxItemResult)
batchDetectSyntaxItemResult_syntaxTokens :: Lens.Lens' BatchDetectSyntaxItemResult (Prelude.Maybe [SyntaxToken])
batchDetectSyntaxItemResult_syntaxTokens :: (Maybe [SyntaxToken] -> f (Maybe [SyntaxToken]))
-> BatchDetectSyntaxItemResult -> f BatchDetectSyntaxItemResult
batchDetectSyntaxItemResult_syntaxTokens = (BatchDetectSyntaxItemResult -> Maybe [SyntaxToken])
-> (BatchDetectSyntaxItemResult
-> Maybe [SyntaxToken] -> BatchDetectSyntaxItemResult)
-> Lens
BatchDetectSyntaxItemResult
BatchDetectSyntaxItemResult
(Maybe [SyntaxToken])
(Maybe [SyntaxToken])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetectSyntaxItemResult' {Maybe [SyntaxToken]
syntaxTokens :: Maybe [SyntaxToken]
$sel:syntaxTokens:BatchDetectSyntaxItemResult' :: BatchDetectSyntaxItemResult -> Maybe [SyntaxToken]
syntaxTokens} -> Maybe [SyntaxToken]
syntaxTokens) (\s :: BatchDetectSyntaxItemResult
s@BatchDetectSyntaxItemResult' {} Maybe [SyntaxToken]
a -> BatchDetectSyntaxItemResult
s {$sel:syntaxTokens:BatchDetectSyntaxItemResult' :: Maybe [SyntaxToken]
syntaxTokens = Maybe [SyntaxToken]
a} :: BatchDetectSyntaxItemResult) ((Maybe [SyntaxToken] -> f (Maybe [SyntaxToken]))
-> BatchDetectSyntaxItemResult -> f BatchDetectSyntaxItemResult)
-> ((Maybe [SyntaxToken] -> f (Maybe [SyntaxToken]))
-> Maybe [SyntaxToken] -> f (Maybe [SyntaxToken]))
-> (Maybe [SyntaxToken] -> f (Maybe [SyntaxToken]))
-> BatchDetectSyntaxItemResult
-> f BatchDetectSyntaxItemResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SyntaxToken] [SyntaxToken] [SyntaxToken] [SyntaxToken]
-> Iso
(Maybe [SyntaxToken])
(Maybe [SyntaxToken])
(Maybe [SyntaxToken])
(Maybe [SyntaxToken])
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 AnIso [SyntaxToken] [SyntaxToken] [SyntaxToken] [SyntaxToken]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON BatchDetectSyntaxItemResult where
parseJSON :: Value -> Parser BatchDetectSyntaxItemResult
parseJSON =
String
-> (Object -> Parser BatchDetectSyntaxItemResult)
-> Value
-> Parser BatchDetectSyntaxItemResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BatchDetectSyntaxItemResult"
( \Object
x ->
Maybe Int -> Maybe [SyntaxToken] -> BatchDetectSyntaxItemResult
BatchDetectSyntaxItemResult'
(Maybe Int -> Maybe [SyntaxToken] -> BatchDetectSyntaxItemResult)
-> Parser (Maybe Int)
-> Parser (Maybe [SyntaxToken] -> BatchDetectSyntaxItemResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Index")
Parser (Maybe [SyntaxToken] -> BatchDetectSyntaxItemResult)
-> Parser (Maybe [SyntaxToken])
-> Parser BatchDetectSyntaxItemResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [SyntaxToken]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SyntaxTokens" Parser (Maybe (Maybe [SyntaxToken]))
-> Maybe [SyntaxToken] -> Parser (Maybe [SyntaxToken])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SyntaxToken]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable BatchDetectSyntaxItemResult
instance Prelude.NFData BatchDetectSyntaxItemResult