{-# 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.Wisdom.Types.Highlight where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Highlight = Highlight'
{
Highlight -> Maybe Int
endOffsetExclusive :: Prelude.Maybe Prelude.Int,
Highlight -> Maybe Int
beginOffsetInclusive :: Prelude.Maybe Prelude.Int
}
deriving (Highlight -> Highlight -> Bool
(Highlight -> Highlight -> Bool)
-> (Highlight -> Highlight -> Bool) -> Eq Highlight
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Highlight -> Highlight -> Bool
$c/= :: Highlight -> Highlight -> Bool
== :: Highlight -> Highlight -> Bool
$c== :: Highlight -> Highlight -> Bool
Prelude.Eq, ReadPrec [Highlight]
ReadPrec Highlight
Int -> ReadS Highlight
ReadS [Highlight]
(Int -> ReadS Highlight)
-> ReadS [Highlight]
-> ReadPrec Highlight
-> ReadPrec [Highlight]
-> Read Highlight
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Highlight]
$creadListPrec :: ReadPrec [Highlight]
readPrec :: ReadPrec Highlight
$creadPrec :: ReadPrec Highlight
readList :: ReadS [Highlight]
$creadList :: ReadS [Highlight]
readsPrec :: Int -> ReadS Highlight
$creadsPrec :: Int -> ReadS Highlight
Prelude.Read, Int -> Highlight -> ShowS
[Highlight] -> ShowS
Highlight -> String
(Int -> Highlight -> ShowS)
-> (Highlight -> String)
-> ([Highlight] -> ShowS)
-> Show Highlight
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Highlight] -> ShowS
$cshowList :: [Highlight] -> ShowS
show :: Highlight -> String
$cshow :: Highlight -> String
showsPrec :: Int -> Highlight -> ShowS
$cshowsPrec :: Int -> Highlight -> ShowS
Prelude.Show, (forall x. Highlight -> Rep Highlight x)
-> (forall x. Rep Highlight x -> Highlight) -> Generic Highlight
forall x. Rep Highlight x -> Highlight
forall x. Highlight -> Rep Highlight x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Highlight x -> Highlight
$cfrom :: forall x. Highlight -> Rep Highlight x
Prelude.Generic)
newHighlight ::
Highlight
newHighlight :: Highlight
newHighlight =
Highlight' :: Maybe Int -> Maybe Int -> Highlight
Highlight'
{ $sel:endOffsetExclusive:Highlight' :: Maybe Int
endOffsetExclusive = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:beginOffsetInclusive:Highlight' :: Maybe Int
beginOffsetInclusive = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
highlight_endOffsetExclusive :: Lens.Lens' Highlight (Prelude.Maybe Prelude.Int)
highlight_endOffsetExclusive :: (Maybe Int -> f (Maybe Int)) -> Highlight -> f Highlight
highlight_endOffsetExclusive = (Highlight -> Maybe Int)
-> (Highlight -> Maybe Int -> Highlight)
-> Lens Highlight Highlight (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Highlight' {Maybe Int
endOffsetExclusive :: Maybe Int
$sel:endOffsetExclusive:Highlight' :: Highlight -> Maybe Int
endOffsetExclusive} -> Maybe Int
endOffsetExclusive) (\s :: Highlight
s@Highlight' {} Maybe Int
a -> Highlight
s {$sel:endOffsetExclusive:Highlight' :: Maybe Int
endOffsetExclusive = Maybe Int
a} :: Highlight)
highlight_beginOffsetInclusive :: Lens.Lens' Highlight (Prelude.Maybe Prelude.Int)
highlight_beginOffsetInclusive :: (Maybe Int -> f (Maybe Int)) -> Highlight -> f Highlight
highlight_beginOffsetInclusive = (Highlight -> Maybe Int)
-> (Highlight -> Maybe Int -> Highlight)
-> Lens Highlight Highlight (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Highlight' {Maybe Int
beginOffsetInclusive :: Maybe Int
$sel:beginOffsetInclusive:Highlight' :: Highlight -> Maybe Int
beginOffsetInclusive} -> Maybe Int
beginOffsetInclusive) (\s :: Highlight
s@Highlight' {} Maybe Int
a -> Highlight
s {$sel:beginOffsetInclusive:Highlight' :: Maybe Int
beginOffsetInclusive = Maybe Int
a} :: Highlight)
instance Core.FromJSON Highlight where
parseJSON :: Value -> Parser Highlight
parseJSON =
String -> (Object -> Parser Highlight) -> Value -> Parser Highlight
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Highlight"
( \Object
x ->
Maybe Int -> Maybe Int -> Highlight
Highlight'
(Maybe Int -> Maybe Int -> Highlight)
-> Parser (Maybe Int) -> Parser (Maybe Int -> Highlight)
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
"endOffsetExclusive")
Parser (Maybe Int -> Highlight)
-> Parser (Maybe Int) -> Parser Highlight
forall (f :: * -> *) a b. Applicative f => 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
"beginOffsetInclusive")
)
instance Prelude.Hashable Highlight
instance Prelude.NFData Highlight