{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | 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
(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)

-- |
-- 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' :: Maybe MatchingBucket -> MatchingResource
MatchingResource' {$sel:matchingBucket:MatchingResource' :: Maybe MatchingBucket
matchingBucket = Maybe 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 :: (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