{-# 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.BucketCountBySharedAccessType
-- 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.BucketCountBySharedAccessType 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 number of S3 buckets that are or aren\'t
-- shared with other Amazon Web Services accounts.
--
-- /See:/ 'newBucketCountBySharedAccessType' smart constructor.
data BucketCountBySharedAccessType = BucketCountBySharedAccessType'
  { -- | The total number of buckets that are shared with an Amazon Web Services
    -- account that isn\'t part of the same Amazon Macie organization.
    BucketCountBySharedAccessType -> Maybe Integer
external :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that are shared with an Amazon Web Services
    -- account that\'s part of the same Amazon Macie organization.
    BucketCountBySharedAccessType -> Maybe Integer
internal :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that aren\'t shared with other Amazon Web
    -- Services accounts.
    BucketCountBySharedAccessType -> Maybe Integer
notShared :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that Amazon Macie wasn\'t able to evaluate
    -- shared access settings for. Macie can\'t determine whether these buckets
    -- are shared with other Amazon Web Services accounts.
    BucketCountBySharedAccessType -> Maybe Integer
unknown :: Prelude.Maybe Prelude.Integer
  }
  deriving (BucketCountBySharedAccessType
-> BucketCountBySharedAccessType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketCountBySharedAccessType
-> BucketCountBySharedAccessType -> Bool
$c/= :: BucketCountBySharedAccessType
-> BucketCountBySharedAccessType -> Bool
== :: BucketCountBySharedAccessType
-> BucketCountBySharedAccessType -> Bool
$c== :: BucketCountBySharedAccessType
-> BucketCountBySharedAccessType -> Bool
Prelude.Eq, ReadPrec [BucketCountBySharedAccessType]
ReadPrec BucketCountBySharedAccessType
Int -> ReadS BucketCountBySharedAccessType
ReadS [BucketCountBySharedAccessType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketCountBySharedAccessType]
$creadListPrec :: ReadPrec [BucketCountBySharedAccessType]
readPrec :: ReadPrec BucketCountBySharedAccessType
$creadPrec :: ReadPrec BucketCountBySharedAccessType
readList :: ReadS [BucketCountBySharedAccessType]
$creadList :: ReadS [BucketCountBySharedAccessType]
readsPrec :: Int -> ReadS BucketCountBySharedAccessType
$creadsPrec :: Int -> ReadS BucketCountBySharedAccessType
Prelude.Read, Int -> BucketCountBySharedAccessType -> ShowS
[BucketCountBySharedAccessType] -> ShowS
BucketCountBySharedAccessType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketCountBySharedAccessType] -> ShowS
$cshowList :: [BucketCountBySharedAccessType] -> ShowS
show :: BucketCountBySharedAccessType -> String
$cshow :: BucketCountBySharedAccessType -> String
showsPrec :: Int -> BucketCountBySharedAccessType -> ShowS
$cshowsPrec :: Int -> BucketCountBySharedAccessType -> ShowS
Prelude.Show, forall x.
Rep BucketCountBySharedAccessType x
-> BucketCountBySharedAccessType
forall x.
BucketCountBySharedAccessType
-> Rep BucketCountBySharedAccessType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BucketCountBySharedAccessType x
-> BucketCountBySharedAccessType
$cfrom :: forall x.
BucketCountBySharedAccessType
-> Rep BucketCountBySharedAccessType x
Prelude.Generic)

-- |
-- Create a value of 'BucketCountBySharedAccessType' 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:
--
-- 'external', 'bucketCountBySharedAccessType_external' - The total number of buckets that are shared with an Amazon Web Services
-- account that isn\'t part of the same Amazon Macie organization.
--
-- 'internal', 'bucketCountBySharedAccessType_internal' - The total number of buckets that are shared with an Amazon Web Services
-- account that\'s part of the same Amazon Macie organization.
--
-- 'notShared', 'bucketCountBySharedAccessType_notShared' - The total number of buckets that aren\'t shared with other Amazon Web
-- Services accounts.
--
-- 'unknown', 'bucketCountBySharedAccessType_unknown' - The total number of buckets that Amazon Macie wasn\'t able to evaluate
-- shared access settings for. Macie can\'t determine whether these buckets
-- are shared with other Amazon Web Services accounts.
newBucketCountBySharedAccessType ::
  BucketCountBySharedAccessType
