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