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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 aren\'t shared with other Amazon Web
    -- Services accounts.
    BucketCountBySharedAccessType -> Maybe Integer
notShared :: 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 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 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
(BucketCountBySharedAccessType
 -> BucketCountBySharedAccessType -> Bool)
-> (BucketCountBySharedAccessType
    -> BucketCountBySharedAccessType -> Bool)
-> Eq BucketCountBySharedAccessType
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]
(Int -> ReadS BucketCountBySharedAccessType)
-> ReadS [BucketCountBySharedAccessType]
-> ReadPrec BucketCountBySharedAccessType
-> ReadPrec [BucketCountBySharedAccessType]
-> Read 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
(Int -> BucketCountBySharedAccessType -> ShowS)
-> (BucketCountBySharedAccessType -> String)
-> ([BucketCountBySharedAccessType] -> ShowS)
-> Show BucketCountBySharedAccessType
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.
 BucketCountBySharedAccessType
 -> Rep BucketCountBySharedAccessType x)
-> (forall x.
    Rep BucketCountBySharedAccessType x
    -> BucketCountBySharedAccessType)
-> Generic BucketCountBySharedAccessType
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:
--
-- 'notShared', 'bucketCountBySharedAccessType_notShared' - The total number of buckets that aren\'t shared with other Amazon Web
-- Services accounts.
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountBySharedAccessType
BucketCountBySharedAccessType'
    { $sel:notShared:BucketCountBySharedAccessType' :: Maybe Integer
notShared =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:internal:BucketCountBySharedAccessType' :: Maybe Integer
internal = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:external:BucketCountBySharedAccessType' :: Maybe Integer
external = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:unknown:BucketCountBySharedAccessType' :: Maybe Integer
unknown = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountBySharedAccessType -> f BucketCountBySharedAccessType
bucketCountBySharedAccessType_notShared = (BucketCountBySharedAccessType -> Maybe Integer)
-> (BucketCountBySharedAccessType
    -> Maybe Integer -> BucketCountBySharedAccessType)
-> Lens
     BucketCountBySharedAccessType
     BucketCountBySharedAccessType
     (Maybe Integer)
     (Maybe Integer)
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 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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountBySharedAccessType -> f BucketCountBySharedAccessType
bucketCountBySharedAccessType_internal = (BucketCountBySharedAccessType -> Maybe Integer)
-> (BucketCountBySharedAccessType
    -> Maybe Integer -> BucketCountBySharedAccessType)
-> Lens
     BucketCountBySharedAccessType
     BucketCountBySharedAccessType
     (Maybe Integer)
     (Maybe Integer)
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 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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountBySharedAccessType -> f BucketCountBySharedAccessType
bucketCountBySharedAccessType_external = (BucketCountBySharedAccessType -> Maybe Integer)
-> (BucketCountBySharedAccessType
    -> Maybe Integer -> BucketCountBySharedAccessType)
-> Lens
     BucketCountBySharedAccessType
     BucketCountBySharedAccessType
     (Maybe Integer)
     (Maybe Integer)
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 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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountBySharedAccessType -> f BucketCountBySharedAccessType
bucketCountBySharedAccessType_unknown = (BucketCountBySharedAccessType -> Maybe Integer)
-> (BucketCountBySharedAccessType
    -> Maybe Integer -> BucketCountBySharedAccessType)
-> Lens
     BucketCountBySharedAccessType
     BucketCountBySharedAccessType
     (Maybe Integer)
     (Maybe Integer)
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 Core.FromJSON BucketCountBySharedAccessType where
  parseJSON :: Value -> Parser BucketCountBySharedAccessType
parseJSON =
    String
-> (Object -> Parser BucketCountBySharedAccessType)
-> Value
-> Parser BucketCountBySharedAccessType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BucketCountBySharedAccessType"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountBySharedAccessType
BucketCountBySharedAccessType'
            (Maybe Integer
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe Integer
 -> BucketCountBySharedAccessType)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer
      -> Maybe Integer -> Maybe Integer -> BucketCountBySharedAccessType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"notShared")
            Parser
  (Maybe Integer
   -> Maybe Integer -> Maybe Integer -> BucketCountBySharedAccessType)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer -> Maybe Integer -> BucketCountBySharedAccessType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"internal")
            Parser
  (Maybe Integer -> Maybe Integer -> BucketCountBySharedAccessType)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> BucketCountBySharedAccessType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"external")
            Parser (Maybe Integer -> BucketCountBySharedAccessType)
-> Parser (Maybe Integer) -> Parser BucketCountBySharedAccessType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unknown")
      )

instance
  Prelude.Hashable
    BucketCountBySharedAccessType

instance Prelude.NFData BucketCountBySharedAccessType