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