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