{-# 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.Occurrences where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.Cell
import Amazonka.MacieV2.Types.Page
import Amazonka.MacieV2.Types.Range
import Amazonka.MacieV2.Types.Record
import qualified Amazonka.Prelude as Prelude
data Occurrences = Occurrences'
{
Occurrences -> Maybe [Cell]
cells :: Prelude.Maybe [Cell],
Occurrences -> Maybe [Range]
lineRanges :: Prelude.Maybe [Range],
Occurrences -> Maybe [Range]
offsetRanges :: Prelude.Maybe [Range],
Occurrences -> Maybe [Page]
pages :: Prelude.Maybe [Page],
Occurrences -> Maybe [Record]
records :: Prelude.Maybe [Record]
}
deriving (Occurrences -> Occurrences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Occurrences -> Occurrences -> Bool
$c/= :: Occurrences -> Occurrences -> Bool
== :: Occurrences -> Occurrences -> Bool
$c== :: Occurrences -> Occurrences -> Bool
Prelude.Eq, ReadPrec [Occurrences]
ReadPrec Occurrences
Int -> ReadS Occurrences
ReadS [Occurrences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Occurrences]
$creadListPrec :: ReadPrec [Occurrences]
readPrec :: ReadPrec Occurrences
$creadPrec :: ReadPrec Occurrences
readList :: ReadS [Occurrences]
$creadList :: ReadS [Occurrences]
readsPrec :: Int -> ReadS Occurrences
$creadsPrec :: Int -> ReadS Occurrences
Prelude.Read, Int -> Occurrences -> ShowS
[Occurrences] -> ShowS
Occurrences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Occurrences] -> ShowS
$cshowList :: [Occurrences] -> ShowS
show :: Occurrences -> String
$cshow :: Occurrences -> String
showsPrec :: Int -> Occurrences -> ShowS
$cshowsPrec :: Int -> Occurrences -> ShowS
Prelude.Show, forall x. Rep Occurrences x -> Occurrences
forall x. Occurrences -> Rep Occurrences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Occurrences x -> Occurrences
$cfrom :: forall x. Occurrences -> Rep Occurrences x
Prelude.Generic)
newOccurrences ::
Occurrences
newOccurrences :: Occurrences
newOccurrences =
Occurrences'
{ $sel:cells:Occurrences' :: Maybe [Cell]
cells = forall a. Maybe a
Prelude.Nothing,
$sel:lineRanges:Occurrences' :: Maybe [Range]
lineRanges = forall a. Maybe a
Prelude.Nothing,
$sel:offsetRanges:Occurrences' :: Maybe [Range]
offsetRanges = forall a. Maybe a
Prelude.Nothing,
$sel:pages:Occurrences' :: Maybe [Page]
pages = forall a. Maybe a
Prelude.Nothing,
$sel:records:Occurrences' :: Maybe [Record]
records = forall a. Maybe a
Prelude.Nothing
}
occurrences_cells :: Lens.Lens' Occurrences (Prelude.Maybe [Cell])
occurrences_cells :: Lens' Occurrences (Maybe [Cell])
occurrences_cells = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Occurrences' {Maybe [Cell]
cells :: Maybe [Cell]
$sel:cells:Occurrences' :: Occurrences -> Maybe [Cell]
cells} -> Maybe [Cell]
cells) (\s :: Occurrences
s@Occurrences' {} Maybe [Cell]
a -> Occurrences
s {$sel:cells:Occurrences' :: Maybe [Cell]
cells = Maybe [Cell]
a} :: Occurrences) 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
occurrences_lineRanges :: Lens.Lens' Occurrences (Prelude.Maybe [Range])
occurrences_lineRanges :: Lens' Occurrences (Maybe [Range])
occurrences_lineRanges = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Occurrences' {Maybe [Range]
lineRanges :: Maybe [Range]
$sel:lineRanges:Occurrences' :: Occurrences -> Maybe [Range]
lineRanges} -> Maybe [Range]
lineRanges) (\s :: Occurrences
s@Occurrences' {} Maybe [Range]
a -> Occurrences
s {$sel:lineRanges:Occurrences' :: Maybe [Range]
lineRanges = Maybe [Range]
a} :: Occurrences) 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
occurrences_offsetRanges :: Lens.Lens' Occurrences (Prelude.Maybe [Range])
occurrences_offsetRanges :: Lens' Occurrences (Maybe [Range])
occurrences_offsetRanges = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Occurrences' {Maybe [Range]
offsetRanges :: Maybe [Range]
$sel:offsetRanges:Occurrences' :: Occurrences -> Maybe [Range]
offsetRanges} -> Maybe [Range]
offsetRanges) (\s :: Occurrences
s@Occurrences' {} Maybe [Range]
a -> Occurrences
s {$sel:offsetRanges:Occurrences' :: Maybe [Range]
offsetRanges = Maybe [Range]
a} :: Occurrences) 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
occurrences_pages :: Lens.Lens' Occurrences (Prelude.Maybe [Page])
occurrences_pages :: Lens' Occurrences (Maybe [Page])
occurrences_pages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Occurrences' {Maybe [Page]
pages :: Maybe [Page]
$sel:pages:Occurrences' :: Occurrences -> Maybe [Page]
pages} -> Maybe [Page]
pages) (\s :: Occurrences
s@Occurrences' {} Maybe [Page]
a -> Occurrences
s {$sel:pages:Occurrences' :: Maybe [Page]
pages = Maybe [Page]
a} :: Occurrences) 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
occurrences_records :: Lens.Lens' Occurrences (Prelude.Maybe [Record])
occurrences_records :: Lens' Occurrences (Maybe [Record])
occurrences_records = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Occurrences' {Maybe [Record]
records :: Maybe [Record]
$sel:records:Occurrences' :: Occurrences -> Maybe [Record]
records} -> Maybe [Record]
records) (\s :: Occurrences
s@Occurrences' {} Maybe [Record]
a -> Occurrences
s {$sel:records:Occurrences' :: Maybe [Record]
records = Maybe [Record]
a} :: Occurrences) 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
instance Data.FromJSON Occurrences where
parseJSON :: Value -> Parser Occurrences
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Occurrences"
( \Object
x ->
Maybe [Cell]
-> Maybe [Range]
-> Maybe [Range]
-> Maybe [Page]
-> Maybe [Record]
-> Occurrences
Occurrences'
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
"cells" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lineRanges" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"offsetRanges" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"pages" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"records" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Occurrences where
hashWithSalt :: Int -> Occurrences -> Int
hashWithSalt Int
_salt Occurrences' {Maybe [Cell]
Maybe [Range]
Maybe [Page]
Maybe [Record]
records :: Maybe [Record]
pages :: Maybe [Page]
offsetRanges :: Maybe [Range]
lineRanges :: Maybe [Range]
cells :: Maybe [Cell]
$sel:records:Occurrences' :: Occurrences -> Maybe [Record]
$sel:pages:Occurrences' :: Occurrences -> Maybe [Page]
$sel:offsetRanges:Occurrences' :: Occurrences -> Maybe [Range]
$sel:lineRanges:Occurrences' :: Occurrences -> Maybe [Range]
$sel:cells:Occurrences' :: Occurrences -> Maybe [Cell]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Cell]
cells
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Range]
lineRanges
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Range]
offsetRanges
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Page]
pages
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Record]
records
instance Prelude.NFData Occurrences where
rnf :: Occurrences -> ()
rnf Occurrences' {Maybe [Cell]
Maybe [Range]
Maybe [Page]
Maybe [Record]
records :: Maybe [Record]
pages :: Maybe [Page]
offsetRanges :: Maybe [Range]
lineRanges :: Maybe [Range]
cells :: Maybe [Cell]
$sel:records:Occurrences' :: Occurrences -> Maybe [Record]
$sel:pages:Occurrences' :: Occurrences -> Maybe [Page]
$sel:offsetRanges:Occurrences' :: Occurrences -> Maybe [Range]
$sel:lineRanges:Occurrences' :: Occurrences -> Maybe [Range]
$sel:cells:Occurrences' :: Occurrences -> Maybe [Cell]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Cell]
cells
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Range]
lineRanges
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Range]
offsetRanges
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Page]
pages
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Record]
records