{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MacieV2.Types.MatchingResource
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.MatchingResource 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.MatchingBucket
import qualified Amazonka.Prelude as Prelude

-- | Provides statistical data and other information about an Amazon Web
-- Services resource that Amazon Macie monitors and analyzes for your
-- account.
--
-- /See:/ 'newMatchingResource' smart constructor.
data MatchingResource = MatchingResource'
  { -- | The details of an S3 bucket that Amazon Macie monitors and analyzes.
    MatchingResource -> Maybe MatchingBucket
matchingBucket :: Prelude.Maybe MatchingBucket
  }
  deriving (MatchingResource -> MatchingResource -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'MatchingResource' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'matchingBucket', 'matchingResource_matchingBucket' - The details of an S3 bucket that Amazon Macie monitors and analyzes.
newMatchingResource ::
  MatchingResource
newMatchingResource :: MatchingResource
newMatchingResource =
  MatchingResource' {$sel:matchingBucket:MatchingResource' :: Maybe MatchingBucket
matchingBucket = forall a. Maybe a
Prelude.Nothing}

-- | The details of an S3 bucket that Amazon Macie monitors and analyzes.
matchingResource_matchingBucket :: Lens.Lens' MatchingResource (Prelude.Maybe MatchingBucket)
matchingResource_matchingBucket :: Lens' MatchingResource (Maybe MatchingBucket)
matchingResource_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 Data.FromJSON MatchingResource where
  parseJSON :: Value -> Parser MatchingResource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MatchingResource"
      ( \Object
x ->
          Maybe MatchingBucket -> MatchingResource
MatchingResource'
            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
"matchingBucket")
      )

instance Prelude.Hashable MatchingResource where
  hashWithSalt :: Int -> MatchingResource -> Int
hashWithSalt Int
_salt MatchingResource' {Maybe MatchingBucket
matchingBucket :: Maybe MatchingBucket
$sel:matchingBucket:MatchingResource' :: MatchingResource -> Maybe MatchingBucket
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MatchingBucket
matchingBucket

instance Prelude.NFData MatchingResource where
  rnf :: MatchingResource -> ()
rnf MatchingResource' {Maybe MatchingBucket
matchingBucket :: Maybe MatchingBucket
$sel:matchingBucket:MatchingResource' :: MatchingResource -> Maybe MatchingBucket
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MatchingBucket
matchingBucket