{-# 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.Lens as Lens
import Amazonka.MacieV2.Types.JobScopingBlock
import qualified Amazonka.Prelude as Prelude
data Scoping = Scoping'
{
Scoping -> Maybe JobScopingBlock
includes :: Prelude.Maybe JobScopingBlock,
Scoping -> Maybe JobScopingBlock
excludes :: Prelude.Maybe JobScopingBlock
}
deriving (Scoping -> Scoping -> Bool
(Scoping -> Scoping -> Bool)
-> (Scoping -> Scoping -> Bool) -> Eq Scoping
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]
(Int -> ReadS Scoping)
-> ReadS [Scoping]
-> ReadPrec Scoping
-> ReadPrec [Scoping]
-> Read 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
(Int -> Scoping -> ShowS)
-> (Scoping -> String) -> ([Scoping] -> ShowS) -> Show Scoping
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. Scoping -> Rep Scoping x)
-> (forall x. Rep Scoping x -> Scoping) -> Generic Scoping
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' :: Maybe JobScopingBlock -> Maybe JobScopingBlock -> Scoping
Scoping'
{ $sel:includes:Scoping' :: Maybe JobScopingBlock
includes = Maybe JobScopingBlock
forall a. Maybe a
Prelude.Nothing,
$sel:excludes:Scoping' :: Maybe JobScopingBlock
excludes = Maybe JobScopingBlock
forall a. Maybe a
Prelude.Nothing
}
scoping_includes :: Lens.Lens' Scoping (Prelude.Maybe JobScopingBlock)
scoping_includes :: (Maybe JobScopingBlock -> f (Maybe JobScopingBlock))
-> Scoping -> f Scoping
scoping_includes = (Scoping -> Maybe JobScopingBlock)
-> (Scoping -> Maybe JobScopingBlock -> Scoping)
-> Lens
Scoping Scoping (Maybe JobScopingBlock) (Maybe JobScopingBlock)
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)
scoping_excludes :: Lens.Lens' Scoping (Prelude.Maybe JobScopingBlock)
scoping_excludes :: (Maybe JobScopingBlock -> f (Maybe JobScopingBlock))
-> Scoping -> f Scoping
scoping_excludes = (Scoping -> Maybe JobScopingBlock)
-> (Scoping -> Maybe JobScopingBlock -> Scoping)
-> Lens
Scoping Scoping (Maybe JobScopingBlock) (Maybe JobScopingBlock)
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)
instance Core.FromJSON Scoping where
parseJSON :: Value -> Parser Scoping
parseJSON =
String -> (Object -> Parser Scoping) -> Value -> Parser Scoping
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Scoping"
( \Object
x ->
Maybe JobScopingBlock -> Maybe JobScopingBlock -> Scoping
Scoping'
(Maybe JobScopingBlock -> Maybe JobScopingBlock -> Scoping)
-> Parser (Maybe JobScopingBlock)
-> Parser (Maybe JobScopingBlock -> Scoping)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe JobScopingBlock)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"includes")
Parser (Maybe JobScopingBlock -> Scoping)
-> Parser (Maybe JobScopingBlock) -> Parser Scoping
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobScopingBlock)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"excludes")
)
instance Prelude.Hashable Scoping
instance Prelude.NFData Scoping
instance Core.ToJSON Scoping where
toJSON :: Scoping -> Value
toJSON Scoping' {Maybe JobScopingBlock
excludes :: Maybe JobScopingBlock
includes :: Maybe JobScopingBlock
$sel:excludes:Scoping' :: Scoping -> Maybe JobScopingBlock
$sel:includes:Scoping' :: Scoping -> Maybe JobScopingBlock
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"includes" Text -> JobScopingBlock -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobScopingBlock -> Pair) -> Maybe JobScopingBlock -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobScopingBlock
includes,
(Text
"excludes" Text -> JobScopingBlock -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobScopingBlock -> Pair) -> Maybe JobScopingBlock -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobScopingBlock
excludes
]
)