{-# 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.Scoping 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.JobScopingBlock
import qualified Amazonka.Prelude as Prelude
data Scoping = Scoping'
{
Scoping -> Maybe JobScopingBlock
excludes :: Prelude.Maybe JobScopingBlock,
Scoping -> Maybe JobScopingBlock
includes :: Prelude.Maybe JobScopingBlock
}
deriving (Scoping -> Scoping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scoping -> Scoping -> Bool
$c/= :: Scoping -> Scoping -> Bool
== :: Scoping -> Scoping -> Bool
$c== :: Scoping -> Scoping -> Bool
Prelude.Eq, ReadPrec [Scoping]
ReadPrec Scoping
Int -> ReadS Scoping
ReadS [Scoping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Scoping]
$creadListPrec :: ReadPrec [Scoping]
readPrec :: ReadPrec Scoping
$creadPrec :: ReadPrec Scoping
readList :: ReadS [Scoping]
$creadList :: ReadS [Scoping]
readsPrec :: Int -> ReadS Scoping
$creadsPrec :: Int -> ReadS Scoping
Prelude.Read, Int -> Scoping -> ShowS
[Scoping] -> ShowS
Scoping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scoping] -> ShowS
$cshowList :: [Scoping] -> ShowS
show :: Scoping -> String
$cshow :: Scoping -> String
showsPrec :: Int -> Scoping -> ShowS
$cshowsPrec :: Int -> Scoping -> ShowS
Prelude.Show, forall x. Rep Scoping x -> Scoping
forall x. Scoping -> Rep Scoping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Scoping x -> Scoping
$cfrom :: forall x. Scoping -> Rep Scoping x
Prelude.Generic)
newScoping ::
Scoping
newScoping :: Scoping
newScoping =
Scoping'
{ $sel:excludes:Scoping' :: Maybe JobScopingBlock
excludes = forall a. Maybe a
Prelude.Nothing,
$sel:includes:Scoping' :: Maybe JobScopingBlock
includes = forall a. Maybe a
Prelude.Nothing
}
scoping_excludes :: Lens.Lens' Scoping (Prelude.Maybe JobScopingBlock)
scoping_excludes :: Lens' Scoping (Maybe JobScopingBlock)
scoping_excludes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scoping' {Maybe JobScopingBlock
excludes :: Maybe JobScopingBlock
$sel:excludes:Scoping' :: Scoping -> Maybe JobScopingBlock
excludes} -> Maybe JobScopingBlock
excludes) (\s :: Scoping
s@Scoping' {} Maybe JobScopingBlock
a -> Scoping
s {$sel:excludes:Scoping' :: Maybe JobScopingBlock
excludes = Maybe JobScopingBlock
a} :: Scoping)
scoping_includes :: Lens.Lens' Scoping (Prelude.Maybe JobScopingBlock)
scoping_includes :: Lens' Scoping (Maybe JobScopingBlock)
scoping_includes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scoping' {Maybe JobScopingBlock
includes :: Maybe JobScopingBlock
$sel:includes:Scoping' :: Scoping -> Maybe JobScopingBlock
includes} -> Maybe JobScopingBlock
includes) (\s :: Scoping
s@Scoping' {} Maybe JobScopingBlock
a -> Scoping
s {$sel:includes:Scoping' :: Maybe JobScopingBlock
includes = Maybe JobScopingBlock
a} :: Scoping)
instance Data.FromJSON Scoping where
parseJSON :: Value -> Parser Scoping
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Scoping"
( \Object
x ->
Maybe JobScopingBlock -> Maybe JobScopingBlock -> Scoping
Scoping'
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
"excludes")
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
"includes")
)
instance Prelude.Hashable Scoping where
hashWithSalt :: Int -> Scoping -> Int
hashWithSalt Int
_salt Scoping' {Maybe JobScopingBlock
includes :: Maybe JobScopingBlock
excludes :: Maybe JobScopingBlock
$sel:includes:Scoping' :: Scoping -> Maybe JobScopingBlock
$sel:excludes:Scoping' :: Scoping -> Maybe JobScopingBlock
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobScopingBlock
excludes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobScopingBlock
includes
instance Prelude.NFData Scoping where
rnf :: Scoping -> ()
rnf Scoping' {Maybe JobScopingBlock
includes :: Maybe JobScopingBlock
excludes :: Maybe JobScopingBlock
$sel:includes:Scoping' :: Scoping -> Maybe JobScopingBlock
$sel:excludes:Scoping' :: Scoping -> Maybe JobScopingBlock
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe JobScopingBlock
excludes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobScopingBlock
includes
instance Data.ToJSON Scoping where
toJSON :: Scoping -> Value
toJSON Scoping' {Maybe JobScopingBlock
includes :: Maybe JobScopingBlock
excludes :: Maybe JobScopingBlock
$sel:includes:Scoping' :: Scoping -> Maybe JobScopingBlock
$sel:excludes:Scoping' :: Scoping -> Maybe JobScopingBlock
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"excludes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobScopingBlock
excludes,
(Key
"includes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobScopingBlock
includes
]
)