{-# 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.ClassificationScopeSummary
-- 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.ClassificationScopeSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the classification scope for an Amazon Macie
-- account. Macie uses the scope\'s settings when it performs automated
-- sensitive data discovery for the account.
--
-- /See:/ 'newClassificationScopeSummary' smart constructor.
data ClassificationScopeSummary = ClassificationScopeSummary'
  { -- | The unique identifier for the classification scope.
    ClassificationScopeSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the classification scope.
    ClassificationScopeSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (ClassificationScopeSummary -> ClassificationScopeSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassificationScopeSummary -> ClassificationScopeSummary -> Bool
$c/= :: ClassificationScopeSummary -> ClassificationScopeSummary -> Bool
== :: ClassificationScopeSummary -> ClassificationScopeSummary -> Bool
$c== :: ClassificationScopeSummary -> ClassificationScopeSummary -> Bool
Prelude.Eq, ReadPrec [ClassificationScopeSummary]
ReadPrec ClassificationScopeSummary
Int -> ReadS ClassificationScopeSummary
ReadS [ClassificationScopeSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClassificationScopeSummary]
$creadListPrec :: ReadPrec [ClassificationScopeSummary]
readPrec :: ReadPrec ClassificationScopeSummary
$creadPrec :: ReadPrec ClassificationScopeSummary
readList :: ReadS [ClassificationScopeSummary]
$creadList :: ReadS [ClassificationScopeSummary]
readsPrec :: Int -> ReadS ClassificationScopeSummary
$creadsPrec :: Int -> ReadS ClassificationScopeSummary
Prelude.Read, Int -> ClassificationScopeSummary -> ShowS
[ClassificationScopeSummary] -> ShowS
ClassificationScopeSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassificationScopeSummary] -> ShowS
$cshowList :: [ClassificationScopeSummary] -> ShowS
show :: ClassificationScopeSummary -> String
$cshow :: ClassificationScopeSummary -> String
showsPrec :: Int -> ClassificationScopeSummary -> ShowS
$cshowsPrec :: Int -> ClassificationScopeSummary -> ShowS
Prelude.Show, forall x.
Rep ClassificationScopeSummary x -> ClassificationScopeSummary
forall x.
ClassificationScopeSummary -> Rep ClassificationScopeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClassificationScopeSummary x -> ClassificationScopeSummary
$cfrom :: forall x.
ClassificationScopeSummary -> Rep ClassificationScopeSummary x
Prelude.Generic)

-- |
-- Create a value of 'ClassificationScopeSummary' 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:
--
-- 'id', 'classificationScopeSummary_id' - The unique identifier for the classification scope.
--
-- 'name', 'classificationScopeSummary_name' - The name of the classification scope.
newClassificationScopeSummary ::
  ClassificationScopeSummary
newClassificationScopeSummary :: ClassificationScopeSummary
newClassificationScopeSummary =
  ClassificationScopeSummary'
    { $sel:id:ClassificationScopeSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ClassificationScopeSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for the classification scope.
classificationScopeSummary_id :: Lens.Lens' ClassificationScopeSummary (Prelude.Maybe Prelude.Text)
classificationScopeSummary_id :: Lens' ClassificationScopeSummary (Maybe Text)
classificationScopeSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationScopeSummary' {Maybe Text
id :: Maybe Text
$sel:id:ClassificationScopeSummary' :: ClassificationScopeSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ClassificationScopeSummary
s@ClassificationScopeSummary' {} Maybe Text
a -> ClassificationScopeSummary
s {$sel:id:ClassificationScopeSummary' :: Maybe Text
id = Maybe Text
a} :: ClassificationScopeSummary)

-- | The name of the classification scope.
classificationScopeSummary_name :: Lens.Lens' ClassificationScopeSummary (Prelude.Maybe Prelude.Text)
classificationScopeSummary_name :: Lens' ClassificationScopeSummary (Maybe Text)
classificationScopeSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassificationScopeSummary' {Maybe Text
name :: Maybe Text
$sel:name:ClassificationScopeSummary' :: ClassificationScopeSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ClassificationScopeSummary
s@ClassificationScopeSummary' {} Maybe Text
a -> ClassificationScopeSummary
s {$sel:name:ClassificationScopeSummary' :: Maybe Text
name = Maybe Text
a} :: ClassificationScopeSummary)

instance Data.FromJSON ClassificationScopeSummary where
  parseJSON :: Value -> Parser ClassificationScopeSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ClassificationScopeSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ClassificationScopeSummary
ClassificationScopeSummary'
            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
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
      )

instance Prelude.Hashable ClassificationScopeSummary where
  hashWithSalt :: Int -> ClassificationScopeSummary -> Int
hashWithSalt Int
_salt ClassificationScopeSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:ClassificationScopeSummary' :: ClassificationScopeSummary -> Maybe Text
$sel:id:ClassificationScopeSummary' :: ClassificationScopeSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData ClassificationScopeSummary where
  rnf :: ClassificationScopeSummary -> ()
rnf ClassificationScopeSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:ClassificationScopeSummary' :: ClassificationScopeSummary -> Maybe Text
$sel:id:ClassificationScopeSummary' :: ClassificationScopeSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name