newBucketCountBySharedAccessType :: BucketCountBySharedAccessType
newBucketCountBySharedAccessType =
  BucketCountBySharedAccessType'
    { $sel:external:BucketCountBySharedAccessType' :: Maybe Integer
external =
        forall a. Maybe a
Prelude.Nothing,
      $sel:internal:BucketCountBySharedAccessType' :: Maybe Integer
internal = forall a. Maybe a
Prelude.Nothing,
      $sel:notShared:BucketCountBySharedAccessType' :: Maybe Integer
notShared = forall a. Maybe a
Prelude.Nothing,
      $sel:unknown:BucketCountBySharedAccessType' :: Maybe Integer
unknown = forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of buckets that are shared with an Amazon Web Services
-- account that isn\'t part of the same Amazon Macie organization.
bucketCountBySharedAccessType_external :: Lens.Lens' BucketCountBySharedAccessType (Prelude.Maybe Prelude.Integer)
bucketCountBySharedAccessType_external :: Lens' BucketCountBySharedAccessType (Maybe Integer)
bucketCountBySharedAccessType_external = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountBySharedAccessType' {Maybe Integer
external :: Maybe Integer
$sel:external:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
external} -> Maybe Integer
external) (\s :: BucketCountBySharedAccessType
s@BucketCountBySharedAccessType' {} Maybe Integer
a -> BucketCountBySharedAccessType
s {$sel:external:BucketCountBySharedAccessType' :: Maybe Integer
external = Maybe Integer
a} :: BucketCountBySharedAccessType)

-- | The total number of buckets that are shared with an Amazon Web Services
-- account that\'s part of the same Amazon Macie organization.
bucketCountBySharedAccessType_internal :: Lens.Lens' BucketCountBySharedAccessType (Prelude.Maybe Prelude.Integer)
bucketCountBySharedAccessType_internal :: Lens' BucketCountBySharedAccessType (Maybe Integer)
bucketCountBySharedAccessType_internal = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountBySharedAccessType' {Maybe Integer
internal :: Maybe Integer
$sel:internal:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
internal} -> Maybe Integer
internal) (\s :: BucketCountBySharedAccessType
s@BucketCountBySharedAccessType' {} Maybe Integer
a -> BucketCountBySharedAccessType
s {$sel:internal:BucketCountBySharedAccessType' :: Maybe Integer
internal = Maybe Integer
a} :: BucketCountBySharedAccessType)

-- | The total number of buckets that aren\'t shared with other Amazon Web
-- Services accounts.
bucketCountBySharedAccessType_notShared :: Lens.Lens' BucketCountBySharedAccessType (Prelude.Maybe Prelude.Integer)
bucketCountBySharedAccessType_notShared :: Lens' BucketCountBySharedAccessType (Maybe Integer)
bucketCountBySharedAccessType_notShared = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountBySharedAccessType' {Maybe Integer
notShared :: Maybe Integer
$sel:notShared:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
notShared} -> Maybe Integer
notShared) (\s :: BucketCountBySharedAccessType
s@BucketCountBySharedAccessType' {} Maybe Integer
a -> BucketCountBySharedAccessType
s {$sel:notShared:BucketCountBySharedAccessType' :: Maybe Integer
notShared = Maybe Integer
a} :: BucketCountBySharedAccessType)

-- | The total number of buckets that Amazon Macie wasn\'t able to evaluate
-- shared access settings for. Macie can\'t determine whether these buckets
-- are shared with other Amazon Web Services accounts.
bucketCountBySharedAccessType_unknown :: Lens.Lens' BucketCountBySharedAccessType (Prelude.Maybe Prelude.Integer)
bucketCountBySharedAccessType_unknown :: Lens' BucketCountBySharedAccessType (Maybe Integer)
bucketCountBySharedAccessType_unknown = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountBySharedAccessType' {Maybe Integer
unknown :: Maybe Integer
$sel:unknown:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
unknown} -> Maybe Integer
unknown) (\s :: BucketCountBySharedAccessType
s@BucketCountBySharedAccessType' {} Maybe Integer
a -> BucketCountBySharedAccessType
s {$sel:unknown:BucketCountBySharedAccessType' :: Maybe Integer
unknown = Maybe Integer
a} :: BucketCountBySharedAccessType)

instance Data.FromJSON BucketCountBySharedAccessType where
  parseJSON :: Value -> Parser BucketCountBySharedAccessType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BucketCountBySharedAccessType"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountBySharedAccessType
BucketCountBySharedAccessType'
            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
"external")
            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
"internal")
            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
"notShared")
            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
"unknown")
      )

instance
  Prelude.Hashable
    BucketCountBySharedAccessType
  where
  hashWithSalt :: Int -> BucketCountBySharedAccessType -> Int
hashWithSalt Int
_salt BucketCountBySharedAccessType' {Maybe Integer
unknown :: Maybe Integer
notShared :: Maybe Integer
internal :: Maybe Integer
external :: Maybe Integer
$sel:unknown:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
$sel:notShared:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
$sel:internal:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
$sel:external:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
external
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
internal
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
notShared
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
unknown

instance Prelude.NFData BucketCountBySharedAccessType where
  rnf :: BucketCountBySharedAccessType -> ()
rnf BucketCountBySharedAccessType' {Maybe Integer
unknown :: Maybe Integer
notShared :: Maybe Integer
internal :: Maybe Integer
external :: Maybe Integer
$sel:unknown:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
$sel:notShared:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
$sel:internal:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
$sel:external:BucketCountBySharedAccessType' :: BucketCountBySharedAccessType -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
external
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
internal
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
notShared
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
unknown